Lightning-AI/pytorch-lightning · error · NotImplementedError
The `{type(self).__name__}` does not use the `CheckpointIO`
Error message
The `{type(self).__name__}` does not use the `CheckpointIO` plugin interface. What it means
ModelParallelStrategy does not use the CheckpointIO plugin interface: both the checkpoint_io getter and setter raise NotImplementedError by design, because checkpointing for this strategy is handled through a different mechanism (state-dict based saving/loading via the strategy itself). Any generic code path that reads or assigns strategy.checkpoint_io will hit this.
Source
Thrown at src/lightning/fabric/strategies/model_parallel.py:126
self._tensor_parallel_size = tensor_parallel_size
self._num_nodes = 1
self._save_distributed_checkpoint = save_distributed_checkpoint
self._process_group_backend: Optional[str] = process_group_backend
self._timeout: Optional[timedelta] = timeout
self._backward_sync_control = _ParallelBackwardSyncControl()
self._device_mesh: Optional[DeviceMesh] = None
@property
def device_mesh(self) -> "DeviceMesh":
if self._device_mesh is None:
raise RuntimeError("Accessing the device mesh before processes have initialized is not allowed.")
return self._device_mesh
@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:View on GitHub (pinned to 9fed5c27d2)
Solutions
- Remove any code that sets or reads checkpoint_io when using ModelParallelStrategy; rely on fabric.save/load
- For custom storage backends, serialize via the strategy's state_dict hooks instead of a CheckpointIO plugin
- If you need a pluggable CheckpointIO, use a strategy that supports it (e.g. DDPStrategy/FSDPStrategy) or subclass and override the property knowingly
Example fix
# before
strategy = ModelParallelStrategy()
strategy.checkpoint_io = MyCheckpointIO() # NotImplementedError
# after
strategy = ModelParallelStrategy()
fabric = Fabric(strategy=strategy)
fabric.save("ckpt.path", state) # state-dict based, no CheckpointIO plugin Defensive patterns
Strategy: type-guard
Validate before calling
from lightning.fabric.strategies import ModelParallelStrategy
uses_checkpoint_io = not isinstance(strategy, ModelParallelStrategy)
if uses_checkpoint_io:
strategy.checkpoint_io = my_io Type guard
def supports_checkpoint_io(strategy) -> bool:
try:
_ = strategy.checkpoint_io
return True
except NotImplementedError:
return False Try / catch
try:
strategy.checkpoint_io = io
except NotImplementedError:
pass # strategy handles checkpointing via state_dict path Prevention
- Feature-detect plugin interfaces instead of assuming every Strategy supports them
- Use fabric.save/fabric.load for ModelParallelStrategy checkpoints
When it happens
Trigger: Calling strategy.checkpoint_io or assigning strategy.checkpoint_io = ... on ModelParallelStrategy; generic tooling (profiling, checkpoint wrappers, older Lightning abstractions) that unconditionally accesses the property on any Strategy instance.
Common situations: Porting code from DDP/FSDP strategies that set a custom CheckpointIO (e.g. fsspec or deepspeed-style IO plugins); shared utilities that iterate strategies and touch checkpoint_io; version upgrades where the base-class contract changed to require the property.
Related errors
- The `CSVLogger` does not yet support logging hyperparameters
- Loading a single optimizer object from a checkpoint is not s
- Accessing the device mesh before processes have initialized
- __setitem__ is not supported
- Accessing the device mesh before processes have initialized
AI-assisted analysis of Lightning-AI/pytorch-lightning@9fed5c27d2 (2026-08-28).
Data as JSON: /api/errors/6c38ed7943b19d12.
Report an issue: GitHub.