Repository navigation
[Docs] Split the fixed per-request cost: 212 ms is the cache, 165 ms is unnamed - #15
Merged
Merged
Conversation
… is unnamed
A ladder of unique prompts (74..1,608 tokens) against two arms on the
0.2.13 tree, with the engine's own prefill and park accounting, splits
what a request pays before its first token.
conv_route on TTFT 243 ms + 0.77 ms/token prefill 222 + 0.77 server 21-32 ms
shadow (stock) TTFT 455 ms + 0.79 ms/token prefill 434 + 0.79 server 21-24 ms
What that settles:
- nothing hides outside prefill; the "450-500 ms overhead" in the older
notes was prefill, plus ~21 ms of server in both modes;
- the cache-on state costs +212 ms per request, which is the router's
prize, and at batch_after 4 the first three fresh requests of a run
still pay it (484/485/402 ms against 290 ms once switched off);
- parking is ~101 ms, happens after the answer in both modes, and stops
entirely when the cache is off - so it is not TTFT;
- --prompt-cache 0 is 58 ms cheaper per request than the router's
cache-off path at 75 tokens (324 ms, spread 323-339, against 382,
327-537), so the slots cost something even unused; a repeated default
arm reproduced 382 exactly;
- --spec 0 is refused on a native IQ pack ("needs --spec T (T >= 2)"), so
the draft layer cannot be excluded this way - recorded so it is not
tried again;
- what remains is ~165 ms inside prefill with no configuration lever left
to explain it; naming it needs a phase timer in the request path.
The PLE read path was excluded in the previous round, so the remaining
candidates are slot/KV setup and the first layers' expert reach.
Artifacts: dirigo-results/0.2.13-port/intercept/ (both ladders, three
cause arms, summary.json, the probe and both drivers, logs with restore
lines). Production was restored and verified after every window.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and result
docs/PERF-NEXT.mdlisted "attribute the ~330 ms fixed per-request cost" as the next experiment. Ran it: a ladder ofunique prompts against two arms, with the engine's own
prefill_msandpark_msread out of its log and TTFT takenfrom the first content delta.
The split: TTFT = prefill + ~21 ms of server in both modes. The cache-on state adds +212 ms to the prefill
intercept (434 against 222); parking is ~101 ms and happens after the answer in both modes;
--prompt-cache 0is58 ms cheaper than the router's cache-off path at 75 tokens; and ~165 ms inside prefill remains unexplained by
any configuration lever tried.
Related discussion
none — measurement and documentation.
Approach
strata-intercept-probe.py): unique salted prompts at 4…2,048 target tokens (74…1,608 real), twosamples each,
max_tokens 8, streaming, TTFT from the firstdelta.content— not the first SSE byte, which theserver sends before the prompt is read (the first attempt measured 2.6 ms and was thrown away).
conv_route: onandshadow(classify and log, never switch), sothe cache-on path stock always runs is measured on the same card, not inferred.
--spec 0and--prompt-cache 0, plus a repeateddefault arm for drift (
base382 ms,base2382 ms).re-ranked (the attribution item becomes "an engine-side phase timer", plus a new idea about dropping cache slots in
a one-shot mode), and section 2 records that
--spec 0is refused on a native IQ pack.Validation
Passed:
server in both arms.
shadowarm every request has a ~101 ms park; in theonarm exactly three do — the first three of the run — and the fourth onward has none, which isbatch_after 4switching the cache off.
--prompt-cache 0comparison is same-build, same prompts, 6 samples each, with a repeated default armbounding drift at 0.5 ms.
--spec 0failure captured: engine exit 2 with "it needs --native SHARD1, --spec T (T >= 2) and --prefillCHUNK" — recorded rather than retried.
strata-b70with:8095 http=200and engine 0.1.58 in the log, checked afterthe last one.
Failed:
before the prompt is read. Fixed to the first
delta.content, both arms re-run; the byte-prefix JSONs are keptbeside the good ones so the mistake and its cause are auditable.
--spec 0arm produced nothing for the same reason it was supposed to answer a question: the engine refusesthat flag on an IQ pack, so the arm never started. Re-run unfiltered to capture the refusal.
Not run:
Limits
slightly above the line (300–340 ms measured against a 280–315 ms fit) because the engine's fixed cost does not
decay smoothly at small sizes.
--prompt-cache 0is a restart-class setting. The 58 ms is evidence that the slots cost something, not a proposal tochange the deployed config.