Skip to content

Commit 894258c

Browse files
committed
Arm backend: Refactor OpNotSupportedPipeline to allow for Tosa 1.0
Change-Id: Ieb0e0104a9ebc15f319453f983edfaf0016d4050
1 parent f7ed853 commit 894258c

18 files changed

+105
-38
lines changed

backends/arm/test/ops/test_amax.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ def test_amax_u55_BI_not_delegated():
8787
pipeline = OpNotSupportedPipeline[Amax.input_t](
8888
Amax(dim, keep_dims),
8989
data,
90-
"TOSA-0.80+BI+u55",
9190
{" executorch_exir_dialects_edge__ops_aten_amax_default": 1},
91+
quantize=True,
92+
u55_subset=True,
9293
)
9394
pipeline.run()
9495

@@ -128,14 +129,12 @@ def test_max_dim_tosa_BI_to_amax(test_data: Max.input_t):
128129
def test_max_dim_tosa_BI_not_delegated():
129130
data, dim = Max.test_data()["rank_4_dim_3"]()
130131
pipeline = OpNotSupportedPipeline[Max.input_t](
131-
MaxWithIndex(dim), data, "TOSA-0.80+BI", {}
132+
MaxWithIndex(dim), data, {}, quantize=True
132133
)
133134
pipeline.run()
134135

135136

136137
def test_max_dim_tosa_MI_not_delegated():
137138
data, dim = Max.test_data["rank_4_dim_3"]()
138-
pipeline = OpNotSupportedPipeline[Max.input_t](
139-
MaxWithIndex(dim), data, "TOSA-0.80+MI", {}
140-
)
139+
pipeline = OpNotSupportedPipeline[Max.input_t](MaxWithIndex(dim), data, {})
141140
pipeline.run()

backends/arm/test/ops/test_amin.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,9 @@ def test_amin_u55_BI_not_delegated():
9696
pipeline = OpNotSupportedPipeline[Amin.input_t](
9797
Amin(dim, keep_dims),
9898
data,
99-
"TOSA-0.80+BI+u55",
10099
{" executorch_exir_dialects_edge__ops_aten_amin_default": 1},
100+
quantize=True,
101+
u55_subset=True,
101102
)
102103
pipeline.run()
103104

@@ -137,14 +138,15 @@ def test_min_dim_tosa_BI_to_amin(test_data: Min.input_t):
137138
def test_min_dim_tosa_BI_not_delegated():
138139
data, dim = Min.test_data["rank_4_dim_3"]()
139140
pipeline = OpNotSupportedPipeline[Min.input_t](
140-
MinWithIndex(dim), data, "TOSA-0.80+BI+u55", {}
141+
MinWithIndex(dim),
142+
data,
143+
{},
144+
quantize=True,
141145
)
142146
pipeline.run()
143147

144148

145149
def test_min_dim_tosa_MI_not_delegated():
146150
data, dim = Min.test_data["rank_4_dim_3"]()
147-
pipeline = OpNotSupportedPipeline[Min.input_t](
148-
MinWithIndex(dim), data, "TOSA-0.80+MI", {}
149-
)
151+
pipeline = OpNotSupportedPipeline[Min.input_t](MinWithIndex(dim), data, {})
150152
pipeline.run()

backends/arm/test/ops/test_any.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,11 @@ def test_any_u55_BI(test_data: input_t1):
143143
# Tests that we don't delegate these ops since they are not supported on U55.
144144
op, test_input = test_data()
145145
pipeline = OpNotSupportedPipeline[input_t1](
146-
op, test_input(), "TOSA-0.80+BI+u55", {op.exir_op: 1}
146+
op,
147+
test_input(),
148+
{op.exir_op: 1},
149+
quantize=True,
150+
u55_subset=True,
147151
)
148152
pipeline.run()
149153

backends/arm/test/ops/test_avg_pool2d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ def test_avg_pool2d_tosa_BI_not_delegated(reject_module):
159159
pipeline = OpNotSupportedPipeline[input_t](
160160
module=model,
161161
test_data=(test_data,),
162-
tosa_version="TOSA-0.80+BI",
163162
non_delegated_ops={},
164163
n_expected_delegates=0,
164+
quantize=True,
165165
)
166166
pipeline.run()

backends/arm/test/ops/test_bitwise.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ def test_bitwise_and_tensor_tosa_BI(test_data: input_t2):
8787
def test_bitwise_and_tensor_u55_BI(test_data: input_t2):
8888
# Tests that we don't delegate these ops since they are not supported on U55.
8989
pipeline = OpNotSupportedPipeline[input_t2](
90-
And(), test_data(), "TOSA-0.80+BI+u55", {And().exir_op: 1}
90+
And(),
91+
test_data(),
92+
{And().exir_op: 1},
93+
quantize=True,
94+
u55_subset=True,
9195
)
9296
pipeline.run()
9397

