[BUG] ZeRO-2 deadlocks at step 1 training HF MixtralForCausalLM (native experts) with 2-GPU data parallel
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
調査の方向性
Start by comparing the backward and engine.step() stack locations with DeepSpeed’s ZeRO-2 gradient reduction path, especially stage_1_and_2.py and runtime/utils.py. The issue provides a two-GPU Mixtral reproduction configuration, but says the cause is not identified and a standalone script will follow. First minimize the repro and trace collective ordering across ranks; done when step 1 completes or fails with a clear error under the reported setup.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
An unmodified Hugging Face MixtralForCausalLM (native expert loop, no AutoEP and no deepspeed.moe) trained with ZeRO-2 under plain data parallelism on 2 GPUs completes step 0, then hangs in step 1. GPUs stay at 100% utilization, with no error or timeout for more than 9 minutes.
Stack dumps (faulthandler) show the two ranks in different places:
- One rank has finished backward and is in
engine.step()→stage_1_and_2.pystep→check_overflow→has_overflow_partitioned_grads_serial→runtime/utils.py:has_inf_or_nan. It is blocked on device sync. - The other rank is still inside
engine.backward()(autograd engine).
This looks like the gradient-reduction collective sequence diverging between ranks during step 1. The root cause has not been identified yet.
To Reproduce
transformers.MixtralConfig(vocab_size=32000, hidden_size=1024, intermediate_size=1024, num_hidden_layers=12, num_attention_heads=16, num_key_value_heads=4, num_local_experts=16, num_experts_per_tok=2, output_router_logits=True, router_aux_loss_coef=0.01, tie_word_embeddings=False, use_cache=False, attn_implementation="sdpa"), random init.- DeepSpeed config: bf16,
zero_optimization.stage=2, AdamW (torch_adam: true),gradient_clipping: 1.0,train_micro_batch_size_per_gpu: 8, WarmupCosineLR. - Inputs: packed SFT batches, seq 1024,
labelswith prompt tokens masked to -100;loss = engine(input_ids=x, labels=y).loss;engine.backward(loss);engine.step(). deepspeed --num_gpus 2 ...
Under the same config, the same model with its MoE blocks replaced by AutoEP (expert_parallel.enabled, EP=2) or by deepspeed.moe.layer.MoE (EP=2) trains for 400 steps without hanging.
Expected behavior
Training proceeds, or fails with an error, instead of deadlocking.
System info
- 2× NVIDIA H100 80GB HBM3, driver 595.112.07, CUDA 12.9
- torch 2.8.0+cu129, transformers 5.23.0, DeepSpeed 0.20.1+5420b75de (master), Python 3.12, Ubuntu 24.04
Additional context
Found while collecting MoE baselines for roadmap #8672. Not yet minimized; a smaller standalone repro script will follow in a comment. AI assistance (Claude Code) was used to run the experiment and draft this report.
- 主要言語
- Python
- スター
- 43.3k
- フォーク
- 5.1k
- 平均マージ
- 5日 10時間
- マージ済み PR(30日)
- 85
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 日以内に返信
-
accepted
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
future-agi/future-agi#4737 ·
メンテナーはふだん 1 日以内に返信
-
Fix URL validation, get_version_url, and implement robust parse_url for Launchpad backend対応中かも @patelshivani2283-lab が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
fedora-infra/anitya#2278 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
Dao-AILab/flash-attention#3251 ·
メンテナーはふだん 2 日以内に返信