AutoTP rollout engine: generate with a tensor-parallel copy of a ZeRO training model
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
调研方向
Start by reading the existing RolloutEngine interface, HybridEngineRollout, the build_rollout factory, and _resolve_autotp_partition plus the universal-checkpoint restore path. Then trace how ZeRO exposes master weights through safe_get_full_fp32_param and how AutoTP records layer layout metadata. Done means an opt-in AutoTP rollout engine syncs weights in memory, generates across ranks with matching tokens and rank-local output layouts, and is wired into the factory.
由索引模型根据 Issue 内容生成。
描述
Is your feature request related to a problem? Please describe.
HybridEngineRollout generates with the training model itself, on each rank's own ZeRO replica. Users who train with ZeRO have no built-in way to run rollout tensor-parallel across ranks unless training also moves to AutoTP. Keeping a separately sharded inference model current today takes a checkpoint round trip, which is too slow to repeat at every RL step.
Describe the solution you'd like
A new opt-in engine, build_rollout(RolloutConfig(engine="autotp"), ...). AutoTPRollout leaves training on ZeRO and generates with a separate inference copy sharded across all ranks with AutoTP. sync_weights(step) refreshes the copy in memory after each optimizer step.
- Sync:
safe_get_full_fp32_paramgathers each master weight, and_resolve_autotp_partition, the universal-checkpoint restore path, cuts this rank's shard from the layout metadata each AutoTP layer records. Sharing that function means sync and checkpoint restore cannot disagree about a layout. - Generation: one TP group spans all ranks, so ranks generate together. Each rank's left-padded prompts are gathered and padded to a common width, the union is generated once with a shared seed, tokens are checked to match on every rank, and each rank gets back only its own rows in its own
[B', T_p + T_r]layout. - Size: one new module on the existing
RolloutEngineinterface, plus factory wiring. No changes toHybridEngineRollout, the engine, ZeRO ordeepspeed.comm. - Cost: the inference copy needs roughly one more model's memory, divided by the number of ranks.
- Not supported at first: graph capture, shared prefill, continuous batching, models with tied embeddings.
Describe alternatives you've considered
- Keep using
HybridEngineRollout. This is the simpler option, needs no second model and no weight sync, and remains the default (see #8942). This engine is an opt-in addition for users who want tensor-parallel generation while training on ZeRO. - Reload weights through a universal checkpoint. I tested this path and it produces correct weights, but it needs disk I/O for every update, and DeepSpeed has no reader from universal checkpoints into a plain inference model.
- Train with AutoTP as well, so rollout can share the model (#9008 addresses the rollout cache sizing for this setup). That changes the training configuration, which not every user wants.
- Keep this outside DeepSpeed, in DeepSpeedExamples. It would then depend on the private
_resolve_autotp_partition, which is one of the questions below.
- 主要语言
- Python
- 星标
- 43.3k
- 派生
- 5.1k
- 平均合并
- 5 天 10 小时
- 30 天内合并 PR
- 85
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
deepspeedai/DeepSpeed 的其他 Issue
-
[Bug] DeepSpeedEngine.step leaves _running_engine_step=True permanently on exception, corrupting is_gradient_accumulation_boundary()可能已有人在做 @its-amann 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
deepspeedai/DeepSpeed#9190 · 1 条评论 ·
维护者通常 2 天内回复
-
[Bug] PipelineEngine._exec_reduce_grads and _exec_optimizer_step leave _force_grad_boundary=True permanently after any exception可能已有人在做 @bantianyue 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
deepspeedai/DeepSpeed#9183 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
deepspeedai/DeepSpeed#9019 · 2 条评论 ·
维护者通常 2 天内回复
-
fp16 `hysteresis: 0` (or negative) makes DynamicLossScaler never lower the loss scale, so every overflowing step is skipped forever可能已有人在做 @damienen 于 26 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
deepspeedai/DeepSpeed#8982 ·
维护者通常 2 天内回复
-
[BUG] OneCycle applies the minimum momentum to the first Adam update可能已有人在做 @ai-yang 于 30 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
deepspeedai/DeepSpeed#8951 ·
维护者通常 2 天内回复
查看 deepspeedai/DeepSpeed 的全部 Issue
相似的 Issue
-
area/auth comp/agent P3 type/bug
难度 2/5 1-3 小时 新手友好度 88/100
NousResearch/hermes-agent#161417 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 75/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
Dao-AILab/flash-attention#3251 ·
维护者通常 2 天内回复
-
[New Check]: sqlserver_public_network_access_disabled可能已有人在做 @pouria-l 今天认领。 未关闭feature-request status/needs-triage
难度 2/5 1-3 小时 新手友好度 78/100
prowler-cloud/prowler#13607 · 1 条评论 ·
维护者通常 1 天内回复
-
external langchain
难度 1/5 1 小时以内 新手友好度 90/100
langchain-ai/docs#8184 ·
维护者通常 1 天内回复