cuda: Support Q2_0#25603
Draft
dfriehs wants to merge 4 commits into
Draft
Conversation
Collaborator
|
@khosravipasha how is the cuda pr coming along? |
Contributor
|
Mostly ready. Waiting for metal to merge as policy is to have one PR open at a time. Can send ours as draft PR here instead of waiting. This is the bracnh planning to submit https://github.com/PrismML-Eng/llama.cpp/tree/pr/q2_0-cuda Interesting speed up, need to take a closer look tomorrow. |
Contributor
|
The CUDA changes should be scheduled after #24127 . |
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.
Overview
Support Q2_0. The base implementation was cherry picked from PrismML-Eng/llama.cpp (9c0edea), and then rewritten to unpack elements via
__byte_perm, leading to quite a substantial boost in t/s especially for single decode. If you would rather wait for the official PR by PrismML I don't mind leaving it open.Additional information
test-backend-ops testpasses before and with d19075f, and KL divergence is 0 between the two. I have not tested KL divergence against CPU as the CPU pass would take 6+ hours on my machine.I'm not able to test HIP/ROCm or MUSA. If either don't support
__byte_perm, I will add a fallback path.test-backend-ops perf
before d19075f:
with d19075f:
llama-batched-bench
merged output of
llama-batched-bench -no-kvu -ngl all -fit off -ub 1024 -npp 0,256,4096 -ntg 256 -npl 1,2,4,8 -m Ternary-Bonsai-8B-Q2_0_g64.ggufand
llama-batched-bench -no-kvu -ngl all -fit off -ub 1024 -npp 16384,32768 -ntg 256 -npl 1 -m Ternary-Bonsai-8B-Q2_0_g64.ggufbefore d19075f:
with d19075f:
Requirements