Price TP4 sequence-parallel boundary shards in the checkpoint floor - #988
Merged
Merged
Conversation
At TP>1 the full-recompute checkpoint floor declined, so a cold TP4 sequence-parallel wave was priced only by the static per-token floor. That floor covers the saved boundaries but not the recomputed layer's workspace. In two dense Qwen3.8-27B runs the first 25,728-row wave admitted 4.64 GB and peaked at 7.06 GB on every rank. A trace of that exact wave reproduces it (7.13 GB) and puts the rest of the peak in the recomputed layer's transient workspace over the gathered rows. Apply the floor at TP4 with sequence parallelism: each rank saves ceil(rows/TP) rows per boundary, and the repeated boundaries (the input-gradient term) cover that workspace. The floor is limited to dense models at CP1/PP1 with full/uniform/1 recompute that are deep enough for this cover at their widths. Other shapes keep today's pricing. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
bradhilton
deployed
to
trainer-rank-gpu-validation
September 26, 2026 11:56 — with
GitHub Actions
Active
Round-1 review closures: - The recomputed GDN layer's recurrent states grow with segments, not rows. The floor now prices them from the plan's gradient segments. - Fewer KV groups than TP keep a replicated global QKV on every rank, so those configurations keep today's pricing. So do models with unreadable attention or GDN widths. - The bound uses the SwiGLU live set when it is wider than the FC1 stage, and prices other workspace (the trace's TE and residual allocations) at H per gathered row instead of relying on slack. - The test fixture's rank is typed Any so it can stub the topology. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
bradhilton
had a problem deploying
to
trainer-rank-gpu-validation
September 26, 2026 12:22 — with
GitHub Actions
Failure
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
bradhilton
had a problem deploying
to
trainer-rank-gpu-validation
September 26, 2026 12:32 — with
GitHub Actions
Failure
Round-2 review closures: - TP padding gives each pad token its own GDN root. The floor now adds up to TP - 1 padding roots per gradient group to the segment count. - Segment states are charged only for gradient waves, so no-grad pricing is unchanged. - Width probing counted every active request, no-grad included, and priced exact layouts with that bound. _estimate_flat_forward now reports gradient groups' segments: twice their requests in cheap mode (still an upper bound for accepting a width) and the selected layouts' actual counts in exact mode, matching the materialized plan. - Tests exercise conv history and pin the per-segment charge exactly. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
bradhilton
had a problem deploying
to
trainer-rank-gpu-validation
September 26, 2026 12:58 — with
GitHub Actions
Failure
The memory-minimal cheap estimate decides rejection, but it carried the no-sharing upper bound on GDN segments (twice the requests), so exact pricing never ran for many-segment widths. It now reports at least one segment per gradient group, like its full-sharing token count. The no-sharing estimate keeps the upper bound for acceptance, and exact pricing keeps actual counts. The TP4 floor also requires the GDN conv kernel width, which prices each segment's conv history. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
bradhilton
deployed
to
trainer-rank-gpu-validation
September 26, 2026 13:19 — with
GitHub Actions
Active
bradhilton
marked this pull request as ready for review
September 26, 2026 15:46
bradhilton
had a problem deploying
to
trainer-rank-gpu-validation
September 26, 2026 15:46 — with
GitHub Actions
Failure
This branch had an error being 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.
At TP>1 the full-recompute checkpoint floor returns nothing, so a cold wave on a TP4 sequence-parallel model is priced only by the static per-token floor. That floor covers the saved layer boundaries but not the recomputed layer's workspace, until a memory profile is learned.
In two 062 SFT runs on dense Qwen3.8-27B at TP4, the first 25,728-row wave admitted 4.64 GB (4.22 GB raw) and peaked at 7.06 GB on all four ranks: +67.5% raw, +52.3% admitted. That was one wave per run, replicated across the TP ranks. It didn't OOM because about 77 GB was free. Later, profiled waves were covered.
Trace. A random-init trace of that exact wave on four H200s reproduces it: 4.637 GB admitted, 7.13 GB peak on every rank (+69.2% raw, +53.8% admitted). At the peak:
Change.
Scope. Only where that cover is justified by the traced decomposition:
TP2, TP8, TP with CP, MoE, and shallower or wider models keep today's pricing; this trace doesn't establish their coverage. No-grad waves at TP4 are priced as before.
Before/after (the traced wave):
The floor is also a minimum for profiled waves and for each child of a split plan, as main already does at TP1; cold split plans sum their children's floors. So qualifying TP4 gradient waves roughly double their cold static floor, and steady-state packing gets about 16% more conservative here.
Testing: 22 new CPU tests:
Each gate condition was mutation-tested. The trainer-rank suite passes.
🤖 Generated with Claude Code