-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
[ROCm] [Feature] [Doc] [Dockerfile] Support Per-Token-Activation Per-Channel-Weight FP8 Quantization Inferencing #12501
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: kliuae <[email protected]>
Signed-off-by: tjtanaa <[email protected]>
…lation readme to point to ROCm6.5 Signed-off-by: tjtanaa <[email protected]>
👋 Hi! Thank you for contributing to the vLLM project. 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 do one of these:
🚀 |
Signed-off-by: tjtanaa <[email protected]>
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.
Thanks for your contribution. Do you think it would be possible to implement this inside of fp8.py? It seems we could just change the default --quantization fp8
on an unquantized model to use per-token and per-channel. Given the cutlass and pytorch support we have now, I don't think there is a great reason to rely on per-tensor by default anymore
@mgoin We think it should be possible to implement PTPC-FP8 inside of fp8.py and force the @hongxiayang @mgoin Maybe we could get the input from AMD to check if there is any preference or demand in maintaining a per-tensor quantization for backward compatibility. Since we are on this topic, I remember making vLLM production ready is a goal, I wonder if there is a need for us to maintain certain backward compatibility so that the behavior of features does not change as much as possible? |
Support Per-Token-Activation Per-Channel-Weight FP8 Quantization Inferencing
Note: This PR feature requires ROCm 6.3 and later and GPU Arch MI300 and later.
Description
This PR involves the following enhancements
This is a PR specific to support Per-Token-Activation Per-Channel-Weight (PTPC-FP8) FP8 Quantization Inferencing.
The model will be quantized on-the-fly from BFloat16 to FP8. Model weight which are store in Float16 will need to be casted into BFloat16.
It used PyTorch latest rowwise scaled GEMM feature in
torch._scaled_mm
which is introduced in [ROCm] hipblaslt rowwise f8 gemm pytorch/pytorch#144432 , which speeds up current naive implementation by at least 2 times. For more details check out the Performance sectionDockerfile.rocm_base
PyTorch repo commit has been updated to3a585126
.Dockerfile.rocm
is left untouched as the base image is referencing to AMD docker hub registry. That base image at this point in time has already installed with PyTorch repo commit3a585126
.Dockerfile.rocm_base
.Performance
Perplexity Test
Model: Llama-3.1-8B-Instruct
Dataset: Wikitexts
GPU: MI300X
Speed Test (Old naive implementation vs torch._scaled_mm rowwise scaled GEMM feature)
Model: Llama-3.1-70B-Instruct
Dataset: SharedGPT
GPU: 1xMI300X
PTPC_FP8 (naive)