Repository navigation
perf(sft): add a direct path for Megatron-LM prepacked inputs - #3380
Merged
terrykong merged 74 commits intoOct 8, 2026
Merged
Conversation
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
Signed-off-by: sna <[email protected]>
…ked-metrics-latest-main-200step-20260727
Signed-off-by: sna <[email protected]>
Contributor
Author
|
/ok to test65f132f |
Contributor
Author
|
/ok to test 2510b16 |
Preserve direct MLM and Energon packed input paths, use the shared FP8 alignment helper, and fix pad-token type narrowing reported by CI. Signed-off-by: seonjinn <[email protected]>
Contributor
Author
|
/ok to test 5ccc1fb |
…fresh-pr3380-vllm029-20260930
Signed-off-by: seonjinn <[email protected]>
Signed-off-by: seonjinn <[email protected]>
Contributor
Author
|
/ok to test 6d46c64 |
terrykong
reviewed
Oct 6, 2026
Signed-off-by: seonjinn <[email protected]>
terrykong
previously approved these changes
Oct 6, 2026
Collaborator
|
/ok to test 28de69d |
Signed-off-by: seonjinn <[email protected]>
Contributor
Author
|
/ok to test e0e612a |
Collaborator
|
@seonjinn looks like some test failures that need to be resolved |
Signed-off-by: seonjinn <[email protected]>
Contributor
Author
|
/ok to test 48d776e |
Contributor
Author
|
@terrykong addressed issues and launched ci again |
Signed-off-by: seonjinn <[email protected]>
Signed-off-by: seonjinn <[email protected]>
Contributor
Author
|
/ok to test 76aafa8 |
Signed-off-by: seonjinn <[email protected]>
Contributor
Author
|
/ok to test 641cac7 |
terrykong
approved these changes
Oct 8, 2026
3 of 5 tasks
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.
Summary
Adds an opt-in Megatron-only
megatron_sft_packedpath for SFT.Each JSONL row is packed offline and passed directly to MCore, preserving conversation boundaries, labels, loss masks, positions, and
cu_seqlens. Existing SFT datasets are unchanged.Requirements:
sft.only_unmask_final: falsepolicy.sequence_packing.enabled: truewhen context parallelism is greater than 1See
docs/guides/sft.mdfor the dataset format and configuration.Performance
Latest full-scale validation (
ed4d5342, 64 nodes / 512 H100, steady-state steps 3–20):The run used the same packed data, row schedule, topology, and performance-critical settings as the preserved Megatron-LM reference. It was not a new same-container rerun.
Loss comparison remained finite and closely aligned:
0.0017220.003830W&B performance report
Validation
77bd36c8includes the latestmain(a43d71b3) and follow-up compatibility/documentation fixes.