Conversation
`ParallelConfig.use_sequence_parallel_moe` is derived from the all2all backend and the parallel sizes, with no way to override it. Since vllm-project#48036 dropped the `data_parallel_size > 1` condition, it also turns on for every EP + TP deployment without data parallelism, where the extra all-gather / reduce-scatter per MoE layer and the activation memory it needs can cost more than the duplicate expert work it avoids (see vllm-project#48656: -19% single- request throughput and -24% KV cache on GLM-5.2 at TP4/EP/dp1). Add `sequence_parallel_moe` (`--sequence-parallel-moe` / `--no-sequence-parallel-moe`), defaulting to None so the heuristic keeps deciding; an explicit value overrides it. No behavior change by default. Co-authored-by: Claude Signed-off-by: Mikhail Kostryukov <mike@triptrack.net>
yewentao256
left a comment
There was a problem hiding this comment.
Thanks for the work! Let me take a further look
yewentao256
left a comment
There was a problem hiding this comment.
Could you test #48763?
We don't want to make this exposed to users as it is sometimes complicated
|
Thanks @yewentao256. Independent confirmation just landed in #48656: a bisect I don't think #48763 covers it:
The fix that matches both reports is the one passtoor-agi also suggested: Happy to close #48657 once the DP gate is restored or another working opt-out AI assistance was used for the code-path analysis above; our GLM-5.2 numbers |
|
Numbers as promised, on GLM-5.2-NVFP4, TP4 / DCP4 / EP / dp=1, util 0.945,
The last row is the sharp one: with SP-MoE on, the engine fails init at our This matches the independent Nemotron report in #48656 (same bisect to #48036, I also confirmed at runtime that #48763 doesn't touch this path: the prod log So the ask stands: restore AI assistance was used to run and analyze this; the numbers are from a real |
|
Thanks for the work, close this PR as #48849 landed |
Purpose
ParallelConfig.use_sequence_parallel_moeis a derived property with no override: it is decided entirely by the all2all backend and the parallel sizes. This PR adds an explicitsequence_parallel_moesetting (--sequence-parallel-moe/--no-sequence-parallel-moe) that defaults toNone, i.e. no behavior change — the current heuristic keeps deciding unless an operator sets the flag.Motivation is #48656. Since #48036 removed the
data_parallel_size > 1condition, sequence-parallel MoE auto-enables on every EP + TP deployment without data parallelism. On our TP=4 / EP / dp=1 GLM-5.2 setup (4×H200) that measured as:main)The extra all-gather/reduce-scatter per MoE layer, plus the activation memory it needs, cost more than the duplicate expert work it avoids — and today the only escape is switching
all2all_backendaway from the default, which changes the expert-exchange mechanism entirely. Patchingparallel.pydownstream (what we do now) is worse.This PR only adds the knob; whether the auto-heuristic itself should be revisited for
dp=1is the open question in #48656.Test plan
New test asserts the default still follows the heuristic and that an explicit value overrides it in both directions.
Test result
pytest tests/test_config.py -k sequence_parallel_moe: passes.ruff check/ruff format: clean.None/True/False, and--no-sequence-parallel-moereproduces the "SP-MoE off" row above end-to-end.AI assistance
AI assistance (Claude) was used for this change. The human submitter reviewed every changed line and ran the tests above.