Add VarlenDataset family and wire it into GPT pretraining - #6680
Closed
ilml wants to merge 6 commits into
Closed
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>
Split 9/10 from NVIDIA#3386 (sequence packing / THD E2E support). Adds the variable-length packed (THD) dataset family: HF-hub/parquet/jsonl loading, THD __getitem__ with cu_seqlens, SBHD validation mode, and the mock variant, with unit tests. Also adds hybrid_context_parallel=False to the _make_config test helper (deviation from NVIDIA#3386: fixes a latent AttributeError in _calculate_padding_divisor with SimpleNamespace configs). Original changes by @xiaoyao0115 in NVIDIA#3386. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: ilml <tolong@nvidia.com>
…vider Split 10/10 from NVIDIA#3386 (sequence packing / THD E2E support). Adds --use-varlen-dataset / --varlen-sbhd-validation / --varlen-mock-dataset-config-json, their validation (auto-selecting the dp_balanced scheduler), the dataset-provider wiring in pretrain_gpt, and the remaining dataloader/unpack 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>
Contributor
Author
|
/ok to test cd0a019 |
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 varlen dataset family (
VarlenLowLevelDataset,VarlenDataset,MockVarlenDataset) and wires it into the pretraining CLI, dataloader, and dataset provider. Final PR of the #3386 split series tracked in the Dynamic Context Parallelism project. Original changes by @xiaoyao0115 in #3386. Replaces closed #6629/#6630.VarlenLowLevelDataset,VarlenDataset,MockVarlenDataset(megatron/training/datasets/varlen_dataset.py) + unit tests--use-varlen-datasetCLI, dataloader/provider wiring inpretrain_gpt.py, arg validationOnce #6679 merges, this branch gets rebased and the Files-changed diff collapses to exactly those two commits (~+907/−7).
Contribution process