[Bugfix] Fix accuracy issue for silu_mul + nvfp4 quant fusion kernel#24833
Merged
vllm-bot merged 12 commits intovllm-project:mainfrom Sep 17, 2025
Merged
Conversation
|
No ciflow labels are configured for this repo. |
Collaborator
|
Can you compare to the Inductor-generated fused kernel? |
Signed-off-by: elvischenv <219235043+elvischenv@users.noreply.github.com>
Signed-off-by: elvischenv <219235043+elvischenv@users.noreply.github.com>
Signed-off-by: elvischenv <219235043+elvischenv@users.noreply.github.com>
Signed-off-by: elvischenv <219235043+elvischenv@users.noreply.github.com>
Signed-off-by: elvischenv <219235043+elvischenv@users.noreply.github.com>
Signed-off-by: elvischenv <219235043+elvischenv@users.noreply.github.com>
eb3cce4 to
a2bada3
Compare
mgoin
approved these changes
Sep 17, 2025
Member
mgoin
left a comment
There was a problem hiding this comment.
Looks good to me as a bugfix, we should merge. @ProExpertProg I don't think we have nvfp4 quant in torch implemented in a serious way, so we should leave that to future work
yewentao256
approved these changes
Sep 17, 2025
Member
yewentao256
left a comment
There was a problem hiding this comment.
LGTM, thanks for the work!
debroy-rh
pushed a commit
to debroy-rh/vllm
that referenced
this pull request
Sep 19, 2025
…llm-project#24833) Signed-off-by: elvischenv <219235043+elvischenv@users.noreply.github.com> Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com>
FeiDaLI
pushed a commit
to FeiDaLI/vllm
that referenced
this pull request
Sep 25, 2025
…llm-project#24833) Signed-off-by: elvischenv <219235043+elvischenv@users.noreply.github.com> Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com>
charlifu
pushed a commit
to ROCm/vllm
that referenced
this pull request
Sep 25, 2025
…llm-project#24833) Signed-off-by: elvischenv <219235043+elvischenv@users.noreply.github.com> Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Signed-off-by: charlifu <charlifu@amd.com>
choprahetarth
pushed a commit
to Tandemn-Labs/vllm
that referenced
this pull request
Oct 11, 2025
…llm-project#24833) Signed-off-by: elvischenv <219235043+elvischenv@users.noreply.github.com> Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com>
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.
Purpose
tanh(x/2) * 0.5 + 0.5, while the standard definition should be1 / (1 + e^(-x)).vllm/csrc/quantization/fp4/activation_nvfp4_quant_fusion_kernels.cu
Lines 34 to 54 in 5679399
activation_nvfp4_quant_fusion_kernels.cu. We don't need an extrasilu_and_cvt_warp_fp16_to_fp4but justcompute_silu_mul+cvt_warp_fp16_to_fp4(reuse from the nvfp4_utils).test_silu_mul_quant_fusion.py. Improved the test coverage.test_silu_mul_nvfp4_quant.py. Removed lots of unnecessary components.Test Plan && Test Result
Unit test:
tests/compile/test_silu_mul_quant_fusion.pytests/kernels/quantization/test_silu_mul_nvfp4_quant.pyE2E online lm_eval:
main not fused:
main fused(the accuracy dropped slightly):
PR fused:
Perf:
main not fused:
main fused:
PR fused:
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.