We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b3ce371 commit 224a125Copy full SHA for 224a125
src/lightning/pytorch/strategies/fsdp2.py
@@ -67,7 +67,13 @@
67
from torch.distributed.fsdp import CPUOffloadPolicy, MixedPrecisionPolicy, OffloadPolicy
68
69
if _TORCH_GREATER_EQUAL_2_6:
70
- from torch.distributed.checkpoint.stateful import Stateful as _TorchStateful
+ try:
71
+ from torch.distributed.checkpoint.stateful import Stateful as _TorchStateful
72
+ except ImportError:
73
+
74
+ class _TorchStateful: # type: ignore[no-redef]
75
+ pass
76
77
else:
78
79
class _TorchStateful: # type: ignore[no-redef]
0 commit comments