Skip to content

Commit c6263f6

Browse files
Martin LindströmMartin Lindström
authored andcommitted
Revert "Arm backend: Merge passes that replace scalars"
Accidentally pushed extra commit This reverts commit c69bac4.
1 parent c69bac4 commit c6263f6

12 files changed

+37
-67
lines changed

backends/arm/_passes/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@
8888
from .mm_to_bmm_pass import ConvertMmToBmmPass # noqa
8989
from .remove_noop_pass import RemoveNoopPass # noqa
9090
from .replace_scalar_with_tensor_pass import ( # noqa
91-
ReplaceScalarWithTensorByProfilePass,
91+
ReplaceScalarWithTensorArgPassTOSABI,
92+
ReplaceScalarWithTensorArgPassTOSAMI,
9293
)
9394
from .rewrite_upsample import RewriteUpsamplePass # noqa
9495
from .scalars_to_attribute_pass import ScalarsToAttributePass # noqa

backends/arm/_passes/arm_pass_manager.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@
8888
QuantizeOperatorArguments,
8989
RemoveNoopPass,
9090
ReplaceInfValues,
91-
ReplaceScalarWithTensorByProfilePass,
91+
ReplaceScalarWithTensorArgPassTOSABI,
92+
ReplaceScalarWithTensorArgPassTOSAMI,
9293
RetraceFoldedDtypesPass,
9394
RewriteUpsamplePass,
9495
ScalarsToAttributePass,
@@ -170,7 +171,7 @@ def _tosa_INT_pipeline(self, exported_program: ExportedProgram) -> GraphModule:
170171
self.add_pass(CastToInt32Pass())
171172

172173
self.add_pass(CastBoolToInt8Pass())
173-
self.add_pass(ReplaceScalarWithTensorByProfilePass())
174+
self.add_pass(ReplaceScalarWithTensorArgPassTOSABI())
174175
self.add_pass(AnnotateDecomposedMatmulPass())
175176
self.add_pass(QuantizeOperatorArguments())
176177
self.add_pass(ConvertELUParamsPass())
@@ -238,7 +239,7 @@ def _tosa_FP_pipeline(self, exported_program: ExportedProgram) -> GraphModule:
238239
self.add_pass(DecomposeSinhPass())
239240
self.add_pass(DecomposeSignPass())
240241
self.add_pass(DecomposeDivTensorModePass())
241-
self.add_pass(ReplaceScalarWithTensorByProfilePass())
242+
self.add_pass(ReplaceScalarWithTensorArgPassTOSAMI())
242243
self.add_pass(DecomposeEmbeddingPass())
243244
self.add_pass(FuseQuantizedActivationPass())
244245
self.add_pass(RemoveGetItemPass())
@@ -328,7 +329,7 @@ def transform_for_annotation_pipeline(self, graph_module: GraphModule):
328329
self.add_pass(DecomposeSignPass())
329330
self.add_pass(DecomposeAddmmPass())
330331
self.add_pass(DecomposeDivTensorModePass())
331-
self.add_pass(ReplaceScalarWithTensorByProfilePass())
332+
self.add_pass(ReplaceScalarWithTensorArgPassTOSABI())
332333
self.add_pass(ScalarsToAttributePass())
333334
self.add_pass(DecomposeGroupNormPass())
334335
self.add_pass(DecomposeLayerNormPass())

backends/arm/_passes/decompose_acosh_pass.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from executorch.backends.arm._passes.match_arg_dtype_pass import MatchArgDtypePass
1414
from executorch.backends.arm._passes.match_arg_ranks_pass import MatchArgRanksPass
1515
from executorch.backends.arm._passes.replace_scalar_with_tensor_pass import (
16-
ReplaceScalarWithTensorByProfilePass,
16+
ReplaceScalarWithTensorArgPassTOSAMI,
1717
)
1818
from executorch.exir.dialects._ops import ops as exir_ops
1919
from executorch.exir.pass_base import ExportPass
@@ -33,7 +33,7 @@ class DecomposeAcoshPass(ArmPass):
3333
DecomposeSqrtPass,
3434
InsertTableOpsPass,
3535
MatchArgRanksPass,
36-
ReplaceScalarWithTensorByProfilePass,
36+
ReplaceScalarWithTensorArgPassTOSAMI,
3737
MatchArgDtypePass,
3838
}
3939

backends/arm/_passes/decompose_asin_and_acos_pass.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from executorch.backends.arm._passes.match_arg_dtype_pass import MatchArgDtypePass
2121
from executorch.backends.arm._passes.match_arg_ranks_pass import MatchArgRanksPass
2222
from executorch.backends.arm._passes.replace_scalar_with_tensor_pass import (
23-
ReplaceScalarWithTensorByProfilePass,
23+
ReplaceScalarWithTensorArgPassTOSAMI,
2424
)
2525
from executorch.exir.dialects._ops import ops as exir_ops
2626
from executorch.exir.pass_base import ExportPass
@@ -72,7 +72,7 @@ class DecomposeAsinAndAcosPass(ArmPass):
7272
ConvertFullLikeToFullPass,
7373
MatchArgRanksPass,
7474
MatchArgDtypePass,
75-
ReplaceScalarWithTensorByProfilePass,
75+
ReplaceScalarWithTensorArgPassTOSAMI,
7676
}
7777

