提交 9e313fda authored 作者: Frédéric Bastien's avatar Frédéric Bastien 提交者: GitHub

Merge pull request #5435 from ReyhaneAskari/fix_max_use_ratio

changed optdb.max_use_ratio to 6
...@@ -13,5 +13,5 @@ echo "===== Testing theano core" ...@@ -13,5 +13,5 @@ echo "===== Testing theano core"
# Test theano core # Test theano core
PARTS="theano -e cuda -e gpuarray" PARTS="theano -e cuda -e gpuarray"
THEANO_PARAM="${PARTS} --with-timer --timer-top-n 10 --with-xunit --xunit-file=theanocore_tests.xml" THEANO_PARAM="${PARTS} --with-timer --timer-top-n 10 --with-xunit --xunit-file=theanocore_tests.xml"
FLAGS="mode=FAST_RUN,floatX=float32" FLAGS="mode=FAST_RUN,floatX=float32,on_opt_error=raise,on_shape_error=raise"
THEANO_FLAGS=${FLAGS} bin/theano-nose ${THEANO_PARAM} THEANO_FLAGS=${FLAGS} bin/theano-nose ${THEANO_PARAM}
...@@ -76,5 +76,5 @@ THEANO_GPUARRAY_TESTS="theano/gpuarray/tests \ ...@@ -76,5 +76,5 @@ THEANO_GPUARRAY_TESTS="theano/gpuarray/tests \
theano/sandbox/tests/test_rng_mrg.py:test_consistency_GPUA_parallel \ theano/sandbox/tests/test_rng_mrg.py:test_consistency_GPUA_parallel \
theano/sandbox/tests/test_rng_mrg.py:test_GPUA_full_fill \ theano/sandbox/tests/test_rng_mrg.py:test_GPUA_full_fill \
theano/scan_module/tests/test_scan.py:T_Scan_Gpuarray" theano/scan_module/tests/test_scan.py:T_Scan_Gpuarray"
FLAGS="init_gpu_device=$DEVICE,gpuarray.preallocate=1000,mode=FAST_RUN" FLAGS="init_gpu_device=$DEVICE,gpuarray.preallocate=1000,mode=FAST_RUN,on_opt_error=raise,on_shape_error=raise"
THEANO_FLAGS=${FLAGS} time nosetests -v --with-xunit --xunit-file=theanogpuarray_tests.xml ${THEANO_GPUARRAY_TESTS} THEANO_FLAGS=${FLAGS} time nosetests -v --with-xunit --xunit-file=theanogpuarray_tests.xml ${THEANO_GPUARRAY_TESTS}
...@@ -1111,7 +1111,7 @@ AddConfigVar('optdb.position_cutoff', ...@@ -1111,7 +1111,7 @@ AddConfigVar('optdb.position_cutoff',
AddConfigVar('optdb.max_use_ratio', AddConfigVar('optdb.max_use_ratio',
'A ratio that prevent infinite loop in EquilibriumOptimizer.', 'A ratio that prevent infinite loop in EquilibriumOptimizer.',
FloatParam(5), FloatParam(8),
in_c_key=False) in_c_key=False)
AddConfigVar('gcc.cxxflags', AddConfigVar('gcc.cxxflags',
......
...@@ -2510,10 +2510,14 @@ class EquilibriumOptimizer(NavigatorOptimizer): ...@@ -2510,10 +2510,14 @@ class EquilibriumOptimizer(NavigatorOptimizer):
end_nb_nodes = len(fgraph.apply_nodes) end_nb_nodes = len(fgraph.apply_nodes)
if max_use_abort: if max_use_abort:
_logger.error("EquilibriumOptimizer max'ed out by '%s'" % opt_name + msg = ("EquilibriumOptimizer max'ed out by '%s'" % opt_name +
". You can safely raise the current threshold of " + ". You can safely raise the current threshold of " +
"%f with the theano flag 'optdb.max_use_ratio'." % "%f with the theano flag 'optdb.max_use_ratio'." %
config.optdb.max_use_ratio) config.optdb.max_use_ratio)
if theano.config.on_opt_error == 'raise':
raise AssertionError(msg)
else:
_logger.error(msg)
fgraph.remove_feature(change_tracker) fgraph.remove_feature(change_tracker)
assert len(loop_process_count) == len(loop_timing) assert len(loop_process_count) == len(loop_timing)
assert len(loop_process_count) == len(global_opt_timing) assert len(loop_process_count) == len(global_opt_timing)
......
...@@ -571,6 +571,7 @@ class TestEquilibrium(object): ...@@ -571,6 +571,7 @@ class TestEquilibrium(object):
opt.optimize(g) opt.optimize(g)
assert str(g) == '[Op2(x, y)]' assert str(g) == '[Op2(x, y)]'
@theano.configparser.change_flags(on_opt_error='ignore')
def test_low_use_ratio(self): def test_low_use_ratio(self):
x, y, z = map(MyVariable, 'xyz') x, y, z = map(MyVariable, 'xyz')
e = op3(op4(x, y)) e = op3(op4(x, y))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论