A week inside Apoc: 42% faster prompt reading, repeatable CSL, a model that stopped spilling, and the bench that pushed back
Since 2026-10-25, Apoc got a zero-spill model (13,210 MiB peak), new attention and DeltaNet kernels (+6% decode), CSL output that comes out the same every time (5 of 5 runs, was 1 of 5), and a prefill kernel that reads long prompts at 304 instead of 215 tok/s. Then the graded quality bench dipped, so we tested each new kernel by switching it alone: none is the cause, and the dip was noise. (Correction: the new kernel only went live on 11-01.)
Apoc is the local model behind Apocrypha: Qwen3.8-27B squeezed into a 2-bit-based mix so it fits one Intel Arc A770 with 16 GB, served by our llama.cpp fork, llama-prism. The last post ended with speculative decoding learning to sample. This one covers the week after. Times are Pacific. Every number is from our own runs and names what it was measured on.
What you can take from this
- Every kernel speedup also needs a quality check on real tasks, and next-token agreement is not enough. Our new prefill kernel passed every equality test and matched the old one on KL divergence (0.2712 vs 0.2713). Then the graded bench, which scores whole multi-step answers, came in lower. We don’t yet know whether the kernel caused it; the point is that only the end-to-end bench could raise the question.
- If two runs of the same prompt give different answers, look at the order in which your matrix library adds numbers. Floating-point addition isn’t associative. A library that picks a different summation order from run to run gives slightly different sums. That was enough to flip which token wins in our structured CSL output. A kernel that always adds in the same order fixed it for about 2 to 4% of time.
- Make a crashed test window restore the service by itself. One test window died without running its cleanup and left Apoc down for 94 minutes. Now a small detached process watches each window and brings production back if the window disappears.
The week, in order
- One engine merge, five features, all off by default. Shared attention scratch memory, wider prefill, async scheduling and a draft pipeline. One switch (
GGML_SYCL_FATTN_SHARED) alone cut 379 MiB at a 54k-token context. Speed matched the old build within noise. - The model stopped spilling. A trimmed trunk plus a 4-bit speculative-decoding head brought peak card memory to 13,210 MiB, under our 13,500 target. Below that line nothing spills into slow system memory. KL against the 8-bit model even improved slightly: 0.2686 vs 0.2718.
- A terser chat template. Same model, a short block asking for direct answers: 42% fewer answer tokens, 35% less wall time, bench 91/132 vs 82/132 (a gain, but not statistically significant).
- An importance matrix from agent turns: no clear win. A 6.9-hour run collecting statistics from 820 chunks of Apoc's tool-using turns came out within noise of the current one. Not deployed. It did show that a 2048-token micro-batch computes the same matrix 17% faster than 512.
- New attention and DeltaNet kernels (build int-1027). Hand-written for the Arc card: a verify-attention kernel for checking speculative drafts and an ESIMD version of the Gated DeltaNet layers. Real-turn decode 28.9 to 30.6 tok/s, prefill 203 to 216 tok/s, KL within 0.3 standard errors.
- Paused for heat. A new temperature reader showed the card at 86 to 91 °C, clocking down to 1,350 to 2,000 of its 2,400 MHz at only 82 to 105 W. That points to cooling, not power. A/B tests from those hours are queued to be rerun.
- CSL output became repeatable (build int-1031). Explained below.
- Prompt reading 42% faster (build int-1031k). Explained below. Correction: the new kernel's on-switch was missed in production's config, so it actually went live on 2026-11-01 at 15:12.
- The bench pushed back. Explained at the end, with the answer.
Why the same prompt gave different CSL answers
CSL is the compact notation Apoc writes plans and specs in, and it runs through a small adapter (a LoRA) on top of the base model. While testing a cache for that adapter we noticed two cold runs of the same prompt disagreeing. A token’s log-probability moved by 0.81, enough to change the text.
The cause was in how the adapter’s small matrix multiplications were done. The adapter is “low-rank”: a tall, thin matrix times a short, wide one. Intel’s math libraries (oneMKL and oneDNN) choose how to split that work across the GPU, and the split, and so the order of the additions, could change between runs. In floating point, (a + b) + c is not always a + (b + c). The differences are tiny, but CSL is a strict format where one flipped token is a wrong answer.
The fix is a kernel of our own for exactly these low-rank half-precision products, which adds in one fixed order every time. It is on by default, and GGML_SYCL_F16_DET=0 brings the old path back as a control.
The cost: CSL turns take 1.5 to 3.6% longer. Ordinary turns, which don’t use the adapter, are unchanged within noise. Greedy output matched the previous build 3 of 3 times.
Reading prompts 42% faster
“Prefill” is the model reading your prompt before it writes anything. In Apocrypha a turn often starts with 20,000+ tokens of code, tool output and memory, so prefill is the wait you feel before the first word.
The biggest step in prefill is multiplying the quantized weights by a large batch of token vectors. The Arc card has matrix engines (XMX) built for this, but our quantized weight formats (q2_K and q3_K) have to be unpacked into a form those engines accept first. Our first version of this kernel, kq_xmx, did that unpacking well. The second version reorganizes it: each work group now handles four output tiles at once (“NT4”) and gets a larger register file (“GRF128”). Each unpacked block of weights is reused four times before it is thrown away.
The first try at v2 was 4% slower. Finding out why needed a fix to our profiler first: its 32-bit GPU timestamps wrap around every 223.7 seconds, which had been scrambling long measurements. With correct timings the loss was all in the q3_K path, and four tiles per group turned it into a win.
Before deploying we ran the kernel tests: 280 of 280 matrix cases match the reference for v2 (and for v1). A deliberately broken v2 that drops the last block of weights fails them, so the test can catch an error. We also checked KL divergence on held-out text: 0.27116 for v2 vs 0.27130 for v1, with perplexity 4.834 vs 4.847. Equal quality by that measure.
There was a cost we accepted with open eyes. With thinking on, decode got 7 to 8% slower because draft acceptance fell from 0.876 to 0.779, and greedy text differed from v1 in 1 of 3 runs. Tiny numeric differences in how a prompt is read change which drafts survive. Under our “equal quality, not bit-exact” standard that was allowed. Then came the bench.
The bench that pushed back
Our graded bench is 44 tasks across code, math, logic, instruction following, tool calls, long context and CSL. Each is scored pass or fail by a checker, not by eye. On the same tasks and seeds:
On its own a 5-point drop on 88 graded answers is within sampling noise. But it is the second step down in a row, and KL said “equal” both times. KL measures how closely the next-token guesses match on held-out text. A long math answer can go wrong on one early token and never recover, and KL barely notices that.
int-1027 and int-1031k also differ in more than the prefill kernel, so we are isolating it. The same binary runs four bench passes with only the kernel switch changed, in the order v1, v2, v2, v1, at 3 seeds each. Running each version twice tells us how much a version disagrees with itself, which is the noise floor, before reading anything into the gap between them. If v2 loses by more than that, production goes back to v1 with one setting. That gives up the prefill gain but keeps quality.
Result (2026-11-01, 14:26): the new kernel is not the problem. Each version scored exactly the same both times it ran: v1 83 and 83 of 132, v2 92 and 92. With fixed seeds on a fixed binary the bench is fully repeatable, so the “noise” between versions is just which random draw each one gets. Over all four passes v2 scored 184 of 264 against v1’s 166, ahead on 11 tasks and behind on 4 (sign test p = 0.12). v2 stays.
And a correction we owe you. While setting up the next test we read production’s own startup log, and it said kq_xmx: v2 off. The new build went live on 10-31, but the setting that turns the new kernel on (it defaults to off) never made it into production’s config. So from 10-31 until 2026-11-01 at 15:12 Apoc ran the old prefill kernel, and nobody got the faster prompt reading. It also explains part of the puzzle: production’s 51/88 was really v1, which scores 52/88 on the same seeds. After the fix the startup log says kq_xmx: v2 ON. The lesson is now a habit: after a deploy, check the running program’s own log for the feature line, not just that the new files are in place.
So where did the dip come from? We ran two more switch-only passes on the same binary, each against v2 with everything on (92/132). Turning off the two 10-27 kernels (verify-attention and DeltaNet) scored 89, 12 tasks better and 15 worse. Turning off the CSL fixed-order kernel scored exactly 92, because the bench doesn’t use the CSL adapter. Any change to the numbers flips about one answer in five either way, a few points of score up or down, with no direction to it. The 61 to 56 to 51 “trend” was three draws of that. It was not a slow loss of quality.
Behind the scenes: keeping Apoc up while testing it
Every kernel test needs the whole graphics card, so production stops for the test window and comes back afterwards. This week that went wrong three ways:
- 03:33, 2026-10-31: a test window died without cleaning up. It exited with code 4, no traceback, at the moment its child process hit a Windows shutdown error (0xC000026B). Its cleanup never ran, so the GPU lock stayed held and Apoc stayed down for 94 minutes. Now every window spawns a small detached guardian that outlives it. If the window’s process disappears while still holding the lock, the guardian releases it and restores production. Kill test: the guardian acted 3 s after the kill and Apoc answered in 20 s. Control with the guardian disabled: still down after 60 s.
- A scoring tool exited without restoring (05:51 to 05:56). Same pattern, smaller tool. Its guardian is written and waiting for its own kill test.
- Another project borrowed the card. The game project’s GPU lease stopped Apoc four times in one morning. The rule now: Apoc has priority.
What is next
- Re-measure live prefill speed now that v2 is really on, and grow the graded bench (more seeds, more tasks) so a 5-point move means something.
- Rerun the A/B tests from the overheated hours, once the card’s cooling is sorted.
- Live importance-matrix collection while Apoc works: the code is in production but switched off, because its equality check still fails on 20+ tensors.
- Apoc Remote, the phone client, now shows each turn’s tools under one Worked/Working row, opens thinking by default, and can hide system notes (9 notes with the setting on, 0 off, measured on the live bridge). It still needs a real check on the phone itself.