File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
tests/tests_fabric/utilities Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,13 @@ def test_import_fabric_with_torch_dist_unavailable():
23
23
code = dedent (
24
24
"""
25
25
import torch
26
+ try:
27
+ # PyTorch 2.5 relies on torch,distributed._composable.fsdp not
28
+ # existing with USE_DISTRIBUTED=0
29
+ import torch._dynamo.variables.functions
30
+ torch._dynamo.variables.functions._fsdp_param_group = None
31
+ except ImportError:
32
+ pass
26
33
27
34
# pretend torch.distributed not available
28
35
for name in list(torch.distributed.__dict__.keys()):
@@ -31,6 +38,11 @@ def test_import_fabric_with_torch_dist_unavailable():
31
38
32
39
torch.distributed.is_available = lambda: False
33
40
41
+ # needed for Dynamo in PT 2.5+ compare the torch.distributed source
42
+ class _ProcessGroupStub:
43
+ pass
44
+ torch.distributed.ProcessGroup = _ProcessGroupStub
45
+
34
46
import lightning.fabric
35
47
"""
36
48
)
You can’t perform that action at this time.
0 commit comments