Repository navigation
v1.0.6
Fixed
T4 rung r2 showed three defects in the generate ladder (GENERATE_LADDER_VERSION 2 and 1). All three are in Ollama v0.40.11's source and in r2's llama-server log.
- The prompt could overshoot its window, and 16k and 32k came back unmeasured. The window was
target + num_predict + 64, the calibration accepted a prompt within 2% of the target and landed about 1.2% high, so at 16k and 32k the prompt reachednum_ctx - 1and Ollama truncated it to about half (limit=8290 prompt=16577). The window is nowtarget + 2% + num_predict + 64, the largest prompt the tolerance accepts, so nothing the calibration accepts can reach the truncation line. A verify reading that shows truncation while the prompt is above its estimate is cut back and tried again, up to four verify calls.settings.num_ctxis what the request sent;settings.cell_tokensis the nominal cell. - Every ttft in the ladder was a prompt-cache hit, not a prefill. Ollama sets
cache_prompt: trueon every completion with no per-request switch, llama-server reuses the longest common token prefix, and the ladder resent one identical prompt for the verify call, the warmup and every repeat, so each timed pass evaluated about one token (15 ms at 512 tokens and 33 ms at 8,287 on a T4).prompt_eval_countstill reported the full length, so the row looked right. Every timed call now starts with a prefix of its own (the call number and a per-cell nonce, from the first character), the calibration includes the prefix, and the verify call has its own. Two guards turn a cached cell intounmeasured: a prefill faster than 250,000 tok/s (PREFILL_TOK_S_CEILING), and, within a concurrency, a longer cell whose ttft is under 60% of the proportional growth from the first measured cell (TTFT_SCALING_FLOOR). Rows recordprefix_caching: off. - The concurrency cells ran through one slot, and their throughput read about the concurrency times too high.
OLLAMA_NUM_PARALLELdefaults to 1, so the c4 and c8 requests queued, and the aggregate wassum(eval_count) / max(eval_duration), where each request's owneval_durationleaves out the queue wait. The harness's Ollama now runs exactlyconcurrencyslots (it restarts to change the count, and the ladder loops concurrency outermost so each count is set once; exact, not a floor, because KV memory isnum_ctxtimes the slots). The slot count is read from llama-server'sn_slotsin the server log and recorded with its source (parallel_slots,parallel_slots_source); a server that logged fewer slots than the concurrency makes the cellunmeasured. The aggregate decode rate is the generated tokens over the pass's decode window, taken from Ollama's own per-request durations and not the client's clock: from the earliest decode start (total_duration - eval_duration) to the latest end (max total_duration); at one request it is exactlyeval_count / eval_duration(throughput_method: ollama_durations_decode_window), androuteranks on it. Between the request and the first token there is time that is neither prefill nor decode (the rig measured 0.11 s at 512 tokens, 1.36 s at 8k, 2.27 s at 16k, non-monotonic), so a client wall clock cannot give a clean decode rate.ttft_msis now the time to the first token (total_duration - eval_duration - load_duration), which is what--max-ttft-msfloors on;prefill_msisprompt_eval_durationon its own, and the cache check reads that one;overhead_msrecords the rest per row. The tokens over the client's whole pass areend_to_end_tok_s, and the per-request rate isper_request_decode_tok_s. A high-context, high-concurrency cell can honestly fail to load or run out of memory on a small card; it is recorded as that failure.
Changed
- Each readiness poll of the harness's Ollama has a 2 s timeout inside the
ready_timeout_sbudget (it was a 30 surlopeninside a 30 s budget, so one hung request used it all). GENERATE_LADDER_VERSIONis 3. The newest-version filter keeps version 1 and 2 rows out of version 3 decisions.routenever reads what earlier ladders could not measure. A ttft from a row that did not come from a version 3 ladder is never used for--max-ttft-ms(the floor cannot pass), and the throughput of a row with a concurrency above 1 from before version 3 is never used (it cannot rank or pass a decode floor).routesays so innotes("N pre-v3 row(s) with concurrency > 1 not used", "ttft of N pre-v3 row(s) not used").tableshowsttft: not measuredandthroughput: not measuredon those rows. A decode figure at concurrency 1 is unaffected.- Rig harnesses, audited. No row in
table/routing.jsonlcarries a ttft in its slots or settings, and the rig's generate rows (E3 OpenVINO, E3-REF and E4 Ollama) record end-to-end latency, not a ttft; none has a concurrency above 1. Read, not run:harness/runner.pygenerate steps repeat one prompt across warmups and repeats, andharness/fill.pyresends its prompt in the confirm call after the load call, so a ttft from them would be a cache hit as well;harness/e4b.pytakes its figures from the adapter and was not traced further. A row cannot be told which harness made it, so the router reads no ttft from a row without a version 3 stamp, whatever its harness. tests/fake_ollama.py: a fake that caches by longest common prefix, queues unless it has the slots, truncates bycontextShiftPromptLimit, and keeps virtual time. The tests for each fix fail against 1.0.5.
Docs
- README and handbook carry a correction notice: the generate ladder's time to first token and concurrency-above-1 throughput in 1.0.5 and earlier were not valid measures, and interlock no longer uses them. The handbook describes ladder version 3.