UPSTREAM PR #21629: cuda: Q1_0 initial backend#1343
Open
loci-dev wants to merge 4 commits into
Open
Conversation
Co-authored-by: Johannes Gäßler <johannesg@5d6.de>
|
No meaningful performance changes were detected across 125311 analyzed functions in the following binaries: build.bin.llama-cvector-generator, build.bin.llama-tts, build.bin.libmtmd.so, build.bin.llama-bench, build.bin.libllama.so, build.bin.libggml-base.so, build.bin.libggml-cpu.so, build.bin.libggml.so, build.bin.llama-tokenize, build.bin.llama-gemma3-cli, build.bin.llama-gguf-split, build.bin.llama-llava-cli, build.bin.llama-minicpmv-cli, build.bin.llama-quantize, build.bin.llama-qwen2vl-cli. 💬 Questions? Tag @loci-dev |
d101579 to
63ab8d1
Compare
7638ab4 to
f1b46d5
Compare
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.
Note
Source pull request: ggml-org/llama.cpp#21629
Overview
Follow up after merging of Q1_0 CPU PR. This PR adds the relevant CUDA backend.
Seems also this works for AMD in some cases that was a nice surprise :)
See a live demo of Bonsai 8B using these CUDA kernels and
llama-serveron hugging-face space prism-ml/Bonsai-demo, using a L40S GPU and getting decent speeds. Each request running on one gpu with a naive load balancer (just for demo purposes).Models:
Questions:
llama-bench (-fa 1)
Device: NVIDIA RTX 5090 (32 GB), CUDA backend
Bonsai-1.7B (231.13 MiB, 1.72B params)
Bonsai-4B (540.09 MiB, 4.02B params)
Bonsai-8B (1.07 GiB, 8.19B params)
End-to-end testing: KL Divergence (Q1_0 vs unpacked into FP16)
To test accuracy of the CUDA backend, we compare the KL divergence of the Q1_0 model against the unpacked FP16 model. The weights are equivalent so checking the logits gives us a good indication of the accuracy of the CUDA backend. Ran on 20 chunks of wikitext-2-raw, ctx 512.
For each model testing vs the unpacked version here: https://huggingface.co/collections/prism-ml/bonsai-auxiliary
Requirements