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. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: NVIDIA/Model-Optimizer/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (26)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. 📝 WalkthroughWalkthroughThis change adds experimental dynamic FP8 fake quantization for GatedDeltaNet recurrent states and WY activations. It adds chunked kernels, model and Megatron integration, PTQ configurations, and reference and GPU tests. ChangesGatedDeltaNet Quantization
Optional Test Dependency
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~60 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant GatedDeltaNetStateQuantMixin
participant chunk_gated_delta_rule
participant chunk_gated_delta_rule_fwd_h
participant chunk_gated_delta_rule_bwd_dhu
GatedDeltaNetStateQuantMixin->>chunk_gated_delta_rule: invoke quantized chunk operation
chunk_gated_delta_rule->>chunk_gated_delta_rule_fwd_h: launch forward state computation
chunk_gated_delta_rule->>chunk_gated_delta_rule_bwd_dhu: compute backward state and value gradients
Merge Risk: ⚪ Minimal · up to This change adds experimental FP8 fake quantization for GatedDeltaNet recurrent states and WY activations. It is disabled by default, so existing quantization recipes and restored checkpoints keep their current behavior unless users explicitly enable the new quantizers. No concrete merge-blocking defect remains. Hardware and version requirements are enforced by explicit errors raised before any kernel launches. 🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 22.89% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 83 functions across 17 files. (9 skipped: 9 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2497 +/- ##
==========================================
- Coverage 71.14% 70.58% -0.56%
==========================================
Files 603 611 +8
Lines 66739 71409 +4670
==========================================
+ Hits 47482 50405 +2923
- Misses 19257 21004 +1747
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:
|
8ea824b to
bff7ddf
Compare
Signed-off-by: Kai Xu <kaix@nvidia.com>
bff7ddf to
6686c9b
Compare
Linear-attention PR stack — 5 drafts
All five drafts form a linear GitHub stack in the review order shown above. #2541 applies TensorQuantizer before native vLLM prefill/decode calls.
A separate vLLM prefill-GEMM PR will wait for an optimized fused kernel. #2506 and #2509 are superseded and closed.
What does this PR do?
Type of change: new feature
GatedDeltaNet training keeps recurrent states inside a chunked kernel, so projection quantizers cannot emulate rounding at state boundaries. This draft adds dynamic FP8 E4M3 fake QDQ to the recurrent state and WY-transformed W activations, with identity straight-through gradients for QAT/QAD.
Both sites use the standard
quant_cfginterface and start disabled. State QDQ uses 64-token chunks and one scale per full-key by 64-value-column tile; W grouping is applied byTensorQuantizer. Quantizer settings use normal ModelOpt checkpoint state. There is noQuantizeConfig.linear_attentionfield in this PR; #2519 introduces execution policies for decode and ReplaySSM, and later PRs extend them for prefill and approximate inverse. Configurations or checkpoints from earlier experimental drafts that use those execution policies require #2519.The Megatron adapter supports the direct-forward and older split-forward call layouts, restores the original kernel when disabled, and removes temporary quantizer attributes on export. Independent recurrent/chunk numerical references live under
tests/_test_utils/torch/quantization/; shared runtime capability checks live inlinear_attention/utils.py.The fused path requires
fla-core==0.5.1and chunk size 64. State FP8 emulation requires SM89 or newer. The Hopper path has additional dtype/TileLang restrictions enforced before launch. This PR simulates numerical error; it does not add compressed state storage or faster inference.Usage
Dynamic scales require no calibration.
Testing
Current amended source: 122 passed, 12 skipped on RTX A6000 (SM86), Python 3.12.8, Torch 2.9.1+cu128, Triton 3.5.1, and fla-core 0.5.1. Coverage includes conversion/refinement, state/W checkpoint round trips, legacy disabled-handle restoration, independent reference numerics, W grouping, fused output/gradient comparisons, existing CPU quantization, and recipe regressions. Eleven skips require native state E4M3 conversion; one is Hopper-specific.
CI collection fix: the streaming-dataset test now skips when optional
httpxis unavailable. Reproduced the missing-dependency collection failure, verified it becomes a skip, and ran all 18 streaming-dataset tests successfully with dependencies installed.Pre-commit and
git diff --checkpassed. Megatron-Core/Transformer Engine are absent locally, so the updated Megatron test was checked statically but not rerun. Earlier Hopper/Megatron qualification predates this amendment; it is not current-head runtime evidence. Model-quality/QAT-recovery evaluation, pipeline parallelism, and checkpoint resharding remain outside this 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.
Summary by CodeRabbit
New Features
Documentation
Bug Fixes