synodic-ai™ ML SYSTEMS
ML Systems Desk · Inference Systems

Three serving assumptions agents and local inference break: append-only context, one user per server, one kernel per format

Three systems papers posted on 2026-11-12 and 2026-11-13 start from assumptions that serving stacks were built on and that agent workloads and local deployment no longer meet. Agents edit their own context and so defeat prefix caching; several agents now share one local model with an impatient user; and quantization has multiplied the kernels a tensor library must hand-write. Each paper removes a bottleneck without relaxing correctness: drafts are verified against exact state, preempted work is replayed deterministically, and generated codecs match existing formats bit for bit.

When agents edit their context, the cache they lose is still useful

Prefix caching assumes that a session only appends. Coding agents do not: to save cost or avoid confusing the model, they mask or summarize old tool outputs, which invalidates the cached keys and values for everything after the edit and forces a re-prefill before the next reply can start. Replaying SWE-bench Verified sessions under a published agent policy that keeps only the last five tool outputs in full, the Callo authors found that 79% of requests on their main model were edit-induced cache misses, each re-prefilling a median of 3.1k tokens. In a prefill-decode disaggregated deployment, that wait sits on the request's critical path even though the decode GPU still holds the previous request's cache.

Callo's observation is that this invalidated cache, with retained tokens repositioned and their keys re-rotated, stays close to the exact one: offline, the next token predicted on it matched the exact prediction at 98.3% of positions. Callo therefore drafts with the target model on the invalidated cache while the prefill GPU recomputes the suffix and streams exact keys and values back layer by layer, overwriting the provisional state in place; once about half the layers are exact, drafts are accepted as often as on the full exact cache. Nothing is committed until the drafts are verified against the exact cache, so greedy outputs are unchanged, and an instrumented check of 1,928 verifications and 44,792 committed tokens found no violations. Drafts fail mostly where the model hesitates, so Callo stops a speculation when its estimated cumulative acceptance probability falls below 0.3 and yields slots to ordinary requests.

On two data-center GPUs serving one prefill and one decode instance, built on an unmodified open-source serving engine, all requests completed 1.10 times as fast as with the engine's own disaggregated path at light load and 1.14 times at moderate load, rising to 1.27 times at full load; with a policy that keeps ten tool outputs, the moderate-load gain on misses rose to 1.24 times. Speculating misses saved 0.8 seconds on average, about 47% of their wait. The costs are 2% to 6% more decode-side time for requests that do not speculate, and a dependence on session affinity, a still-cached previous request and spare decode capacity. In a 96-GPU simulation weighted by a week of a cloud provider's coding traffic, speculation alone added miss-request speedups of 1.03 to 1.13 times depending on the prefill-to-decode ratio, and gains shrink when long reasoning outputs dominate a request.

A local server that puts the user ahead of the agents

Superfluid targets two shifts in local inference: one device now serves several agents and an interactive user at once, and small teams own several capable machines from different vendors that sit idle while one is saturated. On one device it runs each model in an isolated worker process behind a single scheduler with four service classes (interactive, completion, agent and background). An interactive request that finds every lane busy preempts the lowest-class lane, which later replays its generated tokens as decode steps and continues exactly where it left off. Ticks are sized by duration so that a new request does not wait long behind a prefill, a burst sharing a long system prompt computes it about once, and every token is written to an append-only, synced session log before the client sees it, so a session survives a worker crash or restart.

On an Apple M5 Pro with 64 GB running a 27-billion-parameter hybrid model at 4 bits, a chat sent while eight agents were prefilling got its first token in 1.5 seconds, against 291 to 612 seconds on three existing local servers. Thirty-two requests sharing a 4k-token system prompt finished in 56 seconds against 171 on one of them, every request completed with the cache oversubscribed four times, and a killed worker ended its streams with a typed error and the server was serving again in under two seconds. On a smaller model, throughput matched a runtime's own server at one request and was 4% ahead at eight.

Across machines, a head server turns a fleet into one endpoint. Each node holds a full copy of the model on whatever runtime suits its hardware, only token ids cross the network over an authenticated, encrypted link, sessions are placed by measured speed and cached-prefix affinity, and a failed node's streams continue on another node from the tokens already delivered. In a one-hour office simulation with 64 users, six machines from three chip vendors joining one at a time and one node killed mid-stream, all 5,041 requests were answered, throughput rose from 112 to 534 tokens per second and the median first-token time fell from 99 to 12 seconds. The limits are a full model copy per node, prompt recomputation when a session moves, output that can differ between nodes quantized differently, and an API without TLS that is meant for loopback, a trusted network or a reverse proxy.

Generating quantized kernels instead of writing them

The third paper addresses the kernel count. Every quantized weight format must be paired with every activation format on every instruction set and GPU, with an encoder and decoder that agree on the stored bytes. In GGML, the tensor library behind llama.cpp, these are written by hand, and on the authors' Arm CPU only 8 of 54 weight and activation pairs have a tiled matrix-multiplication kernel; the rest compute one block dot product at a time. The authors extend Halide's separation of algorithm and schedule to a third choice, the representation of values. A codec pairs an encoder with a decoder, composed from reusable quantizers, integer representations, bit packers and layouts, and a new directive applies it to one stage of a program and returns both halves as ordinary stages the schedule can place: weights encoded offline, activations inside the kernel, both decoders fused into the register tile of a matrix product.

One matrix-product algorithm and one schedule library generated 347 kernels for 31 formats on Arm CPUs and Apple GPUs, covering 38 weight and activation pairs with no existing kernel, from 3.7 times less code. Encoders and decoders matched the reference bit for bit wherever its behavior is defined, with two noted exceptions. On an Apple M3 Max the kernels reached at least 95% of the speed of format-specific hand-written kernels in 91.0% of cases, with a median speedup of 1.13 times, though a vendor math library remains faster for large full-precision matrix products. An x86 port took 793 lines of schedule and compiler code against 11,107 in the original and matched it in 83.5% of cases. Optional contracts made formats testable: a round-trip law, that re-encoding decoded values reproduces their encoding, changed 25% to 27% of blocks in one 8-bit format and exposed a stored block sum computed before its scale was rounded. The authors timed kernels, not end-to-end inference.

What to take into a serving stack

All three papers keep correctness fixed, through exact verification, deterministic replay or bit-exact codecs, and recover performance that a narrower assumption left on the table.

Sources