Lightning-AI/pytorch-lightning · error · NotImplementedError
The `{type(self).__name__}` does not support setting a `Chec
Error message
The `{type(self).__name__}` does not support setting a `CheckpointIO` plugin. What it means
FSDPStrategy does not accept a custom CheckpointIO plugin; assigning to the checkpoint_io setter raises NotImplementedError because FSDP checkpointing is handled natively and cannot be swapped out.
Source
Thrown at src/lightning/fabric/strategies/fsdp.py:196
self._fsdp_kwargs["device_mesh"] = device_mesh
self._activation_checkpointing_kwargs = _activation_checkpointing_kwargs(
activation_checkpointing, activation_checkpointing_policy
)
self._state_dict_type = state_dict_type
self.sharding_strategy = _init_sharding_strategy(sharding_strategy, self._fsdp_kwargs)
self.cpu_offload = _init_cpu_offload(cpu_offload)
self.mixed_precision = mixed_precision
@property
@override
def checkpoint_io(self) -> CheckpointIO:
raise NotImplementedError(f"The `{type(self).__name__}` does not use the `CheckpointIO` plugin interface.")
@checkpoint_io.setter
@override
def checkpoint_io(self, io: CheckpointIO) -> None:
raise NotImplementedError(f"The `{type(self).__name__}` does not support setting a `CheckpointIO` plugin.")
@property
@override
def root_device(self) -> torch.device:
assert self.parallel_devices is not None
return self.parallel_devices[self.local_rank]
@property
def num_nodes(self) -> int:
return self._num_nodes
@num_nodes.setter
def num_nodes(self, num_nodes: int) -> None:
self._num_nodes = num_nodes
@property
def num_processes(self) -> int:
return len(self.parallel_devices) if self.parallel_devices is not None else 0View on GitHub (pinned to 9fed5c27d2)
Solutions
- Remove the checkpoint_io assignment for FSDP; use strategy.save_checkpoint/load_checkpoint
- Implement remote/async saving outside the strategy (e.g. after save_checkpoint, copy files to storage)
- Branch configuration: only set checkpoint_io for strategies that support it (not FSDP)
Example fix
# before strategy.checkpoint_io = AsyncCheckpointIO() # after # FSDPStrategy handles checkpointing itself: strategy.save_checkpoint(path, state)
Defensive patterns
Strategy: type-guard
Validate before calling
from lightning.fabric.strategies import FSDPStrategy
if not isinstance(strategy, FSDPStrategy) and custom_io is not None:
strategy.checkpoint_io = custom_io Type guard
from lightning.fabric.strategies import FSDPStrategy
def accepts_checkpoint_io(strategy) -> bool:
return not isinstance(strategy, FSDPStrategy) Prevention
- Only inject CheckpointIO for strategies that declare support
- Handle remote upload outside the strategy for FSDP
When it happens
Trigger: strategy.checkpoint_io = MyCheckpointIO() or passing checkpoint_io=... to a constructor/utility that assigns it, when strategy is FSDPStrategy.
Common situations: Reusing configuration meant for the parallel/ddp strategy (e.g. AsyncCheckpointIO, S3CheckpointIO) on FSDP; shared training harness that injects checkpoint IO for all strategies.
Related errors
- The `{type(self).__name__}` does not use the `CheckpointIO`
- Loading a single optimizer object from a checkpoint is not s
- Loading a single module or optimizer object from a checkpoin
- XLAFSDP only supports a single model instance with 'model' a
- `FSDPStrategy.save_checkpoint(..., storage_options=...)` is
AI-assisted analysis of Lightning-AI/pytorch-lightning@9fed5c27d2 (2026-08-28).
Data as JSON: /api/errors/5c80f4b8ce160ff7.
Report an issue: GitHub.