Repository navigation
feat: by-handle payload fields table (TRR weights, score-centering logprobs) - #3904
Closed
faresobeid wants to merge 1 commit into
Closed
faresobeid wants to merge 1 commit into
faresobeid wants to merge 1 commit into
Conversation
This was referenced Oct 6, 2026
faresobeid
force-pushed
the
feat/payload-by-handle
branch
from
October 6, 2026 14:53
a4a98c5 to
0d8d29a
Compare
faresobeid
force-pushed
the
feat/payload-fields
branch
from
October 6, 2026 14:53
92de07d to
84ec215
Compare
faresobeid
force-pushed
the
feat/payload-by-handle
branch
from
October 6, 2026 17:29
0d8d29a to
1ed3731
Compare
faresobeid
force-pushed
the
feat/payload-fields
branch
2 times, most recently
from
October 7, 2026 00:39
a1eeaea to
36b8e7f
Compare
faresobeid
force-pushed
the
feat/payload-by-handle
branch
2 times, most recently
from
October 7, 2026 12:43
9b43ad3 to
8e3e321
Compare
faresobeid
force-pushed
the
feat/payload-fields
branch
from
October 7, 2026 12:43
36b8e7f to
b284c19
Compare
faresobeid
force-pushed
the
feat/payload-by-handle
branch
from
October 7, 2026 13:59
8e3e321 to
4f6d3c1
Compare
faresobeid
force-pushed
the
feat/payload-fields
branch
from
October 7, 2026 13:59
b284c19 to
230c022
Compare
faresobeid
force-pushed
the
feat/payload-by-handle
branch
from
October 8, 2026 14:40
4f6d3c1 to
47d764e
Compare
faresobeid
force-pushed
the
feat/payload-fields
branch
from
October 8, 2026 14:40
230c022 to
223a784
Compare
faresobeid
force-pushed
the
feat/payload-fields
branch
from
October 8, 2026 19:16
223a784 to
be77a0e
Compare
faresobeid
force-pushed
the
feat/payload-by-handle
branch
from
October 8, 2026 19:16
47d764e to
968669e
Compare
faresobeid
force-pushed
the
feat/payload-fields
branch
from
October 9, 2026 23:48
be77a0e to
aae02ad
Compare
faresobeid
force-pushed
the
feat/payload-by-handle
branch
2 times, most recently
from
October 10, 2026 04:00
5baf380 to
fcfb7f9
Compare
faresobeid
force-pushed
the
feat/payload-fields
branch
from
October 10, 2026 04:00
aae02ad to
75760d8
Compare
faresobeid
force-pushed
the
feat/payload-fields
branch
from
October 10, 2026 15:11
75760d8 to
fb41a04
Compare
faresobeid
changed the base branch from
feat/payload-by-handle
to
feat/payload-segments
October 10, 2026 15:11
faresobeid
force-pushed
the
feat/payload-segments
branch
from
October 10, 2026 15:21
123233f to
a0690a6
Compare
faresobeid
force-pushed
the
feat/payload-fields
branch
3 times, most recently
from
October 10, 2026 16:56
dd7f155 to
9be553c
Compare
…gprobs) PAYLOAD_FIELDS declares each by-handle field once with its fill value and read window: routed_experts and routed_expert_weights (input positions, CP chunk), sampling_mask (label positions), sampling_mask_logprobs (whole sequence, consumed after the CP gather). The writer, packing, truncation, dummy batches and the trainer reader go through the table, so a new field is one line plus its writer. Ragged fields (sampling_mask, sampling_mask_logprobs) are marked in the table and stored as CSR, int32 values for an int fill and float32 for a float fill.
faresobeid
force-pushed
the
feat/payload-fields
branch
from
October 11, 2026 15:41
9be553c to
24d6884
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 #3902 (by-handle payloads). Parked: only needed for TRR / score centering by handle. Not for review now.
What
Each by-handle per-token field is one line in
PAYLOAD_FIELDS(transports/payload.py), so Total Router Recall weights and score-centering mask logprobs can travel by handle when those features come back, with no further reader or packing changes:Each entry gives the fill value and the window a trainer rank reads on text micro batches: its CP chunk of inputs (routing), its CP chunk shifted onto labels (masks), or the whole sequence at the tokens' own positions (values the loss reads after the CP gather). Multimodal micro batches read every field whole, as before.
PayloadField.raggedmarkssampling_maskandsampling_mask_logprobs. feat: pass router-replay ids and sampling masks by handle on multi-node runs #3902 stores masks as CSR; this generalizes that layout to any ragged field (int32 values for an int fill, float32 for a float fill).read_field/data._read_payload, called fromprepare_micro_batch): dtype-aware (float fields as float32, int fields as int32) and window-driven. Each tensor comes back under theTensorMicroBatchkey of the same name and replaces only that inline field.trajectories._sample_payloadapply to everyinputsfield; dummy batches keep onlyinputsfields;prepare_sample's cut-out placeholder covers every non-inputsfield.When the features come back
(ids, logprobs)from the mask in_PackedOutputs. The by-handle writer then adds one line next to the mask:sampling_mask_logprobsover the whole sequence; positions without logprobs are-inf(the inline path uses -9999; both give zero centering weight).routed_expert_weightsnext to uint8 ids (5 B per layer and top-k slot instead of 8 B for int32[ids | weight bits]), and concatenate them back into the layoutMoE.forwardexpects after the read. Under P/D the router would stitch this field likerouted_experts.Tests
test_payload_by_handle_matches_inlinenow also covers routing weights (against TRR's inline int32[ids | weight bits]layout) and CSR mask logprobs (whole-sequence window), with CP 1 and 2.test_inline_and_by_handle_samples_keep_their_masks(from feat: pass router-replay ids and sampling masks by handle on multi-node runs #3902) still passes on the table-driven reader.pytest -m "not gpu" tests/unit/orchestrator tests/unit/test_configs.py tests/unit/inference tests/unit/train tests/unit/utilswith feat: pass router-replay ids and sampling masks by handle on multi-node runs #3902's pinned verifiers/renderers on the path: 586 passed.ruff check,ruff format --check: clean.