From 3cbce722afa3a29d1171255df13436920d662d1d Mon Sep 17 00:00:00 2001 From: Baris Demir Date: Fri, 15 May 2026 11:25:13 +0100 Subject: [PATCH] Arm backend: Stabilize VGF bilinear fp16 test This patch fixes a flaky VGF no-quant Interpolate test for upsample_bilinear2d fp16 inputs. The neighboring VGF Upsample test already uses looser fp16 comparison tolerances, while the Interpolate variant still used the default 1e-3 atol/rtol. The observed fp16 output difference can be slightly above that default threshold. Match the Upsample behavior by using 1e-2 atol/rtol for fp16 inputs and keeping 1e-3 atol/rtol for other dtypes. The change was verified with collection of the targeted VGF Interpolate pytest cases. Signed-off-by: Baris Demir Change-Id: I83e62f2241d418100d3fa9df5883b2935bd751a1 --- backends/arm/test/ops/test_upsample_bilinear2d.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/backends/arm/test/ops/test_upsample_bilinear2d.py b/backends/arm/test/ops/test_upsample_bilinear2d.py index f084e0ebe14..705f9ba4d20 100644 --- a/backends/arm/test/ops/test_upsample_bilinear2d.py +++ b/backends/arm/test/ops/test_upsample_bilinear2d.py @@ -551,12 +551,21 @@ def test_upsample_bilinear2d_vec_vgf_no_quant_Upsample(test_data: torch.Tensor): @common.SkipIfNoModelConverter def test_upsample_bilinear2d_vec_vgf_no_quant_Interpolate(test_data: torch.Tensor): data, size, scale_factor, compare = test_data() + match data.dtype: + case torch.float16: + atol = 1e-2 + rtol = 1e-2 + case _: + atol = 1e-3 + rtol = 1e-3 pipeline = VgfPipeline[input_t1]( Interpolate(size, scale_factor), (data,), aten_op, exir_op, quantize=False, + atol=atol, + rtol=rtol, ) if not compare: pipeline.pop_stage(-1)