[Proposal] Extend affine live-state transfer to CPU-offloaded optimizer storage
Maintainers usually reply within 3 days
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- distributed-systems, machine-learning
Research direction
This is a design proposal with no implementation files or tests named. First read #8885, #8809, and #8230 and ask the parent maintainers to agree on scope and a residency/readiness contract. Done means an accepted design defining safe live storage access, bounded CPU↔accelerator staging, and collective preflight before implementation begins.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe.
#8885 describes live ZeRO parameter/master/optimizer storage for use with #8809's bounded transfer executor. It explicitly rejects CPU-offloaded optimizer states. The executor also requires buffers to reside on its accelerator transport device, so removing the map guard alone would not provide correct CPU-offload support.
I would like to contribute this as a scoped follow-up to #8230, #8885 and #8809, after agreement on the design and ownership. This is a proposal, not a feature implementation or a claim that the parent PRs are incomplete bug fixes.
Describe the solution you'd like
Initial scope: CPU-offloaded optimizer masters and Adam moments under ZeRO-2/3, with training paused at a documented safe boundary. Preserve existing device-resident behavior. Exclude NVMe, quantized storage, MiCS/hpZ, concurrent training/transfer and topology-changing optimizer resumes initially.
Proposed phases:
- Describe the same logical ranges while representing the shard's residency and readiness separately from the affine geometry. Decide with the parent authors whether this belongs in an endpoint descriptor or in a checked storage-view/lease API.
- Obtain a stable, live view after pending offload copies complete; keep the owner and staging buffers alive until transfer completion. Refuse unavailable/swapped storage rather than returning a placeholder.
- Add bounded CPU↔accelerator staging around existing transport rounds. NCCL payloads remain on the accelerator. Pinned-memory availability, copy events and buffer lifetimes must be explicit; budgets must bound both host and device staging. No whole-model gather or implicit CPU→GPU allocation proportional to total model size.
- Preserve collective preflight: all participants reject unsupported residency or allocation failures before target writes. Do not claim rollback or continued training after a transport failure has partially overwritten target storage.
Describe alternatives you've considered
- Gather complete FP32 tensors, copy them to the accelerator and use the current executor: straightforward but duplicates memory and full gathers.
- Read serialized checkpoints instead of live state: useful for restart, but less suitable for repeated training/rollout synchronization.
- Use CPU/Gloo-only transport: a possible backend option, but it does not directly solve mixed CPU optimizer storage and GPU rollout targets. It also has different performance and stream-completion contracts.
Additional context and baseline experiments
On 2×RTX 3090 24 GiB, driver 580.105.08, torch 2.12.1+cu130 / CUDA 13.0, I exercised frozen #8885 head e34367a7f790eb3f39c62f8b36978cbf3186f0aa with the existing executor file from #8809 head ba9e8b65219efdde2833abda3d66ceb03f907d6d. This combined experimental tree was not published or presented as a new implementation.
A small BF16 model's live ZeRO-3 parameter shards transferred into replicated target buffers with bitwise agreement. The same transfer also passed with bitwise agreement under ZeRO-2 and ZeRO-3 CPU optimizer offload. In both CPU-offload cases, optimizer map access raised the documented NotImplementedError. These runs used 13×13 weights plus a 13-element bias, exercising uneven partitions/padding, and a 128-byte per-peer staging budget. These are correctness smoke tests, not end-to-end throughput claims.
Planned acceptance experiments, once maintainers accept a design:
- Compare every restored master and Adam moment with an independently gathered reference, including straddling parameters, uneven shards and padding.
- Check the next optimizer update against an uninterrupted control at the same topology.
- Exercise CPU→GPU, GPU→CPU and CPU→CPU residency combinations, rejected unsupported states, event ordering and bounded staging under a small budget.
- Begin with two-GPU small models; extend to four-GPU DP/TP topology integration and a representative model for repeated-sync latency, CPU RSS, peak GPU allocation, transfer bytes and run-to-run variability. Report both memory and throughput and avoid treating a microbenchmark as a general speedup.
Before implementation, could the parent maintainers confirm whether this scope is useful, whether related work already exists, and the preferred residency/readiness contract? AI assistance was used to investigate existing code and prepare this proposal.
- Dominant language
- Python
- Stars
- 43.3k
- Forks
- 5.1k
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 69
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from deepspeedai/DeepSpeed
-
[BUG] Universal checkpoint resume puts CPU `step` into fused/capturable optimizer statePossibly taken @ArjunPakhan claimed this 3 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
deepspeedai/DeepSpeed#8884 · 1 comment ·
Maintainers usually reply within 3 days
-
init_inference rejects dtype=torch.int8 on every acceleratorMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
deepspeedai/DeepSpeed#8577 ·
Maintainers usually reply within 3 days
-
[BUG] AutoTP checkpoint load raises AttributeError on a model containing nn.InstanceNorm1dPossibly taken @vineethsaivs claimed this 41 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
deepspeedai/DeepSpeed#8514 ·
Maintainers usually reply within 3 days
-
[BUG] Python checkpoint writers fail to reload full ZeRO-3 state with default torch.loadPossibly taken @ai-yang claimed this 42 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
deepspeedai/DeepSpeed#8500 ·
Maintainers usually reply within 3 days
-
[BUG] set_norm_for_param_grad_in_gpu's grad_accum fallback is dead in both accumulation modesPossibly taken @LOGO127 claimed this 51 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
deepspeedai/DeepSpeed#8371 ·
Maintainers usually reply within 3 days
All issues in deepspeedai/DeepSpeed
Similar issues
-
The changelog workflow excludes otelbot but not dependabot, so every Dependabot pull request fails the changelog checkPossibly taken @ocelotl claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 82/100
open-telemetry/opentelemetry-python#5825 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
cuga-project/cuga-agent#1020 ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
microsoft/playwright#43640 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
stac-utils/stac-fastapi-elasticsearch-opensearch#965 ·
Maintainers usually reply within 2 days
-
from-review-extraction library privacy python severity:suggested
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
LearningCircuit/local-deep-research#7951 ·
Maintainers usually reply within 2 days