You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, attempting to use FSDPStrategy with CPU in PyTorch Lightning raises an artificial ValueError during trainer initialization:
ValueError: The strategy `fsdp` requires a GPU accelerator, but received `accelerator='cpu'`.
Allowing FSDP to run on CPU is highly valuable for several key workflows:
Storage I/O Macrobenchmarking: Enabling CPU-based FSDP allows us to run macrobenchmarks on checkpoint save/restore storage I/O without consuming expensive GPU hours. Isolating storage network and disk throughput from GPU compute provides clear signals for future performance improvements in distributed checkpointing.
Local Development & Debugging: Developers can build, debug, and verify distributed FSDP code locally on laptops without requiring GPU access.
CI & Unit Testing: Enables fast, inexpensive multi-process FSDP end-to-end testing in CPU-only CI environments (e.g., GitHub Actions).
Related Issues
This feature proposal is blocked by / related to SIGSEGV (Segmentation Fault) when saving checkpoints with FSDP on CPU #21804, which tracks the crash/segmentation fault when saving full state dict checkpoints under CPU FSDP. Once it is resolved, CPU support can be fully enabled and tested for both full and sharded checkpoint formats.
Motivation
Currently, attempting to use FSDPStrategy with CPU in PyTorch Lightning raises an artificial ValueError during trainer initialization:
Allowing FSDP to run on CPU is highly valuable for several key workflows:
Related Issues
Pitch
I propose officially enabling accelerator="cpu" support for FSDPStrategy :
Alternatives
No response
Additional context
No response
cc @lantiga