Skip to content

Commit 3cbce72

Browse files
committed
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 <baris.demir@arm.com> Change-Id: I83e62f2241d418100d3fa9df5883b2935bd751a1
1 parent 803e47d commit 3cbce72

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

backends/arm/test/ops/test_upsample_bilinear2d.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,12 +551,21 @@ def test_upsample_bilinear2d_vec_vgf_no_quant_Upsample(test_data: torch.Tensor):
551551
@common.SkipIfNoModelConverter
552552
def test_upsample_bilinear2d_vec_vgf_no_quant_Interpolate(test_data: torch.Tensor):
553553
data, size, scale_factor, compare = test_data()
554+
match data.dtype:
555+
case torch.float16:
556+
atol = 1e-2
557+
rtol = 1e-2
558+
case _:
559+
atol = 1e-3
560+
rtol = 1e-3
554561
pipeline = VgfPipeline[input_t1](
555562
Interpolate(size, scale_factor),
556563
(data,),
557564
aten_op,
558565
exir_op,
559566
quantize=False,
567+
atol=atol,
568+
rtol=rtol,
560569
)
561570
if not compare:
562571
pipeline.pop_stage(-1)

0 commit comments

Comments
 (0)