{"record":{"id":"d23d8065a4bc0a1c","repo":"Lightning-AI/pytorch-lightning","slug":"type-self-name-save-checkpoint-storag-d23d80","errorCode":null,"errorMessage":"`{type(self).__name__}.save_checkpoint(..., storage_options=...)` is not supported because `{type(self).__name__}` does not use the `CheckpointIO`.","messagePattern":"`(.+?)\\.save_checkpoint\\(\\.\\.\\., storage_options=\\.\\.\\.\\)` is not supported because `(.+?)` does not use the `CheckpointIO`\\.","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"src/lightning/pytorch/strategies/model_parallel.py","lineNumber":306,"sourceCode":"        assert self.model is not None\n\n        state_dict = get_optimizer_state_dict(self.model, optimizer, options=state_dict_options)\n        if not self._save_distributed_checkpoint and self.global_rank == 0:\n            state_dict = _align_compiled_param_names_with_module(state_dict, self.model)\n            state_dict = FSDP.rekey_optim_state_dict(state_dict, OptimStateKeyType.PARAM_ID, self.model)\n        return state_dict\n\n    @override\n    def load_optimizer_state_dict(self, checkpoint: Mapping[str, Any]) -> None:\n        # Override to do nothing, the strategy already loaded the states in `load_checkpoint()`\n        pass\n\n    @override\n    def save_checkpoint(\n        self, checkpoint: dict[str, Any], filepath: _PATH, storage_options: Optional[Any] = None\n    ) -> None:\n        if storage_options is not None:\n            raise TypeError(\n                f\"`{type(self).__name__}.save_checkpoint(..., storage_options=...)` is not supported because\"\n                f\" `{type(self).__name__}` does not use the `CheckpointIO`.\"\n            )\n        # broadcast the path from rank 0 to ensure all the checkpoints are saved to a common path\n        path = _resolve_path(self.broadcast(filepath))\n        if _is_checkpoint_dir(path) and not self._save_distributed_checkpoint and not _is_sharded_checkpoint(path):\n            raise IsADirectoryError(f\"The checkpoint path exists and is a directory: {path}\")\n\n        if self._save_distributed_checkpoint:\n            _prepare_directory_checkpoint(path)\n\n            converted_state = {\"state_dict\": checkpoint.pop(\"state_dict\")}\n            converted_state.update({\n                f\"optimizer_{idx}\": optim_state\n                for idx, optim_state in enumerate(checkpoint.pop(\"optimizer_states\", []))\n            })\n            _distributed_checkpoint_save(converted_state, path)\n","sourceCodeStart":288,"sourceCodeEnd":324,"githubUrl":"https://github.com/Lightning-AI/pytorch-lightning/blob/9fed5c27d2a62ff0efd6c3573599921d6ff67c14/src/lightning/pytorch/strategies/model_parallel.py#L288-L324","documentation":"ModelParallelStrategy.save_checkpoint does not go through the CheckpointIO plugin, so it cannot honor the storage_options argument (which is a CheckpointIO/fsspec concept). Passing storage_options raises TypeError.","triggerScenarios":"Calling strategy.save_checkpoint(ckpt, path, storage_options={...}) or trainer.save_checkpoint(..., storage_options=...) with ModelParallelStrategy; usually when code written for cloud-storage checkpointing (fsspec URLs, options) is reused with this strategy.","commonSituations":"Shared checkpoint utilities that pass storage_options for S3/GCS; migrating from strategies that support it (e.g. DeepSpeed via CheckpointIO).","solutions":["Drop the storage_options argument when using ModelParallelStrategy","Configure storage credentials via environment variables (AWS_*, etc.) so fsspec picks them up implicitly when the checkpoint layer reads/writes the path","If you need storage_options, use a strategy whose CheckpointIO supports them"],"exampleFix":"# before\ntrainer.save_checkpoint(\"s3://bucket/ckpt\", storage_options={\"key\": ...})\n\n# after\nos.environ.setdefault(\"AWS_...\")\ntrainer.save_checkpoint(\"s3://bucket/ckpt\")","handlingStrategy":"validation","validationCode":"if isinstance(strategy, ModelParallelStrategy):\n    assert storage_options is None, \"ModelParallelStrategy does not support storage_options\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Parameterize save utilities so storage_options is only passed for strategies that support CheckpointIO","Use env-var credentials for object storage instead of storage_options"],"tags":["checkpoint","storage-options","model-parallel","unsupported-argument"],"backgroundTag":"unsupported-argument","analyzedSha":"9fed5c27d2a62ff0efd6c3573599921d6ff67c14","analyzedAt":"2026-08-28T11:52:41.083Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}