Skip to content
Open
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
12 changes: 7 additions & 5 deletions backends/arm/test/passes/test_rewrite_conv_pass.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Copyright 2025-2026 Arm Limited and/or its affiliates.
#
# This source code is licensed under the BSD-style license found in the
Expand Down Expand Up @@ -534,22 +534,24 @@


@pytest.mark.skipif(not _VGF_ENABLED, reason="VGF not enabled")
def test_fold_and_annotate_q_params_vgf_quant_preserves_output_qparams_on_non_fuseable_clamp() -> (
def test_fold_and_annotate_q_params_vgf_quant_tracks_fused_relu_qparams() -> (
None
):
exported_program = _export_quantized(TinyConvReluCat())
gm = _run_pre_rewrite_passes(to_edge(exported_program).exported_program())

conv = _get_call_function_node(gm, exir_ops.edge.aten.convolution.default)
clamp = _get_call_function_node(gm, exir_ops.edge.aten.clamp.default)
output_qparams = conv.meta["output_qparams"][0]

assert conv.meta["input_qparams"]
assert not conv.meta["output_qparams"]
assert clamp.meta["output_qparams"]
assert output_qparams.qmin == output_qparams.zp
assert not any(
node.target == exir_ops.edge.aten.clamp.default for node in gm.graph.nodes
)


@pytest.mark.skipif(not _VGF_ENABLED, reason="VGF not enabled")
def test_rewrite_conv_vgf_quant_handles_non_fuseable_conv_clamp_cat_branch() -> None:
def test_rewrite_conv_vgf_quant_handles_fused_conv_relu_cat_branch() -> None:
exported_program = _export_quantized(TinyConvReluCat())
compile_spec = _compile_spec()

Expand Down
Loading