Skip to content

validator: GGUF models on llama.cpp for the CPU groups, mt envelope check, and quantised weights in provenance - #154

Merged
BANADDA merged 2 commits into
mainfrom
cpu-envelope
Oct 20, 2026
Merged

BANADDA merged 2 commits into
mainfrom
cpu-envelope

Conversation

@BANADDA

@BANADDA BANADDA commented Oct 19, 2026

Copy link
Copy Markdown
Member

Part of #152, after #153.

GGUF for mt-1 and mt-2

  • artifact/gguf.py reads GGUF v2 and v3 headers: metadata, tensor shapes and types, parameter count (a tied output head that llama.cpp stores twice counts once), file type, and the KV cache size at a context.
  • An SLM repository may now be one *.gguf with README.md and LICENSE.
  • check_slm_repo refuses any tensor below 4 bit (Q2_K, Q3_K, IQ1/2/3, TQ) and a file type outside the arena's precision list.
  • Parameter bounds come from the arena's budgets instead of a fixed 1B to 8B. The contract floor is now 100M so mt-1 bases fit.

CPU runner

  • When the definition's envelope is on CPU, the SLM runs in the llama.cpp server image with --cpus, --cpuset-cpus 0..n-1 and --memory set from the group's reference: 4 threads and 2 GB for mt-1, 8 threads and 4 GB for mt-2. Context is max input plus max output.
  • Peak memory is the container's cgroup memory.peak, with the GGUF footprint as fallback.
  • The SLM phase runs one submission at a time on CPU groups so measurements do not share cores.
  • The epoch refuses to run when the host architecture differs from the group's (arm64 for mt-1, x86_64 for mt-2).
  • Token counts fall back to counting streamed pieces when a server sends no usage.

mt envelope check --arena <id> --slm <dir> [--items dev.jsonl]

  • Reads the arena's resolved budgets from the server.
  • Starts the same container validators use, vLLM on one GPU for GPU groups or llama.cpp at the group's caps, published on 127.0.0.1.
  • Times prompts at the arena's full input length: dev items rendered with the arena prompt, or filler.
  • Prints parameters, memory, first token p95, and per token p95 or tokens per second against the limits. It exits 1 on any fail.

Provenance

  • The fingerprint dequantises AWQ (AutoAWQ GEMM nibble order) and GPTQ (with g_idx and the zero offset) attention weights.
  • It reads GGUF through the gguf package, mapping blk.N.attn_q/k/v/output to the HF names. Row permutation in GGUF conversion leaves singular values unchanged.
  • Weights load through torch and convert to float32, so bf16 bases still work.
  • gguf joins the validator extra.

Testing. Local tests, not committed:

  • AWQ and GPTQ round trips reproduce the spectrum (cosine above 0.999, and both agree element-wise).
  • A synthetic GGUF header counts a tied head once and flags Q3_K.
  • The CPU container pins threads and memory.

I also parsed a real header (Qwen2.5 0.5B Q4_K_M): version 3, file type Q4_K_M, no tensors below 4 bit. Full local suite, newest ruff and mypy are clean, apart from the Windows only resource findings already on main.

Not in this PR: lower group (edge) tests, which no arena can use yet, and pinning the llama.cpp image tag after the benchmark.

🤖 Generated with Claude Code

@BANADDA
BANADDA merged commit 1661f12 into main Oct 20, 2026
6 checks passed
@BANADDA
BANADDA deleted the cpu-envelope branch October 20, 2026 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant