The first decoder spawned OS threads for each of about 385 matrix-vector products
per token, which made it slower with more threads (257 ms per token at 5 threads,
538 ms at 12). It now keeps a pool of parked workers; the products of a layer
are grouped into four regions (QKV, output projection, expert gate+up, expert
down) and participants claim row chunks from a shared counter, which suits the
mixed fast and slow cores. Weights are referenced through shared handles into the
mapped file so jobs are 'static. Adds a per-phase profile, a page pre-touch for the
mapping, and a real-model runner option for it.
Measured on the reference laptop (quiet machine, single runs, short context, NOT
paired; indicative only): 120 to 160 ms per token at 5 to 10 threads cold, 115 ms
(8.7 tokens/s) at 10 threads with pre-touched pages. Same 16 greedy tokens as
llama.cpp. The synthetic end-to-end tests still match the independent f64
reference and give identical logits at every thread count.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
leleka-gguf reads the header of a GGUF file with bounded allocation (limits plus
the file size), validates tensor shapes against block geometry from the pinned
ggml, offsets against alignment, overlap and the end of the file, and builds an
inventory of which bytes one decoded token reads in a mixture-of-experts model
(experts scaled by used/total, one embedding row, full attention, router, norms
and output head). No dependencies, no unsafe. 13 tests on synthetic files, including
hostile headers and truncation at every length.
benchmarks/tools adds Capture-MachineState.ps1 (drift fields of the reference
laptop record, quiet-machine gate) and Measure-LlamaServer.ps1 (rotating-round
measurement of llama.cpp-style servers with the machine state before and after).
Tested only against a fake local server; no real model has been measured yet.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>