{"record":{"id":"42c6f0ca34d44598","repo":"Lightning-AI/pytorch-lightning","slug":"deepspeedstrategy-save-checkpoint-storage-op","errorCode":null,"errorMessage":"`DeepSpeedStrategy.save_checkpoint(..., storage_options=...)` is not supported because `DeepSpeedStrategy` does not use the `CheckpointIO`.","messagePattern":"`DeepSpeedStrategy\\.save_checkpoint\\(\\.\\.\\., storage_options=\\.\\.\\.\\)` is not supported because `DeepSpeedStrategy` does not use the `CheckpointIO`\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"src/lightning/fabric/strategies/deepspeed.py","lineNumber":431,"sourceCode":"        \"\"\"Save model, optimizer, and other state in a checkpoint directory.\n\n        Args:\n            path: A path to where the files should be saved\n            state: A dictionary with contents to be saved. If the dict contains modules or optimizers, their\n                state-dict will be retrieved and converted automatically.\n            storage_options: Unused by this strategy, since it doesn't use a ``CheckpointIO`` plugin.\n            filter: Unsupported.\n\n        Raises:\n            TypeError:\n                If the unused ``storage_options`` gets passed.\n            ValueError:\n                When no :class:`deepspeed.DeepSpeedEngine` objects were found in the state, or when multiple\n                :class:`deepspeed.DeepSpeedEngine` objects were found.\n\n        \"\"\"\n        if storage_options is not None:\n            raise TypeError(\n                \"`DeepSpeedStrategy.save_checkpoint(..., storage_options=...)` is not supported because\"\n                \" `DeepSpeedStrategy` does not use the `CheckpointIO`.\"\n            )\n        if filter is not None:\n            raise TypeError(\n                \"`DeepSpeedStrategy.save_checkpoint(..., filter=...)` is not supported because\"\n                \" `DeepSpeedStrategy` manages the state serialization internally.\"\n            )\n\n        engines = _get_deepspeed_engines_from_state(state)\n        if len(engines) == 0:\n            raise ValueError(\n                \"Could not find a DeepSpeed model in the provided checkpoint state. Please provide the model as\"\n                \" part of the state like so: `save_checkpoint(..., state={'model': model, ...})`. Make sure\"\n                \" you set up the model (and optimizers if any) through the strategy before saving the checkpoint.\"\n            )\n        if len(engines) > 1:\n            raise ValueError(","sourceCodeStart":413,"sourceCodeEnd":449,"githubUrl":"https://github.com/Lightning-AI/pytorch-lightning/blob/9fed5c27d2a62ff0efd6c3573599921d6ff67c14/src/lightning/fabric/strategies/deepspeed.py#L413-L449","documentation":"DeepSpeedStrategy serializes checkpoints itself through the DeepSpeedEngine, bypassing the CheckpointIO plugin that would interpret storage_options. Passing a non-None storage_options to save_checkpoint therefore raises TypeError.","triggerScenarios":"fabric.save_checkpoint(path, state, storage_options={...}) while strategy='deepspeed'; e.g. options meant for fsspec/AsyncCheckpointIO like 'write_in_parallel'.","commonSituations":"Shared checkpointing helper code that always forwards storage_options regardless of strategy; migrating from FSDP (where storage_options work) to DeepSpeed.","solutions":["Drop the storage_options argument when saving under DeepSpeed","Branch your checkpoint helper: pass storage_options only for strategies that use CheckpointIO","For deepspeed-specific needs, configure checkpointing via DeepSpeed config (e.g. checkpoint options in the deepspeed json)"],"exampleFix":"# before\nfabric.save_checkpoint(state, path, storage_options={\"write_in_parallel\": True})\n# after (deepspeed)\nfabric.save_checkpoint(state, path)","handlingStrategy":"validation","validationCode":"from lightning.fabric.strategies.deepspeed import DeepSpeedStrategy\nsave_kwargs = {} if isinstance(fabric.strategy, DeepSpeedStrategy) else {\"storage_options\": opts}\nfabric.save_checkpoint(path, state, **save_kwargs)","typeGuard":"from lightning.fabric.strategies.deepspeed import DeepSpeedStrategy\n\ndef supports_storage_options(strategy) -> bool:\n    return not isinstance(strategy, DeepSpeedStrategy)","tryCatchPattern":"try:\n    fabric.save_checkpoint(path, state, storage_options=opts)\nexcept TypeError:\n    fabric.save_checkpoint(path, state)","preventionTips":["Keep per-strategy checkpoint helpers instead of forwarding all kwargs blindly"],"tags":["deepspeed","checkpointing","unsupported-argument","pytorch-lightning"],"backgroundTag":"unsupported-argument","analyzedSha":"9fed5c27d2a62ff0efd6c3573599921d6ff67c14","analyzedAt":"2026-08-28T11:52:41.083Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}