Skip to content

Commit e5f2120

Browse files
committed
_XFAIL_GLOO_WINDOWS
1 parent 98d20a4 commit e5f2120

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

tests/tests_pytorch/callbacks/test_spike.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
import pytest
44
import torch
55

6-
from lightning.fabric.utilities.imports import _IS_WINDOWS, _TORCHMETRICS_GREATER_EQUAL_1_0_0
6+
from lightning.fabric.utilities.imports import _TORCHMETRICS_GREATER_EQUAL_1_0_0
77
from lightning.fabric.utilities.spike import TrainingSpikeException
88
from lightning.pytorch import LightningModule, Trainer
99
from lightning.pytorch.callbacks.spike import SpikeDetection
10-
from lightning.pytorch.utilities.imports import _TORCH_GREATER_EQUAL_2_8
11-
from tests_pytorch.helpers.runif import RunIf
10+
from tests_pytorch.helpers.runif import _XFAIL_GLOO_WINDOWS, RunIf
1211

1312

1413
class IdentityModule(LightningModule):
@@ -49,10 +48,6 @@ def on_train_batch_end(self, trainer, pl_module, outputs, batch, batch_idx):
4948
super().on_train_batch_end(trainer, pl_module, outputs, batch, batch_idx)
5049

5150

52-
# todo: RuntimeError: makeDeviceForHostname(): unsupported gloo device
53-
_XFAIL_GLOO_WINDOWS = pytest.mark.xfail(RuntimeError, strict=True, condition=(_IS_WINDOWS and _TORCH_GREATER_EQUAL_2_8))
54-
55-
5651
@pytest.mark.flaky(max_runs=3)
5752
@pytest.mark.parametrize(
5853
("global_rank_spike", "num_devices", "spike_value", "finite_only"),

tests/tests_pytorch/helpers/runif.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,20 @@
1313
# limitations under the License.
1414
import pytest
1515

16+
from lightning.fabric.utilities.imports import _IS_WINDOWS
17+
from lightning.pytorch.utilities.imports import _TORCH_GREATER_EQUAL_2_8
1618
from lightning.pytorch.utilities.testing import _runif_reasons
1719

1820

1921
def RunIf(**kwargs):
2022
reasons, marker_kwargs = _runif_reasons(**kwargs)
2123
return pytest.mark.skipif(condition=len(reasons) > 0, reason=f"Requires: [{' + '.join(reasons)}]", **marker_kwargs)
24+
25+
26+
# todo: RuntimeError: makeDeviceForHostname(): unsupported gloo device
27+
_XFAIL_GLOO_WINDOWS = pytest.mark.xfail(
28+
RuntimeError,
29+
strict=True,
30+
condition=(_IS_WINDOWS and _TORCH_GREATER_EQUAL_2_8),
31+
reason="makeDeviceForHostname(): unsupported gloo device",
32+
)

0 commit comments

Comments
 (0)