-
-
Couldn't load subscription status.
- Fork 10.8k
[Kernel] Faster pre-processing time for W4A8 #23972
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
Merged
Merged
Conversation
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
Signed-off-by: czhu-cohere <conway.zhu@cohere.com>
333c884 to
7913f56
Compare
mgoin
approved these changes
Sep 10, 2025
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.
Nice and clean, thanks for the work!
|
@mgoin Thanks for the review, I think the failure is unrelated, OK to merge? |
debroy-rh
pushed a commit
to debroy-rh/vllm
that referenced
this pull request
Sep 19, 2025
Signed-off-by: czhu-cohere <conway.zhu@cohere.com>
FeiDaLI
pushed a commit
to FeiDaLI/vllm
that referenced
this pull request
Sep 25, 2025
Signed-off-by: czhu-cohere <conway.zhu@cohere.com>
charlifu
pushed a commit
to ROCm/vllm
that referenced
this pull request
Sep 25, 2025
Signed-off-by: czhu-cohere <conway.zhu@cohere.com> Signed-off-by: charlifu <charlifu@amd.com>
xuebwang-amd
pushed a commit
to xuebwang-amd/vllm
that referenced
this pull request
Oct 10, 2025
Signed-off-by: czhu-cohere <conway.zhu@cohere.com> Signed-off-by: xuebwang-amd <xuebwang@amd.com>
choprahetarth
pushed a commit
to Tandemn-Labs/vllm
that referenced
this pull request
Oct 11, 2025
Signed-off-by: czhu-cohere <conway.zhu@cohere.com>
xuebwang-amd
pushed a commit
to xuebwang-amd/vllm
that referenced
this pull request
Oct 24, 2025
Signed-off-by: czhu-cohere <conway.zhu@cohere.com> Signed-off-by: xuebwang-amd <xuebwang@amd.com>
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
The W4A8 kernels require a special encoding/pre-processing step (one for weights, one for scales). The current CUTLASS implementation walks the values 1-by-1 on CPU which is slow, causing startup to take ~10 minutes for a 100B model.
The simple CUDA implementation is much faster for this specific op and reduce total model load time from ~10min to <1min. The main logic is to build a lookup table to map 8-bit nibbles (2 4-bit values) at a time, where
1..7 -> (8 - v)and0, 8..15are untouched. (A similar thing could be implemented for the scales pre-processing but that is less of a bottleneck than weights, and waiting <1min on startup seems reasonable)Test Plan
Correctness - the existing test here
pytest tests/kernels/quantization/test_cutlass_w4a8.pyshould cover it (if the encoding step is wrong the result will be wrong)Speedup - look at logs for
vllm serveand compare the startup time for Command A (111B params)E2E - compare gsm8k lm-eval before and after
Test Result
startup time
lm-eval gsm8k
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.