提交 74a27aae authored 作者: notoraptor's avatar notoraptor

Small updates:

* Remove the "[new backend]" part of the message and idem in the old back-end. * Move the check to the make_node of the ops. I'll continue analyzing the subsamples.
上级 56a39445
......@@ -720,6 +720,11 @@ class GpuDnnConvGradW(DnnBase):
return defs
def make_node(self, img, topgrad, output, desc, alpha=None, beta=None):
if img.type.ndim == 5 and self.algo != 'none':
warnings.warn('cuDNN backward filter convolution computation for 3D convolutions '
'may produce bad results with certain algorithms depending on the compute capability '
'of your GPU. If you encounter problems, consider setting the theano flag '
'"dnn.conv.algo_bwd_filter" to "none" (dnn.conv.algo_bwd_filter=none)')
ctx_name = infer_context_name(img, topgrad, output)
img = as_gpuarray_variable(img, ctx_name)
topgrad = as_gpuarray_variable(topgrad, ctx_name)
......@@ -1135,11 +1140,6 @@ def dnn_conv3d(img, kerns, border_mode='valid', subsample=(1, 1, 1),
desc_op.subsample)
out_shp = assert_conv_shape(out_shp)
out = gpu_alloc_empty(ctx_name, dtype=img.dtype)(*out_shp)
if config.dnn.conv.algo_bwd_filter != 'none':
warnings.warn('[new backend] cuDNN backward filter convolution computation for 3D convolutions '
'may produce bad results with certain algorithms depending on the compute capability '
'of your GPU. If you encounter problems, consider setting the theano flag '
'"dnn.conv.algo_bwd_filter" to "none" (dnn.conv.algo_bwd_filter=none)')
return gpu_dnn_conv(algo=algo)(img, kerns, out, desc)
......
......@@ -763,17 +763,12 @@ class GpuDnnConv3dGradW(GpuDnnConvGradW):
good_algo = ['none', 'small',
'guess_once', 'guess_on_shape_change',
'time_once', 'time_on_shape_change']
if algo is None:
algo = config.dnn.conv.algo_bwd_filter
if version() < (5000, 5000) and algo == 'small':
algo = 'guess_once'
elif algo not in good_algo:
elif algo is None and config.dnn.conv.algo_bwd_filter not in good_algo:
algo = 'guess_once'
elif algo is not None and algo not in good_algo:
algo = 'guess_once'
if algo != 'none':
warnings.warn('[old backend] cuDNN backward filter convolution computation for 3D convolutions '
'may produce bad results with certain algorithms depending on the compute capability '
'of your GPU. If you encounter problems, consider setting the theano flag '
'"dnn.conv.algo_bwd_filter" to "none" (dnn.conv.algo_bwd_filter=none)')
super(GpuDnnConv3dGradW, self).__init__(inplace=inplace,
algo=algo)
assert self.algo in good_algo
......@@ -794,6 +789,11 @@ class GpuDnnConv3dGradW(GpuDnnConvGradW):
DisconnectedType()(), d_alpha, d_beta)
def make_node(self, img, topgrad, output, desc, alpha=None, beta=None):
if self.algo != 'none':
warnings.warn('cuDNN backward filter convolution computation for 3D convolutions '
'may produce bad results with certain algorithms depending on the compute capability '
'of your GPU. If you encounter problems, consider setting the theano flag '
'"dnn.conv.algo_bwd_filter" to "none" (dnn.conv.algo_bwd_filter=none)')
img = as_cuda_ndarray_variable(img)
topgrad = as_cuda_ndarray_variable(topgrad)
output = as_cuda_ndarray_variable(output)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论