Repository navigation
feat(pd): stitch routed_expert_weights payload segments like routed_experts - #62
Draft
faresobeid wants to merge 4 commits into
Draft
faresobeid wants to merge 4 commits into
faresobeid wants to merge 4 commits into
Conversation
faresobeid
force-pushed
the
feat/pd-merge-payload-segments
branch
from
October 6, 2026 17:24
629e72d to
7d22041
Compare
…perts STITCHED_FIELDS lists the by-handle fields the forward pass produces for every position (routed_experts and Total Router Recall's routed_expert_weights). Each is stitched from prefill + decode with its own prefill cut; sampling masks and their logprobs stay decode-only and pass through.
faresobeid
force-pushed
the
feat/pd-merge-payload-fields
branch
from
October 10, 2026 19:10
4c87216 to
0dc7ac3
Compare
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.
Stacked on #60. Draft, parked. No prime-rl producer yet: a future TRR fields PR would write
routed_expert_weightssegments (PrimeIntellect-ai/prime-rl#3904 is closed).STITCHED_FIELDS = ["routed_experts", "routed_expert_weights"]lists the payload fields that the forward pass produces for every position. Each is stitched separately: the prefill segments come first, then the decode segments clipped at that field's own prefill coverage end. Row bytes are dtype-aware: uint8/uint16 ids, float32 weights (float32is added todtype_itemsizehere). Every other field (sampling_mask,sampling_mask_logprobs) comes from decode only and passes through. A decode stitched field with no prefill counterpart is an error, as before.Checks:
cargo fmt --check,cargo clippy --lib --tests -D warnings,cargo test --lib. I extended the existing merge test with weights and logprobs.Note
Stitch
routed_expert_weightssegments alongsiderouted_expertsin HTTP routerSTITCHED_FIELDSset withrouted_expertsandrouted_expert_weightsin routed_experts_merge.rs, so payload segments for both fields are collected and stitchedmerge_routed_payload_in_jsonnow tracks prefill coverage per field in aHashMapand clips each decode segment against its own field's prefill endpoint. Non-stitched fields like sampling masks pass through unchangedrouted_expert_weightspayloads that previously passed through now fail with an error instead of being silently unmergedMacroscope summarized 4c87216. (Automatic summaries will resume when PR exits draft mode or review begins).