85ff4657cb3839809c9bc3cbdd89b7e9445cdc13
Turing had no entry in ggml_cuda_should_use_mmvq and fell through to the generic ne11 <= 8, while Ada, Blackwell, DGX Spark and Orin all have measured switch points. MMQ overtakes MMVQ far earlier than n=8 on SM75. Measured on a CMP 50HX (cc 7.5, CUDA 13.3) with test-backend-ops perf, medians of 4 reps after a discarded warmup, forcing each path via an instrumentation build. MMQ speedup over MMVQ at n=8: q2_K 2.57x q3_K 2.13x q4_K 1.96x iq4_xs 1.93x q5_K 1.79x q6_K 1.74x End to end on Qwen3.5-9B-UD-Q4_K_XL, llama-bench, medians of 3 interleaved rounds at -r 20: pp1 -0.2% pp2 0.0% pp3 0.0% pp4 +3.2% pp5 +12.1% pp8 +47.6% q6_K is deliberately 3 rather than the 2 the synthetic sweep suggested. That sweep had a single shape for q6_K and MMQ won it by only 1.02x, the weakest margin measured. With the threshold at 2 the model regressed 2% at pp3, reproducibly across three rounds: its 24 q6_K tensors were the only ones switching path at that batch size. The synthetic margin did not survive on the model's real q6_K shapes, so mmvq keeps n=3 for that type. q4_K was measured across five m/k shapes; at n=3 mmvq wins 1.19x/1.09x/1.08x on three and loses 1.01x on two, geometric mean 1.065 in mmvq's favour. At n=4 mmq wins on all five. The n=512 cases act as a control: above MMVQ_MAX_BATCH_SIZE neither mode can select mmvq, and both measure within 1.00x-1.01x of each other. Only the measured types are listed; everything else keeps the default. q2_K and q3_K rest on a single shape each and are not present in the model used for the end-to-end check, so they are less well evidenced than the rest.
llama.cpp
LLM inference in C/C++
ggml / ops / maintainer PRs / dev stats / lib llama API / llama-server REST API
Quick start
A few options to get llama.cpp installed on your machine:
- Visit https://llama.app and follow the instructions
- Run with Docker - see our Docker documentation
- Download pre-built binaries from the releases page
- Build from source by cloning this repository - check out our build guide
Once installed:
# Download and run a model directly from Hugging Face
llama cli -hf ggml-org/Qwen3.5-0.8B-GGUF
# Launch OpenAI-compatible API server
llama serve -hf ggml-org/Qwen3.5-0.8B-GGUF
|
|
|
Description
The main goal of llama.cpp is to enable LLM (and VLM) inference with minimal setup and state-of-the-art performance on
a wide range of hardware - locally and in the cloud.
- Plain C/C++ implementation without any dependencies
- Apple silicon is a first-class citizen - optimized via ARM NEON, Accelerate and Metal frameworks
- AVX, AVX2, AVX512 and AMX support for x86 architectures
- RVV, ZVFH, ZFH, ZICBOP and ZIHINTPAUSE support for RISC-V architectures
- 1.5-bit, 2-bit, 3-bit, 4-bit, 5-bit, 6-bit, and 8-bit integer quantization for faster inference and reduced memory use
- Custom CUDA kernels for running LLMs on NVIDIA GPUs (support for AMD GPUs via HIP and Moore Threads GPUs via MUSA)
- Vulkan and SYCL backend support
- CPU+GPU hybrid inference to partially accelerate models larger than the total VRAM capacity
The llama.cpp project is build on top of the ggml library.
Supported backends
| Backend | Target devices |
|---|---|
| BLAS | All |
| BLIS | All |
| CANN | Ascend NPU |
| CUDA | Nvidia GPU |
| HIP | AMD GPU |
| Hexagon | Snapdragon |
| IBM zDNN | IBM Z & LinuxONE |
| MUSA | Moore Threads GPU |
| Metal | Apple Silicon |
| OpenCL | Adreno GPU |
| OpenVINO [In Progress] | Intel CPUs, GPUs, and NPUs |
| RPC | All |
| SYCL | Intel GPU |
| VirtGPU | VirtGPU APIR |
| Vulkan | GPU |
| WebGPU | All |
| ZenDNN | AMD CPU |
Documentation
Tools
Development
- How to build
- Running on Docker
- Build on Android
- Multi-GPU usage
- Performance troubleshooting
- GGML tips & tricks
- XCFramework
- Completions
- Models
- Release process
Contributing
- Contributors can open PRs
- Collaborators will be invited based on contributions
- Maintainers can push to branches in the
llama.cpprepo and merge PRs into themasterbranch - Any help with managing issues, PRs and projects is very appreciated!
- Read the CONTRIBUTING.md for more information
Acknowledgements
- yhirose/cpp-httplib - Single-header HTTP server, used by
llama-server- MIT license - nothings/stb - Single-header image format decoder, used by multimodal subsystem - Public domain
- nlohmann/json - Single-header JSON library, used by various tools/examples - MIT License
- mackron/miniaudio - Single-header audio format decoder, used by multimodal subsystem - Public domain
- sheredom/subprocess.h - Single-header process launching solution for C and C++ - Public domain
Description
llama.cpp fork with AVX1, NUMA, SM75 Turing, and FastMTP optimizations
364 MiB
0 Stars
1 Watchers
0 Forks
Languages
C++
55.8%
C
16.3%
Python
7.5%
Cuda
5.1%
TypeScript
4.3%
Other
10.8%