Repository navigation
Feat: pack the residue columns of the ep_pp_dp packing into two-segment pairs - #1764
Merged
majieyue merged 1 commit intoNov 17, 2026
Conversation
majieyue
requested review from
BalaBalaYi,
bikemechanic,
duck7216,
samplise,
way-zer and
workingloong
as code owners
November 16, 2026 18:04
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1764 +/- ##
==========================================
- Coverage 82.30% 82.27% -0.03%
==========================================
Files 255 255
Lines 25435 25439 +4
==========================================
- Hits 20935 20931 -4
- Misses 4500 4508 +8 ☔ View full report in Codecov by Harness. |
…nt pairs The ep_pp_dp greedy took residue slots from the largest-remaining psw group first, which drifted the last leftover columns into a psw mix of 3+ segments (e.g. the ling-max job showed [SG3|SG5|SG8] in one PP column). Residue sizes cannot always own a whole column, so accumulate each residue column from the SMALLEST remaining group (exact fit preferred) instead: every fragment group is then spent inside at most two columns and the residue columns stay strictly two-segment whenever the sizes allow it. For 9 psws x 8 residue slots (pp=12, ep_workers=4) this packs the residues into 6 [4|8] columns (6 PP boundaries) instead of 5 mixed columns + 1 three-segment column (7 boundaries); the pure columns, the EP-slot straddle handling and the crumb fill are unchanged. Co-Authored-By: Claude <noreply@anthropic.com>
majieyue
force-pushed
the
feat/rerank-two-way-mixed-columns
branch
from
November 16, 2026 18:40
ba07293 to
bd79547
Compare
samplise
approved these changes
Nov 17, 2026
majieyue
merged commit Nov 17, 2026
a177312
into
intelligent-machine-learning:master
12 checks passed
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.
Motivation
The
ep_pp_dptopology-rerank packing fills each PP column with thelargest-remaining psw group first. That works well while groups can own
whole columns, but once every group holds fewer than
ppslots thegreedy starts a column from the big fragment and then chips the 4-slot
piece off the NEXT group that still has slots — which leaves the last
residue columns with no 8-slot pairing partner and forces an avoidable
THREE-segment column.
Assuming case (9 psws x 128 nodes, pp=12,
ep_workers=4, N=1152): 18 pure columns consume 24 slots of every psw,
leaving 9 x 8 residue slots to fill exactly 6 residue columns. The
online rerank logged one mixed column as
{SG3: 4, SG5: 4, SG8: 4}(three psw groups in one PP column → 2 extrastage boundaries), while the residue profile admits a strictly two-way
packing: 6 columns of [8+4] — 6 groups exhaust themselves as the 8-slot
half and 3 groups are spent as a 4-slot "double-small" half in each of
two adjacent columns.
Changes
_ep_pp_dp_group_sequence(master/elastic_training/topology_rerank.py),residue column filling only — whole (pure) columns, the EP-slot straddle
accounting and the crumb fill are untouched.
column still needs): unchanged — it owns the column alone.
group, preferring an exact fit for what the column still needs (ties
by the smallest group id). Every fragment group is consumed inside at
most two columns, so residue columns stay strictly two-segment
whenever such a packing exists; otherwise the loop degrades to the
plain smallest-first accumulation that still terminates with a valid
(best-effort) layout.
Each take provably consumes ≥1 slot: the smallest-first selection is
made over groups with
remaining > 0only (the oldmax(...)neverpicked an empty group, but carrying that generic choice into the
residue phase would loop when it selects a drained key).
Layout effect (backtest on the ling-max shape)
Per-pipeline-stage DP composition also becomes smoother: every psw
contributes a steady 2-3 slots to each stage row instead of the old
3/3/2/3/3/... uneven counts.
EP behavior is unchanged: every EP slot stays inside one psw group
(0/288 and 0/72 straddles in all ideal layouts, before and after).
Tests
test_topology_rerank.py: the 26 pre-existing sequence-level pins arebyte-for-byte unchanged (pure columns, crumb fill, straddle
reporting, creation-order invariants); the new regression test
test_ep_pp_dp_residues_pack_into_two_segment_columnslocks theling-max shape: every EP slot intra-group, every column ≤2 segments,
exactly 6 mixed columns and exactly 6 crossing boundaries.
test_node_group_strategy/test_job_manager/test_soft_group/test_pod_scalerall at baseline.