提交 b8dbd4ca authored 作者: Ricardo Vieira's avatar Ricardo Vieira 提交者: Ricardo Vieira

Make all inplace rewrites happen at 50.x

上级 b248ebac
...@@ -2492,7 +2492,7 @@ optdb.register( ...@@ -2492,7 +2492,7 @@ optdb.register(
"fast_run", "fast_run",
"inplace", "inplace",
"scan", "scan",
position=75, position=50.5,
) )
scan_eqopt1.register("all_pushout_opt", scan_seqopt1, "fast_run", "scan") scan_eqopt1.register("all_pushout_opt", scan_seqopt1, "fast_run", "scan")
......
...@@ -210,7 +210,7 @@ pytensor.compile.optdb.register( ...@@ -210,7 +210,7 @@ pytensor.compile.optdb.register(
), ),
"fast_run", "fast_run",
"inplace", "inplace",
position=60, position=50.1,
) )
...@@ -239,9 +239,9 @@ def local_addsd_ccode(fgraph, node): ...@@ -239,9 +239,9 @@ def local_addsd_ccode(fgraph, node):
pytensor.compile.optdb.register( pytensor.compile.optdb.register(
"local_addsd_ccode", "local_addsd_ccode",
WalkingGraphRewriter(local_addsd_ccode), WalkingGraphRewriter(local_addsd_ccode),
# Must be after local_inplace_addsd_ccode at 60 # Must be after local_inplace_addsd_ccode at 70.0
"fast_run", "fast_run",
position=61, position=70.1,
) )
......
...@@ -60,7 +60,7 @@ optdb.register( ...@@ -60,7 +60,7 @@ optdb.register(
in2out(random_make_inplace, ignore_newtrees=True), in2out(random_make_inplace, ignore_newtrees=True),
"fast_run", "fast_run",
"inplace", "inplace",
position=99, position=50.9,
) )
......
...@@ -762,8 +762,6 @@ blas_optdb.register( ...@@ -762,8 +762,6 @@ blas_optdb.register(
) )
# After destroyhandler(49.5) but before we try to make elemwise things
# inplace (75)
blas_opt_inplace = in2out( blas_opt_inplace = in2out(
local_inplace_gemm, local_inplace_gemv, local_inplace_ger, name="blas_opt_inplace" local_inplace_gemm, local_inplace_gemv, local_inplace_ger, name="blas_opt_inplace"
) )
...@@ -773,7 +771,8 @@ optdb.register( ...@@ -773,7 +771,8 @@ optdb.register(
"fast_run", "fast_run",
"inplace", "inplace",
"blas_opt_inplace", "blas_opt_inplace",
position=70.0, # Before we try to make elemwise things inplace (70.5)
position=50.2,
) )
......
...@@ -33,5 +33,5 @@ if have_fblas: ...@@ -33,5 +33,5 @@ if have_fblas:
make_scipy_blas_destructive, make_scipy_blas_destructive,
"fast_run", "fast_run",
"inplace", "inplace",
position=70.0, position=50.2,
) )
...@@ -186,9 +186,8 @@ class InplaceElemwiseOptimizer(GraphRewriter): ...@@ -186,9 +186,8 @@ class InplaceElemwiseOptimizer(GraphRewriter):
for i in range(len(node.inputs)) for i in range(len(node.inputs))
if i not in baseline.values() if i not in baseline.values()
and not isinstance(node.inputs[i], Constant) and not isinstance(node.inputs[i], Constant)
and
# the next line should not be costly most of the time. # the next line should not be costly most of the time.
not fgraph.has_destroyers([node.inputs[i]]) and not fgraph.has_destroyers([node.inputs[i]])
and node.inputs[i] not in protected_inputs and node.inputs[i] not in protected_inputs
] ]
else: else:
...@@ -362,7 +361,7 @@ compile.optdb.register( ...@@ -362,7 +361,7 @@ compile.optdb.register(
"inplace_elemwise_optimizer", "inplace_elemwise_optimizer",
"fast_run", "fast_run",
"inplace", "inplace",
position=75, position=50.5,
) )
......
...@@ -1307,7 +1307,7 @@ compile.optdb.register( ...@@ -1307,7 +1307,7 @@ compile.optdb.register(
), ),
"fast_run", "fast_run",
"inplace", "inplace",
position=60, position=50.1,
) )
...@@ -1329,7 +1329,7 @@ compile.optdb.register( ...@@ -1329,7 +1329,7 @@ compile.optdb.register(
), ),
"fast_run", "fast_run",
"inplace", "inplace",
position=60, position=70.6,
) )
...@@ -1355,7 +1355,7 @@ compile.optdb.register( ...@@ -1355,7 +1355,7 @@ compile.optdb.register(
), ),
"fast_run", "fast_run",
"inplace", "inplace",
position=60, position=70.6,
) )
......
...@@ -22,5 +22,5 @@ optdb.register( ...@@ -22,5 +22,5 @@ optdb.register(
), ),
"fast_run", "fast_run",
"inplace", "inplace",
position=60, position=50.1,
) )
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论