[DO NOT MERGE][dev] moe(perf): Fuse pre-gated delta net ops.#4842
Draft
yuzhongw-nvidia wants to merge 10 commits into
Draft
[DO NOT MERGE][dev] moe(perf): Fuse pre-gated delta net ops.#4842yuzhongw-nvidia wants to merge 10 commits into
yuzhongw-nvidia wants to merge 10 commits into
Conversation
f8fb53d to
5b54bc1
Compare
e11dc9e to
f30e6dc
Compare
Replace the placeholder with the all-in-one ("mega") pre-GDR path:
- Forward: a single Triton launch over a flat logical task space
(QK conv+silu+l2norm+repeat, V conv+silu, Z copy, g/beta), supporting
dense BSHD and packed THD. Replaces the streamed path's four launches.
- Backward: one fused branch kernel (QK l2norm/repeat, V layout, Z layout,
g/beta chain rule; per-head d_A_log/d_dt_bias via atomics) plus the
external causal_conv1d backward for conv input/weight gradients. Two
launches, down from five.
Outputs and saved tensors match the streamed path bit-for-bit, so the
public (query, key, value, gate, beta, g) contract and parity are preserved.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The pre_gated_delta_rule_impl selector is already exposed as a CLI arg by ArgumentGroupFactory(TransformerConfig), which auto-derives --pre-gated-delta-rule-impl from the dataclass field. Registering it manually raised an argparse "conflicting option string" error at parse time, so only a clarifying comment is kept. Recipes / passthrough can set the impl via the auto-generated arg. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
f30e6dc to
05bd2da
Compare
71 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.
What does this PR do ?
Issue tracking
For PRs from open-source community contributors:
Linked issue:
Contribution process
Pre-checks
Code review
Feel free to message or comment the @mcore-oncall to help accelerate your merge into main. The less complex your PR is, the faster it will be approved and merged!
All PRs start as draft. If you open a non-draft PR, it will be automatically converted to draft.
Step 1: Mark PR as "Ready for Review"
.github/CODEOWNERS.Final Review might get declined if these requirements are not fulfilled.
Step 2: Final Review
For PRs that change
megatron/core, once all expert reviewers have approved, theFinal Reviewlabel is applied automatically and final reviewers are assigned.For PRs outside
megatron/core, this step is skipped.Step 3: Approved
Once all required reviewers have approved, the
Approvedlabel is applied automatically.Merge
Any member of mcore-engineers will be able to merge your PR.
For MRs into `dev` branch
The proposed review process for `dev` branch is under active discussion.MRs are mergable after one approval by either
eharper@nvidia.comorzijiey@nvidia.com.