7878
def _build_polynomial(

backends/arm/_passes/decompose_asinh_pass.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from executorch.backends.arm._passes.match_arg_dtype_pass import MatchArgDtypePass
1515
from executorch.backends.arm._passes.match_arg_ranks_pass import MatchArgRanksPass
1616
from executorch.backends.arm._passes.replace_scalar_with_tensor_pass import (
17-
ReplaceScalarWithTensorByProfilePass,
17+
ReplaceScalarWithTensorArgPassTOSAMI,
1818
)
1919
from executorch.exir.dialects._ops import ops as exir_ops
2020
from executorch.exir.pass_base import ExportPass
@@ -34,7 +34,7 @@ class DecomposeAsinhPass(ArmPass):
3434
DecomposeSqrtPass,
3535
InsertTableOpsPass,
3636
MatchArgRanksPass,
37-
ReplaceScalarWithTensorByProfilePass,
37+
ReplaceScalarWithTensorArgPassTOSAMI,
3838
MatchArgDtypePass,
3939
}
4040

backends/arm/_passes/decompose_atan_pass.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from executorch.backends.arm._passes.match_arg_dtype_pass import MatchArgDtypePass
1313
from executorch.backends.arm._passes.match_arg_ranks_pass import MatchArgRanksPass
1414
from executorch.backends.arm._passes.replace_scalar_with_tensor_pass import (
15-
ReplaceScalarWithTensorByProfilePass,
15+
ReplaceScalarWithTensorArgPassTOSAMI,
1616
)
1717
from executorch.exir.dialects._ops import ops as exir_ops
1818
from executorch.exir.pass_base import ExportPass
@@ -47,7 +47,7 @@ class DecomposeAtanPass(ArmPass):
4747
InsertTableOpsPass,
4848
MatchArgRanksPass,
4949
MatchArgDtypePass,
50-
ReplaceScalarWithTensorByProfilePass,
50+
ReplaceScalarWithTensorArgPassTOSAMI,
5151
}
5252

5353
def _rational_approximation(self, z, ops, meta):

backends/arm/_passes/decompose_atanh_pass.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from executorch.backends.arm._passes.match_arg_dtype_pass import MatchArgDtypePass
1111
from executorch.backends.arm._passes.match_arg_ranks_pass import MatchArgRanksPass
1212
from executorch.backends.arm._passes.replace_scalar_with_tensor_pass import (
13-
ReplaceScalarWithTensorByProfilePass,
13+
ReplaceScalarWithTensorArgPassTOSAMI,
1414
)
1515
from executorch.exir.dialects._ops import ops as exir_ops
1616
from executorch.exir.pass_base import ExportPass
@@ -43,7 +43,7 @@ class DecomposeAtanhPass(ArmPass):
4343
InsertTableOpsPass,
4444
MatchArgRanksPass,
4545
MatchArgDtypePass,
46-
ReplaceScalarWithTensorByProfilePass,
46+
ReplaceScalarWithTensorArgPassTOSAMI,
4747
}
4848

4949
def call_operator(self, op, args, kwargs, meta):

backends/arm/_passes/decompose_cosh_pass.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from executorch.backends.arm._passes.match_arg_dtype_pass import MatchArgDtypePass
1111
from executorch.backends.arm._passes.match_arg_ranks_pass import MatchArgRanksPass
1212
from executorch.backends.arm._passes.replace_scalar_with_tensor_pass import (
13-
ReplaceScalarWithTensorByProfilePass,
13+
ReplaceScalarWithTensorArgPassTOSAMI,
1414
)
1515
from executorch.exir.dialects._ops import ops as exir_ops
1616
from executorch.exir.pass_base import ExportPass
@@ -31,7 +31,7 @@ class DecomposeCoshPass(ArmPass):
3131
_passes_required_after: Set[Type[ExportPass]] = {
3232
InsertTableOpsPass,
3333
MatchArgRanksPass,
34-
ReplaceScalarWithTensorByProfilePass,
34+
ReplaceScalarWithTensorArgPassTOSAMI,
3535
MatchArgDtypePass,
3636
}
3737

backends/arm/_passes/decompose_expm1_pass.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from executorch.backends.arm._passes.match_arg_dtype_pass import MatchArgDtypePass
1313
from executorch.backends.arm._passes.match_arg_ranks_pass import MatchArgRanksPass
1414
from executorch.backends.arm._passes.replace_scalar_with_tensor_pass import (
15-
ReplaceScalarWithTensorByProfilePass,
15+
ReplaceScalarWithTensorArgPassTOSAMI,
1616
)
1717
from executorch.exir.dialects._ops import ops as exir_ops
1818
from executorch.exir.pass_base import ExportPass
@@ -83,7 +83,7 @@ class DecomposeExpm1Pass(ArmPass):
8383
ConvertIntPowToMuls,
8484
InsertTableOpsPass,
8585
DecomposeDivPass,
86-
ReplaceScalarWithTensorByProfilePass,
86+
ReplaceScalarWithTensorArgPassTOSAMI,
8787
MatchArgDtypePass,
8888
MatchArgRanksPass,
8989
}

backends/arm/_passes/decompose_logit_pass.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from executorch.backends.arm._passes.match_arg_dtype_pass import MatchArgDtypePass
1313
from executorch.backends.arm._passes.match_arg_ranks_pass import MatchArgRanksPass
1414
from executorch.backends.arm._passes.replace_scalar_with_tensor_pass import (
15-
ReplaceScalarWithTensorByProfilePass,
15+
ReplaceScalarWithTensorArgPassTOSAMI,
1616
)
1717
from executorch.exir.dialects._ops import ops as exir_ops
1818
from executorch.exir.pass_base import ExportPass
@@ -73,7 +73,7 @@ class DecomposeLogitPass(ArmPass):
7373
InsertTableOpsPass,
7474
MatchArgRanksPass,
7575
MatchArgDtypePass,
76-
ReplaceScalarWithTensorByProfilePass,
76+
ReplaceScalarWithTensorArgPassTOSAMI,
7777
}
7878

7979
def call_operator(self, op, args, kwargs, meta):

0 commit comments

Comments
 (0)