Skip to content

Commit 2aa8084

Browse files
authored
Arm backend: Remove TOSA v0.80 from arm backend (#13040)
### Summary This PR removes TOSA v0.80 from the arm backend. This includes updates to: - operator node visitors - operator support - passes - test infrastructure - tosa specification and utils - removal of installation of v0.80 and patch scripts
1 parent 468f95d commit 2aa8084

File tree

236 files changed

+2127
-6343
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

236 files changed

+2127
-6343
lines changed

backends/arm/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ The Arm EthosU Backend should be considered a prototype quality at this point, l
181181
## Current flows
182182

183183
The EthosUBackend has a two stage process,
184-
- Compile to TOSA to rationalise the graph into known hardware support profiles. Currently this is to v0.80 TOSA BI with specific concern to a subset which gives support on Ethos-U55 and Ethos-U85, the target of the initial prototype efforts. This calls into the TOSABackend.
185-
- Lower via the ethos-u-vela compilation flow which takes TOSA v0.80 as an input and produces a low level commandstream for the hardware which is then passed via the delegate to the ethos-u-core-driver for direct execution.
184+
- Compile to TOSA to rationalise the graph into known hardware support profiles. Currently this is to v1.0 TOSA INT with specific concern to a subset which gives support on Ethos-U55 and Ethos-U85, the target of the initial prototype efforts. This calls into the TOSABackend.
185+
- Lower via the ethos-u-vela compilation flow which takes TOSA v1.0 as an input and produces a low level commandstream for the hardware which is then passed via the delegate to the ethos-u-core-driver for direct execution.
186186

187187
The EthosUPartitioner is currenly used to ensure the operations converted are Ethos-U compatible, but will be extended to offer spec-correct TOSA Base inference and TOSA Main Inference generation in future.
188188

backends/arm/_passes/arm_pass_manager.py

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def _transform(self, graph_module: GraphModule):
106106
with TosaLoweringContext(self.tosa_spec):
107107
return self(graph_module).graph_module
108108

109-
def _tosa_080_BI_pipeline(self, exported_program: ExportedProgram) -> GraphModule:
109+
def _tosa_INT_pipeline(self, exported_program: ExportedProgram) -> GraphModule:
110110
self.add_pass(FuseQuantizedActivationPass())
111111
self.add_pass(RemoveGetItemPass())
112112
self.add_pass(ConvertSplitToSlicePass())
@@ -161,7 +161,7 @@ def _tosa_080_BI_pipeline(self, exported_program: ExportedProgram) -> GraphModul
161161

162162
return self._transform(exported_program.graph_module)
163163

164-
def _tosa_080_MI_pipeline(self, exported_program: ExportedProgram) -> GraphModule:
164+
def _tosa_FP_pipeline(self, exported_program: ExportedProgram) -> GraphModule:
165165
self.add_pass(DecomposeMaskedFill())
166166
self.add_pass(DecomposeRoundPass())
167167
self.add_pass(DecomposeAcoshPass())
@@ -235,22 +235,12 @@ def _tosa_080_MI_pipeline(self, exported_program: ExportedProgram) -> GraphModul
235235

236236
return self._transform(exported_program.graph_module)
237237

238-
def _tosa_1_0_int_quantized_pipeline(self, exported_program: ExportedProgram):
239-
return self._tosa_080_BI_pipeline(exported_program)
240-
241-
def _tosa_1_0_fp_pipeline(self, exported_program: ExportedProgram):
242-
return self._tosa_080_MI_pipeline(exported_program)
243-
244238
def transform_to_backend_pipeline(self, exported_program: ExportedProgram):
245239
"""Apply passes before transforming program to backend"""
246-
if self.tosa_spec == TosaSpecification.create_from_string("TOSA-0.80.0+BI"):
247-
return self._tosa_080_BI_pipeline(exported_program)
248-
elif self.tosa_spec == TosaSpecification.create_from_string("TOSA-0.80.0+MI"):
249-
return self._tosa_080_MI_pipeline(exported_program)
250-
elif self.tosa_spec == TosaSpecification.create_from_string("TOSA-1.0+FP"):
251-
return self._tosa_1_0_fp_pipeline(exported_program)
240+
if self.tosa_spec == TosaSpecification.create_from_string("TOSA-1.0+FP"):
241+
return self._tosa_FP_pipeline(exported_program)
252242
elif self.tosa_spec == TosaSpecification.create_from_string("TOSA-1.0+INT"):
253-
return self._tosa_1_0_int_quantized_pipeline(exported_program)
243+
return self._tosa_INT_pipeline(exported_program)
254244
else:
255245
raise NotImplementedError(
256246
f"No pass pipeline implemented for {self.tosa_spec=}"

backends/arm/operator_support/convolution_support.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ class ConvolutionSupported(SupportedTOSAOperatorCheck):
2121
targets = [exir_ops.edge.aten.convolution.default]
2222

2323
tosa_specs = [
24-
TosaSpecification.create_from_string("TOSA-0.80+BI"),
25-
TosaSpecification.create_from_string("TOSA-0.80+MI"),
2624
TosaSpecification.create_from_string("TOSA-1.0+INT"),
2725
TosaSpecification.create_from_string("TOSA-1.0+FP"),
2826
]

backends/arm/operator_support/embedding_support.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ class EmbeddingSupported(SupportedTOSAOperatorCheck):
2020
targets = [exir_ops.edge.aten.embedding.default]
2121

2222
tosa_specs = [
23-
TosaSpecification.create_from_string("TOSA-0.80+BI"),
24-
TosaSpecification.create_from_string("TOSA-0.80+MI"),
2523
TosaSpecification.create_from_string("TOSA-1.0+INT"),
2624
TosaSpecification.create_from_string("TOSA-1.0+FP"),
2725
]

backends/arm/operator_support/index_select_support.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ class IndexSelectSupported(SupportedTOSAOperatorCheck):
1818
targets = [exir_ops.edge.aten.index_select.default]
1919

2020
tosa_specs = [
21-
TosaSpecification.create_from_string("TOSA-0.80+BI"),
22-
TosaSpecification.create_from_string("TOSA-0.80+MI"),
2321
TosaSpecification.create_from_string("TOSA-1.0+INT"),
2422
TosaSpecification.create_from_string("TOSA-1.0+FP"),
2523
]

backends/arm/operator_support/index_tensor_support.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ class IndexTensorSupported(SupportedTOSAOperatorCheck):
100100
targets = [exir_ops.edge.aten.index.Tensor]
101101

102102
tosa_specs = [
103-
TosaSpecification.create_from_string("TOSA-0.80+BI"),
104-
TosaSpecification.create_from_string("TOSA-0.80+MI"),
105103
TosaSpecification.create_from_string("TOSA-1.0+INT"),
106104
TosaSpecification.create_from_string("TOSA-1.0+FP"),
107105
]

backends/arm/operator_support/minmax_support.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ class MinMaxSupported(SupportedTOSAOperatorCheck):
2121

2222
# TODO : "MLETORCH-718 : Quantization of indices in arm_quantizer"
2323
tosa_specs = [
24-
TosaSpecification.create_from_string("TOSA-0.80+MI"),
2524
TosaSpecification.create_from_string("TOSA-1.0+FP"),
2625
]
2726

backends/arm/operator_support/pool_2d_support.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ class AvgPool2dSupported(SupportedTOSAOperatorCheck):
4343
]
4444

4545
tosa_specs = [
46-
TosaSpecification.create_from_string("TOSA-0.80+BI"),
47-
TosaSpecification.create_from_string("TOSA-0.80+MI"),
4846
TosaSpecification.create_from_string("TOSA-1.0+INT"),
4947
TosaSpecification.create_from_string("TOSA-1.0+FP"),
5048
]
@@ -122,8 +120,6 @@ class MaxPool2dSupported(SupportedTOSAOperatorCheck):
122120
]
123121

