← Back to Pull requests

[Bugfix] Honor --disable-custom-all-reduce in MiniMax fused MoE finalize #71959

Merged
matteso1 merged 3 files (44 lines) on Dec 05, 2026 09:47 UTC
View on GitHub
matteso1 matteso1 commented on Dec 04, 2026 20:22 UTC
Author

Motivation

MiniMax-M3's fused MoE finalize does its own all-reduce through an NVLink multicast mailbox (torch.distributed._symmetric_memory). It is built even when --disable-custom-all-reduce is set, and nothing releases the mailbox before a checkpoint. CUDACheckpointExecutor requires that flag, and with the mailbox alive the driver's Checkpoint call does not return, so sleep fails at the stage deadline and the engine exits. This matches NVIDIA/nccl#2537 (a live multicast object blocks the checkpoint), on the same driver.

How it was identified: with the fused finalize turned off the checkpoint completes; with only the mailbox kept (no other multicast object, no torch NCCL communicator initialized) all four ranks lock and Checkpoint still hits a 60 s deadline.

Why this flag: the kernel is a custom all-reduce, the flag already turns off the other ones (QuickReduce, AITER), and the executor already requires it. On CUDA the flag is never set automatically, so only a setup that passes it by hand changes. The longer-term fix is a mailbox that is released and rebuilt around the checkpoint, like the FlashInfer workspace hooks; this PR doesn't attempt that.

No open or closed issue or PR covers this. #65433 and #65434 touch the same function for batch invariance and don't add this check.

