Skip to content

v0.28.0

Choose a tag to compare

@github-actions github-actions released this 30 Oct 05:19
· 19 commits to main since this release
e950cb4
fix: accept the llama.cpp spelling of the boolean flags

## What

GGUF Parser now accepts a llama.cpp command line unchanged, and the README documents the
parameter mapping between the two.

## Why

llama.cpp changed its flag panel. `--flash-attn` used to be a boolean; it now takes a value,
`on|off|auto`. The change landed in llama.cpp **b6325** (2025-08-30, commit `e81b8e4b7`,
PR #15434), and **b6324** is the last release with the old boolean form.

llama.cpp's CLI accepts `--flag value` and never `--flag=value` — `--flash-attn=on` is
rejected as an invalid argument.

GGUF Parser models the flag as a plain boolean, so the llama.cpp spelling did not work:

| input | before | after |
| --- | --- | --- |
| `--flash-attn on` | `no model specified`, exit 1 — Go's flag package stops at the first argument that is not a flag, so the model source was never read | accepted |
| `--flash-attn=on` | the help text is printed, exit 0, nothing is estimated | accepted |
| `--flash-attn off` | not accepted | disables Flash Attention |
| `--flash-attn=auto` | not accepted | enables Flash Attention |

The value `auto` means "enable it when the device supports it". Every device the estimate
targets supports it, so `auto` counts as enabled.

## The flag names

`--parallel-size` has never existed in llama.cpp — `git log --all -G'parallel-size'` over the
whole history returns no commit — so the name no llama.cpp user types was the canonical one.
`--parallel` becomes the primary name and `--parallel-size` stays as an alias, so every
existing invocation keeps working.

The README gains a [parameter mapping](https://github.com/gpustack/gguf-parser-go#parameter-compatibility)
covering the flag names, the value forms, and the llama.cpp flags that change the estimate and
have no equivalent here:

| llama.cpp | GGUF Parser |
| --- | --- |
| `-fa`, `--flash-attn on\|off\|auto` | `--flash-attention`, `--flash-attn`, `--fa` |
| `-np`, `--parallel N` | `--parallel N`, `--parallel-size N`, `-np N`, `--threads-http N` |
| `-c`, `--ctx-size N` | `--ctx-size N`, `-c N` |
| `-ngl`, `--gpu-layers N` | `--gpu-layers N`, `--ngl N`, `--n-gpu-layers N` |
| `-ctk`, `--cache-type-k TYPE` | `--cache-type-k TYPE`, `--ctk TYPE` |
| `-m`, `--model PATH` | `--path PATH`, `--model PATH`, `-m PATH` |

## Test plan

`cmd/gguf-parser/args_test.go` covers the translation: the llama.cpp value form with a
separate token and attached to the flag, every accepted value word, the case-insensitive
form, the bare flag, the existing GGUF Parser value form, the disabling flag, an unknown
value, a token that is not a value, and the other flags left alone.

The CLI module's tests now run in `make test`. They did not before — the target only covered
the root module.

Verified against the reporter's model
(`unsloth/Qwen3.6-35B-A3B-MTP-GGUF/Qwen3.6-35B-A3B-MXFP4_MOE.gguf`) over ranged reads:

| input | context size | Flash Attention | VRAM |
| --- | --- | --- | --- |
| `--flash-attn on --parallel 1 -c 24576` | 24576 | on | 21.08 GiB |
| `--flash-attn=on --parallel 1 -c 24576` | 24576 | on | 21.08 GiB |
| `--flash-attn --parallel 1 -c 24576` | 24576 | on | 21.08 GiB |
| `--flash-attn off --parallel 1 -c 24576` | 24576 | off | 21.73 GiB |
| `--parallel-size 4 -c 24576` | 24576 | off | 21.92 GiB |

## Note on the local toolchain

`make generate` and `make lint` fail on this machine with Go 1.27.3: the pinned stringer and
golangci-lint v1.63.4 (built with go1.23.4) cannot read go1.27 export data. Both fail
identically on a clean tree. CI pins Go 1.22.9 and is unaffected.


Signed-off-by: thxCode <thxcode0824@gmail.com>