cuda: extract Q1_0 elements via __byte_perm#25628
Open
dfriehs wants to merge 1 commit into
Open
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
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
Unpack Q1_0 elements via
__byte_perm, leading to a nice increase in t/s (+5-10%) and a modest one for pp (+1-2.5%). I expect this PR to stay in draft until after #24127 is merged, at which point I will rebase. I consider it complete, though.Tagging @khosravipasha, in case you are interested in this one as well.
Additional information
test-backend-ops testpasses before and with 8373d2b, and KL divergence is 0 between the two.n=4shows a slowdown intest-backend-ops perf, butllama-batched-benchshows increased t/s even forB=4. Maybe there is some tuning to update?I'm not able to test HIP/ROCm or MUSA. If either don't support
__byte_permor slow down I will add a fallback path.test-backend-ops perf
before 8373d2b:
with 8373d2b:
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 Bonsai-8B-Q1_0.ggufand
llama-batched-bench -no-kvu -ngl all -fit off -ub 1024 -npp 16384,32768 -ntg 256 -npl 1 -m Bonsai-8B-Q1_0.ggufbefore 8373d2b:
with 8373d2b:
Requirements