Skip to content

Commit f7f6926

Browse files
authored
Revert "Arm backend: Add FP8 VGF operator tests" (#24241)
Reverts #24148 cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani
1 parent 068f9f6 commit f7f6926

25 files changed

Lines changed: 61 additions & 523 deletions

‎backends/arm/test/ops/test_adaptive_avg_pool2d.py‎

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
TosaPipelineFP,
1919
TosaPipelineINT,
2020
VgfPipeline,
21-
VgfPipelineFP8,
2221
)
2322

2423
exir_op = "executorch_exir_dialects_edge__ops_aten_avg_pool2d_default"
@@ -113,7 +112,7 @@ def forward(self, *args, **kwargs):
113112
),
114113
}
115114

116-
test_modules_fp8_no_comparing = {
115+
test_modules_fp8 = {
117116
"output_2x2_fp8e4m3": lambda: (
118117
AdaptiveAvgPool2d((2, 2)),
119118
(torch.rand(1, 4, 10, 10).to(torch.float8_e4m3fn),),
@@ -140,7 +139,7 @@ def test_adaptive_avg_pool2d_tosa_FP(test_module):
140139
pipeline.run()
141140

142141

143-
@common.parametrize("test_module", test_modules_fp8_no_comparing)
142+
@common.parametrize("test_module", test_modules_fp8)
144143
def test_adaptive_avg_pool2d_tosa_FP_fp8(test_module):
145144
model, input_tensor, tosa_extension = test_module()
146145

@@ -251,20 +250,6 @@ def test_adaptive_avg_pool2d_u85_INT_a16w8(test_module):
251250
pipeline.run()
252251

253252

254-
@common.parametrize("test_module", test_modules_fp8_no_comparing)
255-
@common.SkipIfNoModelConverter
256-
def test_adaptive_avg_pool2d_vgf_no_quant_fp8(test_module):
257-
model, input_tensor, _ = test_module()
258-
pipeline = VgfPipelineFP8[input_t](
259-
model,
260-
input_tensor,
261-
aten_op=[],
262-
exir_op=exir_op,
263-
expect_missing_reference=True,
264-
)
265-
pipeline.run()
266-
267-
268253
@common.parametrize("test_module", test_modules)
269254
@common.SkipIfNoModelConverter
270255
def test_adaptive_avg_pool2d_vgf_no_quant(test_module):

‎backends/arm/test/ops/test_avg_pool2d.py‎

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
TosaPipelineFP,
2121
TosaPipelineINT,
2222
VgfPipeline,
23-
VgfPipelineFP8,
2423
)
2524

2625
aten_op = "avg_pool2d.default"
@@ -153,7 +152,7 @@ def forward(self, x: torch.Tensor):
153152
(torch.rand(1, 4, 12, 12, dtype=torch.float16),),
154153
),
155154
}
156-
test_modules_fp8_no_comparing = {
155+
test_modules_fp8 = {
157156
"rand_fp8e4m3": lambda: (
158157
AvgPool2d(4, 2, 0, False),
159158
(torch.rand(1, 16, 50, 32).to(torch.float8_e4m3fn),),
@@ -181,7 +180,7 @@ def test_avg_pool2d_tosa_FP(test_module):
181180
pipeline.run()
182181

183182

184-
@common.parametrize("test_module", test_modules_fp8_no_comparing)
183+
@common.parametrize("test_module", test_modules_fp8)
185184
def test_avg_pool2d_tosa_FP_fp8(test_module):
186185
model, input_tensor, tosa_extension = test_module()
187186
pipeline = TosaPipelineFP[input_t](
@@ -289,20 +288,6 @@ def test_avg_pool2d_16a8w_u85_INT(test_module):
289288
pipeline.run()
290289

291290

292-
@common.parametrize("test_module", test_modules_fp8_no_comparing)
293-
@common.SkipIfNoModelConverter
294-
def test_avg_pool2d_vgf_no_quant_fp8(test_module):
295-
model, input_tensor, _ = test_module()
296-
pipeline = VgfPipelineFP8[input_t](
297-
model,
298-
input_tensor,
299-
aten_op,
300-
exir_op,
301-
expect_missing_reference=True,
302-
)
303-
pipeline.run()
304-
305-
306291
@common.parametrize(
307292
"test_module",
308293
test_modules | test_modules_bf16 | test_modules_fp16,

‎backends/arm/test/ops/test_cat.py‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -201,23 +201,6 @@ def test_cat_u85_INT(test_data: Tuple):
201201
pipeline.run()
202202

203203

204-
@common.parametrize("test_data", Cat.test_parameters_fp8)
205-
@common.SkipIfNoModelConverter
206-
def test_cat_vgf_no_quant_fp8(test_data: Tuple):
207-
tensors, dim, _ = test_data()
208-
pipeline = VgfPipeline[input_t1](
209-
Cat(),
210-
(tensors, dim),
211-
aten_op,
212-
exir_op,
213-
tosa_extensions=["fp8e4m3", "fp8e5m2"],
214-
quantize=False,
215-
atol=0,
216-
rtol=0,
217-
)
218-
pipeline.run()
219-
220-
221204
@common.parametrize(
222205
"test_data",
223206
Cat.test_parameters | Cat.test_parameters_bf16 | Cat.test_parameters_fp16,

‎backends/arm/test/ops/test_constant_pad_nd.py‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -404,23 +404,6 @@ def test_constant_pad_nd_u55_INT():
404404
pipeline.run()
405405

406406

407-
@common.parametrize("test_data", test_data_suite_fp8)
408-
@common.SkipIfNoModelConverter
409-
def test_constant_pad_nd_vgf_no_quant_fp8(test_data: Tuple):
410-
test_data, padding, value, mode, _ = test_data()
411-
pipeline = VgfPipeline[input_t1](
412-
ConstantPadND(padding, value, mode),
413-
(test_data,),
414-
aten_op,
415-
exir_op,
416-
tosa_extensions=["fp8e4m3", "fp8e5m2"],
417-
quantize=False,
418-
atol=0,
419-
rtol=0,
420-
)
421-
pipeline.run()
422-
423-
424407
@common.parametrize(
425408
"test_data", test_data_suite | test_data_suite_bf16 | test_data_suite_fp16
426409
)

‎backends/arm/test/ops/test_conv2d.py‎

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
TosaPipelineFP,
2020
TosaPipelineINT,
2121
VgfPipeline,
22-
VgfPipelineFP8,
2322
)
2423

2524
aten_op = "torch.ops.aten.conv2d.default"
@@ -523,7 +522,7 @@ def conv2d_fp16_1x1():
523522
"fp16_3x3": conv2d_fp16_3x3,
524523
"fp16_1x1": conv2d_fp16_1x1,
525524
}
526-
test_data_FP_fp8_no_comparing = {
525+
test_data_FP_fp8 = {
527526
"fp8e4m3": lambda: (
528527
Conv2d(
529528
height=8,
@@ -608,7 +607,7 @@ def test_convolution_2d_tosa_FP(test_data):
608607
pipeline.run()
609608

610609

611-
@common.parametrize("test_data", test_data_FP_fp8_no_comparing)
610+
@common.parametrize("test_data", test_data_FP_fp8)
612611
def test_convolution_2d_tosa_FP_fp8(test_data):
613612
model, tosa_extension = test_data()
614613
pipeline = TosaPipelineFP[input_t](
@@ -719,20 +718,6 @@ def test_convolution_2d_u85_INT_a8w4(test_data):
719718
pipeline.run()
720719

721720

722-
@common.parametrize("test_data", test_data_FP_fp8_no_comparing)
723-
@common.SkipIfNoModelConverter
724-
def test_convolution_2d_vgf_no_quant_fp8(test_data):
725-
model, _ = test_data()
726-
pipeline = VgfPipelineFP8[input_t](
727-
model,
728-
model.get_inputs(),
729-
aten_op,
730-
exir_op,
731-
expect_missing_reference=True,
732-
)
733-
pipeline.run()
734-
735-
736721
@common.parametrize("test_data", test_data_FP | test_data_FP_bf16 | test_data_FP_fp16)
737722
@common.SkipIfNoModelConverter
738723
def test_convolution_2d_vgf_no_quant(test_data):

‎backends/arm/test/ops/test_conv3d.py‎

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
TosaPipelineFP,
2121
TosaPipelineINT,
2222
VgfPipeline,
23-
VgfPipelineFP8,
2423
)
2524

2625
aten_op = "torch.ops.aten.conv3d.default"
@@ -484,7 +483,7 @@ def forward(self, x):
484483
"5x5_3x2x24x24_st1": lambda: conv3d_5x5_3x2x24x24_st1,
485484
"3x3_1x3x28x28_st2_pd1": lambda: conv3d_3x3_1x3x28x28_st2_pd1,
486485
}
487-
test_data_FP_fp8_no_comparing = {
486+
test_data_FP_fp8 = {
488487
"basic_fp8e4m3": lambda: (
489488
Conv3d(
490489
height=6,
@@ -609,7 +608,7 @@ def test_convolution_3d_tosa_FP(test_data):
609608
pipeline.run()
610609

611610

612-
@common.parametrize("test_data", test_data_FP_fp8_no_comparing)
611+
@common.parametrize("test_data", test_data_FP_fp8)
613612
def test_convolution_3d_tosa_FP_fp8(test_data):
614613
model, tosa_extension = test_data()
615614
pipeline = TosaPipelineFP[input_t](
@@ -774,20 +773,6 @@ def test_convolution_3d_u85_INT_a8w4(test_data):
774773
pipeline.run()
775774

776775

777-
@common.parametrize("test_data", test_data_FP_fp8_no_comparing)
778-
@common.SkipIfNoModelConverter
779-
def test_convolution_3d_vgf_no_quant_fp8(test_data):
780-
model, _ = test_data()
781-
pipeline = VgfPipelineFP8[input_t](
782-
model,
783-
model.get_inputs(),
784-
aten_op,
785-
exir_op,
786-
expect_missing_reference=True,
787-
)
788-
pipeline.run()
789-
790-
791776
@common.parametrize("test_data", test_data_FP | test_data_FP_bf16 | test_data_FP_fp16)
792777
@common.SkipIfNoModelConverter
793778
def test_convolution_3d_vgf_no_quant(test_data):

‎backends/arm/test/ops/test_depthwise_conv.py‎

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
TosaPipelineFP,
2121
TosaPipelineINT,
2222
VgfPipeline,
23-
VgfPipelineFP8,
2423
)
2524

2625
input_t = Tuple[torch.Tensor] # Input x
@@ -196,7 +195,7 @@
196195
dtype=torch.float16,
197196
),
198197
}
199-
test_data_conv2d_FP_fp8_no_comparing = {
198+
test_data_conv2d_FP_fp8 = {
200199
"fp8e4m3_3x3_gp3": lambda: (
201200
Conv2d(
202201
in_channels=3,
@@ -290,7 +289,7 @@ def test_convolution_2d_tosa_FP_depthwise(test_data: torch.nn.Module):
290289
pipeline.run()
291290

292291

293-
@common.parametrize("test_data", test_data_conv2d_FP_fp8_no_comparing)
292+
@common.parametrize("test_data", test_data_conv2d_FP_fp8)
294293
def test_convolution_2d_tosa_FP_fp8_depthwise(test_data):
295294
model, tosa_extension = test_data()
296295
pipeline = TosaPipelineFP[input_t](
@@ -341,20 +340,6 @@ def test_convolution_2d_tosa_INT_a8w4_depthwise(test_data):
341340
pipeline.run()
342341

343342

344-
@common.parametrize("test_data", test_data_conv2d_FP_fp8_no_comparing)
345-
@common.SkipIfNoModelConverter
346-
def test_convolution_2d_vgf_no_quant_fp8_depthwise(test_data):
347-
model, _ = test_data()
348-
pipeline = VgfPipelineFP8[input_t](
349-
model,
350-
model.get_inputs(),
351-
aten_op=[],
352-
exir_op=exir_op,
353-
expect_missing_reference=True,
354-
)
355-
pipeline.run()
356-
357-
358343
@common.parametrize(
359344
"test_data",
360345
test_data_conv1d_FP

‎backends/arm/test/ops/test_embedding.py‎

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -141,25 +141,6 @@ def test_embedding_tosa_INT_expand():
141141
pipeline.run()
142142

143143

144-
@common.parametrize("test_input", test_input_fp8)
145-
@common.SkipIfNoModelConverter
146-
def test_embedding_vgf_no_quant_fp8(test_input):
147-
inputs, _ = test_input
148-
op = Embedding()
149-
pipeline = VgfPipeline[input_params](
150-
op,
151-
inputs,
152-
op.aten_op,
153-
op.exir_op,
154-
transform_passes=[InsertInt32CastsAfterInt64PlaceholdersPass()],
155-
tosa_extensions=["fp8e4m3", "fp8e5m2"],
156-
quantize=False,
157-
atol=0,
158-
rtol=0,
159-
)
160-
pipeline.run()
161-
162-
163144
@pytest.mark.skip("reason=MLETORCH-1274 Improve data type checks during partitioning")
164145
@common.parametrize("test_input", test_input)
165146
@common.SkipIfNoModelConverter

‎backends/arm/test/ops/test_flip.py‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -225,23 +225,6 @@ def test_flip_u85_INT(test_data):
225225
pipeline.run()
226226

227227

228-
@common.parametrize("test_data", test_data_suite_fp8)
229-
@common.SkipIfNoModelConverter
230-
def test_flip_vgf_no_quant_fp8(test_data):
231-
data, dims, _ = test_data()
232-
pipeline = VgfPipeline[input_t1](
233-
Flip(dims),
234-
(data,),
235-
aten_op,
236-
exir_op,
237-
tosa_extensions=["fp8e4m3", "fp8e5m2"],
238-
quantize=False,
239-
atol=0,
240-
rtol=0,
241-
)
242-
pipeline.run()
243-
244-
245228
@common.parametrize("test_data", test_data_suite)
246229
@common.SkipIfNoModelConverter
247230
def test_flip_vgf_no_quant(test_data):

‎backends/arm/test/ops/test_gather.py‎

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
TosaPipelineFP,
1717
TosaPipelineINT,
1818
VgfPipeline,
19-
VgfPipelineFP8,
2019
)
2120

2221

@@ -88,7 +87,7 @@ def forward(self, input_: torch.Tensor, dim_, index_: torch.Tensor):
8887
), # Shape: [N=2, W=2, C=2]
8988
),
9089
}
91-
test_data_fp_fp8_no_comparing: dict[str, tuple[input_params, str]] = {
90+
test_data_fp_fp8: dict[str, tuple[input_params, str]] = {
9291
"test_fp8e4m3_2d": (
9392
(
9493
torch.tensor(
@@ -176,7 +175,7 @@ def test_gather_tosa_FP(test_data: input_params):
176175
pipeline.run()
177176

178177

179-
@common.parametrize("test_data", test_data_fp_fp8_no_comparing)
178+
@common.parametrize("test_data", test_data_fp_fp8)
180179
def test_gather_tosa_FP_fp8(test_data: tuple[input_params, str]):
181180
input_data, tosa_extension = test_data
182181
pipeline = TosaPipelineFP[input_params](
@@ -232,23 +231,6 @@ def test_gather_u85_INT(test_data: input_params):
232231
pipeline.run()
233232

234233

235-
@common.parametrize("test_data", test_data_fp_fp8_no_comparing)
236-
@common.SkipIfNoModelConverter
237-
def test_gather_vgf_no_quant_fp8(test_data: tuple[input_params, str]):
238-
input_data, _ = test_data
239-
pipeline = VgfPipelineFP8[input_params](
240-
Gather(),
241-
input_data,
242-
aten_op=Gather.aten_op,
243-
exir_op=Gather.exir_op,
244-
transform_passes=[InsertInt32CastsAfterInt64PlaceholdersPass()],
245-
expect_missing_reference=True,
246-
atol=0,
247-
rtol=0,
248-
)
249-
pipeline.run()
250-
251-
252234
@common.parametrize("test_data", test_data_fp | test_data_fp_bf16 | test_data_int)
253235
@common.SkipIfNoModelConverter
254236
def test_gather_vgf_no_quant(test_data: input_params):

0 commit comments

Comments
 (0)