From 039359526f4a2f424be3fa81de25d37649067cc4 Mon Sep 17 00:00:00 2001 From: Oscar Andersson Date: Fri, 16 May 2025 09:50:30 +0200 Subject: [PATCH 1/2] Arm backend: Remove duplicted Matmul-tests torch.matmul was tested in both test_bmm and test_matmul. Signed-off-by: Oscar Andersson Change-Id: Ia84384071e6d27a7c8b171cfc79aba0b4b1e2422 --- backends/arm/test/ops/test_bmm.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/backends/arm/test/ops/test_bmm.py b/backends/arm/test/ops/test_bmm.py index bd2c9338275..5ed0b5076ce 100644 --- a/backends/arm/test/ops/test_bmm.py +++ b/backends/arm/test/ops/test_bmm.py @@ -44,16 +44,6 @@ def forward(self, x, y): return torch.bmm(x, y) -class MatMul(torch.nn.Module): - test_data_generators = { - "rand_3d": lambda: (torch.rand(2, 3, 5), torch.rand(2, 5, 2)), - "rand_4d": lambda: (torch.rand(1, 2, 3, 5), torch.rand(1, 2, 5, 2)), - } - - def forward(self, x, y): - return torch.matmul(x, y) - - class BMMSingleInput(torch.nn.Module): test_data_generators = { "rand_3d_1": lambda: (torch.rand(20, 3, 3),), @@ -81,18 +71,6 @@ def test_bmm_tosa_MI_single_input(test_data: input_t1): pipeline.run() -@common.parametrize("test_data", MatMul.test_data_generators) -def test_mm_tosa_MI(test_data: input_t1): - pipeline = TosaPipelineMI[input_t1](MatMul(), test_data(), aten_op_mm, exir_op_mm) - pipeline.run() - - -@common.parametrize("test_data", MatMul.test_data_generators) -def test_mm_tosa_BI(test_data: input_t1): - pipeline = TosaPipelineBI[input_t1](MatMul(), test_data(), aten_op_mm, exir_op_mm) - pipeline.run() - - @pytest.mark.flaky(reruns=5) # TODO: Investigate flakyness (MLETORCH-534) @common.parametrize("test_data", BMM.test_data_generators) def test_bmm_tosa_BI(test_data: input_t1): From 8eb6f7b432d92cb501bdcc513e74b1bed021f2d9 Mon Sep 17 00:00:00 2001 From: Oscar Andersson Date: Fri, 16 May 2025 10:05:26 +0200 Subject: [PATCH 2/2] Arm backend: Unmark test_bmm:tosa_bi as flaky Replace pytest.mark_flaky with qtol=1 for TOSA BI tests in test_bmm.py Signed-off-by: Oscar Andersson Change-Id: Idb71178cb458557a74d1518b8c8c3283ff7ff9ad --- backends/arm/test/ops/test_bmm.py | 6 +++--- backends/arm/test/ops/test_mm.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backends/arm/test/ops/test_bmm.py b/backends/arm/test/ops/test_bmm.py index 5ed0b5076ce..6b66abbda01 100644 --- a/backends/arm/test/ops/test_bmm.py +++ b/backends/arm/test/ops/test_bmm.py @@ -71,14 +71,14 @@ def test_bmm_tosa_MI_single_input(test_data: input_t1): pipeline.run() -@pytest.mark.flaky(reruns=5) # TODO: Investigate flakyness (MLETORCH-534) @common.parametrize("test_data", BMM.test_data_generators) def test_bmm_tosa_BI(test_data: input_t1): - pipeline = TosaPipelineBI[input_t1](BMM(), test_data(), aten_op_bmm, exir_op_bmm) + pipeline = TosaPipelineBI[input_t1]( + BMM(), test_data(), aten_op_bmm, exir_op_bmm, qtol=1 + ) pipeline.run() -@pytest.mark.flaky(reruns=5) # TODO: Investigate flakyness (MLETORCH-534) @common.parametrize("test_data", BMMSingleInput.test_data_generators) def test_bmm_tosa_BI_single_input(test_data: input_t1): pipeline = TosaPipelineBI[input_t1]( diff --git a/backends/arm/test/ops/test_mm.py b/backends/arm/test/ops/test_mm.py index a5a3b4b98b9..9c3ce443bfd 100644 --- a/backends/arm/test/ops/test_mm.py +++ b/backends/arm/test/ops/test_mm.py @@ -41,7 +41,7 @@ def test_mm_tosa_MI(test_data: Tuple): @common.parametrize("test_data", MM.test_data_generators) def test_mm_tosa_BI(test_data: Tuple): - TosaPipelineBI[test_t](MM(), test_data(), MM.aten_op, MM.exir_op).run() + TosaPipelineBI[test_t](MM(), test_data(), MM.aten_op, MM.exir_op, qtol=1).run() @common.parametrize("test_data", MM.test_data_generators)