Repository navigation
docs(onnx-pack): the KV cache is opt-in, not a missing feature - #684
Conversation
The pack page said a cached graph was "a different, much larger piece of work" and left it there. It exists now: `--cached` exports the cache as an input and an output, and at a 256-token prompt it is 63.7 ms/token against 291.2 for the re-run-the-sequence graph, with the gap widening as context grows and logits matching transformers' own cached greedy loop to mean KL 1.2e-07 at identical top-1. What is still absent is written down separately, because "has a KV cache" and "is a server" are different claims: no batching, no paged cache, one sequence.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY (tprs-ready applied). The replacement text is faithful to the measurement it summarises; two notes, neither blocking.
The numbers are the ones recorded in onnx/README.md on #683's head — --cached 63.66 ms/token against uncached 291.22 at a 256-token prompt (-n 16 --threads 8, same box), 4.6x (291.22/63.66 = 4.58), and "mean KL of 1.2e-07 nats with top-1 matching at every step" — so the sentence replaces a "no KV cache" claim with the same measurement the runner's own doc carries, rather than a new number.
Merge order matters here: those numbers exist only on #683's branch. main's onnx/README.md has none of 63.66 / 291.22 / 1.2e-07 / 4.6x, so if this lands before #683 it will point readers at a measurement that is not in the tree yet. #683 first, then this one.
One clause in the new text is not in the doc it summarises: "no batching, no paged cache, one sequence at a time". It is true of the runner — onnx/ort_run.cpp:238 hard-wires the batch dimension (dims[2] = {1, ids.size()}) and the cached graph carries one stacked past/present per step — but onnx/README.md and docs/onnx.md do not say it anywhere. Worth one sentence there so the pack doc is not the only place that limit is written down, and so a future paged-cache or batching change has something to update.
From the owner's pi session on ryzen (commit 93b2191). Docs only.
🤖 Generated with Claude Code