From a7ea048011a94a2c8fe2a8d85e71e1d51c6e6fbe Mon Sep 17 00:00:00 2001 From: Ekaterina Ignasheva Date: Wed, 22 Oct 2025 14:45:19 -0700 Subject: [PATCH] Move ReplaceScalarWithTensorArgPass, to the common section. (#15359) Summary: This diff reverts D83184528 by moving the ReplaceScalarWithTensorArgPass to the common section between helios and jarvis. The mul.Scalar op is used in MTL models and Michael Maitland caught a performance degradation: With mul.Scalar: P2003182852 vs without mul.Scalar P2003196850 Reviewed By: michaelmaitland, mcremon-meta Differential Revision: D85256050 --- backends/cadence/aot/replace_ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/cadence/aot/replace_ops.py b/backends/cadence/aot/replace_ops.py index e75c967d682..d430e95c470 100644 --- a/backends/cadence/aot/replace_ops.py +++ b/backends/cadence/aot/replace_ops.py @@ -2106,6 +2106,7 @@ def call_operator( class CommonReplacePasses: passes = [ + ReplaceScalarWithTensorArgPass, ReplaceSqueezeAndUnsqueezeWithViewPass, ReplaceSplitWithSlicePass, ReplaceSelectWithViewOpPass, @@ -2143,7 +2144,6 @@ class CadenceReplaceOpsInGraph: ReplaceEmptyTensorsWithFullPass, ReplaceFunctionallyEquivalentOpTargets, ReplacePermuteWithTransposePass, - ReplaceScalarWithTensorArgPass, ReplaceConvolutionOptionalArgsWithConcreteArgsPass, ReplaceAddMMWithLinearPass, RemoveNopSelectOpPass,