Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
79f84e0f
提交
79f84e0f
authored
10月 03, 2014
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CRASH] skip cudnn tests on gpu that are too old.
上级
01e852ae
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
32 行增加
和
8 行删除
+32
-8
dnn.py
theano/sandbox/cuda/dnn.py
+18
-1
test_conv_cuda_ndarray.py
theano/sandbox/cuda/tests/test_conv_cuda_ndarray.py
+11
-7
test_nnet.py
theano/sandbox/cuda/tests/test_nnet.py
+3
-0
没有找到文件。
theano/sandbox/cuda/dnn.py
浏览文件 @
79f84e0f
...
...
@@ -7,7 +7,7 @@ from theano.gof.type import CDataType
from
theano.compat
import
PY3
from
theano.compat.six
import
StringIO
from
theano.sandbox.cuda.type
import
CudaNdarrayType
from
theano.sandbox.cuda
import
GpuOp
from
theano.sandbox.cuda
import
GpuOp
,
active_device_number
,
device_properties
from
theano.sandbox.cuda.basic_ops
import
(
as_cuda_ndarray_variable
,
gpu_contiguous
)
from
theano.sandbox.cuda.blas
import
GpuConv
...
...
@@ -16,6 +16,23 @@ from theano.sandbox.cuda.nnet import GpuSoftmax
from
theano.sandbox.cuda.nvcc_compiler
import
NVCC_compiler
def
dnn_available
():
if
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
.
avail
=
False
else
:
dnn_available
.
msg
=
"Can not find the cuDNN library"
dnn_available
.
avail
=
theano
.
gof
.
cmodule
.
GCC_compiler
.
try_flags
(
[
"-l"
,
"cudnn"
])
return
dnn_available
.
avail
dnn_available
.
avail
=
None
dnn_available
.
msg
=
None
class
DnnBase
(
GpuOp
):
"""
Creates a handle for cudnn and pulls in the cudnn libraries and headers.
...
...
theano/sandbox/cuda/tests/test_conv_cuda_ndarray.py
浏览文件 @
79f84e0f
...
...
@@ -578,8 +578,8 @@ def test_gemm_valid():
def
test_dnn_valid
():
if
cuda
.
device_properties
(
cuda
.
active_device_number
())[
'major'
]
<
3
:
raise
SkipTest
(
'Current GPU too old'
)
if
not
cuda
.
dnn
.
dnn_available
()
:
raise
SkipTest
(
cuda
.
dnn
.
dnn_available
.
msg
)
for
t
in
_test_valid
(
GpuDnnConv
,
mode
=
theano_mode
.
including
(
"cudnn"
)):
yield
t
...
...
@@ -659,8 +659,8 @@ def test_gemm_full():
def
test_dnn_full
():
if
cuda
.
device_properties
(
cuda
.
active_device_number
())[
'major'
]
<
3
:
raise
SkipTest
(
'Current GPU too old'
)
if
not
cuda
.
dnn
.
dnn_available
()
:
raise
SkipTest
(
cuda
.
dnn
.
dnn_available
.
msg
)
for
t
in
_test_full
(
GpuDnnConv
,
mode
=
theano_mode
.
including
(
"cudnn"
)):
yield
t
...
...
@@ -711,8 +711,8 @@ def test_gemm_subsample():
def
test_dnn_subsample
():
if
cuda
.
device_properties
(
cuda
.
active_device_number
())[
'major'
]
<
3
:
raise
SkipTest
(
'Current GPU too old'
)
if
not
cuda
.
dnn
.
dnn_available
()
:
raise
SkipTest
(
cuda
.
dnn
.
dnn_available
.
msg
)
for
t
in
_test_subsample
(
GpuDnnConv
,
theano_mode
.
including
(
'cudnn'
)):
yield
t
...
...
@@ -909,6 +909,10 @@ def conv_grad(mode, bs, ch, nf, rImg1, rImg2, rFlt1, rFlt2, subsample, op):
def
test_conv_grads
():
if
cuda
.
device_properties
(
cuda
.
active_device_number
())[
'major'
]
<
3
:
ops
=
[
gemm_op
]
else
:
ops
=
[
gemm_op
,
dnn_op
]
for
mode
in
'valid'
,
'full'
:
for
bs
in
[
1
,
5
]:
for
ch
in
[
4
]:
...
...
@@ -918,7 +922,7 @@ def test_conv_grads():
for
rFlt1
in
[
1
,
2
]:
for
rFlt2
in
[
1
,
2
]:
for
subsample
in
(
1
,
1
),
(
1
,
2
),
(
2
,
2
):
for
op
in
[
gemm_op
,
dnn_op
]
:
for
op
in
ops
:
yield
(
conv_grad
,
mode
,
bs
,
ch
,
nf
,
rImg1
,
rImg2
,
rFlt1
,
rFlt2
,
subsample
,
op
)
...
...
theano/sandbox/cuda/tests/test_nnet.py
浏览文件 @
79f84e0f
...
...
@@ -301,6 +301,9 @@ class test_SoftMax(unittest.TestCase):
self
.
_cmp
(
0
,
10
,
f
,
f_gpu
)
def
test_cudnn_softmax
(
self
):
if
not
cuda
.
dnn
.
dnn_available
():
raise
SkipTest
(
cuda
.
dnn
.
dnn_available
.
msg
)
def
cmp
(
n
,
m
,
f
,
f_gpu
):
data
=
numpy
.
arange
(
n
*
m
,
dtype
=
'float32'
)
.
reshape
(
n
,
m
)
gdata
=
numpy
.
asarray
(
data
)[:,
:,
None
,
None
]
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论