Skip to content

Commit bb07cad

Browse files
mansnilsfreddan80
authored andcommitted
Move to TOSA v0.80.1
Change-Id: I24986e3014cb0fd58e558cea0c06b2e8031da308
1 parent e94c2ff commit bb07cad

Some content is hidden

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

63 files changed

+143
-143
lines changed

backends/arm/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ The Arm Backend should be considered a prototype quality at this point, likely s
104104
## Current flows
105105

106106
The ArmBackend has a two stage process,
107-
- Compile to TOSA to rationalise the graph into known hardware support profiles. Currently this is to v0.80.0 TOSA BI with specific concern to a subset which gives support on Ethos-U55, the target of the initial prototype efforts.
108-
- Lower via the ethos-u-vela compilation flow which takes TOSA v0.80.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.
107+
- 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, the target of the initial prototype efforts.
108+
- 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.
109109

110110
The ArmPartitioner 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.
111111

backends/arm/arm_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def ethosu_compile_spec(
9090
if extra_flags is not None:
9191
self.compiler_flags.append(extra_flags)
9292

93-
base_tosa_version = "TOSA-0.80.0+BI"
93+
base_tosa_version = "TOSA-0.80+BI"
9494
if "u55" in config:
9595
# Add the Ethos-U55 extension marker
9696
base_tosa_version += "+u55"

backends/arm/operator_support/right_shift_support.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ class RightShiftSupported(SupportedTOSAOperatorCheck):
2323
targets = [exir_ops.edge.aten.__rshift__.Scalar]
2424

2525
tosa_specs = [
26-
TosaSpecification.create_from_string("TOSA-0.80.0+BI"),
27-
TosaSpecification.create_from_string("TOSA-0.80.0+MI"),
26+
TosaSpecification.create_from_string("TOSA-0.80+BI"),
27+
TosaSpecification.create_from_string("TOSA-0.80+MI"),
2828
]
2929

3030
def is_node_supported(self, node: fx.Node, tosa_spec: TosaSpecification):

backends/arm/operator_support/to_copy_support.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ class ToCopySupported(SupportedTOSAOperatorCheck):
2525
targets = [exir_ops.edge.aten._to_copy.default]
2626

2727
tosa_specs = [
28-
TosaSpecification.create_from_string("TOSA-0.80.0+BI"),
29-
TosaSpecification.create_from_string("TOSA-0.80.0+MI"),
28+
TosaSpecification.create_from_string("TOSA-0.80+BI"),
29+
TosaSpecification.create_from_string("TOSA-0.80+MI"),
3030
]
3131

3232
SupportedTypeDict = dict[torch.dtype, list[torch.dtype]]

backends/arm/operator_support/tosa_supported_operators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ def is_node_supported(self, node: fx.Node, tosa_spec: TosaSpecification) -> bool
3535
_tosa_spec_dicts: dict[
3636
TosaSpecification, dict[str, Type[SupportedTOSAOperatorCheck]]
3737
] = {
38-
TosaSpecification.create_from_string("TOSA-0.80.0+BI"): {},
39-
TosaSpecification.create_from_string("TOSA-0.80.0+MI"): {},
38+
TosaSpecification.create_from_string("TOSA-0.80+BI"): {},
39+
TosaSpecification.create_from_string("TOSA-0.80+MI"): {},
4040
}
4141

4242

backends/arm/operators/node_visitor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ class NodeVisitor:
2525
# When all node_visitors has been refactored to target a specific
2626
# version, this list should be removed.
2727
tosa_specs = [
28-
TosaSpecification.create_from_string("TOSA-0.80.0+BI"),
29-
TosaSpecification.create_from_string("TOSA-0.80.0+MI"),
28+
TosaSpecification.create_from_string("TOSA-0.80+BI"),
29+
TosaSpecification.create_from_string("TOSA-0.80+MI"),
3030
]
3131

3232
def __init__(self, exported_program: ExportedProgram, tosa_spec: TosaSpecification):
@@ -46,8 +46,8 @@ def define_node(
4646

4747
# container for all node visitors
4848
_node_visitor_dicts = {
49-
TosaSpecification.create_from_string("TOSA-0.80.0+BI"): {},
50-
TosaSpecification.create_from_string("TOSA-0.80.0+MI"): {},
49+
TosaSpecification.create_from_string("TOSA-0.80+BI"): {},
50+
TosaSpecification.create_from_string("TOSA-0.80+MI"): {},
5151
}
5252

5353

backends/arm/operators/op_add.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class AddVisitor_080_BI(NodeVisitor):
2626
target = "aten.add.Tensor"
2727

2828
tosa_specs = [
29-
TosaSpecification.create_from_string("TOSA-0.80.0+BI"),
29+
TosaSpecification.create_from_string("TOSA-0.80+BI"),
3030
]
3131

3232
def __init__(self, *args):
@@ -84,7 +84,7 @@ class AddVisitor_080_MI(AddVisitor_080_BI):
8484
# inheriting 'target' from BI class
8585

8686
tosa_specs = [
87-
TosaSpecification.create_from_string("TOSA-0.80.0+MI"),
87+
TosaSpecification.create_from_string("TOSA-0.80+MI"),
8888
]
8989

9090
def __init__(self, *args):

backends/arm/test/misc/test_debug_feats.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def _tosa_MI_pipeline(self, module: torch.nn.Module, dump_file=None):
4949
ArmTester(
5050
module,
5151
example_inputs=module.get_inputs(),
52-
compile_spec=common.get_tosa_compile_spec("TOSA-0.80.0+MI"),
52+
compile_spec=common.get_tosa_compile_spec("TOSA-0.80+MI"),
5353
)
5454
.export()
5555
.to_edge()
@@ -63,7 +63,7 @@ def _tosa_BI_pipeline(self, module: torch.nn.Module, dump_file=None):
6363
ArmTester(
6464
module,
6565
example_inputs=module.get_inputs(),
66-
compile_spec=common.get_tosa_compile_spec("TOSA-0.80.0+BI"),
66+
compile_spec=common.get_tosa_compile_spec("TOSA-0.80+BI"),
6767
)
6868
.quantize()
6969
.export()
@@ -111,7 +111,7 @@ def test_numerical_diff_prints(self):
111111
model,
112112
example_inputs=model.get_inputs(),
113113
compile_spec=common.get_tosa_compile_spec(
114-
"TOSA-0.80.0+MI",
114+
"TOSA-0.80+MI",
115115
permute_memory_to_nhwc=True,
116116
custom_path=tempfile.mkdtemp("diff_print_test"),
117117
),
@@ -138,7 +138,7 @@ def test_dump_ops_and_dtypes():
138138
ArmTester(
139139
model,
140140
example_inputs=model.get_inputs(),
141-
compile_spec=common.get_tosa_compile_spec("TOSA-0.80.0+BI"),
141+
compile_spec=common.get_tosa_compile_spec("TOSA-0.80+BI"),
142142
)
143143
.quantize()
144144
.dump_dtype_distribution()
@@ -159,7 +159,7 @@ def test_dump_ops_and_dtypes_parseable():
159159
ArmTester(
160160
model,
161161
example_inputs=model.get_inputs(),
162-
compile_spec=common.get_tosa_compile_spec("TOSA-0.80.0+BI"),
162+
compile_spec=common.get_tosa_compile_spec("TOSA-0.80+BI"),
163163
)
164164
.quantize()
165165
.dump_dtype_distribution(print_table=False)
@@ -187,7 +187,7 @@ def test_collate_tosa_BI_tests(self):
187187
ArmTester(
188188
model,
189189
example_inputs=model.get_inputs(),
190-
compile_spec=common.get_tosa_compile_spec("TOSA-0.80.0+BI"),
190+
compile_spec=common.get_tosa_compile_spec("TOSA-0.80+BI"),
191191
)
192192
.quantize()
193193
.export()
@@ -216,7 +216,7 @@ def test_dump_tosa_ops(caplog):
216216
ArmTester(
217217
model,
218218
example_inputs=model.get_inputs(),
219-
compile_spec=common.get_tosa_compile_spec("TOSA-0.80.0+BI"),
219+
compile_spec=common.get_tosa_compile_spec("TOSA-0.80+BI"),
220220
)
221221
.quantize()
222222
.export()

backends/arm/test/misc/test_dim_order_guards.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_tosa_MI_pipeline(self):
3434
ArmTester(
3535
module,
3636
example_inputs=module.get_inputs(),
37-
compile_spec=common.get_tosa_compile_spec("TOSA-0.80.0+MI"),
37+
compile_spec=common.get_tosa_compile_spec("TOSA-0.80+MI"),
3838
)
3939
.export()
4040
.to_edge()
@@ -48,7 +48,7 @@ def test_tosa_BI_pipeline(self):
4848
ArmTester(
4949
module,
5050
example_inputs=module.get_inputs(),
51-
compile_spec=common.get_tosa_compile_spec("TOSA-0.80.0+BI"),
51+
compile_spec=common.get_tosa_compile_spec("TOSA-0.80+BI"),
5252
)
5353
.quantize()
5454
.export()

backends/arm/test/misc/test_lifted_tensor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def test_partition_lifted_tensor_tosa_MI(self, op, data):
6060
ArmTester(
6161
LiftedTensor(op),
6262
example_inputs=data,
63-
compile_spec=common.get_tosa_compile_spec("TOSA-0.80.0+MI"),
63+
compile_spec=common.get_tosa_compile_spec("TOSA-0.80+MI"),
6464
)
6565
.export()
6666
.to_edge()
@@ -77,7 +77,7 @@ def test_partition_lifted_tensor_tosa_BI(self, op, data):
7777
ArmTester(
7878
LiftedTensor(op),
7979
example_inputs=data,
80-
compile_spec=common.get_tosa_compile_spec("TOSA-0.80.0+BI"),
80+
compile_spec=common.get_tosa_compile_spec("TOSA-0.80+BI"),
8181
)
8282
.quantize()
8383
.export()
@@ -95,7 +95,7 @@ def test_partition_lifted_scalar_tensor_tosa_MI(self, op, data, arg1):
9595
ArmTester(
9696
LiftedScalarTensor(op, arg1),
9797
example_inputs=(data),
98-
compile_spec=common.get_tosa_compile_spec("TOSA-0.80.0+MI"),
98+
compile_spec=common.get_tosa_compile_spec("TOSA-0.80+MI"),
9999
)
100100
.export()
101101
.to_edge()
@@ -110,7 +110,7 @@ def test_partition_lifted_scalar_tensor_tosa_BI(self, op, data, arg1):
110110
ArmTester(
111111
LiftedScalarTensor(op, arg1),
112112
example_inputs=(data),
113-
compile_spec=common.get_tosa_compile_spec("TOSA-0.80.0+BI"),
113+
compile_spec=common.get_tosa_compile_spec("TOSA-0.80+BI"),
114114
)
115115
.quantize()
116116
.export()

backends/arm/test/misc/test_tosa_spec.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
from parameterized import parameterized
1717

1818
test_valid_0_80_strings = [
19-
"TOSA-0.80.0+BI",
20-
"TOSA-0.80.0+MI+8k",
21-
"TOSA-0.80.0+BI+u55",
19+
"TOSA-0.80+BI",
20+
"TOSA-0.80+MI+8k",
21+
"TOSA-0.80+BI+u55",
2222
]
2323
test_valid_1_00_strings = [
2424
"TOSA-1.00.0+INT+FP+fft",
@@ -35,11 +35,11 @@
3535
}
3636

3737
test_invalid_strings = [
38-
"TOSA-0.80.0+bi",
39-
"TOSA-0.80.0",
40-
"TOSA-0.80.0+8k",
41-
"TOSA-0.80.0+BI+MI",
42-
"TOSA-0.80.0+BI+U55",
38+
"TOSA-0.80+bi",
39+
"TOSA-0.80",
40+
"TOSA-0.80+8k",
41+
"TOSA-0.80+BI+MI",
42+
"TOSA-0.80+BI+U55",
4343
"TOSA-1.00.0+fft",
4444
"TOSA-1.00.0+fp+bf16+fft",
4545
"TOSA-1.00.0+INT+INT4+cf",
@@ -50,13 +50,13 @@
5050
]
5151

5252
test_compile_specs = [
53-
([CompileSpec("tosa_version", "TOSA-0.80.0+BI".encode())],),
54-
([CompileSpec("tosa_version", "TOSA-0.80.0+BI+u55".encode())],),
53+
([CompileSpec("tosa_version", "TOSA-0.80+BI".encode())],),
54+
([CompileSpec("tosa_version", "TOSA-0.80+BI+u55".encode())],),
5555
([CompileSpec("tosa_version", "TOSA-1.00.0+INT".encode())],),
5656
]
5757

5858
test_compile_specs_no_version = [
59-
([CompileSpec("other_key", "TOSA-0.80.0+BI".encode())],),
59+
([CompileSpec("other_key", "TOSA-0.80+BI".encode())],),
6060
([CompileSpec("other_key", "some_value".encode())],),
6161
]
6262

backends/arm/test/models/test_mobilenet_v2_arm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def test_mv2_tosa_MI(self):
5555
self.mv2,
5656
example_inputs=self.model_inputs,
5757
compile_spec=common.get_tosa_compile_spec(
58-
"TOSA-0.80.0+MI", permute_memory_to_nhwc=True
58+
"TOSA-0.80+MI", permute_memory_to_nhwc=True
5959
),
6060
)
6161
.export()
@@ -70,7 +70,7 @@ def test_mv2_tosa_BI(self):
7070
self.mv2,
7171
example_inputs=self.model_inputs,
7272
compile_spec=common.get_tosa_compile_spec(
73-
"TOSA-0.80.0+BI", permute_memory_to_nhwc=True
73+
"TOSA-0.80+BI", permute_memory_to_nhwc=True
7474
),
7575
)
7676
.quantize()

