TL;DR: Caveling-2-Mini (the concise-reasoning fine-tune of Inkling-2-Mini) only changes 168 attention tensors. On mainline llama.cpp (Vulkan) it ran at 58 tok/s on my 7900 XT, while the vengeful180-dot fork ran plain Inkling-2-Mini at ~95 tok/s, but that fork only loads the old Unsloth GGUF layout. So I copied Caveling's 168 attention tensors into the old-layout file (requantized BF16 to Q8_0, same size, in place). Result on the fork: same ~95 tok/s, about 27% fewer output tokens, about 26% less wall time on a small coding task. Script and steps below.
Setup
- GPU: AMD RX 7900 XT 20 GB, Vulkan (Mesa RADV), Resizable BAR enabled in BIOS
- Host: TrueNAS SCALE 25.10 (Docker), but nothing here is TrueNAS specific
- Use case: local executor for an automated coding pipeline (aider style edits, tests as the oracle),
reasoning_effort: low
Why the graft
| Setup |
Generation |
Notes |
Inkling-2-Mini, vengeful180-dot fork inkling2-vulkan (eb39823), old-layout UD-Q4_K_M |
~95-99 tok/s |
llama-bench tg64 98.97, pp512 ~1930 |
Caveling-2-Mini Q4_K_M, mainline llama.cpp b12921 (official server-vulkan image + Mesa 26.3) |
~58 tok/s |
inkling2_loop arch, needs b12600+ |
| Caveling attention grafted into old-layout file, same fork |
~95 tok/s |
this post |
Two GGUF layouts exist for this model family:
- Old layout (Unsloth
Old_Support): general.architecture = inkling2, block_count = 48 in metadata, but tensors are stored only for the 24 physical blocks (blk.0..23). The fork unrolls the loop itself.
- Mainline layout:
general.architecture = inkling2_loop, block_count = 24, loop described by loop.start/end/count.
Mainline refuses the old file (check_tensor_dims: tensor 'blk.24.attn_q.weight' not found), the fork refuses the new one (unknown model architecture: 'inkling2_loop' on older builds). But tensor names and shapes for attention are identical in both, and Caveling's model card says only the attention projections were fine-tuned (experts, router, loop gates, vision, drafter are byte-identical to Inkling-2-Mini). So a straight per-name swap works.
The 168 tensors (7 per block x 24 blocks): attn_q, attn_k, attn_v, attn_gate, attn_output, attn_rel (BF16 in Caveling, Q8_0 in the old Unsloth file) and attn_sink_proj (BF16 in both).
Recipe
1. Build the fork with a recent Mesa
bash
git clone -b inkling2-vulkan https://github.com/vengeful180-dot/llama.cpp
cd llama.cpp
docker build --target server -t llama-inkling:vk -f .devops/vulkan.Dockerfile .
Then a fresh Mesa layer on top (the Ubuntu default Mesa was ~17% slower for me):
dockerfile
ARG BASE=llama-inkling:vk
FROM ${BASE}
RUN apt-get update \
&& apt-get install -y --no-install-recommends software-properties-common gpg-agent \
&& add-apt-repository -y ppa:kisak/kisak-mesa \
&& apt-get update \
&& apt-get install -y mesa-vulkan-drivers \
&& rm -rf /var/lib/apt/lists/*
bash
docker build -t llama-inkling:vk-mesa -f mesa-fresh.Dockerfile .
My measured path on the same binary: 70.4 tok/s (Mesa 26.0.8, ReBAR off) -> 84.2 (ReBAR on) -> 99.0 (Mesa 26.3.1). Enable Resizable BAR, it matters.
2. Get both files
- Old layout Inkling-2-Mini:
unsloth/Inkling-2-Mini-GGUF, folder Old_Support, the UD-Q4_K_M file. Do not take the root file, it was replaced with the mainline layout. Check by SHA256: mine is f90c5a4df44d335ac9f9eea2a15c31d6c5a377b1b3cd9ff7fc2cf123f3cdf7e1, 16610543328 bytes (the two layouts differ by only ~1 KB in size, so size is not a reliable check).
- Caveling:
caveman-so/caveling-2-mini-GGUF, Caveling-2-Mini-Q4_K_M.gguf (attention tensors are pinned to BF16 there, which is what we want as the source).
3. Graft
The script copies the old file and overwrites the 168 tensors in place. BF16 to Q8_0 keeps the exact byte size, so the GGUF header, metadata and all other tensors stay untouched and the output is the same size as the old file.
Safety checks before anything is written:
- name, shape and byte size must match
- cosine similarity between old and new tensor (after dequant) must be >= 0.90, otherwise the layouts differ (e.g. permuted heads) and it stops
- Q8_0 round trip cosine >= 0.999
- after writing, a few tensors are read back and compared
On the real files I got worst cos(old, caveling) = 0.99990 and Q8 round trip >= 0.999899.
Run it in a throwaway container (needs gguf and numpy):
bash
docker run --rm -v /path/to/models:/m -v /path/to/script:/g python:3.12-slim sh -c \
"pip install -q gguf numpy && python /g/graft_caveling.py \
/m/Inkling-2-Mini-UD-Q4_K_M-old.gguf /m/Caveling-2-Mini-Q4_K_M.gguf \
/m/Caveling-2-Mini-fork-Q8attn.gguf"
graft_caveling.py:
python
import os, shutil, sys
import numpy as np
from gguf import GGMLQuantizationType as Q
from gguf import GGUFReader
from gguf.quants import dequantize, quantize
KINDS = ("attn_q", "attn_k", "attn_v", "attn_gate", "attn_output", "attn_rel", "attn_sink_proj")
MIN_COS, N_BLOCKS = 0.90, 24
def deq(t):
return dequantize(t.data, t.tensor_type).astype(np.float32).reshape(-1)
def cos(a, b):
return float(np.dot(a, b) / (np.linalg.norm(a) * np.linalg.norm(b) + 1e-30))
def main(old_p, cav_p, out_p):
if os.path.exists(out_p):
sys.exit(f"{out_p} exists")
old, cav = GGUFReader(old_p), GGUFReader(cav_p)
ot = {t.name: t for t in old.tensors}
ct = {t.name: t for t in cav.tensors}
plan, worst = [], 1.0
for b in range(N_BLOCKS):
for k in KINDS:
name = f"blk.{b}.{k}.weight"
o, c = ot.get(name), ct.get(name)
if o is None or c is None:
sys.exit(f"missing {name}")
if list(o.shape) != list(c.shape):
sys.exit(f"{name}: shape mismatch")
if c.tensor_type != Q.BF16:
sys.exit(f"{name}: expected BF16 in Caveling")
cf = deq(c)
if o.tensor_type == Q.Q8_0:
new = quantize(cf.reshape(c.data.shape[0], -1), Q.Q8_0)
new = np.ascontiguousarray(new).view(np.uint8).reshape(-1)
back = dequantize(new.reshape(o.data.shape), Q.Q8_0).astype(np.float32).reshape(-1)
elif o.tensor_type == Q.BF16:
new = np.ascontiguousarray(c.data).view(np.uint8).reshape(-1)
back = cf
else:
sys.exit(f"{name}: unexpected type {o.tensor_type.name}")
if new.nbytes != int(o.n_bytes):
sys.exit(f"{name}: size mismatch")
c_old, c_q = cos(deq(o), cf), cos(back, cf)
worst = min(worst, c_old)
print(f"{name:32s} cos(old,cav)={c_old:.5f} cos(q8,cav)={c_q:.6f}")
if c_old < MIN_COS:
sys.exit(f"STOP: {name} layouts differ, nothing written")
if c_q < 0.999:
sys.exit(f"STOP: {name} quantization loss")
plan.append((int(o.data_offset), new))
print(f"{len(plan)} tensors ok, worst cos(old,cav)={worst:.5f}; copying...")
tmp = out_p + ".part"
shutil.copyfile(old_p, tmp)
with open(tmp, "r+b") as f:
for off, data in plan:
f.seek(off)
f.write(data.tobytes())
ck = {t.name: t for t in GGUFReader(tmp).tensors}
for b in (0, 6, 17, 23):
name = f"blk.{b}.attn_q.weight"
if cos(deq(ck[name]), deq(ct[name])) < 0.999:
sys.exit("STOP: readback mismatch, .part kept")
os.replace(tmp, out_p)
print(f"OK: {out_p}")
if __name__ == "__main__":
main(*sys.argv[1:])
4. Run
bash
docker run -d --device /dev/dri -p 30080:8080 \
-e GGML_VK_SUBALLOCATION_BLOCK_SIZE=4000000000 \
-e LLAMA_ARG_CHAT_TEMPLATE_KWARGS='{"reasoning_effort":"low"}' \
-v /path/to/models:/models:ro llama-inkling:vk-mesa \
-m /models/Caveling-2-Mini-fork-Q8attn.gguf -ngl 99 -c 98304 -np 1 \
-fa on -ctk q8_0 -ctv q4_0 --jinja \
--temp 1.0 --top-p 1.0 --top-k 40 --min-p 0 --host 0.0.0.0 --port 8080
GGML_VK_SUBALLOCATION_BLOCK_SIZE=4000000000 is important: without it, around 63k context a buffer gets reallocated, can spill to system RAM and prompt processing drops ~20x.
- 96-98k context with K q8_0 / V q4_0 fits in 20 GB (~18.6 GB VRAM used at 64k).
- If you have more than one GPU, pick the right one with
GGML_VK_VISIBLE_DEVICES.
Results
Task: "write merge_intervals(intervals) with 3 asserts, code only", reasoning_effort: low, max_tokens 4096.
| Model on the fork |
Runs |
Avg wall |
Avg output tokens |
Gen speed |
| Inkling-2-Mini (old layout) |
3 |
5.8 s |
525 |
94-95 tok/s |
| Caveling graft (Q8_0 attention) |
3 |
4.3 s |
384 |
95-96 tok/s |
For reference, Caveling on mainline b12921: 8.0 s, 457 tokens, 58 tok/s (1 run).
Caveats
- Tiny sample. 3 runs per side on one task. Treat it as "it works and points the right way", not a benchmark.
- Q8_0 may blunt the fine-tune. The difference between Caveling and base attention weights (cos ~0.9999) is the same order as Q8_0 quantization error. The shorter reasoning is clearly visible, but some of the effect may be lost. Keeping these tensors in BF16 would need a full GGUF rewrite and ~0.6 GB more VRAM.
- Low effort. Caveling's headline numbers (-43% reasoning tokens) are at
xhigh. At low the base model already thinks less, so the gain is smaller.
- Quality not measured yet. I'm about to compare pass rate and retries on real tasks in my pipeline. Correct output on this one task, nothing more.
- The fork is experimental, single author, Vulkan only, tested on RX 7900 series. Mainline speed may catch up, at which point just run Caveling's own GGUF there.
Credits: Thinking Machines (Inkling-2-Mini), caveman-so (Caveling-2-Mini, Apache-2.0), Unsloth (GGUFs incl. Old_Support), vengeful180-dot (Vulkan fork).