Conversation
Signed-off-by: Kai Xu <kaix@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
Contributor
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2497 +/- ##
==========================================
- Coverage 71.14% 70.50% -0.65%
==========================================
Files 603 610 +7
Lines 66739 68036 +1297
==========================================
+ Hits 47482 47969 +487
- Misses 19257 20067 +810
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: Kai Xu <kaix@nvidia.com>
This was referenced Sep 22, 2026
kaix-nv
added this pull request to stack #2510
September 22, 2026 21:27
kaix-nv
removed this pull request from stack #2510
September 23, 2026 01:07
kaix-nv
added this pull request to stack #2520
September 23, 2026 01:07
kaix-nv
removed this pull request from stack #2520
September 23, 2026 01:08
kaix-nv
added this pull request to stack #2521
September 23, 2026 01:22
This branch has not been deployed
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?
Type of change: new feature
ModelOpt needs to emulate recurrent-state and WY-activation rounding inside GatedDeltaNet training, where projection quantization does not expose those numerical boundaries. This draft adds dynamic FP8 E4M3 fake QDQ at the state and W sites, with identity straight-through gradients, plus differentiable GDN/KDA references for numerical validation.
This is the M0/M1 implementation slice: GDN state/W QDQ in Megatron's chunked training path. KDA has a recurrent reference only. Additional prefill operand sites, approximate inverse, KDA training/decay approximation, and decode/SSM replay remain subsequent work. The triangular solve stays exact. No compressed state storage, native FP8 matmul speedup, or model-quality recovery is claimed.
The implementation adapts #2455 at
13c7e2456f2e9d079c9ef822742eeaa634353802with these contracts:fla-core==0.5.1, chunk size 64, dynamic E4M3, and identity STE. Unsupported formats, clipping-aware backward, and context parallelism are rejected. Forward's quantized W is saved for backward, avoiding a second quantizer invocation at the cost of one saved W activation.linear_attentionexecution policy with complete last-match precedence, capability checks, and persistence of resolved state-scale grouping through conversion, calibration, and checkpoints.tilelang==0.1.8andapache-tvm-ffi==0.1.9. FLA disables its gated Triton backward there; its TileLang fallback requires equal head counts. Q/K expansion outside custom autograd preserves grouped-head gradients, with temporary activation-storage overhead. FP32 is rejected before launch.Usage
After constructing a supported Megatron GatedDeltaNet model:
Dynamic scales require no calibration. State QDQ requires SM89 or newer; W-only QDQ is tested on SM86. The selector must match actual GDN module names. See
docs/linear_attention_qat.mdfor the numerical contract and recipe composition.Testing
Validation uses the branch based on
051d6adb204f10cd3e78d0f824f31a5a01d54831.tests/unit/recipe/test_presets.py).fladeliberately unavailable via an import blocker.git diff --check: passed.Checkpoint qualification is limited to unchanged TP topology with PP=1. Pipeline parallelism and resharding across topology changes remain unqualified. Dynamic-batching inference and model-quality/QAT-recovery evaluation are outside this draft's validation.
Before your PR is "Ready for review"
Contributor and security guidance reviewed. Commits are signed and signed off.
CONTRIBUTING.md: ❌ Internal third-party approval tracking still needs confirmation. Upstream attribution, MIT/Apache headers,LICENSEnotice, and license-hook exclusions are included. FLA/TileLang and TVM-FFI license files were reviewed.Additional Information
Related: #2455. This is one draft for the first integration slice and does not assume #2455 has merged. Later milestones will extend the numerical boundaries after choosing their approximation contracts.