Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions backends/arm/test/ops/test_linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,3 +308,69 @@ def test_linear_16a8w_tosa_INT(test_data: torch.Tensor):
)
# Run the pipeline
pipeline.run()


@common.parametrize("test_data", test_data_rank1_INT)
@common.XfailIfNoCorstone300
@pytest.mark.xfail(
reason="Vela compilation fails with 'Invalid arguments' for int16 linear operations. See: https://github.com/pytorch/executorch/issues/13947"
)
def test_linear_16a8w_u55_INT16(test_data: torch.Tensor):
"""Test linear operation with 16A8W quantization on U55 (16-bit activations, 8-bit weights)"""
test_data, out_features, has_bias, per_channel_quantization = test_data()
in_features = test_data.shape[-1]

pipeline = EthosU55PipelineINT[input_t1](
Linear(
in_features=in_features,
out_features=out_features,
bias=has_bias,
),
(test_data,),
aten_op,
exir_ops=[],
per_channel_quantization=per_channel_quantization,
use_to_edge_transform_and_lower=True,
run_on_fvp=True,
)

pipeline.change_args(
"quantize",
get_symmetric_a16w8_linear_quantizer(
per_channel_quantization=per_channel_quantization
),
)
pipeline.run()


@common.parametrize("test_data", test_data_rank1_INT | test_data_rank4_INT)
@common.XfailIfNoCorstone320
@pytest.mark.xfail(
reason="Vela compilation fails with 'Invalid arguments' for int16 linear operations. See: https://github.com/pytorch/executorch/issues/13947"
)
def test_linear_16a8w_u85_INT16(test_data: torch.Tensor):
"""Test linear operation with 16A8W quantization on U85 (16-bit activations, 8-bit weights)"""
test_data, out_features, has_bias, per_channel_quantization = test_data()
in_features = test_data.shape[-1]

pipeline = EthosU85PipelineINT[input_t1](
Linear(
in_features=in_features,
out_features=out_features,
bias=has_bias,
),
(test_data,),
aten_op,
exir_ops=[],
per_channel_quantization=per_channel_quantization,
use_to_edge_transform_and_lower=True,
run_on_fvp=True,
)

pipeline.change_args(
"quantize",
get_symmetric_a16w8_linear_quantizer(
per_channel_quantization=per_channel_quantization
),
)
pipeline.run()
Loading