Skip to content

Commit db895e9

Browse files
martinlsmMartin Lindström
andauthored
Arm backend: Test partial quantization of models on VGF (#16311)
Run tests of partial quantization on the MobileNetV2 and Llama models using the VGF backend (INT+FP profile). Signed-off-by: Martin Lindström <Martin.Lindstroem@arm.com> Co-authored-by: Martin Lindström <Martin.Lindstroem@arm.com>
1 parent b4734c8 commit db895e9

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

backends/arm/test/models/test_llama.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,22 @@ def test_llama_partial_quant_tosa_INT_FP():
206206
)
207207
_use_partial_quantizer(pipeline)
208208
pipeline.run()
209+
210+
211+
@common.SkipIfNoModelConverter
212+
def test_llama_partial_quant_vgf_quant():
213+
llama_model, llama_inputs, llama_meta = TestLlama().prepare_model()
214+
215+
if llama_model is None or llama_inputs is None:
216+
pytest.skip("Missing model and/or input files")
217+
218+
with torch.no_grad():
219+
pipeline = VgfPipeline[input_t](
220+
llama_model,
221+
llama_inputs,
222+
aten_op=[],
223+
exir_op=[],
224+
quantize=True,
225+
)
226+
_use_partial_quantizer(pipeline)
227+
pipeline.run()

backends/arm/test/models/test_mobilenet_v2_arm.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,17 @@ def test_mv2_partial_quant_tosa_INT_FP():
163163
)
164164
_use_partial_quantizer(pipeline)
165165
pipeline.run()
166+
167+
168+
@common.SkipIfNoModelConverter
169+
def test_mv2_partial_quant_vgf_quant():
170+
pipeline = VgfPipeline[input_t](
171+
mv2,
172+
model_inputs,
173+
aten_op=[],
174+
exir_op=[],
175+
quantize=True,
176+
atol=0.10,
177+
)
178+
_use_partial_quantizer(pipeline)
179+
pipeline.run()

0 commit comments

Comments
 (0)