cuda: extract Q1_0 elements via __byte_perm - #25628
Conversation
|
Same benchmarks for Bonsai-27B-Q1_0.gguf: llama-batched-bench (master, bf2c86d)
llama-batched-bench (this PR, 19e2181)
|
|
Wait what, qwen3.6 27b 1bit model?? |
|
Just launched today :) |
|
without pr (12127de)
with pr
Small but noticeable uplift for both pp and tg. |
JohannesGaessler
left a comment
There was a problem hiding this comment.
This seems logically correct to me though I haven't actually tested it for correctness or performance. @khosravipasha I'll leave whether or not this should be merged at your discretion.
|
Is there anything you are concerned about regarding correctness? I can offer a small script that should check all 16 bit values exhaustively for equivalent unpacking. Needs |
|
Overall looks good to us. I am running our KL logits tests and speed test to be sure. Will share numbers in a bit. Don't see anything concerning. |
|
The logits seems to match perfect and see around 5 percent faster token generation on L40S depending on model size so safe to merge. |
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%).Tagging @khosravipasha, in case you are interested in this one as well.
Additional information
test-backend-ops testpasses before and with 8373d2bbc0f96ba6940a81d3f3c385823a69b5ae, 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 8373d2bbc0f96ba6940a81d3f3c385823a69b5ae:
with 8373d2bbc0f96ba6940a81d3f3c385823a69b5ae:
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 8373d2bbc0f96ba6940a81d3f3c385823a69b5ae:
with 8373d2bbc0f96ba6940a81d3f3c385823a69b5ae:
Requirements