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():
2323 code = dedent (
2424 """
2525 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
2633
2734 # pretend torch.distributed not available
2835 for name in list(torch.distributed.__dict__.keys()):
@@ -31,6 +38,11 @@ def test_import_fabric_with_torch_dist_unavailable():
3138
3239 torch.distributed.is_available = lambda: False
3340
41+ # needed for Dynamo in PT 2.5+ compare the torch.distributed source
42+ class _ProcessGroupStub:
43+ pass
44+ torch.distributed.ProcessGroup = _ProcessGroupStub
45+
3446 import lightning.fabric
3547 """
3648 )
You can’t perform that action at this time.
0 commit comments