Add fp16 mixed precision softmax#1950
Conversation
Signed-off-by: Kai Xu <kaix@nvidia.com>
Signed-off-by: Kai Xu <kaix@nvidia.com>
Signed-off-by: Kai Xu <kaix@nvidia.com>
Signed-off-by: Kai Xu <kaix@nvidia.com>
Signed-off-by: Kai Xu <kaix@nvidia.com>
Adapt the per-head split-K and FP32 combine structure from internal ModelOpt commit 6c08d08. Reuse the compact branch paged loaders and NVFP4 P/V QDQ helpers, while preserving the Option-3 pristine V tail. Signed-off-by: Kai Xu <kaix@nvidia.com>
Signed-off-by: Kai Xu <kaix@nvidia.com>
Signed-off-by: Kai Xu <kaix@nvidia.com>
Signed-off-by: Kai Xu <kaix@nvidia.com>
Signed-off-by: Kai Xu <kaix@nvidia.com>
Signed-off-by: Kai Xu <kaix@nvidia.com>
Signed-off-by: Kai Xu <kaix@nvidia.com>
Signed-off-by: Kai Xu <kaix@nvidia.com>
Signed-off-by: Kai Xu <kaix@nvidia.com>
Signed-off-by: Kai Xu <kaix@nvidia.com>
Signed-off-by: Kai Xu <kaix@nvidia.com>
Signed-off-by: Kai Xu <kaix@nvidia.com>
Signed-off-by: Kai Xu <kaix@nvidia.com>
Signed-off-by: Kai Xu <kaix@nvidia.com>
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. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1950 +/- ##
==========================================
+ Coverage 61.21% 67.95% +6.73%
==========================================
Files 515 523 +8
Lines 57245 62047 +4802
==========================================
+ Hits 35043 42164 +7121
+ Misses 22202 19883 -2319
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>
Signed-off-by: Kai Xu <kaix@nvidia.com>
Signed-off-by: Kai Xu <kaix@nvidia.com>
Signed-off-by: Kai Xu <kaix@nvidia.com>
Signed-off-by: Kai Xu <kaix@nvidia.com>
Signed-off-by: Kai Xu <kaix@nvidia.com>
Signed-off-by: Kai Xu <kaix@nvidia.com>
Signed-off-by: Kai Xu <kaix@nvidia.com>
9a1695d to
a3f54ac
Compare
What does this PR do?
Type of change: ?
New feature.
Type of change: New feature
Adds opt-in mixed-FP16 online-softmax support to the compact NVFP4 attention path.
Adds MODELOPT_ATTN_SOFTMAX_MODE=fp32|mixed_fp16; default behavior remains fp32.
Uses native FP16 exp2 for tile probabilities and online-max corrections while retaining FP32 denominator state,
accumulators, and split-K reconciliation.
Supports Triton prefill and fixed 32-split decode.
Propagates the mode through FlashAttention and FlashInfer adapters, including mixed decode/prefill batches.
Composes with NVFP4 Q/K/P/V fake quantization and optional prefill N:M sparsity.
Keeps mixed mode inference-only and rejects autograd before kernel launch.
Propagates the selector to Ray workers across supported vLLM executor layouts.
Documents hardware and serving limitations. The compact NVFP4 worker requires SM89+.
Usage
Testing
Before your PR is "Ready for review"
Make sure you read and follow Contributor guidelines and your commits are signed (
git commit -s -S).Make sure you read and follow the Security Best Practices (e.g. avoiding hardcoded
trust_remote_code=True,torch.load(..., weights_only=False),pickle, etc.).CONTRIBUTING.md: ✅ / ❌ / N/AAdditional Information