Repository navigation
Bound PLE backward workspace by chunking token reductions - #213
Open
yuchenwang3 wants to merge 1 commit into
Open
yuchenwang3 wants to merge 1 commit into
yuchenwang3 wants to merge 1 commit into
Conversation
Signed-off-by: Yuchen Wang <93700456+yuchenwang3@users.noreply.github.com>
yuchenwang3
marked this pull request as ready for review
October 3, 2026 20:27
Contributor
Author
|
@hjh0119 Could you review the PLE backward chunking? The GPU run passes all 22 tests, including Torch-reference forward/backward checks. CP/TP and a full 256K training run are still untested. |
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.
PLE backward still allocates whole-sequence FP32 buffers for norm-weight reduction and gate-gradient partials. At 262,144 tokens and width 10,240, each
[T, W]FP32 buffer takes 10 GiB.This accumulates norm-weight and gate-weight gradients in token chunks, with a 64 MiB budget for the three gate partial buffers. It also reuses the consumed norm-output gradient buffer for norm backward. Required input/output gradients and saved activations still scale with the sequence length. Chunked weight reductions change the floating-point summation order, so gradient comparisons use tolerances.
Validation:
pre-commit run --all-filespassed.[1024, 10240]inputs. BF16 tolerances wereatol=0.002, rtol=0.01; this is tolerance-based gradient agreement, not bitwise equality.[4096, 512]norm-weight reduction's additional allocated-memory peak fell from 33,559,040 to 90,112 bytes. This measures that helper's workspace, not total model memory or the default-budget saving.[262144, 10240]. Those exercise individual kernels, not the complete chunked autograd path or a 256K training step.Implementation and tests were generated with OpenAI Codex.