Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
c0e915a2
提交
c0e915a2
authored
7月 19, 2016
作者:
Arnaud Bergeron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove checks for unsupported versions.
上级
f8c749ee
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
36 行增加
和
70 行删除
+36
-70
dnn.py
theano/gpuarray/dnn.py
+36
-70
没有找到文件。
theano/gpuarray/dnn.py
浏览文件 @
c0e915a2
...
...
@@ -439,22 +439,6 @@ class GpuDnnConv(DnnBase):
if
self
.
inplace
:
self
.
destroy_map
=
{
0
:
[
2
]}
if
version
()
<
3000
:
if
self
.
algo
==
'fft'
:
raise
RuntimeError
(
"cuDNN FFT convolution requires cuDNN v3"
)
elif
self
.
algo
in
[
'guess_once'
,
'guess_on_shape_change'
]:
raise
RuntimeError
(
"cuDNN selection of convolution "
"implementation based on heuristics "
"requires cuDNN v3"
)
elif
self
.
algo
in
[
'time_once'
,
'time_on_shape_change'
]:
raise
RuntimeError
(
"cuDNN convolution timing requires cuDNN v3"
)
# The fft_tiling implementation is only available from cuDNN V4 onward
if
version
()
<
4000
:
if
self
.
algo
==
'fft_tiling'
:
raise
RuntimeError
(
"cuDNN tiled-FFT convolution requires "
"cuDNN v4 or more recent"
)
if
version
()
<
5000
and
self
.
algo
==
'winograd'
:
raise
RuntimeError
(
"cuDNN winograd convolution requires "
"cuDNN v5 or more recent"
)
...
...
@@ -490,7 +474,6 @@ class GpuDnnConv(DnnBase):
elif
self
.
algo
==
'fft'
:
alg
=
'CUDNN_CONVOLUTION_FWD_ALGO_FFT'
elif
self
.
algo
==
'fft_tiling'
:
# need v4
alg
=
'CUDNN_CONVOLUTION_FWD_ALGO_FFT_TILING'
elif
self
.
algo
==
'winograd'
:
# need v5
...
...
@@ -652,26 +635,23 @@ class GpuDnnConvGradW(DnnBase):
if
self
.
inplace
:
defs
.
append
((
'CONV_INPLACE'
,
'1'
))
if
version
()
<
3000
:
alg
=
'0'
else
:
alg
=
'CUDNN_CONVOLUTION_BWD_FILTER_ALGO_0'
if
self
.
algo
==
'none'
:
alg
=
'CUDNN_CONVOLUTION_BWD_FILTER_ALGO_0'
if
self
.
algo
==
'none'
:
alg
=
'CUDNN_CONVOLUTION_BWD_FILTER_ALGO_0'
if
self
.
algo
==
'deterministic'
:
alg
=
'CUDNN_CONVOLUTION_BWD_FILTER_ALGO_1'
if
self
.
algo
==
'fft'
:
alg
=
'CUDNN_CONVOLUTION_BWD_FILTER_ALGO_FFT'
if
self
.
algo
==
'small'
:
# non-deterministic, small workspace
alg
=
'CUDNN_CONVOLUTION_BWD_FILTER_ALGO_3'
if
self
.
algo
in
[
'guess_once'
,
'guess_on_shape_change'
,
'time_once'
,
'time_on_shape_change'
]:
defs
.
append
((
'CHOOSE_ALGO'
,
''
))
if
self
.
algo
in
[
'guess_once'
,
'time_once'
]:
defs
.
append
((
'CHOOSE_ONCE'
,
''
))
if
self
.
algo
in
[
'time_once'
,
'time_on_shape_change'
]:
defs
.
append
((
'CHOOSE_TIME'
,
''
))
if
self
.
algo
==
'deterministic'
:
alg
=
'CUDNN_CONVOLUTION_BWD_FILTER_ALGO_1'
if
self
.
algo
==
'fft'
:
alg
=
'CUDNN_CONVOLUTION_BWD_FILTER_ALGO_FFT'
if
self
.
algo
==
'small'
:
# non-deterministic, small workspace
alg
=
'CUDNN_CONVOLUTION_BWD_FILTER_ALGO_3'
if
self
.
algo
in
[
'guess_once'
,
'guess_on_shape_change'
,
'time_once'
,
'time_on_shape_change'
]:
defs
.
append
((
'CHOOSE_ALGO'
,
''
))
if
self
.
algo
in
[
'guess_once'
,
'time_once'
]:
defs
.
append
((
'CHOOSE_ONCE'
,
''
))
if
self
.
algo
in
[
'time_once'
,
'time_on_shape_change'
]:
defs
.
append
((
'CHOOSE_TIME'
,
''
))
defs
.
append
((
'CONV_ALGO'
,
alg
))
...
...
@@ -749,11 +729,6 @@ class GpuDnnConvGradI(DnnBase):
algo
=
config
.
dnn
.
conv
.
algo_bwd_data
self
.
algo
=
algo
# The small-workspace implementation is only available from cuDNN V4
# onward.
if
version
()
<
4000
and
self
.
algo
==
'fft_tiling'
:
raise
RuntimeError
(
"cuDNN's tiled-FFT convolution requires cuDNN "
"v4 or more recent"
)
if
version
()
<
5000
and
self
.
algo
==
'winograd'
:
raise
RuntimeError
(
"cuDNN's winograd convolution requires cuDNN "
"v5 or more recent"
)
...
...
@@ -792,30 +767,27 @@ class GpuDnnConvGradI(DnnBase):
if
self
.
inplace
:
defs
.
append
((
'CONV_INPLACE'
,
'1'
))
if
version
()
<
3000
:
alg
=
'0'
else
:
alg
=
'CUDNN_CONVOLUTION_BWD_DATA_ALGO_0'
if
self
.
algo
==
'none'
:
alg
=
'CUDNN_CONVOLUTION_BWD_DATA_ALGO_0'
if
self
.
algo
==
'none'
:
alg
=
'CUDNN_CONVOLUTION_BWD_DATA_ALGO_0'
elif
self
.
algo
==
'deterministic'
:
alg
=
'CUDNN_CONVOLUTION_BWD_DATA_ALGO_1'
elif
self
.
algo
==
'fft'
:
alg
=
'CUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT'
elif
self
.
algo
==
'fft_tiling'
:
# big workspace but less than fft
alg
=
'CUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT_TILING'
elif
self
.
algo
==
'winograd'
:
# need v5
alg
=
'CUDNN_CONVOLUTION_BWD_DATA_ALGO_WINOGRAD'
if
self
.
algo
in
[
'guess_once'
,
'guess_on_shape_change'
,
'time_once'
,
'time_on_shape_change'
]:
defs
.
append
((
'CHOOSE_ALGO'
,
''
))
if
self
.
algo
in
[
'guess_once'
,
'time_once'
]:
defs
.
append
((
'CHOOSE_ONCE'
,
''
))
if
self
.
algo
in
[
'time_once'
,
'time_on_shape_change'
]:
defs
.
append
((
'CHOOSE_TIME'
,
''
))
elif
self
.
algo
==
'deterministic'
:
alg
=
'CUDNN_CONVOLUTION_BWD_DATA_ALGO_1'
elif
self
.
algo
==
'fft'
:
alg
=
'CUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT'
elif
self
.
algo
==
'fft_tiling'
:
# big workspace but less than fft
alg
=
'CUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT_TILING'
elif
self
.
algo
==
'winograd'
:
# need v5
alg
=
'CUDNN_CONVOLUTION_BWD_DATA_ALGO_WINOGRAD'
if
self
.
algo
in
[
'guess_once'
,
'guess_on_shape_change'
,
'time_once'
,
'time_on_shape_change'
]:
defs
.
append
((
'CHOOSE_ALGO'
,
''
))
if
self
.
algo
in
[
'guess_once'
,
'time_once'
]:
defs
.
append
((
'CHOOSE_ONCE'
,
''
))
if
self
.
algo
in
[
'time_once'
,
'time_on_shape_change'
]:
defs
.
append
((
'CHOOSE_TIME'
,
''
))
defs
.
append
((
'CONV_ALGO'
,
alg
))
...
...
@@ -1060,12 +1032,6 @@ class GpuDnnPoolDesc(Op):
self
.
stride
=
stride
self
.
pad
=
pad
if
self
.
get_ndim
()
==
3
and
version
()
<
3000
:
raise
RuntimeError
(
"cuDNN 3d pooling requires v3"
)
if
mode
==
'average_exc_pad'
and
max
(
pad
)
>
0
and
version
()
<
4004
:
raise
RuntimeError
(
"cuDNN pooling mode 'average_exc_pad' requires at least v4"
)
def
get_ndim
(
self
):
return
len
(
self
.
ws
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论