Skip to content

Commit 8f1abad

Browse files
Arm backend: Relax Qwen3-VL 2B text BF16 tolerance (#20760)
Raise the TOSA BF16 tolerance for the Qwen3-VL 2B instruct text model. Signed-off-by: Sebastian Larsson <sebastian.larsson@arm.com>
1 parent 2a51f45 commit 8f1abad

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

backends/arm/test/models/Qwen3_VL/test_qwen3_vl_model.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -252,16 +252,17 @@ def _test_qwen3_vl_full_models_tosa_FP(
252252
def _test_qwen3_vl_full_models_tosa_FP_bf16(
253253
test_case: Qwen3VLModelTestCase,
254254
config_factory=_make_qwen3_vl_e2e_test_config,
255+
text_model_atol: float | None = None,
255256
):
256257
model, inputs = test_case.model_cls.prepare_model_and_inputs(config_factory)
257258
model, inputs = _to_bfloat16_model_and_floating_inputs(model, inputs)
258259
# Slightly higher atol for TOSA BF16 on aarch64 (MLETORCH-2048: numeric mismatch)
259-
atol = (
260-
0.4
261-
if common.is_aarch64_host()
262-
and test_case.model_cls is LowerableVisionModelWrapper
263-
else 0.1
264-
)
260+
if common.is_aarch64_host() and test_case.model_cls is LowerableVisionModelWrapper:
261+
atol = 0.4
262+
elif text_model_atol is not None and test_case.model_cls is TextModelWrapper:
263+
atol = text_model_atol
264+
else:
265+
atol = 0.1
265266
with torch.no_grad():
266267
pipeline = TosaPipelineFP[input_t](
267268
model,
@@ -382,7 +383,9 @@ def test_qwen3_vl_2b_instruct_full_models_tosa_FP_bf16(
382383
test_case: Qwen3VLModelTestCase,
383384
):
384385
_test_qwen3_vl_full_models_tosa_FP_bf16(
385-
test_case, _make_qwen3_vl_2b_instruct_layer_config
386+
test_case,
387+
_make_qwen3_vl_2b_instruct_layer_config,
388+
text_model_atol=0.15,
386389
)
387390

388391

0 commit comments

Comments
 (0)