Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
926dec89
提交
926dec89
authored
8月 30, 2017
作者:
Frédéric Bastien
提交者:
GitHub
8月 30, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6368 from notoraptor/fix-cudnn-conv-timed-algos-with-beta
Fix error related to cuDNN runtime timed algos when beta is not null.
上级
4d46e410
574dc4ca
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
33 行增加
和
3 行删除
+33
-3
dnn_fwd.c
theano/gpuarray/c_code/dnn_fwd.c
+11
-1
dnn_gi.c
theano/gpuarray/c_code/dnn_gi.c
+11
-1
dnn_gw.c
theano/gpuarray/c_code/dnn_gw.c
+11
-1
没有找到文件。
theano/gpuarray/c_code/dnn_fwd.c
浏览文件 @
926dec89
...
@@ -234,14 +234,24 @@ APPLY_SPECIFIC(conv_fwd)(PyGpuArrayObject *input, PyGpuArrayObject *kerns,
...
@@ -234,14 +234,24 @@ APPLY_SPECIFIC(conv_fwd)(PyGpuArrayObject *input, PyGpuArrayObject *kerns,
if
(
input
->
ga
.
typecode
==
GA_HALF
)
if
(
input
->
ga
.
typecode
==
GA_HALF
)
c_set_math_type_for_conv
(
desc
,
CUDNN_TENSOR_OP_MATH
);
c_set_math_type_for_conv
(
desc
,
CUDNN_TENSOR_OP_MATH
);
/* cudnnFindConvolutionForwardAlgorithmEx() may write to output.
We don't want that if output is used in computation (ie. if beta != 0). */
PyGpuArrayObject
*
o
=
*
output
;
if
(
beta
!=
0
)
{
o
=
pygpu_empty
(
PyGpuArray_NDIM
(
*
output
),
PyGpuArray_DIMS
(
*
output
),
(
*
output
)
->
ga
.
typecode
,
GA_C_ORDER
,
c
,
Py_None
);
}
// We don't sync the buffer as we don't care about the values.
// We don't sync the buffer as we don't care about the values.
err
=
cudnnFindConvolutionForwardAlgorithmEx
(
err
=
cudnnFindConvolutionForwardAlgorithmEx
(
params
->
handle
,
APPLY_SPECIFIC
(
input
),
PyGpuArray_DEV_DATA
(
input
),
params
->
handle
,
APPLY_SPECIFIC
(
input
),
PyGpuArray_DEV_DATA
(
input
),
APPLY_SPECIFIC
(
kerns
),
PyGpuArray_DEV_DATA
(
kerns
),
APPLY_SPECIFIC
(
kerns
),
PyGpuArray_DEV_DATA
(
kerns
),
desc
,
APPLY_SPECIFIC
(
output
),
PyGpuArray_DEV_DATA
(
*
output
),
desc
,
APPLY_SPECIFIC
(
output
),
PyGpuArray_DEV_DATA
(
o
),
1
,
&
count
,
&
choice
,
*
(
void
**
)
tmpmem
,
1
,
&
count
,
&
choice
,
*
(
void
**
)
tmpmem
,
maxfree
);
maxfree
);
gpudata_release
(
tmpmem
);
gpudata_release
(
tmpmem
);
if
(
beta
!=
0
)
{
Py_XDECREF
(
o
);
}
if
(
err
!=
CUDNN_STATUS_SUCCESS
)
{
if
(
err
!=
CUDNN_STATUS_SUCCESS
)
{
PyErr_Format
(
PyExc_RuntimeError
,
PyErr_Format
(
PyExc_RuntimeError
,
...
...
theano/gpuarray/c_code/dnn_gi.c
浏览文件 @
926dec89
...
@@ -204,12 +204,22 @@ APPLY_SPECIFIC(conv_gi)(PyGpuArrayObject *kerns, PyGpuArrayObject *output,
...
@@ -204,12 +204,22 @@ APPLY_SPECIFIC(conv_gi)(PyGpuArrayObject *kerns, PyGpuArrayObject *output,
return
-
1
;
return
-
1
;
}
}
/* cudnnFindConvolutionBackwardDataAlgorithmEx() may write to output (input).
We don't want that if output is used in computation (ie. if beta != 0). */
PyGpuArrayObject
*
ip
=
*
input
;
if
(
beta
!=
0
)
{
ip
=
pygpu_empty
(
PyGpuArray_NDIM
(
*
input
),
PyGpuArray_DIMS
(
*
input
),
(
*
input
)
->
ga
.
typecode
,
GA_C_ORDER
,
c
,
Py_None
);
}
err
=
cudnnFindConvolutionBackwardDataAlgorithmEx
(
err
=
cudnnFindConvolutionBackwardDataAlgorithmEx
(
params
->
handle
,
APPLY_SPECIFIC
(
kerns
),
PyGpuArray_DEV_DATA
(
kerns
),
params
->
handle
,
APPLY_SPECIFIC
(
kerns
),
PyGpuArray_DEV_DATA
(
kerns
),
APPLY_SPECIFIC
(
output
),
PyGpuArray_DEV_DATA
(
output
),
desc
,
APPLY_SPECIFIC
(
output
),
PyGpuArray_DEV_DATA
(
output
),
desc
,
APPLY_SPECIFIC
(
input
),
PyGpuArray_DEV_DATA
(
*
input
),
APPLY_SPECIFIC
(
input
),
PyGpuArray_DEV_DATA
(
ip
),
1
,
&
count
,
&
choice
,
*
(
void
**
)
tmpmem
,
maxfree
);
1
,
&
count
,
&
choice
,
*
(
void
**
)
tmpmem
,
maxfree
);
gpudata_release
(
tmpmem
);
gpudata_release
(
tmpmem
);
if
(
beta
!=
0
)
{
Py_XDECREF
(
ip
);
}
if
(
err
!=
CUDNN_STATUS_SUCCESS
)
{
if
(
err
!=
CUDNN_STATUS_SUCCESS
)
{
PyErr_Format
(
PyExc_RuntimeError
,
"error selecting convolution algo: %s"
,
PyErr_Format
(
PyExc_RuntimeError
,
"error selecting convolution algo: %s"
,
...
...
theano/gpuarray/c_code/dnn_gw.c
浏览文件 @
926dec89
...
@@ -191,12 +191,22 @@ APPLY_SPECIFIC(conv_gw)(PyGpuArrayObject *input, PyGpuArrayObject *output,
...
@@ -191,12 +191,22 @@ APPLY_SPECIFIC(conv_gw)(PyGpuArrayObject *input, PyGpuArrayObject *output,
return
-
1
;
return
-
1
;
}
}
/* cudnnFindConvolutionBackwardFilterAlgorithmEx() may write to kernels output (kerns).
We don't want that if output is used in computation (ie. if beta != 0). */
PyGpuArrayObject
*
k
=
*
kerns
;
if
(
beta
!=
0
)
{
k
=
pygpu_empty
(
PyGpuArray_NDIM
(
*
kerns
),
PyGpuArray_DIMS
(
*
kerns
),
(
*
kerns
)
->
ga
.
typecode
,
GA_C_ORDER
,
c
,
Py_None
);
}
err
=
cudnnFindConvolutionBackwardFilterAlgorithmEx
(
err
=
cudnnFindConvolutionBackwardFilterAlgorithmEx
(
params
->
handle
,
APPLY_SPECIFIC
(
input
),
PyGpuArray_DEV_DATA
(
input
),
params
->
handle
,
APPLY_SPECIFIC
(
input
),
PyGpuArray_DEV_DATA
(
input
),
APPLY_SPECIFIC
(
output
),
PyGpuArray_DEV_DATA
(
output
),
desc
,
APPLY_SPECIFIC
(
output
),
PyGpuArray_DEV_DATA
(
output
),
desc
,
APPLY_SPECIFIC
(
kerns
),
PyGpuArray_DEV_DATA
(
*
kerns
),
APPLY_SPECIFIC
(
kerns
),
PyGpuArray_DEV_DATA
(
k
),
1
,
&
count
,
&
choice
,
*
(
void
**
)
tmpmem
,
maxfree
);
1
,
&
count
,
&
choice
,
*
(
void
**
)
tmpmem
,
maxfree
);
gpudata_release
(
tmpmem
);
gpudata_release
(
tmpmem
);
if
(
beta
!=
0
)
{
Py_XDECREF
(
k
);
}
if
(
err
!=
CUDNN_STATUS_SUCCESS
)
{
if
(
err
!=
CUDNN_STATUS_SUCCESS
)
{
PyErr_Format
(
PyExc_RuntimeError
,
PyErr_Format
(
PyExc_RuntimeError
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论