-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Quantization: support FP4 quantized models on AMD CDNA2/CDNA3 GPUs #22527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can either: Add 🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request adds support for FP4 quantized models on AMD GPUs using the petit-kernel
. The changes look mostly good, with new quantization configurations and utility functions. However, I found a critical issue in the PetitNvFp4Config.from_config
method where it uses direct dictionary access for optional keys, which can lead to a KeyError
and crash the application if the keys are not present in the configuration file. I've suggested a more robust implementation for this method to handle missing keys gracefully.
2855577
to
4725634
Compare
This pull request has merge conflicts that must be resolved before it can be |
bbbab70
to
2f217ff
Compare
55b4398
to
8e11c88
Compare
This pull request has merge conflicts that must be resolved before it can be |
Signed-off-by: feng <fengli1702@gmail.com>
Signed-off-by: feng <fengli1702@gmail.com>
Essential Elements of an Effective PR Description Checklist
supported_models.md
andexamples
for a new model.Purpose
Add support for running FP4 quantized models on AMD CDNA2 / CDNA3 GPUs via a new quantization backend petit_nvfp4. This enables vLLM to serve models such as Llama-3.1 / Llama-3.3
Test Plan
Verified that ROCm backend without --quantization still runs normally, and automatically selects the petit-kernel FP4 path when loading FP4 quantized models.
Installed optional dependencies via:
Ran test with:
Confirmed that the FP4 path (petit-kernel) is selected automatically and outputs are generated successfully.
Test Result
Functional test passed: FP4 quantized models load and run inference successfully on ROCm (MI250/MI300 test nodes) without specifying --quantization.
Non-quantized ROCm inference path unaffected.
Verified via log output that petit-kernel module is loaded when using FP4 models.
(Optional) Documentation Update
Added fp4 extras in setup.py for optional dependency installation.