Add Llama 3 Megatron model support - #783
Draft
FurtherAI wants to merge 15 commits into
Draft
Conversation
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
Implementation
The Llama-specific production surface is a 21-line handler plus registry entries. Generic changes repair or improve existing shared paths:
The FlexAttention change preserves the existing compile configuration and invokes PyTorch's same higher-order operator after ART validation. It removes exact sequence-length guards introduced by the public Python wrapper, which previously caused workload-dependent late graph specialization.
Validation
Model:
meta-llama/Llama-3.2-1B-Instruct(full 16-layer, 1.241B-parameter checkpoint where applicable).0.005352%, loss0.002253%, worst gradient0.042681%mean absolute percentage error0.000840%RL and0.000800%SFT0.010725%2.428707%mean absolute percentage error and0.001223025top-20 KL over 128 tokens and eight depth-3 branch views, under unchanged4%/0.002gates0.75, under the fixed1.5threshold888.745 tok/s, with zero late Dynamo graphs or Inductor kernelsty, lock, and diff checks passScope
The branch is rebased onto
mainat93f3832a. It adds 335 lines and removes 112 lines across 18 files. Model-specific behavior stays in the handler and registry; generic changes have no Llama conditionals.