Skip to content

Commit f80945e

Browse files
authored
Merge pull request #4 from countzero/develop
Release v1.38.0
2 parents b017aba + c9eaa81 commit f80945e

10 files changed

Lines changed: 107 additions & 54 deletions

File tree

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: countzero
2+
ko_fi: finnkumkar

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Binaries land in `./vendor/llama.cpp/build/bin/Release/`. Conda env `llama.cpp`
2929
- **Each build wipes the submodule** back to `origin/master` then checks out the requested `-version` / PR. Any local edits under `vendor/llama.cpp/` are lost by design. The reset/`--remote` step is **scoped to `vendor/llama.cpp` only** — other submodules (e.g. `vendor/Qwen-Fixed-Chat-Templates`, default branch `main`) stay at the SHA pinned in the superproject and are never advanced by the build script. To bump them, do it manually: `git -C vendor/Qwen-Fixed-Chat-Templates fetch && git -C vendor/Qwen-Fixed-Chat-Templates checkout <sha> && git add vendor/Qwen-Fixed-Chat-Templates && git commit`. Once the pin is committed, the next `rebuild_llama.cpp.ps1` mirrors it into the working tree (auto-discovered from `.gitmodules`, `--force`); hand-edits inside the submodule do not survive a rebuild.
3030
- **`ml64.exe` (MASM) must be passed as `-DCMAKE_ASM_COMPILER`.** Upstream `ggml/CMakeLists.txt` sets `cmake_policy(SET CMP0194 NEW)` and declares `project(... ASM)`; on CMake 4.1+ with the VS generator this rejects `cl.exe` as the ASM compiler. The script locates `ml64.exe` via `vswhere.exe`. Don't remove.
3131
- **CUDA is selected iff *both* `nvidia-smi` and `nvcc` are on PATH.** Missing either silently falls back to OpenBLAS.
32+
- **CUDA builds pass `-DGGML_CUDA_FA_ALL_QUANTS=ON`.** Without it the CUDA flash-attention path compiles only four *symmetric* KV kernels — `f16/f16`, `q4_0/q4_0`, `q8_0/q8_0`, `bf16/bf16` (`vendor/llama.cpp/ggml/src/ggml-cuda/CMakeLists.txt:119-124`) — and the dispatcher returns `BEST_FATTN_KERNEL_NONE` -> `GGML_ABORT` for any other K type or any mismatched K/V pair (`ggml-cuda/fattn.cu:424-446`). The flag pulls in the full `fattn-vec*.cu` set so asymmetric / q5 / q4_1 caches work (the presets use `q5_0` K + `q4_1` V). Costs extra `nvcc` compile time.
3233
- **Build parallelism is SMT-aware.** `cmake --build --parallel` is fed a count derived from `Win32_Processor`. Upstream's `UseMultiToolTask=true` + `EnforceProcessCountAcrossBuilds=true` (`vendor/llama.cpp/CMakeLists.txt:92-93`) makes this the single cap on concurrent `cl.exe`/`nvcc` — no per-project `/MP` multiplication. On SMT CPUs it uses physical cores (`Sum(NumberOfCores)`): dropping the logical siblings avoids starving the scheduler / ~doubling peak `nvcc` RAM (no throughput gain) and leaves them free so the machine stays usable. On non-SMT CPUs where physical == logical (hybrid Arrow/Lunar Lake; e.g. Core Ultra 9 285HX = 8P+16E, 24 threads) using all cores would peg the box at 100%, so it backs off to 80% of physical (`floor(cores * 0.8)` = 19 on the 285HX) to keep the machine usable during builds. Override with `-parallelJobs N`.
3334
- **`requirements_override.txt` layers on top of upstream `vendor/llama.cpp/requirements.txt`.** It pins `torch` to a CUDA 12.6 wheel, adds `tiktoken` (missing upstream, required for GLM), pins `transformers==5.3.0`, and narrows `numpy` to resolve an `opencv-python-headless` conflict. When bumping any of these, verify both constraints still hold.
3435
- **`server.ps1` reads GGUF metadata** by shelling out to `vendor/llama.cpp/gguf-py/gguf/scripts/gguf_dump.py`. Upstream has moved this path before (CHANGELOG 1.24.0) — if server startup fails with "Failed to extract model details", check the path first.

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [Unreleased]
99

1010

