Skip to content

Arm backend: Extend and fix bugs in VgfPipeline #12484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 0 additions & 1 deletion backends/arm/test/ops/test_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,5 @@ def test_add_tensor_vgf_int(test_data: input_t1):
aten_op,
exir_op,
tosa_version="TOSA-1.0+INT",
symmetric_io_quantization=True,
)
pipeline.run()
3 changes: 3 additions & 0 deletions backends/arm/test/tester/arm_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
EthosUQuantizer,
get_symmetric_quantization_config,
TOSAQuantizer,
VgfQuantizer,
)
from executorch.backends.arm.test.runner_utils import (
dbg_tosa_fb_to_json,
Expand Down Expand Up @@ -332,6 +333,8 @@ def quantize(
quantizer = TOSAQuantizer(tosa_spec)
elif is_ethosu(self.compile_spec):
quantizer = EthosUQuantizer(self.compile_spec)
elif is_vgf(self.compile_spec):
quantizer = VgfQuantizer(self.compile_spec)
quantize_stage = tester.Quantize(
quantizer,
get_symmetric_quantization_config(),
Expand Down
12 changes: 5 additions & 7 deletions backends/arm/test/tester/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,18 +861,15 @@ def __init__(
rtol: float = 1e-03,
qtol: int = 1,
dynamic_shapes: Optional[Tuple[Any]] = None,
transform_passes: Optional[
Union[Sequence[PassType], Dict[str, Sequence[PassType]]]
] = None,
):

if (
symmetric_io_quantization or per_channel_quantization
) and tosa_version == "TOSA-1.0+FP":
raise ValueError("Dont configure quantization with FP TOSA profile.")
if (
symmetric_io_quantization is False
and per_channel_quantization is False
and tosa_version == "TOSA-1.0+INT"
):
raise ValueError("Missing quantization options for INT TOSA profile.")

tosa_profile = TosaSpecification.create_from_string(tosa_version)
compile_spec = common.get_vgf_compile_spec(
Expand All @@ -887,6 +884,7 @@ def __init__(
exir_op,
use_to_edge_transform_and_lower,
dynamic_shapes,
transform_passes=transform_passes,
)

if symmetric_io_quantization or per_channel_quantization:
Expand All @@ -900,7 +898,7 @@ def __init__(
else:
quant_stage = None

if quant_stage:
if "INT" in tosa_version:
self.add_stage(self.tester.quantize, quant_stage, pos=0)

self.add_stage_after(
Expand Down
Loading