[Bugfix] Honor --disable-custom-all-reduce in MiniMax fused MoE finalize #71959
Documentation preview: https://vllm--71959.org.readthedocs.build/en/71959/
Approved these changes.
/ci run
❌ @matteso1, PR authors cannot run CI while the PR is a draft.
<!-- vllm-ci-command:7425603314 -->
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.
/ci run
✅ 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.
/ci run
✅ 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.
zyongye
matteso1
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-reduceis set, and nothing releases the mailbox before a checkpoint.CUDACheckpointExecutorrequires 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_finalizereturns False whendisable_custom_all_reduceis 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.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
5f21430105with the test added):Run on a CPU-only node in the nightly image (CUDA build of torch), with the repository conftest.
Not covered:
---
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>
/pr-checklistskill. (Mandatory for agents, optional for humans).</details>