Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
5639c0f0
提交
5639c0f0
authored
4月 12, 2016
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Raise min cudnn version to v4. Better report of the problem when not used.
上级
ef0fc56e
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
20 行增加
和
26 行删除
+20
-26
__init__.py
theano/sandbox/cuda/__init__.py
+10
-13
__init__.py
theano/sandbox/gpuarray/__init__.py
+4
-4
dnn.py
theano/sandbox/gpuarray/dnn.py
+6
-9
没有找到文件。
theano/sandbox/cuda/__init__.py
浏览文件 @
5639c0f0
...
...
@@ -270,14 +270,14 @@ from theano.sandbox.cuda.type import CudaNdarrayType
def
dnn_available
():
if
config
.
dnn
.
enabled
==
"False"
:
dnn_available
.
avail
=
False
dnn_available
.
msg
=
"
d
isabled by dnn.enabled flag"
dnn_available
.
msg
=
"
D
isabled by dnn.enabled flag"
if
dnn_available
.
avail
is
None
and
not
cuda_available
:
dnn_available
.
msg
=
"CUDA not available"
dnn_available
.
avail
=
False
elif
dnn_available
.
avail
is
None
:
dev
=
active_device_number
()
if
device_properties
(
dev
)[
'major'
]
<
3
:
dnn_available
.
msg
=
"Device not supported
by cuDNN
"
dnn_available
.
msg
=
"Device not supported"
dnn_available
.
avail
=
False
else
:
preambule
=
"""
...
...
@@ -315,7 +315,7 @@ if ((err = cudnnCreate(&_handle)) != CUDNN_STATUS_SUCCESS) {
dnn_available
.
avail
=
comp
if
not
dnn_available
.
avail
:
dnn_available
.
msg
=
(
"
Theano c
an not compile with cuDNN. We got this error:
\n
"
+
"
C
an not compile with cuDNN. We got this error:
\n
"
+
str
(
err
))
else
:
# If we can compile, check that we can import and run.
...
...
@@ -326,13 +326,10 @@ if ((err = cudnnCreate(&_handle)) != CUDNN_STATUS_SUCCESS) {
" from one version, but we link with"
" a different version
%
s"
%
str
(
v
))
raise
RuntimeError
(
dnn_available
.
msg
)
if
v
==
-
1
or
v
[
0
]
<
3
007
:
#
3007 is the final release of cudnn v3
if
v
==
-
1
or
v
[
0
]
<
4
007
:
#
4007 is the final release of cudnn v4
dnn_available
.
avail
=
False
dnn_available
.
msg
=
(
"You have an old release of CuDNN (or a release "
"candidate) that isn't supported. Please update to "
"at least v3 final version."
)
dnn_available
.
msg
=
"Version too old. Update to v5."
raise
RuntimeError
(
dnn_available
.
msg
)
if
config
.
dnn
.
enabled
==
"True"
:
if
not
dnn_available
.
avail
:
...
...
@@ -582,13 +579,13 @@ def use(device,
if
dnn_available
():
(
hdr_v
,
runtime_v
)
=
dnn_version
()
cudnn_version
=
runtime_v
#
4100 should not print warning with cudnn 4
final.
if
cudnn_version
>
4
100
:
#
5100 should not print warning with cudnn 5
final.
if
cudnn_version
>
5
100
:
warn
=
(
"Your CuDNN version is more recent then Theano."
" If you see problems, try updating Theano or"
" downgrading CuDNN to version
4
."
)
" downgrading CuDNN to version
5
."
)
except
Exception
:
pass
cudnn_version
=
dnn_available
.
msg
print
(
"Using gpu device
%
d:
%
s (CNMeM is
%
s, CuDNN
%
s)"
%
(
active_device_number
(),
active_device_name
(),
...
...
theano/sandbox/gpuarray/__init__.py
浏览文件 @
5639c0f0
...
...
@@ -71,14 +71,14 @@ def init_dev(dev, name=None):
cudnn_version
=
" (CuDNN not available)"
try
:
cudnn_version
=
dnn
.
version
()
#
4100 should not print warning with cudnn 4
final.
if
cudnn_version
>
4
100
:
#
5100 should not print warning with cudnn 5
final.
if
cudnn_version
>
5
100
:
warn
=
(
"Your CuDNN version is more recent than Theano."
" If you see problems, try updating Theano or"
" downgrading CuDNN to version
4
."
)
" downgrading CuDNN to version
5
."
)
cudnn_version
=
" (CuDNN version
%
s)"
%
cudnn_version
except
Exception
:
pass
cudnn_version
=
dnn
.
dnn_present
.
msg
print
(
"Mapped name
%
s to device
%
s:
%
s
%
s"
%
(
name
,
dev
,
context
.
devname
,
cudnn_version
),
file
=
sys
.
stderr
)
...
...
theano/sandbox/gpuarray/dnn.py
浏览文件 @
5639c0f0
...
...
@@ -74,18 +74,15 @@ if ((err = cudnnCreate(&_handle)) != CUDNN_STATUS_SUCCESS) {
try_run
=
False
,
output
=
True
)
if
not
avail
:
return
False
,
(
"
Theano cannot compile with c
uDNN. "
return
False
,
(
"
cannot compile with C
uDNN. "
"We got this error:
\n
"
+
str
(
err
))
return
True
,
None
def
_dnn_check_version
():
v
=
version
()
if
v
<
3007
:
return
False
,
(
"You have an old release of CuDNN (or a release candidate) "
"that isn't supported. Please update to at least v3 final "
"version."
)
if
v
<
4007
:
return
False
,
"Version too old. Update to v5."
return
True
,
None
...
...
@@ -94,7 +91,7 @@ def dnn_present():
if
dnn_present
.
avail
is
not
None
:
return
dnn_present
.
avail
if
config
.
dnn
.
enabled
==
"False"
:
dnn_present
.
msg
=
"
d
isabled by dnn.enabled flag"
dnn_present
.
msg
=
"
D
isabled by dnn.enabled flag"
dnn_present
.
avail
=
False
if
pygpu
is
None
:
...
...
@@ -134,7 +131,7 @@ def dnn_available(context_name):
# This is a hack because bin_id is in the from of
# "<something>_<major><minor>" for cuda devices.
if
ctx
.
bin_id
[
-
2
:]
<
b
'30'
:
dnn_available
.
msg
=
"Device not supported
by cuDNN
"
dnn_available
.
msg
=
"Device not supported"
return
False
return
True
...
...
@@ -1620,7 +1617,7 @@ class NoCuDNNRaise(Optimizer):
# just skip this optimization.
raise
AssertionError
(
"cuDNN optimization was enabled, but Theano was not able "
"to use it for context "
+
c
+
". We got this error:
\n
"
+
"to use it for context "
+
str
(
c
)
+
". We got this error:
\n
"
+
dnn_available
.
msg
)
gpu_seqopt
.
register
(
"NoCuDNNRaise"
,
NoCuDNNRaise
(),
0
,
'cudnn'
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论