Modifications

  • vllm/models/minimax_m3/nvidia/ops/finalize_allreduce_norm.py: supports_fused_moe_finalize returns False when disable_custom_all_reduce is set. The model then takes the path machines without multicast already take.

  • tests/models/minimax_m3/test_finalize_allreduce_norm.py: one test for the disabled case.

  • docs/features/sleep_mode.md: one sentence where the flag is first required.
  • Result

    MiniMax M3.1-Flash, TP4, 4x GB300, driver 610.43.02, bfloat16 KV cache, nightly image 3d7020db. A normal start there takes about 260 s.

    vllm serve <MiniMax M3.1-Flash> --tensor-parallel-size 4 --enable-sleep-mode --enable-nccl-comm-suspend \
      --disable-custom-all-reduce --reasoning-parser minimax_m3 --kv-cache-dtype bfloat16 \
      --no-enable-prefix-caching --block-size 128 --max-num-seqs 80 --disable-hybrid-kv-cache-manager \
      --distributed-executor-backend vllm.v1.executor.cuda_checkpoint_executor.CUDACheckpointExecutor
    # with the NCCL environment the executor requires, then POST /sleep?level=1
    
    # main
    CUDA_PROCESS_CHECKPOINT {"kind": "control_failed", "pids": [3734222, 3734225, 3734224, 3734223], "op": "Checkpoint", "error": "TimeoutError('CUDA controller deadline exceeded')"}
    Exception: Call to sleep method failed: CUDA controller deadline exceeded
    
    # with this change, one line per rank (time_s 1.58, 1.64, 1.76, 1.76)
    CUDA_PROCESS_CHECKPOINT {"kind": "control", "pid": 3923914, "op": "Checkpoint", "rc": 0, "error": "CUDA_SUCCESS", "before": {"rc": 0, "value": 1}, "after": {"rc": 0, "value": 2}, "time_s": 1.5810072480235249}
    

  • Before: Checkpoint did not return within 30 s on main, or within 300 s with a longer deadline (four runs).

  • After, on main: one sleep and wake complete. Sleep 6.56 s, wake call to first token 5.86 s; 8 greedy prompts and their top-5 logprobs are identical before the sleep and after the wake.

  • After, with the pinned-backup patch from aoshen02's fork added (PR 308 there, not upstream): five sleep/wake cycles with 0.5 requests/s arriving. Sleeps take 3.10 to 3.72 s, wake to first token 4.26 to 6.02 s, and the same checks pass after every wake.

  • Cost when the flag is set: throughput is 5.8 to 6.1% lower at concurrency 1, 8 and 32 (244 vs 260, 1,616 vs 1,715, 4,841 vs 5,157 tok/s; two launches per side, same-side spread at most 2.0%).
  • This is one model on one machine with a non-default KV cache dtype, and token and top-5 logprob equality on 8 prompts, not an accuracy eval.

    New test, same command on both sides (base = main 5f21430105 with the test added):

    $ pytest -v tests/models/minimax_m3/test_finalize_allreduce_norm.py::test_disabled_custom_all_reduce_skips_fused_finalize
    
    # 5f21430105 + test
    >       assert not finalize.supports_fused_moe_finalize(config)
    E       assert not True
    ======================== 1 failed, 2 warnings in 9.99s =========================
    
    # 8f119ed7e8
    ======================== 1 passed, 2 warnings in 1.38s =========================
    

    Run on a CPU-only node in the nightly image (CUDA build of torch), with the repository conftest.

    Not covered:

  • On main alone, the second sleep under load took 129 s; that fork patch brings it to about 3 s.

  • A request cancelled while checkpointed ends the engine. Separate fix: #71958.
  • ---

    Details

    The GPU runs used the nightly image with the changed files mounted over the stock ones, not a build of this branch. All of them also carried a fix to MSA's warmup threads, which opened CUDA contexts on GPU 0 from every rank; I'm sending that to vllm-project/MSA separately. The fallback path used when the flag is set is the existing one for machines without NVLink multicast, so no new numerics are introduced.

    ---

    <details>
    <summary> Pull Request Checklist </summary>

  • I used vLLM's /pr-checklist skill. (Mandatory for agents, optional for humans).

  • AI assistance was used during the creation of this PR.
  • Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.

  • Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.

  • Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.

  • Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.

  • </details>

    Diff: 44 lines (+43 / -1) across 3 files Reviewer: zyongye Review duration: 804m
    All Vouch review confidence checks passed
    Residual risk 0.05 = Change Risk (0.29) × (1 − Review Confidence (0.81)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.29 · 44 lines diff across 3 files
    0.29
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.71 · 5 substantive comment(s)
    0.71
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    81%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.228
    Real PR Conversation Timeline
    10 items
    mergify[bot] mergify[bot] commented on Dec 04, 2026 20:23 UTC
    Bot
    zyongye zyongye approved these changes on Dec 04, 2026 22:03 UTC
    Approved Reviewer

    Approved these changes.

    matteso1 matteso1 commented on Dec 04, 2026 22:09 UTC
    Author

    /ci run

    github-actions[bot] github-actions[bot] commented on Dec 04, 2026 22:10 UTC
    Bot

    ❌ @matteso1, PR authors cannot run CI while the PR is a draft.

    <!-- vllm-ci-command:7425603314 -->

    claude[bot] claude[bot] commented on Dec 04, 2026 22:22 UTC
    Reviewer

    Claude Code Review

    This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

    matteso1 matteso1 commented on Dec 04, 2026 22:22 UTC
    Author

    /ci run

    github-actions[bot] github-actions[bot] commented on Dec 04, 2026 22:22 UTC
    Bot

    ✅ Triggered Buildkite CI #108257 for commit 9d850628d999.

    ℹ️ This PR is 10 commits behind upstream main. Merged upstream main into this branch as 9d850628d999 before starting CI. Pull the branch before pushing more changes.

    matteso1 matteso1 commented on Dec 05, 2026 01:04 UTC
    Author

    /ci run

    github-actions[bot] github-actions[bot] commented on Dec 05, 2026 01:04 UTC
    Bot

    ✅ Triggered Buildkite CI #108282 for commit 3be6caa055f7.

    ℹ️ This PR is 3 commits behind upstream main. Merged upstream main into this branch as 3be6caa055f7 before starting CI. Pull the branch before pushing more changes.

    Reviewers
    Assignees
    matteso1 matteso1
    Labels
    risk: low confidence: 81.1% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 28.7% (LOW) · Higher = larger blast radius
    28.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 81.1% · Lower = rushed or shallow review
    81.1%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 5.4% · Safe to merge
    5.4%