Skip to content

Commit e74f1d3

Browse files
Arm backend: Move FuseConstantArgsPass (#16076)
Move FuseConstantArgsPass to run after ComputeConstantOpsAOTPass to make sure that ops without input nodes are pre-computed first. Signed-off-by: Oscar Andersson <[email protected]>
1 parent ac4b939 commit e74f1d3

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

backends/arm/_passes/arm_pass_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@ def _tosa_pipeline(
244244
# passes. Ticket: MLETORCH-1540
245245
DecomposeNotEqualPass(),
246246
MatchArgRanksPass(exported_program),
247-
FuseConstantArgsPass(exported_program),
248247
]
249248
)
250249

@@ -266,6 +265,7 @@ def _tosa_pipeline(
266265
DecomposeAvgPool2dPass(),
267266
DecorateFp32toInt32CastingPass(),
268267
ComputeConstantOpsAOTPass(exported_program),
268+
FuseConstantArgsPass(exported_program),
269269
ConvertExpandCopyToRepeatPass(),
270270
UnsqueezeBeforeRepeatPass(),
271271
DecomposeCumsumPass(exported_program),

backends/arm/_passes/fuse_constant_ops_pass.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,10 @@ def f(node_name_pre_computed):
178178
return node_name_pre_computed
179179
"""
180180

181-
_passes_required_after: Set[Type[ExportPass]] = {FuseEqualPlaceholdersPass}
181+
_passes_required_after: Set[Type[ExportPass]] = {
182+
FuseEqualPlaceholdersPass,
183+
FuseConstantArgsPass,
184+
}
182185

183186
targeted_ops = [
184187
exir_ops.edge.aten.full.default,

backends/arm/test/models/test_torch_functions.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@ def test_torch_fns_FP(test_data):
126126
xfails={
127127
"nonzero": "torch.fx.experimental.symbolic_shapes.GuardOnDataDependentSymNode: Could not guard on data-dependent expression Eq(u4, 0). "
128128
"Requires dynamic output shape.",
129-
"eye": "ValueError: Failed processing buffer placeholder: aten_arange_start_step_1_pre_computed_common. "
130-
"Is the original torch function supported?",
131129
"topk": "NotImplementedError: No registered serialization name for <class 'torch.return_types.topk'> found",
132130
"sort": "NotImplementedError: No registered serialization name for <class 'torch.return_types.sort'> found",
133131
},

0 commit comments

Comments
 (0)