Skip to content

Commit f328c18

Browse files
Add a16w8 per-op test for conv1d
Summary: Add int16 activation / int8 weight (a16w8) quantization tests for `aten.conv1d` on Ethos-U55 and Ethos-U85. ## Changes - Add `test_conv1d_a16w8_u55_INT` using `EthosU55PipelineINT` with `a16w8_quantization=True, symmetric_io_quantization=True, qtol=1, epsilon=2**-16`, reusing existing `test_data_INT` parameters - Add `test_conv1d_a16w8_u85_INT` using `EthosU85PipelineINT` with same kwargs - Register `ops/test_conv1d.py` in `fbcode/` and `xplat/` `targets.bzl` bypass-pytorch-oss-checks Differential Revision: D104532360
1 parent 03dedef commit f328c18

2 files changed

Lines changed: 37 additions & 0 deletions

File tree

backends/arm/test/ops/test_conv1d.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,3 +399,39 @@ def test_convolution_1d_vgf_quant_a8w4(test_data):
399399
get_symmetric_a8w4_quantization_config(is_per_channel=per_channel_quantization)
400400
)
401401
pipeline.run()
402+
403+
404+
@common.parametrize("test_data", test_data_INT)
405+
@common.XfailIfNoCorstone300
406+
def test_conv1d_a16w8_u55_INT(test_data):
407+
model, per_channel_quantization = test_data()
408+
pipeline = EthosU55PipelineINT[input_t](
409+
model,
410+
model.get_inputs(),
411+
aten_op,
412+
exir_op,
413+
a16w8_quantization=True,
414+
symmetric_io_quantization=True,
415+
per_channel_quantization=per_channel_quantization,
416+
qtol=1,
417+
epsilon=2**-16,
418+
)
419+
pipeline.run()
420+
421+
422+
@common.parametrize("test_data", test_data_INT)
423+
@common.XfailIfNoCorstone320
424+
def test_conv1d_a16w8_u85_INT(test_data):
425+
model, per_channel_quantization = test_data()
426+
pipeline = EthosU85PipelineINT[input_t](
427+
model,
428+
model.get_inputs(),
429+
aten_op,
430+
exir_op,
431+
a16w8_quantization=True,
432+
symmetric_io_quantization=True,
433+
per_channel_quantization=per_channel_quantization,
434+
qtol=1,
435+
epsilon=2**-16,
436+
)
437+
pipeline.run()

backends/arm/test/targets.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def define_arm_tests():
4040
"ops/test_reciprocal.py",
4141
"ops/test_mean_dim.py",
4242
"ops/test_var.py",
43+
"ops/test_conv1d.py",
4344
]
4445

4546
# Quantization

0 commit comments

Comments
 (0)