Repository navigation
Fix Beam 256k padding for variable-length batches - #765
Merged
Merged
Conversation
|
Documentation preview: https://modal-labs-training-gym--training-gym-previews-preview-r-78da35.modal.run/765/docs |
Andrew Hinh (andrewhinh)
approved these changes
Oct 28, 2026
zhouhelena1
marked this pull request as ready for review
October 28, 2026 01:58
This branch was successfully 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.
The default batch-256 validation of #762 generated all 256 responses but failed before training in Miles
fill_replay_data:assert seqlen % tp_size == 0. With TP8/CP2, padding to eight global tokens can leave a CP-local sequence that is not divisible by eight.Set the 256k preset's padding multiplier to two so global lengths align to 16 tokens. The observed maximum sample length of 33,013 now pads to 33,024 instead of 33,016; the extra tokens are masked. Keeps upstream's 32 prompts × 8 completions (global batch 256).
Follow-up #766 adds effective-config alignment validation and native Beam LoRA resume with complete-checkpoint checks. Its GPU save/restart proof passed; it is a separate follow-up PR. These guards are separate from this merged padding fix.
Validation:
Autoconfig: Beam 256k DAPO-math