Repository navigation
fix(plugin): build SGLang DP-attention ParallelConfig per rank - #2785
Merged
Merged
Conversation
Under dp-attention SGLang starts one scheduler process per GPU, and the plugin built each process's ATOM ParallelConfig with its own global DP rank as data_parallel_rank and the global DP size as data_parallel_size_local. Since multi-node DP support (#1603), ParallelConfig's constructor reads data_parallel_rank as the start of the node's slice and rejects rank + size_local > size, so every rank but 0 failed at server start: ValueError: data_parallel_rank (3) + data_parallel_size_local (8) must not exceed data_parallel_size (8): this node's slice would run off the end of the global DP group Build the config for the single-node slice starting at rank 0 and assign the process rank afterwards, as EngineCoreManager does for native ATOM. The regression test lives under tests/ rather than tests/plugin/, which the CPU unit-test job skips, and uses the real ParallelConfig.
Contributor
🏷️ CI GuideRuns automatically on every eligible PR before approval:
Heavy model tests:
|
Contributor
Author
|
GPU benchmark reruns on MI355 passed for both DP-attention sizes:
|
zhuyuhua-v
approved these changes
Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every SGLang+ATOM case that uses dp-attention fails at server start. Each scheduler process except DP rank 0 raises while the plugin generates its ATOM config:
Rank 0 then reports
Rank 0 scheduler died during initialization (exit code: -3).Observed in the Oct 27 nightlies on MI355, for every DP case that got past model download:
Cause:
_normalize_sglang_parallel_configmaps that toatom_dp_size = tp_sizeandatom_dp_rank = tp_rank.data_parallel_rankand the global size asdata_parallel_size_local.ParallelConfig.__post_init__readsdata_parallel_rankas the first global rank of this node's slice and rejectsrank + size_local > size. Native ATOM builds the config with the node's start rank and assigns each process's rank afterwards (EngineCoreManager,engine_core_mgr.py), so it is unaffected. The plugin path was not updated, and the existing plugin tests replaceParallelConfigwith a fake, so they did not catch it.Change:
_build_sglang_parallel_config(dp_size, dp_rank)inatom/plugin/config.py. It builds the config for the single-node slice starting at rank 0, then assigns the process'sdata_parallel_rankanddata_parallel_rank_local, mirroringEngineCoreManager.data_parallel_size_localstays at the full DP size, which is whatmoe.pypasses to MoRI aslocal_ep_size.dp_size=1, rank=0, which is unchanged.tests/test_plugin_sglang_parallel_config.py. It runs the real_normalize_sglang_parallel_configand the realParallelConfigfor every rank of TP4 and TP8 dp-attention, plus the non-dp-attention cases. It is undertests/rather thantests/plugin/becauserun_unit_tests.shskipstests/plugin/.Not handled: multi-node SGLang (
nnodes > 1) with dp-attention; the plugin did not support it before this change either.Validation:
bash .github/scripts/run_unit_tests.shon CPU torch: 10133 passed, 1029 skipped, 0 failed.ruff checkandblack --checkpass on the changed files.