提交 31c73982 authored 作者: Frederic Bastien's avatar Frederic Bastien

add a warning about the bug in GpuSum with pattern 01, 011, 0111

上级 70083b27
...@@ -77,3 +77,7 @@ AddConfigVar('traceback.limit', ...@@ -77,3 +77,7 @@ AddConfigVar('traceback.limit',
AddConfigVar('warn.argmax_pushdown_bug', AddConfigVar('warn.argmax_pushdown_bug',
"Warn if in past version of Theano we generated a bug with the optimisation theano.tensor.nnet.nnet.local_argmax_pushdown optimization. Was fixed 27 may 2010", "Warn if in past version of Theano we generated a bug with the optimisation theano.tensor.nnet.nnet.local_argmax_pushdown optimization. Was fixed 27 may 2010",
BoolParam(True)) BoolParam(True))
AddConfigVar('warn.gpusum_01_011_0111_bug',
"Warn if we are in a case where old version of Theano had a silent bug with GpuSum pattern 01,011 and 0111 when the first dimensions was bigger then 4096. Was fixed 31 may 2010",
BoolParam(True))
...@@ -824,6 +824,16 @@ class GpuSum(Op): ...@@ -824,6 +824,16 @@ class GpuSum(Op):
threads_z = '' threads_z = ''
if len(self.reduce_mask)==3: if len(self.reduce_mask)==3:
threads_z = '' threads_z = ''
if config.warn.gpusum_01_011_0111_bug:
pattern = '0'+N_pattern
warn = '''
static bool warn_gpusum_01_011_0111_bug = true;
if(warn_gpusum_01_011_0111_bug && CudaNdarray_HOST_DIMS(%(x)s)[%(N)s]>4096){
printf("WARNING: old version of Theano had a silent bug with GpuSum pattern %(pattern)s when the first dimensions was bigger then 4096. Was fixed 31 may 2010. To disable this warning set the Theano flags warn.gpusum_01_011_0111_bug to False. Won't repeat the warning before we exit.\\n");
warn_gpusum_01_011_0111_bug = false;
}
'''%locals()
else: warn = ""
print >> sio, """ print >> sio, """
{ {
int verbose = 0; int verbose = 0;
...@@ -833,6 +843,7 @@ class GpuSum(Op): ...@@ -833,6 +843,7 @@ class GpuSum(Op):
%(threads_y)s %(threads_y)s
%(threads_z)s %(threads_z)s
dim3 n_blocks(std::min(CudaNdarray_HOST_DIMS(%(x)s)[0],NUM_VECTOR_OP_BLOCKS)); dim3 n_blocks(std::min(CudaNdarray_HOST_DIMS(%(x)s)[0],NUM_VECTOR_OP_BLOCKS));
%(warn)s
%(makecall)s %(makecall)s
} }
""" %locals() """ %locals()
...@@ -1062,7 +1073,7 @@ class GpuSum(Op): ...@@ -1062,7 +1073,7 @@ class GpuSum(Op):
""" %locals() """ %locals()
def c_code_cache_version(self): def c_code_cache_version(self):
return (16,) return (17,)
def c_support_code_apply(self, node, nodename): def c_support_code_apply(self, node, nodename):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论