Add a backwards linear function to be used with the fused mla q up-proj - #3330
Open
chaseblock wants to merge 13 commits into
Open
Add a backwards linear function to be used with the fused mla q up-proj#3330chaseblock wants to merge 13 commits into
chaseblock wants to merge 13 commits into
Conversation
Signed-off-by: Chase Block <cblock@nvidia.com>
chaseblock
added a commit
to chaseblock/Megatron-LM
that referenced
this pull request
Aug 7, 2026
Requires TE PR: NVIDIA/TransformerEngine#3330 Signed-off-by: Chase Block <cblock@nvidia.com>
for more information, see https://pre-commit.ci
Contributor
Greptile SummaryThe PR adds an autograd-enabled backward path for the fused MLA Q up-projection and exports the new function through the PyTorch attention APIs.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Reviews (10): Last reviewed commit: "[pre-commit.ci] auto fixes from pre-comm..." | Re-trigger Greptile |
Signed-off-by: Chase Block <cblock@nvidia.com>
Signed-off-by: Chase Block <cblock@nvidia.com>
cyanguwa
requested review from
sudhakarsingh27
and removed request for
cyanguwa and
ksivaman
August 10, 2026 21:58
Signed-off-by: Chase Block <cblock@nvidia.com>
for more information, see https://pre-commit.ci
Port the RoPE and projection backward needed by the fused Q up-projection path. Keep the one-use Triton kernel colocated and optional, and request both gradients because this temporary wrapper returns both. Cover the real MXFP8 autograd path so dgrad and wgrad are verified end to end. Signed-off-by: Sudhakar Singh <sudhakars@nvidia.com>
Signed-off-by: Chase Block <cblock@nvidia.com>
Member
|
/te-ci pytorch L0 |
Record the source of the copied Triton RoPE helpers in the module docstring so their Megatron-LM origin remains clear as the TE implementation evolves. Signed-off-by: Sudhakar Singh <sudhakars@nvidia.com>
This especially focuses on fixing up the backward correctness test for the Q UpProj + Rope + Quant fusion path. Signed-off-by: Chase Block <cblock@nvidia.com>
for more information, see https://pre-commit.ci
I don't think this test was actually flagging something that matters, since it was comparing against a pytorch reference that does not actually reflect the alternative, unfused path that we should be comparing against. Signed-off-by: Chase Block <cblock@nvidia.com>
for more information, see https://pre-commit.ci
Contributor
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
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.
Description
Please include a brief summary of the changes, relevant motivation and context.
Fixes # (issue)
Type of change
Changes
Please list the changes introduced in this PR:
Checklist: