Skip to content

Commit 0535ac1

Browse files
tests: skip excessively flaky MPS-specific tests in CI
1 parent 5fc38a8 commit 0535ac1

File tree

1 file changed

+4
-1
lines changed
  • tests/backend/model_manager/load/model_cache/cached_model

1 file changed

+4
-1
lines changed

tests/backend/model_manager/load/model_cache/cached_model/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import os
2+
13
import pytest
24
import torch
35

@@ -19,12 +21,13 @@ def forward(self, x: torch.Tensor) -> torch.Tensor:
1921
x = x + self.buffer2
2022
return x
2123

24+
is_github_ci = os.getenv('GITHUB_ACTIONS') == 'true'
2225

2326
parameterize_mps_and_cuda = pytest.mark.parametrize(
2427
("device"),
2528
[
2629
pytest.param(
27-
"mps", marks=pytest.mark.skipif(not torch.backends.mps.is_available(), reason="MPS is not available.")
30+
"mps", marks=pytest.mark.skipif(is_github_ci or not torch.backends.mps.is_available(), reason="MPS is very flaky in CI" if is_github_ci else "MPS is not available.")
2831
),
2932
pytest.param("cuda", marks=pytest.mark.skipif(not torch.cuda.is_available(), reason="CUDA is not available.")),
3033
],

0 commit comments

Comments
 (0)