Repository navigation
Preserve per-call expert routing on shared prompt prefixes - #3326
Draft
KyleWong288 wants to merge 2 commits into
Draft
KyleWong288 wants to merge 2 commits into
KyleWong288 wants to merge 2 commits into
Conversation
This branch has not been deployed
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.
When vLLM recomputes part of a shared prompt, two responses can see the same token IDs but yield different MoE routed experts. When paired with R3, the trainer may accidentally use the wrong routed experts.
The fix yields a 62% reduction in mismatch_kl on a 25M token test.
The trainer consumes these routing histories in Prime-RL #4904.
Note
Preserve per-call expert routing on shared prompt prefixes
routing_overrideplusrouting_offset(see_record_prefix_routesand_attribute_routed_expertsin graph.py).TrainClient.get_responsein train.py now always requests routed-expert history from offset zero, andresponse_from_generaterejects payloads that do not start at zero or do not cover the full call.Branch.routed_experts,Branch.node_routed_experts, andBranch.routing_segmentsin trace.py expose the combined branch routes, first-producer routes, and routing segments.routing_overrideandrouting_offsetare treated as training-array fields in delta.py and excluded from disk serialization.Macroscope summarized 45be0c4. (Automatic summaries will resume when PR exits draft mode or review begins).