f9e7af6e723cc2e1e156ad754e75845e186f09cd
Squashed from 2 fork commits (original subjects and messages below). ---- ggml-vulkan: enable flash-attn mask_opt for GCN large head sizes (was2b5e1962d) mask_opt was disabled on AMD GCN for head sizes <= 256, but it is beneficial there in high-context prefill: on fully-visible causal blocks it skips the per-block mask load+add, and it skips fully-masked blocks entirely. The attention op on GCN is compute-bound on the softmax path (no matrix cores), so this cuts real work. Verified lossless (perplexity bit-identical with it on vs off) and a measured prefill win on Qwen3.5-35B-A3B (head_dim 256) on an RX 580: pp2048 unchanged at short context, +8% @ 16k, +12% @ 32k, growing with depth. Enable for GCN when HSK/HSV >= 256; the existing large-mask conditions keep it off for decode. ---- vulkan: record why flash-attn shmem staging stays off for GCN (was5c5af7b39) Staging K/V through shared memory looks like an obvious win on GCN: without it each rowgroup re-reads the whole K/V block from global memory, and with row_split 4 that pulls one 16KB block through a 16KB vector L1 four times. Measured, it loses: -6.7% pp2048 at depth 16k and -7.4% at 32k on Polaris at head size 128. The kvsh stride of D/4+1 dwords is 4 mod 32, which costs an 8-way LDS bank conflict on wave64 - the +1 padding is tuned for warp32 - and the extra shared memory eats occupancy this shader is already short of. Comment only, no behaviour change. Leaving a note so the next person does not spend a GPU on it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PZz44SLQvTXMyWGio6t9DZ
ggml-vulkan: enable flash-attn mask_opt for GCN head size 256, note why shmem staging stays off (F2)
tool-call: fix Qwen 2.5 Coder support, add micro benchmarks, support trigger patterns for lazy grammars (#12034)
llama.cpp
LLM inference in C/C++
v1.0.0 / ggml / ops / maintainer PRs / dev stats / lib llama API / llama-server REST API
Description
The main goal of llama.cpp is to enable LLM (and MLLM) inference with minimal setup and state-of-the-art performance on a wide range of hardware - locally and in the cloud.
The llama.cpp project is built on top of the ggml library.
Quick start
A few options to get llama.cpp installed on your machine:
# curl
curl -LsSf https://llama.app/install.sh | sh
# powershell
irm https://llama.app/install.ps1 | iex
- 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
|
|
|
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
Languages
C++
54.9%
C
16.7%
Python
7%
Cuda
5.6%
TypeScript
3.9%
Other
11.7%