Skip to content

Commit 3024471

Browse files
committed
warns
1 parent b73c4cb commit 3024471

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

tests/tests_pytorch/utilities/test_compile.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
# https://github.com/pytorch/pytorch/issues/95708
3434
@pytest.mark.skipif(sys.platform == "darwin", reason="fatal error: 'omp.h' file not found")
35-
@RunIf(dynamo=True)
35+
@RunIf(dynamo=True, deepspeed=True)
3636
@mock.patch("lightning.pytorch.trainer.call._call_and_handle_interrupt")
3737
def test_trainer_compiled_model(_, tmp_path, monkeypatch, mps_count_0):
3838
trainer_kwargs = {
@@ -74,13 +74,7 @@ def test_trainer_compiled_model(_, tmp_path, monkeypatch, mps_count_0):
7474
mock_cuda_count(monkeypatch, 2)
7575

7676
# TODO: Update deepspeed to avoid deprecation warning for `torch.cuda.amp.custom_fwd` on import
77-
warn_context = (
78-
pytest.warns(FutureWarning, match="torch.cuda.amp.*is deprecated")
79-
if _TORCH_GREATER_EQUAL_2_4
80-
else nullcontext()
81-
)
82-
83-
with warn_context:
77+
with pytest.warns(FutureWarning, match="torch.cuda.amp.*is deprecated"):
8478
trainer = Trainer(strategy="deepspeed", accelerator="cuda", **trainer_kwargs)
8579

8680
with pytest.raises(RuntimeError, match="Using a compiled model is incompatible with the current strategy.*"):

0 commit comments

Comments
 (0)