Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
c6979aee
提交
c6979aee
authored
3月 12, 2016
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4207 from nouiz/cnmem_threashold
Cnmem threashold, comment, don't call dnn_version and optimization registration.
上级
2c9f2c4d
e3133b80
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
28 行增加
和
15 行删除
+28
-15
config.txt
doc/library/config.txt
+11
-3
check_blas.py
theano/misc/check_blas.py
+1
-1
__init__.py
theano/sandbox/cuda/__init__.py
+8
-7
cuda_ndarray.cu
theano/sandbox/cuda/cuda_ndarray.cu
+4
-4
nnet.py
theano/tensor/nnet/nnet.py
+4
-0
没有找到文件。
doc/library/config.txt
浏览文件 @
c6979aee
...
@@ -403,17 +403,18 @@ import theano and print the config variable, as in:
...
@@ -403,17 +403,18 @@ import theano and print the config variable, as in:
Float value: >= 0
Float value: >= 0
Controls the use of `CNMeM <https://github.com/NVIDIA/cnmem>`_ (a
Controls the use of `CNMeM <https://github.com/NVIDIA/cnmem>`_ (a
faster CUDA memory allocator). In Theano dev version until 0.
7.1
faster CUDA memory allocator). In Theano dev version until 0.
8
is released.
is released.
The CNMeM library is included in Theano and does not need to be separately installed.
The CNMeM library is included in Theano and does not need to be
separately installed.
The value represents the start size (either in MB or the fraction of total GPU
The value represents the start size (either in MB or the fraction of total GPU
memory) of the memory pool. If more memory is needed, Theano will
memory) of the memory pool. If more memory is needed, Theano will
try to obtain more, but this can cause memory fragmentation.
try to obtain more, but this can cause memory fragmentation.
* 0: not enabled.
* 0: not enabled.
* 0 < N <= 1: use this fraction of the total GPU memory (clipped to .9
85 for driver memory)
* 0 < N <= 1: use this fraction of the total GPU memory (clipped to .9
5 for driver memory).
* > 1: use this number in megabytes (MB) of memory.
* > 1: use this number in megabytes (MB) of memory.
...
@@ -426,6 +427,13 @@ import theano and print the config variable, as in:
...
@@ -426,6 +427,13 @@ import theano and print the config variable, as in:
the start or disable it. If you try this, report your result
the start or disable it. If you try this, report your result
on :ref`theano-dev`.
on :ref`theano-dev`.
.. note::
The clipping at 95% can be bypassed by specifing the exact
number of megabytes. If more then 95% are needed, it will try
automatically to get more memory. But this can cause
fragmentation, see note above.
.. attribute:: linker
.. attribute:: linker
String value: 'c|py', 'py', 'c', 'c|py_nogc'
String value: 'c|py', 'py', 'c', 'c|py_nogc'
...
...
theano/misc/check_blas.py
浏览文件 @
c6979aee
...
@@ -272,7 +272,7 @@ if __name__ == "__main__":
...
@@ -272,7 +272,7 @@ if __name__ == "__main__":
GTX 660 2.32s 2.32s
GTX 660 2.32s 2.32s
GTX 580 2.42s 2.47s
GTX 580 2.42s 2.47s
GTX 480 2.87s 2.88s
GTX 480 2.87s 2.88s
TX1 7.6s
TX1 7.6s
(float32 storage and computation)
GT 610 33.5s
GT 610 33.5s
"""
)
"""
)
...
...
theano/sandbox/cuda/__init__.py
浏览文件 @
c6979aee
...
@@ -576,13 +576,14 @@ def use(device,
...
@@ -576,13 +576,14 @@ def use(device,
cudnn_version
=
"not available"
cudnn_version
=
"not available"
warn
=
None
warn
=
None
try
:
try
:
(
hdr_v
,
runtime_v
)
=
dnn_version
()
if
dnn_available
():
cudnn_version
=
runtime_v
(
hdr_v
,
runtime_v
)
=
dnn_version
()
# 4100 should not print warning with cudnn 4 final.
cudnn_version
=
runtime_v
if
cudnn_version
>
4100
:
# 4100 should not print warning with cudnn 4 final.
warn
=
(
"Your CuDNN version is more recent then Theano."
if
cudnn_version
>
4100
:
" If you see problems, try updating Theano or"
warn
=
(
"Your CuDNN version is more recent then Theano."
" downgrading CuDNN to version 4."
)
" If you see problems, try updating Theano or"
" downgrading CuDNN to version 4."
)
except
Exception
:
except
Exception
:
pass
pass
print
(
"Using gpu device
%
d:
%
s (CNMeM is
%
s, CuDNN
%
s)"
%
(
print
(
"Using gpu device
%
d:
%
s (CNMeM is
%
s, CuDNN
%
s)"
%
(
...
...
theano/sandbox/cuda/cuda_ndarray.cu
浏览文件 @
c6979aee
...
@@ -3244,10 +3244,10 @@ CudaNdarray_gpu_init(PyObject* _unused, PyObject* args)
...
@@ -3244,10 +3244,10 @@ CudaNdarray_gpu_init(PyObject* _unused, PyObject* args)
if
(
cnmem
>
1
)
if
(
cnmem
>
1
)
mem
=
cnmem
*
1024
*
1024
;
mem
=
cnmem
*
1024
*
1024
;
else
{
else
{
// Clip to 9
8
% to let memory for the driver.
// Clip to 9
5
% to let memory for the driver.
// 98
.5
% didn't worked in some cases.
// 98% didn't worked in some cases.
if
(
cnmem
>
.9
8
){
if
(
cnmem
>
.9
5
){
cnmem
=
.9
8
;
cnmem
=
.9
5
;
}
}
size_t
free
=
0
,
total
=
0
;
size_t
free
=
0
,
total
=
0
;
cudaError_t
err
=
cudaMemGetInfo
(
&
free
,
&
total
);
cudaError_t
err
=
cudaMemGetInfo
(
&
free
,
&
total
);
...
...
theano/tensor/nnet/nnet.py
浏览文件 @
c6979aee
...
@@ -736,6 +736,8 @@ class LogSoftmax(gof.Op):
...
@@ -736,6 +736,8 @@ class LogSoftmax(gof.Op):
logsoftmax_op
=
LogSoftmax
()
logsoftmax_op
=
LogSoftmax
()
# This is not registered in stabilize, as it cause some crossentropy
# optimization to not be inserted.
@opt.register_specialize
(
'stabilize'
,
'fast_compile'
)
@opt.register_specialize
(
'stabilize'
,
'fast_compile'
)
@gof.local_optimizer
([
tensor
.
Elemwise
])
@gof.local_optimizer
([
tensor
.
Elemwise
])
def
local_logsoftmax
(
node
):
def
local_logsoftmax
(
node
):
...
@@ -757,6 +759,8 @@ def local_logsoftmax(node):
...
@@ -757,6 +759,8 @@ def local_logsoftmax(node):
return
[
ret
]
return
[
ret
]
# This is not registered in stabilize, as it cause some crossentropy
# optimization to not be inserted.
@opt.register_specialize
(
'stabilize'
,
'fast_compile'
)
@opt.register_specialize
(
'stabilize'
,
'fast_compile'
)
@gof.local_optimizer
([
SoftmaxGrad
])
@gof.local_optimizer
([
SoftmaxGrad
])
def
local_logsoftmax_grad
(
node
):
def
local_logsoftmax_grad
(
node
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论