Skip to content

Commit 1188e8b

Browse files
committed
Fix: properly version check added tests
1 parent bcc3b29 commit 1188e8b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/test_dataclasses.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,10 @@ def test_from_env(
215215
def test_cp_handler(self):
216216
"""Test CP handler with various configurations."""
217217

218+
# Any cp_size > 1 requires torch >= BETA_CP_AVAILABLE_PYTORCH_VERSION, we use placeholder for this check as this test doesn't depend on a specific size
219+
if _should_skip_cp_test(2):
220+
pytest.skip(f"CP tests require torch >= {BETA_CP_AVAILABLE_PYTORCH_VERSION}")
221+
218222
from accelerate.utils import TorchContextParallelConfig
219223

220224
for setting in ("allgather", "alltoall"):

0 commit comments

Comments
 (0)