Skip to content

Commit 8947d13

Browse files
authored
Skip test with compile error on torch=2.2.2 on Windows (#19734)
1 parent d25014d commit 8947d13

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/tests_pytorch/utilities/test_compile.py

+7
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import pytest
1818
import torch
19+
from lightning.fabric.utilities.imports import _TORCH_GREATER_EQUAL_2_2
1920
from lightning.pytorch import LightningModule, Trainer
2021
from lightning.pytorch.demos.boring_classes import BoringModel
2122
from lightning.pytorch.utilities.compile import from_compiled, to_uncompiled
@@ -114,6 +115,9 @@ def has_dynamo(fn):
114115

115116
# https://github.com/pytorch/pytorch/issues/95708
116117
@pytest.mark.skipif(sys.platform == "darwin", reason="fatal error: 'omp.h' file not found")
118+
@pytest.mark.xfail(
119+
sys.platform == "win32" and _TORCH_GREATER_EQUAL_2_2, strict=False, reason="RuntimeError: Failed to import"
120+
)
117121
@RunIf(dynamo=True)
118122
def test_trainer_compiled_model_that_logs(tmp_path):
119123
class MyModel(BoringModel):
@@ -140,6 +144,9 @@ def training_step(self, batch, batch_idx):
140144

141145
# https://github.com/pytorch/pytorch/issues/95708
142146
@pytest.mark.skipif(sys.platform == "darwin", reason="fatal error: 'omp.h' file not found")
147+
@pytest.mark.xfail(
148+
sys.platform == "win32" and _TORCH_GREATER_EQUAL_2_2, strict=False, reason="RuntimeError: Failed to import"
149+
)
143150
@RunIf(dynamo=True)
144151
def test_trainer_compiled_model_test(tmp_path):
145152
model = BoringModel()

0 commit comments

Comments
 (0)