Skip to content

Commit 48410d7

Browse files
SaoirseARMagrima1304
authored andcommitted
Arm backend: Remove TOSA v0.80 from arm backend (pytorch#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 80e3782 commit 48410d7

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
@@ -108,7 +108,7 @@ def _transform(self, graph_module: GraphModule):
108108
with TosaLoweringContext(self.tosa_spec):
109109
return self(graph_module).graph_module
110110

111-
def _tosa_080_BI_pipeline(self, exported_program: ExportedProgram) -> GraphModule:
111+
def _tosa_INT_pipeline(self, exported_program: ExportedProgram) -> GraphModule:
112112
self.add_pass(FuseQuantizedActivationPass())
113113
self.add_pass(RemoveGetItemPass())
114114
self.add_pass(ConvertSplitToSlicePass())
@@ -164,7 +164,7 @@ def _tosa_080_BI_pipeline(self, exported_program: ExportedProgram) -> GraphModul
164164

165165
return self._transform(exported_program.graph_module)
166166

167-
def _tosa_080_MI_pipeline(self, exported_program: ExportedProgram) -> GraphModule:
167+
def _tosa_FP_pipeline(self, exported_program: ExportedProgram) -> GraphModule:
168168
self.add_pass(DecomposeMaskedFill())
169169
self.add_pass(DecomposeRoundPass())
170170
self.add_pass(DecomposeAcoshPass())
@@ -239,22 +239,12 @@ def _tosa_080_MI_pipeline(self, exported_program: ExportedProgram) -> GraphModul
239239

240240
return self._transform(exported_program.graph_module)
241241

242-
def _tosa_1_0_int_quantized_pipeline(self, exported_program: ExportedProgram):
243-
return self._tosa_080_BI_pipeline(exported_program)
244-
245-
def _tosa_1_0_fp_pipeline(self, exported_program: ExportedProgram):
246-
return self._tosa_080_MI_pipeline(exported_program)
247-
248242
def transform_to_backend_pipeline(self, exported_program: ExportedProgram):
249243
"""Apply passes before transforming program to backend"""
250-
if self.tosa_spec == TosaSpecification.create_from_string("TOSA-0.80.0+BI"):
251-
return self._tosa_080_BI_pipeline(exported_program)
252-
elif self.tosa_spec == TosaSpecification.create_from_string("TOSA-0.80.0+MI"):
253-
return self._tosa_080_MI_pipeline(exported_program)
254-
elif self.tosa_spec == TosaSpecification.create_from_string("TOSA-1.0+FP"):
255-
return self._tosa_1_0_fp_pipeline(exported_program)
244+
if self.tosa_spec == TosaSpecification.create_from_string("TOSA-1.0+FP"):
245+
return self._tosa_FP_pipeline(exported_program)
256246
elif self.tosa_spec == TosaSpecification.create_from_string("TOSA-1.0+INT"):
257-
return self._tosa_1_0_int_quantized_pipeline(exported_program)
247+
return self._tosa_INT_pipeline(exported_program)
258248
else:
259249
raise NotImplementedError(
260250
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)