11+
## [1.38.0] - 2026-06-30
12+
13+
### Added
14+
- [Documentation] Add MIT license
15+
- [Documentation] Add status badges and Support section to the README
16+
- [Documentation] Add GitHub Sponsors and Ko-fi funding configuration
17+
18+
### Changed
19+
- [Build] Enable GGML_CUDA_FA_ALL_QUANTS on CUDA builds for all KV cache quant combinations
20+
- [Build] Pin GGML_SCHED_MAX_COPIES=1 on CUDA builds
21+
- [Presets] Switch dual-GPU 16GB+8GB KV cache to q5_0 K / q4_1 V
22+
- [Presets] Add tensor-split 1,2 to all dual-GPU 16GB+8GB entries
23+
- [Presets] Switch dual-GPU 16GB+8GB gemma-4-31B draft model to q4_0
24+
- [Presets] Retune dual-GPU 16GB+8GB ctx sizes (gemma-4-31B 102400, Qwen3.6-27B 200000)
25+
- [Presets] Lower gemma-4-31B 24GB ctx-size to 100000
26+
- [Presets] Lower Qwen3.6-27B IQ3_XXS 16GB ctx-size to 100000
27+
- [Presets] Switch 16GB tier from fit-target to fit=off
28+
- [Vendor] Bump llama.cpp submodule to b3fed31
29+
30+
### Removed
31+
- [Presets] Drop gemma-4-26B-A4B from dual-GPU 16GB+8GB tier
32+
33+
1134
## [1.37.0] - 2026-06-15
1235

1336
### Added

LICENSE.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# MIT License
2+
3+
Copyright (c) 2023-2026 Finn Kumkar
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+
23+
## Third-party components
24+
25+
This repository is a wrapper around third-party software that is licensed
26+
separately under its own terms:
27+
28+
- `vendor/llama.cpp` (git submodule) - MIT License, Copyright (c) 2023-2026 The ggml authors
29+
- `vendor/Qwen-Fixed-Chat-Templates` (git submodule) - Apache License 2.0, froggeric
30+
- OpenBLAS (downloaded during build, not distributed in this repository) - BSD 3-Clause License
31+
32+
Each component's full license text is provided within its respective source tree.

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Windows llama.cpp
22