124122
tosa_specs = [
125-
TosaSpecification.create_from_string("TOSA-0.80+BI"),
126-
TosaSpecification.create_from_string("TOSA-0.80+MI"),
127123
TosaSpecification.create_from_string("TOSA-1.0+INT"),
128124
TosaSpecification.create_from_string("TOSA-1.0+FP"),
129125
]

backends/arm/operator_support/reduce_sum_support.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ class SumSupported(SupportedTOSAOperatorCheck):
1919
targets = [exir_ops.edge.aten.sum.dim_IntList]
2020

2121
tosa_specs = [
22-
TosaSpecification.create_from_string("TOSA-0.80+BI"),
23-
TosaSpecification.create_from_string("TOSA-0.80+MI"),
2422
TosaSpecification.create_from_string("TOSA-1.0+INT"),
2523
TosaSpecification.create_from_string("TOSA-1.0+FP"),
2624
]

backends/arm/operator_support/right_shift_support.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ class RightShiftSupported(SupportedTOSAOperatorCheck):
2727
]
2828

2929
tosa_specs = [
30-
TosaSpecification.create_from_string("TOSA-0.80+BI"),
31-
TosaSpecification.create_from_string("TOSA-0.80+MI"),
3230
TosaSpecification.create_from_string("TOSA-1.0+INT"),
3331
TosaSpecification.create_from_string("TOSA-1.0+FP"),
3432
]

0 commit comments

Comments
 (0)