Add DP-balanced sequence-packing scheduler and integrate it into GPT pretraining - #6679
Closed
ilml wants to merge 4 commits into
Closed
Add DP-balanced sequence-packing scheduler and integrate it into GPT pretraining#6679ilml wants to merge 4 commits into
ilml wants to merge 4 commits into
Conversation
Split 2/10 from NVIDIA#3386 (sequence packing / THD E2E support). Adds the sequence_packing_scheduler knob to ModelParallelConfig, its TransformerConfig validation (TE>=2.9 pin, variable_seq_lengths, alltoall dispatcher), the explicit CLI args, and validate_args checks. Feature-flagged no-op until the scheduler lands. Original changes by @xiaoyao0115 in NVIDIA#3386. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: ilml <tolong@nvidia.com>
…ry point Split 5/10 from NVIDIA#3386 (sequence packing / THD E2E support). Adds BasePackingScheduler, DpBalancedScheduler, PackingSchedulerEnum, the wrap_data_iterator entry point, docs, and the wrap_dataloader unit tests. Original changes by @xiaoyao0115 in NVIDIA#3386. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: ilml <tolong@nvidia.com>
Split 6/10 from NVIDIA#3386 (sequence packing / THD E2E support). Adds MockSFTDataset/MockSFTLowLevelDataset with file- and distribution-mode sequence-length configs, the load_json_arg helper, the --sft-mock-dataset-config-json arg with lognormal default, and generalizes the SFT padding divisor beyond cp>1. Original changes by @xiaoyao0115 in NVIDIA#3386. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: ilml <tolong@nvidia.com>
…aining Split 7/10 from NVIDIA#3386 (sequence packing / THD E2E support). Wires wrap_data_iterator into train_step/evaluate with dynamic num_microbatches, adds global seqlen-stats plumbing for FLOPs accounting, gates the HybridCP sampler, and restructures pretrain_gpt.forward_step for packed (THD) batches with padding mask. Original changes by @xiaoyao0115 in NVIDIA#3386. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: ilml <tolong@nvidia.com>
2 tasks
Contributor
Author
|
/ok to test 65727ed |
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.
What does this PR do?
Adds the DP-balanced sequence-packing scheduler for dynamic context parallelism and integrates it into the training loop and GPT pretraining. Part of the #3386 split series tracked in the Dynamic Context Parallelism project. Original changes by @xiaoyao0115 in #3386.
This consolidates three former layers of the series (their PRs #6626/#6627/#6628 were closed by a base-branch mishap; nothing from them landed):
wrap_data_iteratorentry point (megatron/core/datasets/data_schedule.py)train_step/evaluateandpretrain_gpt.pyContribution process