This is Dimonyga/llama.cpp-sm_61, a fork of ggml-org/llama.cpp focused on NVIDIA Pascal sm_61 GPUs and Vulkan on older AMD Radeon cards, especially GCN/Vega. It follows upstream and carries targeted performance changes plus selected server, audio and GGML features. Some optimizations are adapted from ik_llama.cpp.
- Pascal / sm_61: DP4A matrix-vector and matrix-matrix tuning, including IQ4_XS; four-row MMVQ dispatch; a GQA-aware single-token Flash Attention path for Q4_0 K/V caches; and changes to GDN and tiled attention for supported shapes. These paths target GPUs such as the GTX 1080 Ti and use architecture and layout checks to select compatible kernels.
- Older Radeon / Vulkan: GCN Q4_0 KV-cache dequantization with transpose, tiled transpose-concat for GDN, and IQ4_XS matrix-vector shader changes. Subgroup RMS normalization and smaller workgroups, initially backported here, are now also part of the merged upstream code. Build options can omit cooperative-matrix shaders on devices that do not support them.
- CPU inference: tiled Flash Attention for Q4_0 and Q8_0 caches, including mixed K/V types, and split-SwiGLU graph fusion in the Qwen3.5 and Qwen3-Next paths.
- Audio API: Gemma 4 transcription and translation prompts,
/v1/audio/translationswithtarget_language, text/JSON/subtitle response formats, an FFmpeg decoding fallback, and/v1/audio/speechas an alias of/tts. Qwen3-TTS VoiceDesign accepts voice descriptions throughinstructorinstructions. See the server documentation and TTS documentation. - Server statistics:
--moe-routing-logrecords expert-selection counts;--tensor-statscollects activation statistics from served traffic as a GGUF importance matrix for quantization. Both are opt-in and add synchronization overhead. - GGML extensions for stable-diffusion.cpp integration: FP8 conversion paths, INT8 matrix operations with ConvRot preprocessing, RoPE application, and CUDA SageAttention/SOL attention operators. Support depends on the backend and GPU; SageAttention and SOL attention require newer NVIDIA architectures and are separate from the Pascal optimizations.
Optimizations apply to specific devices, quantization types and tensor layouts. Performance depends on the model, workload, driver and build configuration. The presence of a kernel is not a claim that every supported GPU or model has been benchmarked.
Clone this repository and build from source to include its changes. The upstream installers, binaries, container images and release badges in the inherited documentation below refer to upstream builds.
git clone https://github.com/Dimonyga/llama.cpp-sm_61.git
cd llama.cpp-sm_61For NVIDIA Pascal sm_61, use a CUDA toolkit that supports compiling for compute capability 6.1:
cmake -S . -B build-cuda -DCMAKE_BUILD_TYPE=Release \
-DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES=61 \
-DGGML_VULKAN=OFF -DGGML_METAL=OFF -DLLAMA_BUILD_TESTS=ON
cmake --build build-cuda --parallelFor older Radeon cards using Vulkan:
cmake -S . -B build-vulkan -DCMAKE_BUILD_TYPE=Release \
-DGGML_VULKAN=ON -DGGML_CUDA=OFF -DGGML_METAL=OFF \
-DGGML_VULKAN_NO_COOPMAT=ON -DGGML_VULKAN_NO_COOPMAT2=ON \
-DLLAMA_BUILD_TESTS=ON
cmake --build build-vulkan --parallelThe two NO_COOPMAT options omit cooperative-matrix shaders for a build targeting devices without those features. Leave them off for builds that should also use cooperative matrices on newer GPUs. See docs/build.md for dependencies and platform-specific setup.
Create llama.cpp-YYYYMMDDHHmm.tar.gz in the repository root, or pass an output directory:
python3 scripts/package_sources.py
python3 scripts/package_sources.py /path/to/outputThe script needs Python 3 and Git on the packaging machine. It includes current working-tree files from the native source directories, including local edits and new non-ignored source files, all GGML backends, bundled dependencies, licenses, tools and chat templates. It excludes Web UI sources and assets, examples, tests and benchmark suites, documentation directories, CI files, model weights, Git history and Git-ignored build outputs. Native tools such as llama-bench remain included. Three small UI build files remain to generate the server's empty asset table. An existing archive with the same name is not overwritten.
Extract on the build host and load the included source-build.cmake initial cache. It disables both UI building and prebuilt UI downloads, examples and tests, and preserves the source revision in the build information. Add the backend flags needed for the host, for example Pascal CUDA:
tar -xzf llama.cpp-YYYYMMDDHHmm.tar.gz
cmake -S llama.cpp -B build -C llama.cpp/source-build.cmake \
-DCMAKE_BUILD_TYPE=Release -DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES=61 \
-DGGML_VULKAN=OFF -DGGML_METAL=OFF
cmake --build build --parallelThe original upstream README follows.
LLM inference in C/C++
ggml / ops / maintainer PRs / dev stats / lib llama API / llama-server REST API
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
VLM session with llama cli
|
Built-in web UI against llama serve
|
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.
| 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 |
- How to build
- Running on Docker
- Build on Android
- Multi-GPU usage
- Performance troubleshooting
- GGML tips & tricks
- XCFramework
- Completions
- Models
- Release process
- 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
- 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

