Skip to content

Commit 224a125

Browse files
committed
update
1 parent b3ce371 commit 224a125

File tree

1 file changed

+7
-1
lines changed
  • src/lightning/pytorch/strategies

1 file changed

+7
-1
lines changed

src/lightning/pytorch/strategies/fsdp2.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,13 @@
6767
from torch.distributed.fsdp import CPUOffloadPolicy, MixedPrecisionPolicy, OffloadPolicy
6868

6969
if _TORCH_GREATER_EQUAL_2_6:
70-
from torch.distributed.checkpoint.stateful import Stateful as _TorchStateful
70+
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+
7177
else:
7278

7379
class _TorchStateful: # type: ignore[no-redef]

0 commit comments

Comments
 (0)