From 46071658b045b5d97e700e706b0f9f40401943ba Mon Sep 17 00:00:00 2001 From: Roman Bredehoft Date: Thu, 4 Apr 2024 18:27:40 +0200 Subject: [PATCH] chore: add test_reduce_sum configuration as flaky --- src/concrete/ml/pytest/torch_models.py | 2 +- tests/torch/test_reduce_sum.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/concrete/ml/pytest/torch_models.py b/src/concrete/ml/pytest/torch_models.py index f741ca073..dcbdfa617 100644 --- a/src/concrete/ml/pytest/torch_models.py +++ b/src/concrete/ml/pytest/torch_models.py @@ -1097,7 +1097,7 @@ def forward(self, x): # This is only tested in weekly CIs because compiling the circuits make the tests too long # to execute (which is why it is not included in the regular coverage) if self.with_pbs: - torch_sum = torch_sum + torch_sum % 2 - torch_sum % 2 # pragma: no cover + torch_sum = torch_sum + torch_sum % 2 - torch_sum % 2 return torch_sum diff --git a/tests/torch/test_reduce_sum.py b/tests/torch/test_reduce_sum.py index 194c13a81..93b3efb5f 100644 --- a/tests/torch/test_reduce_sum.py +++ b/tests/torch/test_reduce_sum.py @@ -9,6 +9,9 @@ from concrete.ml.torch.compile import compile_torch_model +# This test is a known flaky test +# FIXME: https://github.com/zama-ai/concrete-ml-internal/issues/4357 +@pytest.mark.flaky @pytest.mark.parametrize( "data_generator", [ @@ -65,13 +68,9 @@ def test_sum( check_circuit_has_no_tlu, check_circuit_precision, check_r2_score, - is_weekly_option, ): """Tests ReduceSum ONNX operator on a torch model.""" - if with_pbs and not is_weekly_option: - pytest.skip("Tests on model with some PBS take too long for regular CIs") - # Generate the input-set with several samples. This adds a necessary batch size inputset = data_generator(size=(100,) + size)