backends/arm/test/ops/test_add.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def _test_add_tosa_MI_pipeline(
6161
ArmTester(
6262
module,
6363
example_inputs=test_data,
64-
compile_spec=common.get_tosa_compile_spec("TOSA-0.80.0+MI"),
64+
compile_spec=common.get_tosa_compile_spec("TOSA-0.80+MI"),
6565
)
6666
.export()
6767
.check_count({"torch.ops.aten.add.Tensor": 1})
@@ -80,7 +80,7 @@ def _test_add_tosa_BI_pipeline(
8080
ArmTester(
8181
module,
8282
example_inputs=test_data,
83-
compile_spec=common.get_tosa_compile_spec("TOSA-0.80.0+BI"),
83+
compile_spec=common.get_tosa_compile_spec("TOSA-0.80+BI"),
8484
)
8585
.quantize()
8686
.export()

backends/arm/test/ops/test_avg_pool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def _test_avgpool2d_tosa_MI_pipeline(
5656
module,
5757
example_inputs=test_data,
5858
compile_spec=common.get_tosa_compile_spec(
59-
"TOSA-0.80.0+MI", permute_memory_to_nhwc=True
59+
"TOSA-0.80+MI", permute_memory_to_nhwc=True
6060
),
6161
)
6262
.export()
@@ -79,7 +79,7 @@ def _test_avgpool2d_tosa_BI_pipeline(
7979
module,
8080
example_inputs=test_data,
8181
compile_spec=common.get_tosa_compile_spec(
82-
"TOSA-0.80.0+BI", permute_memory_to_nhwc=True
82+
"TOSA-0.80+BI", permute_memory_to_nhwc=True
8383
),
8484
)
8585
.quantize(Quantize(quantizer, get_symmetric_quantization_config()))

backends/arm/test/ops/test_batch_norm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ def _test_batchnorm2d_tosa_MI_pipeline(
533533
ArmTester(
534534
module,
535535
example_inputs=test_data,
536-
compile_spec=common.get_tosa_compile_spec("TOSA-0.80.0+MI"),
536+
compile_spec=common.get_tosa_compile_spec("TOSA-0.80+MI"),
537537
)
538538
.export()
539539
.check_not(["torch.ops.quantized_decomposed"])
@@ -561,7 +561,7 @@ def _test_batchnorm2d_no_stats_tosa_MI_pipeline(
561561
ArmTester(
562562
module,
563563
example_example_inputs=test_data,
564-
compile_spec=common.get_tosa_compile_spec("TOSA-0.80.0+MI"),
564+
compile_spec=common.get_tosa_compile_spec("TOSA-0.80+MI"),
565565
)
566566
.export()
567567
.check_count({"torch.ops.aten._native_batch_norm_legit.no_stats": 1})
@@ -590,7 +590,7 @@ def _test_batchnorm2d_tosa_BI_pipeline(
590590
ArmTester(
591591
module,
592592
example_inputs=test_data,
593-
compile_spec=common.get_tosa_compile_spec("TOSA-0.80.0+BI"),
593+
compile_spec=common.get_tosa_compile_spec("TOSA-0.80+BI"),
594594
)
595595
.quantize()
596596
.export()

backends/arm/test/ops/test_bmm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def _test_bmm_tosa_MI_pipeline(
5656
ArmTester(
5757
module,
5858
example_inputs=test_data,
59-
compile_spec=common.get_tosa_compile_spec("TOSA-0.80.0+MI"),
59+
compile_spec=common.get_tosa_compile_spec("TOSA-0.80+MI"),
6060
)
6161
.export()
6262
.check_not(["torch.ops.quantized_decomposed"])
@@ -76,7 +76,7 @@ def _test_bmm_tosa_BI_pipeline(
7676
ArmTester(
7777
module,
7878
example_inputs=test_data,
79-
compile_spec=common.get_tosa_compile_spec("TOSA-0.80.0+BI"),
79+
compile_spec=common.get_tosa_compile_spec("TOSA-0.80+BI"),
8080
)
8181
.quantize()
8282
.export()

backends/arm/test/ops/test_cat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def _test_cat_tosa_MI_pipeline(
5555
ArmTester(
5656
module,
5757
example_inputs=test_data,
58-
compile_spec=common.get_tosa_compile_spec("TOSA-0.80.0+MI"),
58+
compile_spec=common.get_tosa_compile_spec("TOSA-0.80+MI"),
5959
)
6060
.export()
6161
.check_count({"torch.ops.aten.cat.default": 1})
@@ -75,7 +75,7 @@ def _test_cat_tosa_BI_pipeline(
7575
ArmTester(
7676
module,
7777
example_inputs=test_data,
78-
compile_spec=common.get_tosa_compile_spec("TOSA-0.80.0+BI"),
78+
compile_spec=common.get_tosa_compile_spec("TOSA-0.80+BI"),
7979
)
8080
.quantize()
8181
.export()

backends/arm/test/ops/test_clone.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def _test_clone_tosa_MI_pipeline(
4747
ArmTester(
4848
module,
4949
example_inputs=test_data,
50-
compile_spec=common.get_tosa_compile_spec("TOSA-0.80.0+MI"),
50+
compile_spec=common.get_tosa_compile_spec("TOSA-0.80+MI"),
5151
)
5252
.export()
5353
.check_count({"torch.ops.aten.clone.default": 1})
@@ -66,7 +66,7 @@ def _test_clone_tosa_BI_pipeline(
6666
ArmTester(
6767
module,
6868
example_inputs=test_data,
69-
compile_spec=common.get_tosa_compile_spec("TOSA-0.80.0+BI"),
69+
compile_spec=common.get_tosa_compile_spec("TOSA-0.80+BI"),
7070
)
7171
.quantize(Quantize(quantizer, get_symmetric_quantization_config()))
7272
.export()

0 commit comments

Comments
 (0)