[EPLB] Simplify EPLB rearrange by only returning one map#36267
Merged
tlrmchlsmth merged 12 commits intovllm-project:mainfrom Mar 19, 2026
Merged
[EPLB] Simplify EPLB rearrange by only returning one map#36267tlrmchlsmth merged 12 commits intovllm-project:mainfrom
tlrmchlsmth merged 12 commits intovllm-project:mainfrom
Conversation
Signed-off-by: Sage Moore <sage@neuralmagic.com>
Signed-off-by: Sage Moore <sage@neuralmagic.com>
Signed-off-by: Sage Moore <sage@neuralmagic.com>
Signed-off-by: Sage Moore <sage@neuralmagic.com>
Signed-off-by: Sage Moore <sage@neuralmagic.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the EPLB rearrange logic to simplify state management by deriving two expert mapping tensors from a single one, instead of computing and storing all three. This is a good simplification that reduces complexity. The overall changes look correct and align with the stated purpose. However, I've found a couple of critical issues in the new compute_logical_maps helper function where it doesn't correctly handle negative indices for unused experts, which could lead to incorrect behavior or crashes. I've provided detailed comments and suggestions to address these bugs.
Note: Security Review is unavailable for this PR.
Signed-off-by: Sage Moore <sage@neuralmagic.com>
Signed-off-by: Sage Moore <sage@neuralmagic.com>
Signed-off-by: Sage Moore <sage@neuralmagic.com>
ilmarkov
approved these changes
Mar 16, 2026
Contributor
ilmarkov
left a comment
There was a problem hiding this comment.
Makes sense. Thank you!
tlrmchlsmth
approved these changes
Mar 18, 2026
fxdawnn
pushed a commit
to fxdawnn/vllm
that referenced
this pull request
Mar 19, 2026
…t#36267) Signed-off-by: Sage Moore <sage@neuralmagic.com> Co-authored-by: Tyler Michael Smith <tyler@neuralmagic.com>
SouthWest7
pushed a commit
to SouthWest7/vllm
that referenced
this pull request
Mar 27, 2026
…t#36267) Signed-off-by: Sage Moore <sage@neuralmagic.com> Co-authored-by: Tyler Michael Smith <tyler@neuralmagic.com>
khairulkabir1661
pushed a commit
to khairulkabir1661/vllm
that referenced
this pull request
Mar 27, 2026
…t#36267) Signed-off-by: Sage Moore <sage@neuralmagic.com> Co-authored-by: Tyler Michael Smith <tyler@neuralmagic.com>
Monishver11
pushed a commit
to Monishver11/vllm
that referenced
this pull request
Mar 27, 2026
…t#36267) Signed-off-by: Sage Moore <sage@neuralmagic.com> Co-authored-by: Tyler Michael Smith <tyler@neuralmagic.com> Signed-off-by: Monishver Chandrasekaran <monishverchandrasekaran@gmail.com>
JiantaoXu
pushed a commit
to JiantaoXu/vllm
that referenced
this pull request
Mar 28, 2026
…t#36267) Signed-off-by: Sage Moore <sage@neuralmagic.com> Co-authored-by: Tyler Michael Smith <tyler@neuralmagic.com>
vrdn-23
pushed a commit
to vrdn-23/vllm
that referenced
this pull request
Mar 30, 2026
…t#36267) Signed-off-by: Sage Moore <sage@neuralmagic.com> Co-authored-by: Tyler Michael Smith <tyler@neuralmagic.com> Signed-off-by: Vinay Damodaran <vrdn@hey.com>
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.
Purpose
On main EPLB rearrange returns 3 maps: physical expert -> logical expert, logical expert -> physical expert, and logical expert -> replica count. The latter two are derivable from the physical expert -> logical expert mapping.
With this change, we only have to keep track of the physical expert -> logical expert map in when running EPLB. Once weight transfer has finished and EPLB is ready to make the changes visible to the model, it will generate the other two maps and write them directly into the model state.
This change deletes a lot of code and reduces the amount of state that EPLB has to maintain when running async. Functionally the only change is "delaying" the creation of the second two maps until after weight transfer has completed when running async. The rest is purely cosmetic.
It also opens the door for post-processing the result of EPLB rearrange without having to re-update all of the maps.
Test Plan
Sync EPLB Server Command
Async EPLB Server Command
Test Result
Sync EPLB
Async EPLB