@@ -126,7 +130,11 @@ def test_bitwise_xor_tensor_tosa_BI(test_data: input_t2):
126130
def test_bitwise_xor_tensor_u55_BI(test_data: input_t2):
127131
# Tests that we don't delegate these ops since they are not supported on U55.
128132
pipeline = OpNotSupportedPipeline[input_t2](
129-
Xor(), test_data(), "TOSA-0.80+BI+u55", {Xor().exir_op: 1}
133+
Xor(),
134+
test_data(),
135+
{Xor().exir_op: 1},
136+
quantize=True,
137+
u55_subset=True,
130138
)
131139
pipeline.run()
132140

@@ -161,7 +169,11 @@ def test_bitwise_or_tensor_tosa_BI(test_data: input_t2):
161169
def test_bitwise_or_tensor_u55_BI(test_data: input_t2):
162170
# Tests that we don't delegate these ops since they are not supported on U55.
163171
pipeline = OpNotSupportedPipeline[input_t2](
164-
Or(), test_data(), "TOSA-0.80+BI+u55", {Or().exir_op: 1}
172+
Or(),
173+
test_data(),
174+
{Or().exir_op: 1},
175+
quantize=True,
176+
u55_subset=True,
165177
)
166178
pipeline.run()
167179

backends/arm/test/ops/test_conv2d.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ def test_convolution_2d_u55_BI_not_delegated(module: Conv2d):
445445
OpNotSupportedPipeline(
446446
module(),
447447
module().get_inputs(),
448-
"TOSA-0.80+BI+u55",
449448
{"executorch_exir_dialects_edge__ops_aten_convolution_default": 1},
449+
quantize=True,
450+
u55_subset=True,
450451
).run()

backends/arm/test/ops/test_conv3d.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ def test_convolution_u55_BI_not_delegated_3d(module: Conv3d):
400400
OpNotSupportedPipeline(
401401
module(),
402402
module().get_inputs(),
403-
"TOSA-0.80+BI+u55",
404403
{"executorch_exir_dialects_edge__ops_aten_convolution_default": 1},
404+
quantize=True,
405+
u55_subset=True,
405406
).run()

backends/arm/test/ops/test_eq.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,9 @@ def test_eq_scalar_u55_BI_tensor(test_module):
127127
pipeline = OpNotSupportedPipeline[input_t](
128128
test_module(),
129129
test_module().get_inputs(),
130-
"TOSA-0.80+BI+u55",
131130
{Equal.exir_op: 1},
131+
quantize=True,
132+
u55_subset=True,
132133
)
133134
pipeline.run()
134135

@@ -140,9 +141,10 @@ def test_eq_scalar_u55_BI(test_module):
140141
pipeline = OpNotSupportedPipeline[input_t](
141142
test_module(),
142143
test_module().get_inputs(),
143-
"TOSA-0.80+BI+u55",
144144
{Equal.exir_op: 1},
145145
n_expected_delegates=1,
146+
quantize=True,
147+
u55_subset=True,
146148
)
147149
pipeline.run()
148150

backends/arm/test/ops/test_ge.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,9 @@ def test_ge_tensor_u55_BI(test_module):
127127
pipeline = OpNotSupportedPipeline[input_t](
128128
test_module(),
129129
test_module().get_inputs(),
130-
"TOSA-0.80+BI+u55",
131130
{GreaterEqual.exir_op: 1},
131+
quantize=True,
132+
u55_subset=True,
132133
)
133134
pipeline.run()
134135

@@ -140,9 +141,10 @@ def test_ge_scalar_u55_BI(test_module):
140141
pipeline = OpNotSupportedPipeline[input_t](
141142
test_module(),
142143
test_module().get_inputs(),
143-
"TOSA-0.80+BI+u55",
144144
{GreaterEqual.exir_op: 1},
145145
n_expected_delegates=1,
146+
quantize=True,
147+
u55_subset=True,
146148
)
147149
pipeline.run()
148150

backends/arm/test/ops/test_gt.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,9 @@ def test_gt_tensor_u55_BI(test_module):
128128
pipeline = OpNotSupportedPipeline[input_t](
129129
test_module(),
130130
test_module().get_inputs(),
131-
"TOSA-0.80+BI+u55",
132131
{Greater.exir_op: 1},
132+
quantize=True,
133+
u55_subset=True,
133134
)
134135
pipeline.run()
135136

@@ -141,9 +142,10 @@ def test_gt_scalar_u55_BI(test_module):
141142
pipeline = OpNotSupportedPipeline[input_t](
142143
test_module(),
143144
test_module().get_inputs(),
144-
"TOSA-0.80+BI+u55",
145145
{Greater.exir_op: 1},
146146
n_expected_delegates=1,
147+
quantize=True,
148+
u55_subset=True,
147149
)
148150
pipeline.run()
149151

0 commit comments

Comments
 (0)