Repository navigation
[Refactor] Add make_pp_layers so models stop handing their PP position down - #41816
Merged
Merged
Conversation
ch-wan
requested review from
Fridge003,
Jiminator,
fzyzcjy,
ispobock,
kpham-sgl,
merrymercy and
pyc96
as code owners
September 30, 2026 03:07
This was referenced Sep 30, 2026
ch-wan
force-pushed
the
cheng/refactor/models-drop-same-leaf-placement
branch
from
September 30, 2026 04:24
4b8856c to
6b0dfee
Compare
ch-wan
requested review from
Qiaolin-Yu,
Ying1123,
alexnails,
hanming-lu,
hnyls2002,
liusy58,
xiezhq-hermann and
yizhang2077
as code owners
September 30, 2026 04:24
ch-wan
requested review from
1am9trash,
Alisehen,
ByronHsu,
Duyi-Wang,
OrangeRedeng,
ShangmingCai,
YAMY1234,
hebiao064,
hubertlu-tw,
iforgetmyname,
kkHuang-amd,
mickqian,
mmangkad,
ping1jing2,
rainj-me,
sogalin,
whybeyoung,
yeahdongcn,
yhyang201 and
yuan-luo
as code owners
September 30, 2026 04:24
ch-wan
force-pushed
the
cheng/refactor/make-pp-layers
branch
from
September 30, 2026 04:25
ebb248e to
be4156e
Compare
ch-wan
force-pushed
the
cheng/refactor/models-drop-same-leaf-placement
branch
from
September 30, 2026 05:06
6b0dfee to
a5f7cf4
Compare
ch-wan
force-pushed
the
cheng/refactor/make-pp-layers
branch
from
September 30, 2026 05:06
be4156e to
e92827d
Compare
ch-wan
force-pushed
the
cheng/refactor/models-drop-same-leaf-placement
branch
from
September 30, 2026 20:28
a5f7cf4 to
eccd9b9
Compare
Base automatically changed from
cheng/refactor/models-drop-same-leaf-placement
to
main
September 30, 2026 20:28
48 models built their decoder stack with `make_layers(..., pp_rank=self.pp_group.rank_in_group, pp_size=self.pp_group.world_size, ...)` (one spelled it with `get_parallel().pp_group`). Passing the pair both supplies the stage and switches `make_layers` to return `(layers, start_layer, end_layer)`, so it was not a redundant argument as such -- but every caller passed the placement of the scope it was being built in. Add `make_pp_layers(num_hidden_layers, layer_fn, prefix, ...)`, which reads the stage from `get_parallel()` and returns the tuple, and use it at all 48 sites. Models are constructed inside the scope that states their placement (a draft inside its pipeline scope), where `get_parallel()` answers the same stage as `self.pp_group`. A unit test checks that each stage builds its own slice from the published placement, and that a single-stage scope builds every layer.
ch-wan
force-pushed
the
cheng/refactor/make-pp-layers
branch
from
September 30, 2026 20:28
e92827d to
cf8b583
Compare
3 of 5 tasks
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.
This PR is part of a stack (oldest at bottom):
Motivation
48 models build their decoder stack with
make_layers(..., pp_rank=self.pp_group.rank_in_group, pp_size=self.pp_group.world_size, ...); one spells it withget_parallel().pp_group. Passing the pair both supplies the stage and switchesmake_layersto return(layers, start_layer, end_layer), so it is not redundant as such. But every caller passes the placement of the scope it is being built in.Modifications
make_pp_layers(num_hidden_layers, layer_fn, prefix, ...), which reads the stage fromget_parallel()and returns the tuple, and use it at all 48 sites.get_parallel()answers the same stage asself.pp_group.test_make_pp_layers.py: each stage builds its own slice from the published placement, and a single-stage scope builds every layer.Accuracy Tests
H200:
--tp-size 2and--pp-size 2: greedy output identical with and without this PR and the two before it.upstage/solar-pro-preview-instruct,--tp-size 2 --pp-size 2: greedy output identical to the Solar TP2 run earlier in this stack; GSM8K (200 questions) 0.900.test/registered/unitat this PR's head, compared withmain: no new failures.Speed Tests and Profiling
Not applicable.
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): 🚫 Run #36772881908
Latest PR Test (Extra): 🚫 Run #36772880959
Latest PR Test (AMD ROCm 10): ❌ Run #36772881796