Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
ca407db4
提交
ca407db4
authored
6月 02, 2017
作者:
notoraptor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Extend cudnn_defs
with list of deterministic algorithms and other utility definitions.
上级
8ef62afb
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
29 行增加
和
0 行删除
+29
-0
cudnn_defs.py
theano/gpuarray/cudnn_defs.py
+29
-0
没有找到文件。
theano/gpuarray/cudnn_defs.py
浏览文件 @
ca407db4
...
@@ -19,6 +19,10 @@ from __future__ import absolute_import, print_function, division
...
@@ -19,6 +19,10 @@ from __future__ import absolute_import, print_function, division
from
theano.gof
import
CEnumType
from
theano.gof
import
CEnumType
HALF
,
FLOAT
,
DOUBLE
=
(
'float16'
,
'float32'
,
'float64'
)
# NB: Some cuDNN algorithms are listed in cuDNN enums but not implemented.
# NB: Some cuDNN algorithms are listed in cuDNN enums but not implemented.
# We still register them here because we try to exactly copy cuDNN enums
# We still register them here because we try to exactly copy cuDNN enums
# in Python side, but they will have no aliases associated, to help
# in Python side, but they will have no aliases associated, to help
...
@@ -51,6 +55,8 @@ class CuDNNV51(object):
...
@@ -51,6 +55,8 @@ class CuDNNV51(object):
conv3d_fwd_algorithms
=
(
'none'
,
'small'
,
'fft_tiling'
)
conv3d_fwd_algorithms
=
(
'none'
,
'small'
,
'fft_tiling'
)
deterministic_fwd_algorithms
=
cudnnConvolutionFwdAlgo_t
.
get_aliases
()
cudnnConvolutionBwdFilterAlgo_t
=
CEnumType
((
'CUDNN_CONVOLUTION_BWD_FILTER_ALGO_0'
,
'none'
),
cudnnConvolutionBwdFilterAlgo_t
=
CEnumType
((
'CUDNN_CONVOLUTION_BWD_FILTER_ALGO_0'
,
'none'
),
(
'CUDNN_CONVOLUTION_BWD_FILTER_ALGO_1'
,
'deterministic'
),
(
'CUDNN_CONVOLUTION_BWD_FILTER_ALGO_1'
,
'deterministic'
),
(
'CUDNN_CONVOLUTION_BWD_FILTER_ALGO_FFT'
,
'fft'
),
(
'CUDNN_CONVOLUTION_BWD_FILTER_ALGO_FFT'
,
'fft'
),
...
@@ -61,6 +67,8 @@ class CuDNNV51(object):
...
@@ -61,6 +67,8 @@ class CuDNNV51(object):
conv3d_bwd_filter_algorithms
=
(
'none'
,
'small'
)
conv3d_bwd_filter_algorithms
=
(
'none'
,
'small'
)
deterministic_bwd_filter_algorithms
=
(
'deterministic'
,
'fft'
,
'winograd_non_fused'
)
cudnnConvolutionBwdDataAlgo_t
=
CEnumType
((
'CUDNN_CONVOLUTION_BWD_DATA_ALGO_0'
,
'none'
),
cudnnConvolutionBwdDataAlgo_t
=
CEnumType
((
'CUDNN_CONVOLUTION_BWD_DATA_ALGO_0'
,
'none'
),
(
'CUDNN_CONVOLUTION_BWD_DATA_ALGO_1'
,
'deterministic'
),
(
'CUDNN_CONVOLUTION_BWD_DATA_ALGO_1'
,
'deterministic'
),
(
'CUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT'
,
'fft'
),
(
'CUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT'
,
'fft'
),
...
@@ -72,6 +80,8 @@ class CuDNNV51(object):
...
@@ -72,6 +80,8 @@ class CuDNNV51(object):
conv3d_bwd_data_algorithms
=
(
'none'
,
'deterministic'
,
'fft_tiling'
)
conv3d_bwd_data_algorithms
=
(
'none'
,
'deterministic'
,
'fft_tiling'
)
deterministic_bwd_data_algorithms
=
(
'deterministic'
,
'fft'
,
'fft_tiling'
,
'winograd'
,
'winograd_non_fused'
)
cudnnPoolingMode_t
=
CEnumType
((
'CUDNN_POOLING_MAX'
,
'max'
),
cudnnPoolingMode_t
=
CEnumType
((
'CUDNN_POOLING_MAX'
,
'max'
),
(
'CUDNN_POOLING_AVERAGE_COUNT_INCLUDE_PADDING'
,
'average_inc_pad'
),
(
'CUDNN_POOLING_AVERAGE_COUNT_INCLUDE_PADDING'
,
'average_inc_pad'
),
(
'CUDNN_POOLING_AVERAGE_COUNT_EXCLUDE_PADDING'
,
'average_exc_pad'
),
(
'CUDNN_POOLING_AVERAGE_COUNT_EXCLUDE_PADDING'
,
'average_exc_pad'
),
...
@@ -93,6 +103,23 @@ class CuDNNV51(object):
...
@@ -93,6 +103,23 @@ class CuDNNV51(object):
# empty list of enum to don't crash with cudnn 5
# empty list of enum to don't crash with cudnn 5
cudnnReduceTensorOp_t
=
CEnumType
()
cudnnReduceTensorOp_t
=
CEnumType
()
def
supported_precisions
(
self
,
dtype
):
"""
Return the tuple of precisions supported by cuDNN for given input data type.
This is currently convenient for both cuDNN V5.1 and V6, as Theano does not
yet support new data types (like INT8, INT8x4, etc.).
"""
assert
dtype
in
(
HALF
,
FLOAT
,
DOUBLE
)
if
dtype
==
HALF
:
# TRUE_HALF_CONFIG, PSEUDO_HALF_CONFIG
return
(
HALF
,
FLOAT
)
if
dtype
==
FLOAT
:
# FLOAT_CONFIG
return
(
FLOAT
,)
if
dtype
==
DOUBLE
:
# DOUBLE_CONFIG
return
(
DOUBLE
,)
class
CuDNNV6
(
CuDNNV51
):
class
CuDNNV6
(
CuDNNV51
):
version
=
6
version
=
6
...
@@ -123,6 +150,8 @@ class CuDNNV6(CuDNNV51):
...
@@ -123,6 +150,8 @@ class CuDNNV6(CuDNNV51):
(
'CUDNN_CONVOLUTION_BWD_FILTER_ALGO_FFT_TILING'
,
'fft_tiling'
),
(
'CUDNN_CONVOLUTION_BWD_FILTER_ALGO_FFT_TILING'
,
'fft_tiling'
),
ctype
=
'cudnnConvolutionBwdFilterAlgo_t'
)
ctype
=
'cudnnConvolutionBwdFilterAlgo_t'
)
deterministic_bwd_filter_algorithms
=
CuDNNV51
.
deterministic_bwd_filter_algorithms
+
(
'fft_tiling'
,)
cudnnReduceTensorOp_t
=
CEnumType
((
'CUDNN_REDUCE_TENSOR_ADD'
,
'add'
),
cudnnReduceTensorOp_t
=
CEnumType
((
'CUDNN_REDUCE_TENSOR_ADD'
,
'add'
),
(
'CUDNN_REDUCE_TENSOR_MUL'
,
'mul'
),
(
'CUDNN_REDUCE_TENSOR_MUL'
,
'mul'
),
(
'CUDNN_REDUCE_TENSOR_MIN'
,
'minimum'
),
(
'CUDNN_REDUCE_TENSOR_MIN'
,
'minimum'
),
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论