提交 7d56b446 authored 作者: David Warde-Farley's avatar David Warde-Farley

Disabled all optimizations pending further review.

上级 a6494915
...@@ -349,13 +349,16 @@ def cond_make_inplace(node): ...@@ -349,13 +349,16 @@ def cond_make_inplace(node):
name=op.name).make_node(*node.inputs).outputs name=op.name).make_node(*node.inputs).outputs
return False return False
optdb.register('cond_make_inplace', opt.in2out(cond_make_inplace,
ignore_newtrees=True), 95, 'fast_run', 'inplace')
ifelse_equilibrium = gof.EquilibriumDB() # XXX: Optimizations commented pending further debugging (certain optimizations
ifelse_seqopt = gof.SequenceDB() # make computation less lazy than it should be currently).
ifelse_equilibrium.register('seq_ifelse', ifelse_seqopt, 'fast_run', # optdb.register('cond_make_inplace', opt.in2out(cond_make_inplace,
'ifelse') # ignore_newtrees=True), 95, 'fast_run', 'inplace')
#
# ifelse_equilibrium = gof.EquilibriumDB()
# ifelse_seqopt = gof.SequenceDB()
# ifelse_equilibrium.register('seq_ifelse', ifelse_seqopt, 'fast_run',
# 'ifelse')
''' Comments: ''' Comments:
I've wrote this comments to explain how the optimization of ifelse function I've wrote this comments to explain how the optimization of ifelse function
(for future developers that need to parse this part of code. Please try to (for future developers that need to parse this part of code. Please try to
...@@ -650,60 +653,64 @@ def cond_merge_random_op(main_node): ...@@ -650,60 +653,64 @@ def cond_merge_random_op(main_node):
return main_outs return main_outs
pushout_equilibrium = gof.EquilibriumDB() # XXX: Optimizations commented pending further debugging (certain optimizations
# make computation less lazy than it should be currently).
#pushout_equilibrium.register("cond_lift_single_if", #
# opt.in2out(cond_lift_single_if, # pushout_equilibrium = gof.EquilibriumDB()
# ignore_newtrees=True), #
# 'fast_run', 'ifelse') # XXX: This optimization doesn't seem to exist anymore?
# pushout_equilibrium.register("cond_lift_single_if",
pushout_equilibrium.register("cond_merge_random_op", # opt.in2out(cond_lift_single_if,
opt.in2out(cond_merge_random_op, # ignore_newtrees=True),
ignore_newtrees=True), # 'fast_run', 'ifelse')
'fast_run', 'ifelse') #
# pushout_equilibrium.register("cond_merge_random_op",
# opt.in2out(cond_merge_random_op,
pushout_equilibrium.register("ifelse_merge", # ignore_newtrees=True),
gof.MergeOptimizer(skip_const_merge=False), # 'fast_run', 'ifelse')
'fast_run', 'ifelse') #
#
pushout_equilibrium.register("ifelse_remove_identical_inside", # pushout_equilibrium.register("ifelse_merge",
opt.in2out(cond_remove_identical, # gof.MergeOptimizer(skip_const_merge=False),
ignore_newtrees=True), # 'fast_run', 'ifelse')
'fast_run', 'ifelse') #
# pushout_equilibrium.register("ifelse_remove_identical_inside",
pushout_equilibrium.register('ifelse_sameCondTrue_inside', # opt.in2out(cond_remove_identical,
opt.in2out(cond_merge_ifs_true, # ignore_newtrees=True),
ignore_newtrees=True), # 'fast_run', 'ifelse')
'fast_run', 'ifelse') #
# pushout_equilibrium.register('ifelse_sameCondTrue_inside',
pushout_equilibrium.register('ifelse_sameCondFalse_inside', # opt.in2out(cond_merge_ifs_true,
opt.in2out(cond_merge_ifs_false, # ignore_newtrees=True),
ignore_newtrees=True), # 'fast_run', 'ifelse')
'fast_run', 'ifelse') #
# pushout_equilibrium.register('ifelse_sameCondFalse_inside',
ifelse_seqopt.register('ifelse_condPushOut_equilibrium', # opt.in2out(cond_merge_ifs_false,
pushout_equilibrium, # ignore_newtrees=True),
1, 'fast_run', 'ifelse') # 'fast_run', 'ifelse')
#
ifelse_seqopt.register('merge_nodes_1', # ifelse_seqopt.register('ifelse_condPushOut_equilibrium',
gof.MergeOptimizer(skip_const_merge=False), # pushout_equilibrium,
2, 'fast_run', 'ifelse') # 1, 'fast_run', 'ifelse')
#
# ifelse_seqopt.register('merge_nodes_1',
ifelse_seqopt.register('ifelse_sameCondTrue', # gof.MergeOptimizer(skip_const_merge=False),
opt.in2out(cond_merge_ifs_true, # 2, 'fast_run', 'ifelse')
ignore_newtrees=True), #
3, 'fast_run', 'ifelse') #
# ifelse_seqopt.register('ifelse_sameCondTrue',
# opt.in2out(cond_merge_ifs_true,
ifelse_seqopt.register('ifelse_sameCondFalse', # ignore_newtrees=True),
opt.in2out(cond_merge_ifs_false, # 3, 'fast_run', 'ifelse')
ignore_newtrees=True), #
4, 'fast_run', 'ifelse') #
# ifelse_seqopt.register('ifelse_sameCondFalse',
# opt.in2out(cond_merge_ifs_false,
ifelse_seqopt.register('ifelse_removeIdenetical', # ignore_newtrees=True),
opt.in2out(cond_remove_identical, # 4, 'fast_run', 'ifelse')
ignore_newtrees=True), #
7, 'fast_run', 'ifelse') #
# ifelse_seqopt.register('ifelse_removeIdenetical',
# opt.in2out(cond_remove_identical,
# ignore_newtrees=True),
# 7, 'fast_run', 'ifelse')
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论