Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
56b301a3
提交
56b301a3
authored
1月 18, 2013
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make GpuSoftmaxWithBias don't crash on GTX285 with some shapes.
上级
d0040637
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
16 行增加
和
10 行删除
+16
-10
nnet.py
theano/sandbox/cuda/nnet.py
+2
-2
test_nnet.py
theano/sandbox/cuda/tests/test_nnet.py
+14
-8
没有找到文件。
theano/sandbox/cuda/nnet.py
浏览文件 @
56b301a3
...
...
@@ -470,7 +470,7 @@ class GpuSoftmaxWithBias (GpuOp):
def
c_code_cache_version
(
self
):
#return ()
return
(
6
,)
+
inline_softmax
.
code_version
return
(
7
,)
+
inline_softmax
.
code_version
def
c_code
(
self
,
node
,
nodename
,
inp
,
out
,
sub
):
x
,
b
=
inp
...
...
@@ -510,7 +510,7 @@ class GpuSoftmaxWithBias (GpuOp):
{
int n_blocks = std::min(CudaNdarray_HOST_DIMS(
%(x)
s)[0],32*1024);
//TODO, detect the maximum number of thread per block.
int n_threads = std::min(CudaNdarray_HOST_DIMS(
%(x)
s)[1],
1024
);
int n_threads = std::min(CudaNdarray_HOST_DIMS(
%(x)
s)[1],
512
);
int n_shared_bytes = CudaNdarray_HOST_DIMS(
%(x)
s)[1] * 2 * sizeof(float);
if (CudaNdarray_HOST_DIMS(
%(x)
s)[0] > 0)
{
...
...
theano/sandbox/cuda/tests/test_nnet.py
浏览文件 @
56b301a3
...
...
@@ -183,7 +183,9 @@ def test_softmax_with_bias():
def
cmp
(
n
,
m
,
catch
=
False
):
"""Some old card won't accet the configuration arguments of
this implementation."""
this implementation. For those cases set catch=True to skip
those errors.
"""
try
:
#print "test_softmax",n,m
data
=
numpy
.
arange
(
n
*
m
,
dtype
=
'float32'
)
.
reshape
(
n
,
m
)
...
...
@@ -193,18 +195,22 @@ def test_softmax_with_bias():
except
RuntimeError
,
e
:
if
not
catch
:
raise
assert
(
e
.
args
[
0
]
==
'Cuda error: kSoftmaxWithBias_node_0: invalid configuration argument.
\n
'
),
e
.
args
[
0
]
# Different CUDA driver have different error message
assert
(
e
.
args
[
0
]
.
startswith
(
'Cuda error: kSoftmaxWithBias_node_0: invalid configuration argument.
\n
'
)
or
e
.
args
[
0
]
.
startswith
(
'Cuda error: kSoftmaxWithBias_node_0: invalid argument.
\n
'
))
cmp
(
2
,
5
)
#we need to test n>32*1024 to check that we make the block loop.
cmp
(
2
<<
15
,
5
)
cmp
(
4074
,
400
)
cmp
(
0
,
10
)
cmp
(
4
,
1000
,
True
)
cmp
(
4
,
1024
,
True
)
cmp
(
4
,
2000
,
True
)
cmp
(
4
,
2024
,
True
)
cmp
(
784
,
784
)
cmp
(
4
,
1000
)
cmp
(
4
,
1024
)
cmp
(
4
,
2000
)
cmp
(
4
,
2024
)
#GTX285 don't have enought shared mem for this case.
cmp
(
4
,
4074
,
True
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论