3+
[![Latest release](https://img.shields.io/github/v/release/countzero/windows_llama.cpp)](https://github.com/countzero/windows_llama.cpp/releases/latest)
4+
[![Last commit](https://img.shields.io/github/last-commit/countzero/windows_llama.cpp)](https://github.com/countzero/windows_llama.cpp/commits/main)
5+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE.md)
6+
[![PowerShell 5.0+](https://img.shields.io/badge/PowerShell-5.0%2B-5391FE)](https://github.com/PowerShell/PowerShell)
7+
[![GitHub Sponsors](https://img.shields.io/github/sponsors/countzero?label=Sponsor&logo=GitHub)](https://github.com/sponsors/countzero)
8+
[![Ko-fi](https://img.shields.io/badge/Ko--fi-Tip-FF5E5B?logo=ko-fi&logoColor=white)](https://ko-fi.com/finnkumkar)
9+
310
A PowerShell automation to rebuild [llama.cpp](https://github.com/ggerganov/llama.cpp) for a Windows environment. It automates the following steps:
411

512
1. Fetching and extracting a specific release of [OpenBLAS](https://github.com/xianyi/OpenBLAS/releases)
@@ -269,3 +276,12 @@ You can build a specific version of llama.cpp by specifying a git tag, commit or
269276
| `./rebuild_llama.cpp.ps1 -version "b1138"` | The tag `b1138` |
270277
| `./rebuild_llama.cpp.ps1 -version "1d16309"` | The commit `1d16309` |
271278
| `./rebuild_llama.cpp.ps1 -pullRequest "18675"` | The pull request `18675` |
279+
280+
## Support
281+
282+
If this project saves you time, consider supporting future work:
283+
284+
- [GitHub Sponsors](https://github.com/sponsors/countzero): recurring or one-time.
285+
- [Ko-fi](https://ko-fi.com/finnkumkar): one-time tip, no signup required.
286+
287+
[![Support on Ko-fi](https://storage.ko-fi.com/cdn/kofi2.png?v=6)](https://ko-fi.com/finnkumkar)

presets/models_16GB_8GB_VRAM.ini

Lines changed: 18 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,22 @@
11
[*]
22
threads = 24
33
split-mode = layer
4-
tensor-split = 1,2
54
main-gpu = 1
65
models-max = 1
76

87
[gemma-4-31B-it-qat-q4_0.IQ4_XS.gguf]
98
alias = gemma-4-31B-it-qat-q4_0.IQ4_XS.gguf
109
model = D:\AI\LLM\gguf\gemma-4-31B-it-qat-q4_0-unquantized\gemma-4-31B-it-qat-q4_0-unquantized.IQ4_XS.gguf
1110
mmproj = D:\AI\LLM\gguf\gemma-4-31B-it-qat-q4_0-unquantized\mmproj.gemma-4-31B-it-qat-q4_0-unquantized.BF16.gguf
12-
spec-draft-model = D:\AI\LLM\gguf\gemma-4-31B-it-qat-q4_0-unquantized-assistant\mtp-gemma-4-31B-it-qat-q4_0-unquantized-assistant.Q8_0.gguf
13-
no-mmproj-offload = true
14-
ctx-size = 100000
15-
parallel = 1
16-
n-gpu-layers = -1
17-
cache-type-k = q4_0
18-
cache-type-v = q4_0
19-
cache-type-k-draft = q8_0
20-
cache-type-v-draft = q8_0
21-
flash-attn = true
22-
reasoning = on
23-
jinja = true
24-
chat-template-file = vendor\llama.cpp\models\templates\google-gemma-4-31B-it.jinja
25-
kv-unified = true
26-
ctx-checkpoints = 32
27-
cache-ram = 51200
28-
min-p = 0.0
29-
top-p = 0.95
30-
top-k = 64
31-
temp = 1.0
32-
spec-type = draft-mtp,ngram-mod
33-
spec-draft-n-max = 3
34-
spec-ngram-mod-n-match = 24
35-
spec-ngram-mod-n-min = 48
36-
spec-ngram-mod-n-max = 64
37-
direct-io = true
38-
no-mmap = true
39-
fit = off
40-
41-
[gemma-4-26B-A4B-it-qat-q4_0.IQ4_XS.gguf]
42-
alias = gemma-4-26B-A4B-it-qat-q4_0.IQ4_XS.gguf
43-
model = D:\AI\LLM\gguf\gemma-4-26B-A4B-it-qat-q4_0-unquantized\gemma-4-26B-A4B-it-qat-q4_0-unquantized.IQ4_XS.gguf
44-
mmproj = D:\AI\LLM\gguf\gemma-4-26B-A4B-it-qat-q4_0-unquantized\mmproj.gemma-4-26B-A4B-it-qat-q4_0-unquantized.BF16.gguf
45-
spec-draft-model = D:\AI\LLM\gguf\gemma-4-26B-A4B-it-qat-q4_0-unquantized-assistant\mtp-gemma-4-26B-A4B-it-qat-q4_0-unquantized-assistant.Q8_0.gguf
11+
spec-draft-model = D:\AI\LLM\gguf\gemma-4-31B-it-qat-q4_0-unquantized-assistant\mtp-gemma-4-31B-it-qat-q4_0-unquantized-assistant.Q4_0.gguf
4612
no-mmproj-offload = true
47-
ctx-size = 262144
13+
ctx-size = 102400
4814
parallel = 1
4915
n-gpu-layers = -1
50-
cache-type-k = q8_0
51-
cache-type-v = q8_0
52-
cache-type-k-draft = q8_0
53-
cache-type-v-draft = q8_0
16+
cache-type-k = q5_0
17+
cache-type-v = q4_1
18+
cache-type-k-draft = q5_0
19+
cache-type-v-draft = q4_1
5420
flash-attn = true
5521
reasoning = on
5622
jinja = true
@@ -69,20 +35,21 @@ spec-ngram-mod-n-min = 48
6935
spec-ngram-mod-n-max = 64
7036
direct-io = true
7137
no-mmap = true
38+
tensor-split = 1,2
7239
fit = off
7340

7441
[Qwen3.6-27B.IQ4_XS.gguf]
7542
alias = Qwen3.6-27B.IQ4_XS.gguf
7643
model = D:\AI\LLM\gguf\Qwen3.6-27B\Qwen3.6-27B.IQ4_XS.gguf
7744
mmproj = D:\AI\LLM\gguf\Qwen3.6-27B\mmproj.Qwen3.6-27B.BF16.gguf
7845
no-mmproj-offload = true
79-
ctx-size = 162144
46+
ctx-size = 200000
8047
parallel = 1
8148
n-gpu-layers = -1
82-
cache-type-k = q4_0
83-
cache-type-v = q4_0
84-
cache-type-k-draft = q4_0
85-
cache-type-v-draft = q4_0
49+
cache-type-k = q5_0
50+
cache-type-v = q4_1
51+
cache-type-k-draft = q5_0
52+
cache-type-v-draft = q4_1
8653
flash-attn = true
8754
reasoning = on
8855
jinja = true
@@ -102,6 +69,7 @@ spec-ngram-mod-n-min = 48
10269
spec-ngram-mod-n-max = 64
10370
direct-io = true
10471
no-mmap = true
72+
tensor-split = 1,2
10573
fit = off
10674

10775
[Qwen3.6-35B-A3B.IQ4_XS.gguf]
@@ -112,10 +80,10 @@ no-mmproj-offload = true
11280
ctx-size = 262144
11381
parallel = 1
11482
n-gpu-layers = -1
115-
cache-type-k = q4_0
116-
cache-type-v = q4_0
117-
cache-type-k-draft = q4_0
118-
cache-type-v-draft = q4_0
83+
cache-type-k = q5_0
84+
cache-type-v = q4_1
85+
cache-type-k-draft = q5_0
86+
cache-type-v-draft = q4_1
11987
flash-attn = true
12088
reasoning = on
12189
jinja = true
@@ -135,4 +103,5 @@ spec-ngram-mod-n-min = 48
135103
spec-ngram-mod-n-max = 64
136104
direct-io = true
137105
no-mmap = true
106+
tensor-split = 1,2
138107
fit = off

presets/models_16GB_VRAM.ini

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ alias = Qwen3.6-27B.IQ3_XXS.gguf
3434
model = D:\AI\LLM\gguf\Qwen3.6-27B\Qwen3.6-27B.IQ3_XXS.gguf
3535
mmproj = D:\AI\LLM\gguf\Qwen3.6-27B\mmproj.Qwen3.6-27B.BF16.gguf
3636
no-mmproj-offload = true
37-
ctx-size = 262144
37+
ctx-size = 100000
3838
threads = 16
3939
parallel = 1
4040
n-gpu-layers = -1
@@ -61,7 +61,7 @@ spec-ngram-mod-n-min = 48
6161
spec-ngram-mod-n-max = 64
6262
direct-io = true
6363
no-mmap = true
64-
fit-target = 1024
64+
fit = off
6565

6666
[Qwen3.6-27B.IQ4_XS.gguf]
6767
alias = Qwen3.6-27B.IQ4_XS.gguf
@@ -120,7 +120,6 @@ top-p = 0.95
120120
top-k = 20
121121
temp = 0.6
122122
presence-penalty = 0
123-
fit-target = 512
124123
spec-type = draft-mtp,ngram-mod
125124
spec-draft-n-max = 4
126125
spec-ngram-mod-n-match = 24

presets/models_24GB_VRAM.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ model = D:\AI\LLM\gguf\gemma-4-31B-it-qat-q4_0-unquantized\gemma-4-31B-it-qat-q4
88
mmproj = D:\AI\LLM\gguf\gemma-4-31B-it-qat-q4_0-unquantized\mmproj.gemma-4-31B-it-qat-q4_0-unquantized.BF16.gguf
99
spec-draft-model = D:\AI\LLM\gguf\gemma-4-31B-it-qat-q4_0-unquantized-assistant\mtp-gemma-4-31B-it-qat-q4_0-unquantized-assistant.Q4_0.gguf
1010
no-mmproj-offload = true
11-
ctx-size = 131072
11+
ctx-size = 100000
1212
parallel = 1
1313
n-gpu-layers = -1
1414
cache-type-k = q4_0

rebuild_llama.cpp.ps1

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,20 @@ switch ($blasAccelerator) {
304304
}
305305

306306
"CUDA" {
307+
# Pin pipeline-parallel staging to a single copy (ggml default is 4).
308+
# On multi-GPU layer-split, ggml pre-allocates GGML_SCHED_MAX_COPIES
309+
# copies of the compute buffer per device. Single-stream decode gains
310+
# nothing from the extra copies.
311+
#
312+
# GGML_CUDA_FA_ALL_QUANTS compiles the full set of flash-attention
313+
# K/V quant kernels. Without it only f16/f16, q4_0/q4_0, q8_0/q8_0,
314+
# bf16/bf16 are built; any mixed or q5/q4_1 KV cache aborts at runtime.
315+
# Unlocks q5_0/q4_1 at the cost of extra nvcc compile time.
307316
cmake `
308317
-DCMAKE_ASM_COMPILER="$ml64" `
309318
-DGGML_CUDA=ON `
319+
-DGGML_SCHED_MAX_COPIES=1 `
320+
-DGGML_CUDA_FA_ALL_QUANTS=ON `
310321
-DLLAMA_CURL=OFF `
311322
..
312323
}

vendor/llama.cpp

Submodule llama.cpp updated 520 files

0 commit comments

Comments
 (0)