{"record":{"id":"5c80f4b8ce160ff7","repo":"Lightning-AI/pytorch-lightning","slug":"the-type-self-name-does-not-support-setti-5c80f4","errorCode":null,"errorMessage":"The `{type(self).__name__}` does not support setting a `CheckpointIO` plugin.","messagePattern":"The `(.+?)` does not support setting a `CheckpointIO` plugin\\.","errorType":"validation","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"src/lightning/fabric/strategies/fsdp.py","lineNumber":196,"sourceCode":"            self._fsdp_kwargs[\"device_mesh\"] = device_mesh\n\n        self._activation_checkpointing_kwargs = _activation_checkpointing_kwargs(\n            activation_checkpointing, activation_checkpointing_policy\n        )\n        self._state_dict_type = state_dict_type\n        self.sharding_strategy = _init_sharding_strategy(sharding_strategy, self._fsdp_kwargs)\n        self.cpu_offload = _init_cpu_offload(cpu_offload)\n        self.mixed_precision = mixed_precision\n\n    @property\n    @override\n    def checkpoint_io(self) -> CheckpointIO:\n        raise NotImplementedError(f\"The `{type(self).__name__}` does not use the `CheckpointIO` plugin interface.\")\n\n    @checkpoint_io.setter\n    @override\n    def checkpoint_io(self, io: CheckpointIO) -> None:\n        raise NotImplementedError(f\"The `{type(self).__name__}` does not support setting a `CheckpointIO` plugin.\")\n\n    @property\n    @override\n    def root_device(self) -> torch.device:\n        assert self.parallel_devices is not None\n        return self.parallel_devices[self.local_rank]\n\n    @property\n    def num_nodes(self) -> int:\n        return self._num_nodes\n\n    @num_nodes.setter\n    def num_nodes(self, num_nodes: int) -> None:\n        self._num_nodes = num_nodes\n\n    @property\n    def num_processes(self) -> int:\n        return len(self.parallel_devices) if self.parallel_devices is not None else 0","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/Lightning-AI/pytorch-lightning/blob/9fed5c27d2a62ff0efd6c3573599921d6ff67c14/src/lightning/fabric/strategies/fsdp.py#L178-L214","documentation":"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.","triggerScenarios":"strategy.checkpoint_io = MyCheckpointIO() or passing checkpoint_io=... to a constructor/utility that assigns it, when strategy is FSDPStrategy.","commonSituations":"Reusing configuration meant for the parallel/ddp strategy (e.g. AsyncCheckpointIO, S3CheckpointIO) on FSDP; shared training harness that injects checkpoint IO for all strategies.","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)"],"exampleFix":"# before\nstrategy.checkpoint_io = AsyncCheckpointIO()\n\n# after\n# FSDPStrategy handles checkpointing itself:\nstrategy.save_checkpoint(path, state)","handlingStrategy":"type-guard","validationCode":"from lightning.fabric.strategies import FSDPStrategy\nif not isinstance(strategy, FSDPStrategy) and custom_io is not None:\n    strategy.checkpoint_io = custom_io","typeGuard":"from lightning.fabric.strategies import FSDPStrategy\ndef accepts_checkpoint_io(strategy) -> bool:\n    return not isinstance(strategy, FSDPStrategy)","tryCatchPattern":null,"preventionTips":["Only inject CheckpointIO for strategies that declare support","Handle remote upload outside the strategy for FSDP"],"tags":["fsdp","checkpoint","not-implemented","setter"],"backgroundTag":"unsupported-api-call","analyzedSha":"9fed5c27d2a62ff0efd6c3573599921d6ff67c14","analyzedAt":"2026-08-28T11:52:41.083Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}