Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
783d83e7
提交
783d83e7
authored
4月 12, 2016
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Chagne CuDNN to cuDNN at all other places
上级
fc4b5c18
隐藏空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
53 行增加
和
53 行删除
+53
-53
HISTORY.txt
HISTORY.txt
+1
-1
NEWS.txt
NEWS.txt
+1
-1
faq.txt
doc/faq.txt
+1
-1
dnn.txt
doc/library/sandbox/cuda/dnn.txt
+9
-9
dnn.txt
doc/library/sandbox/gpuarray/dnn.txt
+8
-8
configdefaults.py
theano/configdefaults.py
+6
-6
dnn_fwd.c
theano/sandbox/cuda/dnn_fwd.c
+1
-1
dnn_gi.c
theano/sandbox/cuda/dnn_gi.c
+1
-1
dnn_gw.c
theano/sandbox/cuda/dnn_gw.c
+1
-1
test_abstractconv.py
theano/sandbox/cuda/tests/test_abstractconv.py
+1
-1
test_conv_cuda_ndarray.py
theano/sandbox/cuda/tests/test_conv_cuda_ndarray.py
+2
-2
test_dnn.py
theano/sandbox/cuda/tests/test_dnn.py
+11
-11
test_abstractconv.py
theano/sandbox/gpuarray/tests/test_abstractconv.py
+1
-1
test_dnn.py
theano/sandbox/gpuarray/tests/test_dnn.py
+4
-4
__init__.py
theano/tensor/nnet/__init__.py
+1
-1
abstract_conv.py
theano/tensor/nnet/abstract_conv.py
+2
-2
pool.py
theano/tensor/signal/pool.py
+2
-2
没有找到文件。
HISTORY.txt
浏览文件 @
783d83e7
...
@@ -10,7 +10,7 @@ Theano 0.7 (26th of March, 2015)
...
@@ -10,7 +10,7 @@ Theano 0.7 (26th of March, 2015)
We recommand to everyone to upgrade to this version.
We recommand to everyone to upgrade to this version.
Highlights:
Highlights:
* Integration of
C
uDNN for 2D convolutions and pooling on supported GPUs
* Integration of
c
uDNN for 2D convolutions and pooling on supported GPUs
* Too many optimizations and new features to count
* Too many optimizations and new features to count
* Various fixes and improvements to scan
* Various fixes and improvements to scan
* Better support for GPU on Windows
* Better support for GPU on Windows
...
...
NEWS.txt
浏览文件 @
783d83e7
...
@@ -10,7 +10,7 @@ We recommend that everybody update to this version.
...
@@ -10,7 +10,7 @@ We recommend that everybody update to this version.
Highlights:
Highlights:
- Python 2 and 3 support with the same code base
- Python 2 and 3 support with the same code base
- Faster optimization
- Faster optimization
- Integration of
C
uDNN for better GPU performance
- Integration of
c
uDNN for better GPU performance
- Many Scan improvements (execution speed up, ...)
- Many Scan improvements (execution speed up, ...)
- optimizer=fast_compile moves computation to the GPU.
- optimizer=fast_compile moves computation to the GPU.
- Better convolution on CPU and GPU. (CorrMM, cudnn, 3d conv, more parameter)
- Better convolution on CPU and GPU. (CorrMM, cudnn, 3d conv, more parameter)
...
...
doc/faq.txt
浏览文件 @
783d83e7
...
@@ -235,7 +235,7 @@ CPU and GPU memory usage.
...
@@ -235,7 +235,7 @@ CPU and GPU memory usage.
Could speed up and lower memory usage:
Could speed up and lower memory usage:
- :ref:`
CuDNN <libdoc_cuda_dnn>` default C
uDNN convolution use less
- :ref:`
cuDNN <libdoc_cuda_dnn>` default c
uDNN convolution use less
memory then Theano version. But some flags allow it to use more
memory then Theano version. But some flags allow it to use more
memory. GPU only.
memory. GPU only.
- Shortly avail, multi-GPU.
- Shortly avail, multi-GPU.
...
...
doc/library/sandbox/cuda/dnn.txt
浏览文件 @
783d83e7
...
@@ -41,22 +41,22 @@ Theano will still work if the user did not introduce them manually.
...
@@ -41,22 +41,22 @@ Theano will still work if the user did not introduce them manually.
The recently added Theano flag :attr:`dnn.enabled
The recently added Theano flag :attr:`dnn.enabled
<config.dnn.enabled>` allows to change the default behavior to force
<config.dnn.enabled>` allows to change the default behavior to force
it or disable it. Older Theano version do not support this flag. To
it or disable it. Older Theano version do not support this flag. To
get an error when
C
uDNN can not be used with them, use this flag:
get an error when
c
uDNN can not be used with them, use this flag:
``optimizer_including=cudnn``.
``optimizer_including=cudnn``.
.. note::
.. note::
CuDNN v3 has now been released. CuDNN v2 remains supported but C
uDNN v3 is
cuDNN v3 has now been released. cuDNN v2 remains supported but c
uDNN v3 is
faster and offers many more options. We recommend that everybody update to
faster and offers many more options. We recommend that everybody update to
v3.
v3.
.. note::
.. note::
Starting in
C
uDNN v3, multiple convolution implementations are offered and
Starting in
c
uDNN v3, multiple convolution implementations are offered and
it is possible to use heuristics to automatically choose a convolution
it is possible to use heuristics to automatically choose a convolution
implementation well suited to the parameters of the convolution.
implementation well suited to the parameters of the convolution.
The Theano flag ``dnn.conv.algo_fwd`` allows to specify the
C
uDNN
The Theano flag ``dnn.conv.algo_fwd`` allows to specify the
c
uDNN
convolution implementation that Theano should use for forward convolutions.
convolution implementation that Theano should use for forward convolutions.
Possible values include :
Possible values include :
...
@@ -69,20 +69,20 @@ get an error when CuDNN can not be used with them, use this flag:
...
@@ -69,20 +69,20 @@ get an error when CuDNN can not be used with them, use this flag:
* ``fft_tiling`` : use the Fast Fourrier Transform implementation of convolution
* ``fft_tiling`` : use the Fast Fourrier Transform implementation of convolution
with tiling (high memory usage, but less then fft)
with tiling (high memory usage, but less then fft)
* ``guess_once`` : the first time a convolution is executed, the
* ``guess_once`` : the first time a convolution is executed, the
implementation to use is chosen according to
C
uDNN's heuristics and reused
implementation to use is chosen according to
c
uDNN's heuristics and reused
for every subsequent execution of the convolution.
for every subsequent execution of the convolution.
* ``guess_on_shape_change`` : like ``guess_once`` but a new convolution
* ``guess_on_shape_change`` : like ``guess_once`` but a new convolution
implementation selected every time the shapes of the inputs and kernels
implementation selected every time the shapes of the inputs and kernels
don't match the shapes from the last execution.
don't match the shapes from the last execution.
* ``time_once`` : the first time a convolution is executed, every convolution
* ``time_once`` : the first time a convolution is executed, every convolution
implementation offered by
C
uDNN is executed and timed. The fastest is
implementation offered by
c
uDNN is executed and timed. The fastest is
reused for every subsequent execution of the convolution.
reused for every subsequent execution of the convolution.
* ``time_on_shape_change`` : like ``time_once`` but a new convolution
* ``time_on_shape_change`` : like ``time_once`` but a new convolution
implementation selected every time the shapes of the inputs and kernels
implementation selected every time the shapes of the inputs and kernels
don't match the shapes from the last execution.
don't match the shapes from the last execution.
The Theano flag ``dnn.conv.algo_bwd_filter`` and
The Theano flag ``dnn.conv.algo_bwd_filter`` and
``dnn.conv.algo_bwd_data`` allows to specify the
C
uDNN
``dnn.conv.algo_bwd_data`` allows to specify the
c
uDNN
convolution implementation that Theano should use for gradient
convolution implementation that Theano should use for gradient
convolutions. Possible values include :
convolutions. Possible values include :
...
@@ -92,13 +92,13 @@ get an error when CuDNN can not be used with them, use this flag:
...
@@ -92,13 +92,13 @@ get an error when CuDNN can not be used with them, use this flag:
* ``fft`` : use the Fast Fourrier Transform implementation of convolution
* ``fft`` : use the Fast Fourrier Transform implementation of convolution
(very high memory usage)
(very high memory usage)
* ``guess_once`` : the first time a convolution is executed, the
* ``guess_once`` : the first time a convolution is executed, the
implementation to use is chosen according to
C
uDNN's heuristics and reused
implementation to use is chosen according to
c
uDNN's heuristics and reused
for every subsequent execution of the convolution.
for every subsequent execution of the convolution.
* ``guess_on_shape_change`` : like ``guess_once`` but a new convolution
* ``guess_on_shape_change`` : like ``guess_once`` but a new convolution
implementation selected every time the shapes of the inputs and kernels
implementation selected every time the shapes of the inputs and kernels
don't match the shapes from the last execution.
don't match the shapes from the last execution.
* ``time_once`` : the first time a convolution is executed, every convolution
* ``time_once`` : the first time a convolution is executed, every convolution
implementation offered by
C
uDNN is executed and timed. The fastest is
implementation offered by
c
uDNN is executed and timed. The fastest is
reused for every subsequent execution of the convolution.
reused for every subsequent execution of the convolution.
* ``time_on_shape_change`` : like ``time_once`` but a new convolution
* ``time_on_shape_change`` : like ``time_once`` but a new convolution
implementation selected every time the shapes of the inputs and kernels
implementation selected every time the shapes of the inputs and kernels
...
...
doc/library/sandbox/gpuarray/dnn.txt
浏览文件 @
783d83e7
...
@@ -43,17 +43,17 @@ To get an error if Theano can not use cuDNN, use this Theano flag:
...
@@ -43,17 +43,17 @@ To get an error if Theano can not use cuDNN, use this Theano flag:
.. note::
.. note::
CuDNN v3 has now been released. CuDNN v2 remains supported but C
uDNN v3 is
cuDNN v3 has now been released. cuDNN v2 remains supported but c
uDNN v3 is
faster and offers many more options. We recommend that everybody update to
faster and offers many more options. We recommend that everybody update to
v3.
v3.
.. note::
.. note::
Starting in
C
uDNN v3, multiple convolution implementations are offered and
Starting in
c
uDNN v3, multiple convolution implementations are offered and
it is possible to use heuristics to automatically choose a convolution
it is possible to use heuristics to automatically choose a convolution
implementation well suited to the parameters of the convolution.
implementation well suited to the parameters of the convolution.
The Theano flag ``dnn.conv.algo_fwd`` allows to specify the
C
uDNN
The Theano flag ``dnn.conv.algo_fwd`` allows to specify the
c
uDNN
convolution implementation that Theano should use for forward convolutions.
convolution implementation that Theano should use for forward convolutions.
Possible values include :
Possible values include :
...
@@ -64,19 +64,19 @@ To get an error if Theano can not use cuDNN, use this Theano flag:
...
@@ -64,19 +64,19 @@ To get an error if Theano can not use cuDNN, use this Theano flag:
* ``fft`` : use the Fast Fourrier Transform implementation of convolution
* ``fft`` : use the Fast Fourrier Transform implementation of convolution
(very high memory usage)
(very high memory usage)
* ``guess_once`` : the first time a convolution is executed, the
* ``guess_once`` : the first time a convolution is executed, the
implementation to use is chosen according to
C
uDNN's heuristics and reused
implementation to use is chosen according to
c
uDNN's heuristics and reused
for every subsequent execution of the convolution.
for every subsequent execution of the convolution.
* ``guess_on_shape_change`` : like ``guess_once`` but a new convolution
* ``guess_on_shape_change`` : like ``guess_once`` but a new convolution
implementation selected every time the shapes of the inputs and kernels
implementation selected every time the shapes of the inputs and kernels
don't match the shapes from the last execution.
don't match the shapes from the last execution.
* ``time_once`` : the first time a convolution is executed, every convolution
* ``time_once`` : the first time a convolution is executed, every convolution
implementation offered by
C
uDNN is executed and timed. The fastest is
implementation offered by
c
uDNN is executed and timed. The fastest is
reused for every subsequent execution of the convolution.
reused for every subsequent execution of the convolution.
* ``time_on_shape_change`` : like ``time_once`` but a new convolution
* ``time_on_shape_change`` : like ``time_once`` but a new convolution
implementation selected every time the shapes of the inputs and kernels
implementation selected every time the shapes of the inputs and kernels
don't match the shapes from the last execution.
don't match the shapes from the last execution.
The Theano flag ``dnn.conv.algo_bwd`` allows to specify the
C
uDNN
The Theano flag ``dnn.conv.algo_bwd`` allows to specify the
c
uDNN
convolution implementation that Theano should use for gradient convolutions.
convolution implementation that Theano should use for gradient convolutions.
Possible values include :
Possible values include :
...
@@ -86,13 +86,13 @@ To get an error if Theano can not use cuDNN, use this Theano flag:
...
@@ -86,13 +86,13 @@ To get an error if Theano can not use cuDNN, use this Theano flag:
* ``fft`` : use the Fast Fourrier Transform implementation of convolution
* ``fft`` : use the Fast Fourrier Transform implementation of convolution
(very high memory usage)
(very high memory usage)
* ``guess_once`` : the first time a convolution is executed, the
* ``guess_once`` : the first time a convolution is executed, the
implementation to use is chosen according to
C
uDNN's heuristics and reused
implementation to use is chosen according to
c
uDNN's heuristics and reused
for every subsequent execution of the convolution.
for every subsequent execution of the convolution.
* ``guess_on_shape_change`` : like ``guess_once`` but a new convolution
* ``guess_on_shape_change`` : like ``guess_once`` but a new convolution
implementation selected every time the shapes of the inputs and kernels
implementation selected every time the shapes of the inputs and kernels
don't match the shapes from the last execution.
don't match the shapes from the last execution.
* ``time_once`` : the first time a convolution is executed, every convolution
* ``time_once`` : the first time a convolution is executed, every convolution
implementation offered by
C
uDNN is executed and timed. The fastest is
implementation offered by
c
uDNN is executed and timed. The fastest is
reused for every subsequent execution of the convolution.
reused for every subsequent execution of the convolution.
* ``time_on_shape_change`` : like ``time_once`` but a new convolution
* ``time_on_shape_change`` : like ``time_once`` but a new convolution
implementation selected every time the shapes of the inputs and kernels
implementation selected every time the shapes of the inputs and kernels
...
...
theano/configdefaults.py
浏览文件 @
783d83e7
...
@@ -309,25 +309,25 @@ AddConfigVar('dnn.conv.algo_bwd',
...
@@ -309,25 +309,25 @@ AddConfigVar('dnn.conv.algo_bwd',
in_c_key
=
False
)
in_c_key
=
False
)
AddConfigVar
(
'dnn.conv.algo_fwd'
,
AddConfigVar
(
'dnn.conv.algo_fwd'
,
"Default implementation to use for
C
uDNN forward convolution."
,
"Default implementation to use for
c
uDNN forward convolution."
,
EnumStr
(
*
SUPPORTED_DNN_CONV_ALGO_FWD
),
EnumStr
(
*
SUPPORTED_DNN_CONV_ALGO_FWD
),
in_c_key
=
False
)
in_c_key
=
False
)
AddConfigVar
(
'dnn.conv.algo_bwd_data'
,
AddConfigVar
(
'dnn.conv.algo_bwd_data'
,
"Default implementation to use for
C
uDNN backward convolution to "
"Default implementation to use for
c
uDNN backward convolution to "
"get the gradients of the convolution with regard to the inputs."
,
"get the gradients of the convolution with regard to the inputs."
,
EnumStr
(
*
SUPPORTED_DNN_CONV_ALGO_BWD_DATA
),
EnumStr
(
*
SUPPORTED_DNN_CONV_ALGO_BWD_DATA
),
in_c_key
=
False
)
in_c_key
=
False
)
AddConfigVar
(
'dnn.conv.algo_bwd_filter'
,
AddConfigVar
(
'dnn.conv.algo_bwd_filter'
,
"Default implementation to use for
C
uDNN backward convolution to "
"Default implementation to use for
c
uDNN backward convolution to "
"get the gradients of the convolution with regard to the "
"get the gradients of the convolution with regard to the "
"filters."
,
"filters."
,
EnumStr
(
*
SUPPORTED_DNN_CONV_ALGO_BWD_FILTER
),
EnumStr
(
*
SUPPORTED_DNN_CONV_ALGO_BWD_FILTER
),
in_c_key
=
False
)
in_c_key
=
False
)
AddConfigVar
(
'dnn.conv.precision'
,
AddConfigVar
(
'dnn.conv.precision'
,
"Default data precision to use for the computation in
C
uDNN "
"Default data precision to use for the computation in
c
uDNN "
"convolutions (defaults to the same dtype as the inputs of the "
"convolutions (defaults to the same dtype as the inputs of the "
"convolutions)."
,
"convolutions)."
,
EnumStr
(
'as_input'
,
'float16'
,
'float32'
,
'float64'
),
EnumStr
(
'as_input'
,
'float16'
,
'float32'
,
'float64'
),
...
@@ -350,9 +350,9 @@ AddConfigVar('dnn.library_path',
...
@@ -350,9 +350,9 @@ AddConfigVar('dnn.library_path',
StrParam
(
default_dnn_path
(
'lib'
if
sys
.
platform
==
'darwin'
else
'lib64'
)))
StrParam
(
default_dnn_path
(
'lib'
if
sys
.
platform
==
'darwin'
else
'lib64'
)))
AddConfigVar
(
'dnn.enabled'
,
AddConfigVar
(
'dnn.enabled'
,
"'auto', use
C
uDNN if available, but silently fall back"
"'auto', use
c
uDNN if available, but silently fall back"
" to not using it if not present."
" to not using it if not present."
" If True and
C
uDNN can not be used, raise an error."
" If True and
c
uDNN can not be used, raise an error."
" If False, disable cudnn"
,
" If False, disable cudnn"
,
StrParam
(
"auto"
,
"True"
,
"False"
),
StrParam
(
"auto"
,
"True"
,
"False"
),
in_c_key
=
False
)
in_c_key
=
False
)
...
...
theano/sandbox/cuda/dnn_fwd.c
浏览文件 @
783d83e7
...
@@ -78,7 +78,7 @@ APPLY_SPECIFIC(conv_fwd)(CudaNdarray *input, CudaNdarray *kerns,
...
@@ -78,7 +78,7 @@ APPLY_SPECIFIC(conv_fwd)(CudaNdarray *input, CudaNdarray *kerns,
// Obtain a convolution algorithm appropriate for the input and kernel
// Obtain a convolution algorithm appropriate for the input and kernel
// shapes. Either by choosing one according to heuristics or by making
// shapes. Either by choosing one according to heuristics or by making
//
C
uDNN time every implementation and choose the best one.
//
c
uDNN time every implementation and choose the best one.
if
(
CHOOSE_ALGO_TIME
)
if
(
CHOOSE_ALGO_TIME
)
{
{
// Time the different implementations to choose the best one
// Time the different implementations to choose the best one
...
...
theano/sandbox/cuda/dnn_gi.c
浏览文件 @
783d83e7
...
@@ -76,7 +76,7 @@ APPLY_SPECIFIC(conv_gi)(CudaNdarray *kerns, CudaNdarray *output,
...
@@ -76,7 +76,7 @@ APPLY_SPECIFIC(conv_gi)(CudaNdarray *kerns, CudaNdarray *output,
{
{
// Obtain a convolution algorithm appropriate for the kernel and output
// Obtain a convolution algorithm appropriate for the kernel and output
// shapes. Either by choosing one according to heuristics or by making
// shapes. Either by choosing one according to heuristics or by making
//
C
uDNN time every implementation and choose the best one.
//
c
uDNN time every implementation and choose the best one.
if
(
CHOOSE_ALGO_TIME
)
if
(
CHOOSE_ALGO_TIME
)
{
{
// Time the different implementations to choose the best one
// Time the different implementations to choose the best one
...
...
theano/sandbox/cuda/dnn_gw.c
浏览文件 @
783d83e7
...
@@ -76,7 +76,7 @@ APPLY_SPECIFIC(conv_gw)(CudaNdarray *input, CudaNdarray *output,
...
@@ -76,7 +76,7 @@ APPLY_SPECIFIC(conv_gw)(CudaNdarray *input, CudaNdarray *output,
{
{
// Obtain a convolution algorithm appropriate for the input and output
// Obtain a convolution algorithm appropriate for the input and output
// shapes. Either by choosing one according to heuristics or by making
// shapes. Either by choosing one according to heuristics or by making
//
C
uDNN time every implementation and choose the best one.
//
c
uDNN time every implementation and choose the best one.
if
(
CHOOSE_ALGO_TIME
)
if
(
CHOOSE_ALGO_TIME
)
{
{
// Time the different implementations to choose the best one
// Time the different implementations to choose the best one
...
...
theano/sandbox/cuda/tests/test_abstractconv.py
浏览文件 @
783d83e7
...
@@ -25,7 +25,7 @@ else:
...
@@ -25,7 +25,7 @@ else:
class
TestDnnConv2d
(
test_abstract_conv
.
BaseTestConv2d
):
class
TestDnnConv2d
(
test_abstract_conv
.
BaseTestConv2d
):
def
setUp
(
self
):
def
setUp
(
self
):
super
(
TestDnnConv2d
,
self
)
.
setUp
()
super
(
TestDnnConv2d
,
self
)
.
setUp
()
# provide_shape is not used by the
C
uDNN impementation
# provide_shape is not used by the
c
uDNN impementation
self
.
provide_shape
=
[
False
]
self
.
provide_shape
=
[
False
]
self
.
shared
=
gpu_shared
self
.
shared
=
gpu_shared
...
...
theano/sandbox/cuda/tests/test_conv_cuda_ndarray.py
浏览文件 @
783d83e7
...
@@ -520,7 +520,7 @@ def _test_full(cls, mode=None, version=[-1], extra_shapes=[],
...
@@ -520,7 +520,7 @@ def _test_full(cls, mode=None, version=[-1], extra_shapes=[],
def
test_full
():
def
test_full
():
# If using
C
uDNN version before v3, only run the tests where the
# If using
c
uDNN version before v3, only run the tests where the
# kernels are not larger than the input in any spatial dimension.
# kernels are not larger than the input in any spatial dimension.
if
cuda
.
dnn
.
dnn_available
()
and
cuda
.
dnn
.
version
()
<
(
3000
,
3000
):
if
cuda
.
dnn
.
dnn_available
()
and
cuda
.
dnn
.
version
()
<
(
3000
,
3000
):
test_bigger_kernels
=
False
test_bigger_kernels
=
False
...
@@ -542,7 +542,7 @@ def test_dnn_full():
...
@@ -542,7 +542,7 @@ def test_dnn_full():
if
not
cuda
.
dnn
.
dnn_available
():
if
not
cuda
.
dnn
.
dnn_available
():
raise
SkipTest
(
cuda
.
dnn
.
dnn_available
.
msg
)
raise
SkipTest
(
cuda
.
dnn
.
dnn_available
.
msg
)
# If using
C
uDNN version before v3, only run the tests where the
# If using
c
uDNN version before v3, only run the tests where the
# kernels are not larger than the input in any spatial dimension.
# kernels are not larger than the input in any spatial dimension.
if
cuda
.
dnn
.
version
()
<
(
3000
,
3000
):
if
cuda
.
dnn
.
version
()
<
(
3000
,
3000
):
test_bigger_kernels
=
False
test_bigger_kernels
=
False
...
...
theano/sandbox/cuda/tests/test_dnn.py
浏览文件 @
783d83e7
...
@@ -413,7 +413,7 @@ def test_old_pool_interface():
...
@@ -413,7 +413,7 @@ def test_old_pool_interface():
def
test_pooling3d
():
def
test_pooling3d
():
#
CuDNN 3d pooling requires CuDNN v3. Don't test if the C
uDNN version is
#
cuDNN 3d pooling requires cuDNN v3. Don't test if the c
uDNN version is
# too old.
# too old.
if
not
cuda
.
dnn
.
dnn_available
()
or
cuda
.
dnn
.
version
()
<
(
3000
,
3000
):
if
not
cuda
.
dnn
.
dnn_available
()
or
cuda
.
dnn
.
version
()
<
(
3000
,
3000
):
raise
SkipTest
(
cuda
.
dnn
.
dnn_available
.
msg
)
raise
SkipTest
(
cuda
.
dnn
.
dnn_available
.
msg
)
...
@@ -641,8 +641,8 @@ class test_DnnSoftMax(test_nnet.test_SoftMax):
...
@@ -641,8 +641,8 @@ class test_DnnSoftMax(test_nnet.test_SoftMax):
)])
==
0
)
)])
==
0
)
def
test_log_softmax
(
self
):
def
test_log_softmax
(
self
):
# This is a test for an optimization that depends on
C
uDNN v3 or
# This is a test for an optimization that depends on
c
uDNN v3 or
# more recent. Don't test if the
C
uDNN version is too old.
# more recent. Don't test if the
c
uDNN version is too old.
if
cuda
.
dnn
.
version
()
<
(
3000
,
3000
):
if
cuda
.
dnn
.
version
()
<
(
3000
,
3000
):
raise
SkipTest
(
"Log-softmax is only in cudnn v3+"
)
raise
SkipTest
(
"Log-softmax is only in cudnn v3+"
)
...
@@ -826,7 +826,7 @@ class TestDnnInferShapes(utt.InferShapeTester):
...
@@ -826,7 +826,7 @@ class TestDnnInferShapes(utt.InferShapeTester):
def
test_conv3d
(
self
):
def
test_conv3d
(
self
):
if
not
(
cuda
.
dnn
.
dnn_available
()
and
dnn
.
version
()
>=
(
2000
,
2000
)):
if
not
(
cuda
.
dnn
.
dnn_available
()
and
dnn
.
version
()
>=
(
2000
,
2000
)):
raise
SkipTest
(
'"
CuDNN 3D convolution requires C
uDNN v2'
)
raise
SkipTest
(
'"
cuDNN 3D convolution requires c
uDNN v2'
)
ftensor5
=
T
.
TensorType
(
dtype
=
"float32"
,
broadcastable
=
(
False
,)
*
5
)
ftensor5
=
T
.
TensorType
(
dtype
=
"float32"
,
broadcastable
=
(
False
,)
*
5
)
img
=
ftensor5
(
'img'
)
img
=
ftensor5
(
'img'
)
kerns
=
ftensor5
(
'kerns'
)
kerns
=
ftensor5
(
'kerns'
)
...
@@ -914,7 +914,7 @@ class TestDnnInferShapes(utt.InferShapeTester):
...
@@ -914,7 +914,7 @@ class TestDnnInferShapes(utt.InferShapeTester):
def
test_conv3d_gradw
(
self
):
def
test_conv3d_gradw
(
self
):
if
not
(
cuda
.
dnn
.
dnn_available
()
and
dnn
.
version
()
>=
(
2000
,
2000
)):
if
not
(
cuda
.
dnn
.
dnn_available
()
and
dnn
.
version
()
>=
(
2000
,
2000
)):
raise
SkipTest
(
'"
CuDNN 3D convolution requires C
uDNN v2'
)
raise
SkipTest
(
'"
cuDNN 3D convolution requires c
uDNN v2'
)
ftensor5
=
T
.
TensorType
(
dtype
=
"float32"
,
broadcastable
=
(
False
,)
*
5
)
ftensor5
=
T
.
TensorType
(
dtype
=
"float32"
,
broadcastable
=
(
False
,)
*
5
)
img
=
ftensor5
(
'img'
)
img
=
ftensor5
(
'img'
)
kerns
=
ftensor5
(
'kerns'
)
kerns
=
ftensor5
(
'kerns'
)
...
@@ -1004,7 +1004,7 @@ class TestDnnInferShapes(utt.InferShapeTester):
...
@@ -1004,7 +1004,7 @@ class TestDnnInferShapes(utt.InferShapeTester):
def
test_conv3d_gradi
(
self
):
def
test_conv3d_gradi
(
self
):
if
not
(
cuda
.
dnn
.
dnn_available
()
and
dnn
.
version
()
>=
(
2000
,
2000
)):
if
not
(
cuda
.
dnn
.
dnn_available
()
and
dnn
.
version
()
>=
(
2000
,
2000
)):
raise
SkipTest
(
'"
CuDNN 3D convolution requires C
uDNN v2'
)
raise
SkipTest
(
'"
cuDNN 3D convolution requires c
uDNN v2'
)
ftensor5
=
T
.
TensorType
(
dtype
=
"float32"
,
broadcastable
=
(
False
,)
*
5
)
ftensor5
=
T
.
TensorType
(
dtype
=
"float32"
,
broadcastable
=
(
False
,)
*
5
)
img
=
ftensor5
(
'img'
)
img
=
ftensor5
(
'img'
)
kerns
=
ftensor5
(
'kerns'
)
kerns
=
ftensor5
(
'kerns'
)
...
@@ -1392,7 +1392,7 @@ def get_conv3d_test_cases():
...
@@ -1392,7 +1392,7 @@ def get_conv3d_test_cases():
itt
=
chain
(
product
(
test_shapes
,
border_modes
,
conv_modes
),
itt
=
chain
(
product
(
test_shapes
,
border_modes
,
conv_modes
),
product
(
test_shapes_full
,
[
'full'
],
conv_modes
))
product
(
test_shapes_full
,
[
'full'
],
conv_modes
))
else
:
else
:
#
C
uDNN, before V3, did not support kernels larger than the inputs,
#
c
uDNN, before V3, did not support kernels larger than the inputs,
# even if the original inputs were padded so they would be larger than
# even if the original inputs were padded so they would be larger than
# the kernels. If using a version older than V3 don't run the tests
# the kernels. If using a version older than V3 don't run the tests
# with kernels larger than the unpadded inputs.
# with kernels larger than the unpadded inputs.
...
@@ -1404,7 +1404,7 @@ def get_conv3d_test_cases():
...
@@ -1404,7 +1404,7 @@ def get_conv3d_test_cases():
def
test_conv3d_fwd
():
def
test_conv3d_fwd
():
if
not
(
cuda
.
dnn
.
dnn_available
()
and
dnn
.
version
()
>=
(
2000
,
2000
)):
if
not
(
cuda
.
dnn
.
dnn_available
()
and
dnn
.
version
()
>=
(
2000
,
2000
)):
raise
SkipTest
(
'"
CuDNN 3D convolution requires C
uDNN v2'
)
raise
SkipTest
(
'"
cuDNN 3D convolution requires c
uDNN v2'
)
def
run_conv3d_fwd
(
inputs_shape
,
filters_shape
,
subsample
,
def
run_conv3d_fwd
(
inputs_shape
,
filters_shape
,
subsample
,
border_mode
,
conv_mode
):
border_mode
,
conv_mode
):
...
@@ -1421,7 +1421,7 @@ def test_conv3d_fwd():
...
@@ -1421,7 +1421,7 @@ def test_conv3d_fwd():
filters
=
shared
(
filters_val
)
filters
=
shared
(
filters_val
)
bias
=
shared
(
numpy
.
zeros
(
filters_shape
[
0
])
.
astype
(
'float32'
))
bias
=
shared
(
numpy
.
zeros
(
filters_shape
[
0
])
.
astype
(
'float32'
))
# Compile a theano function for the
C
uDNN implementation
# Compile a theano function for the
c
uDNN implementation
conv
=
dnn
.
dnn_conv3d
(
img
=
inputs
,
kerns
=
filters
,
conv
=
dnn
.
dnn_conv3d
(
img
=
inputs
,
kerns
=
filters
,
border_mode
=
border_mode
,
subsample
=
subsample
,
border_mode
=
border_mode
,
subsample
=
subsample
,
conv_mode
=
conv_mode
)
conv_mode
=
conv_mode
)
...
@@ -1476,7 +1476,7 @@ def test_conv3d_fwd():
...
@@ -1476,7 +1476,7 @@ def test_conv3d_fwd():
def
test_conv3d_bwd
():
def
test_conv3d_bwd
():
if
not
(
cuda
.
dnn
.
dnn_available
()
and
dnn
.
version
()
>=
(
2000
,
2000
)):
if
not
(
cuda
.
dnn
.
dnn_available
()
and
dnn
.
version
()
>=
(
2000
,
2000
)):
raise
SkipTest
(
'"
CuDNN 3D convolution requires C
uDNN v2'
)
raise
SkipTest
(
'"
cuDNN 3D convolution requires c
uDNN v2'
)
def
run_conv3d_bwd
(
inputs_shape
,
filters_shape
,
subsample
,
def
run_conv3d_bwd
(
inputs_shape
,
filters_shape
,
subsample
,
border_mode
,
conv_mode
):
border_mode
,
conv_mode
):
...
@@ -1488,7 +1488,7 @@ def test_conv3d_bwd():
...
@@ -1488,7 +1488,7 @@ def test_conv3d_bwd():
filters
=
shared
(
filters_val
)
filters
=
shared
(
filters_val
)
bias
=
shared
(
numpy
.
zeros
(
filters_shape
[
0
])
.
astype
(
'float32'
))
bias
=
shared
(
numpy
.
zeros
(
filters_shape
[
0
])
.
astype
(
'float32'
))
# Compile a theano function for the
C
uDNN implementation
# Compile a theano function for the
c
uDNN implementation
conv
=
dnn
.
dnn_conv3d
(
img
=
inputs
,
kerns
=
filters
,
conv
=
dnn
.
dnn_conv3d
(
img
=
inputs
,
kerns
=
filters
,
border_mode
=
border_mode
,
subsample
=
subsample
,
border_mode
=
border_mode
,
subsample
=
subsample
,
conv_mode
=
conv_mode
)
conv_mode
=
conv_mode
)
...
...
theano/sandbox/gpuarray/tests/test_abstractconv.py
浏览文件 @
783d83e7
...
@@ -18,7 +18,7 @@ class TestDnnConv2d(test_abstract_conv.BaseTestConv2d):
...
@@ -18,7 +18,7 @@ class TestDnnConv2d(test_abstract_conv.BaseTestConv2d):
def
setUp
(
self
):
def
setUp
(
self
):
super
(
TestDnnConv2d
,
self
)
.
setUp
()
super
(
TestDnnConv2d
,
self
)
.
setUp
()
self
.
shared
=
gpuarray_shared_constructor
self
.
shared
=
gpuarray_shared_constructor
# provide_shape is not used by the
C
uDNN impementation
# provide_shape is not used by the
c
uDNN impementation
self
.
provide_shape
=
[
False
]
self
.
provide_shape
=
[
False
]
def
tcase
(
self
,
i
,
f
,
s
,
b
,
flip
,
provide_shape
):
def
tcase
(
self
,
i
,
f
,
s
,
b
,
flip
,
provide_shape
):
...
...
theano/sandbox/gpuarray/tests/test_dnn.py
浏览文件 @
783d83e7
...
@@ -893,8 +893,8 @@ class test_SoftMax(test_nnet.test_SoftMax):
...
@@ -893,8 +893,8 @@ class test_SoftMax(test_nnet.test_SoftMax):
])
==
0
)
])
==
0
)
def
test_log_softmax
(
self
):
def
test_log_softmax
(
self
):
# This is a test for an optimization that depends on
C
uDNN v3 or
# This is a test for an optimization that depends on
c
uDNN v3 or
# more recent. Don't test if the
C
uDNN version is too old.
# more recent. Don't test if the
c
uDNN version is too old.
if
dnn
.
version
(
False
)
<
3000
:
if
dnn
.
version
(
False
)
<
3000
:
raise
SkipTest
(
"Log-softmax is only in cudnn v3+"
)
raise
SkipTest
(
"Log-softmax is only in cudnn v3+"
)
...
@@ -934,8 +934,8 @@ class test_SoftMax(test_nnet.test_SoftMax):
...
@@ -934,8 +934,8 @@ class test_SoftMax(test_nnet.test_SoftMax):
# Test that the op LogSoftmax is correctly replaced by the op
# Test that the op LogSoftmax is correctly replaced by the op
# DnnSoftmax with the 'log' mode.
# DnnSoftmax with the 'log' mode.
# This is a test for an optimization that depends on
C
uDNN v3 or
# This is a test for an optimization that depends on
c
uDNN v3 or
# more recent. Don't test if the
C
uDNN version is too old.
# more recent. Don't test if the
c
uDNN version is too old.
if
dnn
.
version
(
False
)
<
3000
:
if
dnn
.
version
(
False
)
<
3000
:
raise
SkipTest
(
"Log-softmax is only in cudnn v3+"
)
raise
SkipTest
(
"Log-softmax is only in cudnn v3+"
)
...
...
theano/tensor/nnet/__init__.py
浏览文件 @
783d83e7
...
@@ -106,7 +106,7 @@ def conv2d(input, filters, input_shape=None, filter_shape=None,
...
@@ -106,7 +106,7 @@ def conv2d(input, filters, input_shape=None, filter_shape=None,
Notes
Notes
-----
-----
If
C
uDNN is available, it will be used on the
If
c
uDNN is available, it will be used on the
GPU. Otherwise, it is the *CorrMM* convolution that will be used
GPU. Otherwise, it is the *CorrMM* convolution that will be used
"caffe style convolution".
"caffe style convolution".
...
...
theano/tensor/nnet/abstract_conv.py
浏览文件 @
783d83e7
...
@@ -225,7 +225,7 @@ def conv2d_grad_wrt_inputs(output_grad,
...
@@ -225,7 +225,7 @@ def conv2d_grad_wrt_inputs(output_grad,
Notes
Notes
-----
-----
:note: If
C
uDNN is available, it will be used on the
:note: If
c
uDNN is available, it will be used on the
GPU. Otherwise, it is the *CorrMM* convolution that will be used
GPU. Otherwise, it is the *CorrMM* convolution that will be used
"caffe style convolution".
"caffe style convolution".
...
@@ -348,7 +348,7 @@ def conv2d_grad_wrt_weights(input,
...
@@ -348,7 +348,7 @@ def conv2d_grad_wrt_weights(input,
Notes
Notes
-----
-----
:note: If
C
uDNN is available, it will be used on the
:note: If
c
uDNN is available, it will be used on the
GPU. Otherwise, it is the *CorrMM* convolution that will be used
GPU. Otherwise, it is the *CorrMM* convolution that will be used
"caffe style convolution".
"caffe style convolution".
...
...
theano/tensor/signal/pool.py
浏览文件 @
783d83e7
...
@@ -78,8 +78,8 @@ def pool_2d(input, ds, ignore_border=None, st=None, padding=(0, 0),
...
@@ -78,8 +78,8 @@ def pool_2d(input, ds, ignore_border=None, st=None, padding=(0, 0),
" default value changed to True (currently"
" default value changed to True (currently"
" False). To have consistent behavior with all Theano"
" False). To have consistent behavior with all Theano"
" version, explicitly add the parameter ignore_border=True."
" version, explicitly add the parameter ignore_border=True."
" On the GPU, using ignore_border=True is needed to use
C
uDNN."
" On the GPU, using ignore_border=True is needed to use
c
uDNN."
" When using ignore_border=False and not using
C
uDNN, the only"
" When using ignore_border=False and not using
c
uDNN, the only"
" GPU combination supported is when"
" GPU combination supported is when"
" `ds == st and padding == (0, 0) and mode == 'max'`."
" `ds == st and padding == (0, 0) and mode == 'max'`."
" Otherwise, the convolution will be executed on CPU."
,
" Otherwise, the convolution will be executed on CPU."
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论