diff --git a/bench/results/2026-10-01-ctx-ladder/128k.json b/bench/results/2026-10-01-ctx-ladder/128k.json new file mode 100644 index 00000000..c83284c4 --- /dev/null +++ b/bench/results/2026-10-01-ctx-ladder/128k.json @@ -0,0 +1,117 @@ +{ + "engine": "Strata", + "model_name": "qwen3.8-flash-next-iq2_xs", + "host": "Shin-BlackMamba", + "started_at_utc": 1791229354, + "contexts": [ + 131072 + ], + "note": "IQ2_XS @ 128k (KV=int8) - upstream 6f32ec07 fresh rebuild, sm_89 fat-bin", + "results": [ + { + "target_ctx": 131072, + "model_name": "qwen3.8-flash-next-iq2_xs", + "target_prompt_tokens": 120748, + "fill_chars": 560962, + "cold_prefill": { + "prompt_tokens_actual": 120748, + "prompt_total_ms": 45217.9, + "prompt_per_second": 2670.4, + "completion_tokens": 1 + }, + "runs": [ + { + "seq": 1, + "target_ctx": 131072, + "target_fill_chars": 560962, + "prompt_tokens_actual": 120748, + "completion_tokens": 192, + "content_chunks": 182, + "reasoning_chunks": 0, + "ttft_ms": 431.5, + "decode_avg_tps": 82.28, + "decode_peak_tps": 111.19, + "eng_predicted_per_second": 81.1, + "eng_predicted_per_token_ms": 12.33, + "eng_prompt_per_second": 123.0, + "sse_prompt_per_second": 123.0, + "eng_draft_n": 151, + "eng_draft_n_accepted": 115, + "eng_predicted_ms": 2368.2, + "eng_total_request_ms": 2765.2, + "finish_reason": "length", + "elapsed_ms": 2764.9 + }, + { + "seq": 2, + "target_ctx": 131072, + "target_fill_chars": 560962, + "prompt_tokens_actual": 120748, + "completion_tokens": 192, + "content_chunks": 182, + "reasoning_chunks": 0, + "ttft_ms": 403.48, + "decode_avg_tps": 89.98, + "decode_peak_tps": 117.52, + "eng_predicted_per_second": 88.7, + "eng_predicted_per_token_ms": 11.27, + "eng_prompt_per_second": 143.4, + "sse_prompt_per_second": 143.4, + "eng_draft_n": 147, + "eng_draft_n_accepted": 116, + "eng_predicted_ms": 2163.5, + "eng_total_request_ms": 2537.5, + "finish_reason": "length", + "elapsed_ms": 2537.3 + }, + { + "seq": 3, + "target_ctx": 131072, + "target_fill_chars": 560962, + "prompt_tokens_actual": 120748, + "completion_tokens": 192, + "content_chunks": 182, + "reasoning_chunks": 0, + "ttft_ms": 429.82, + "decode_avg_tps": 91.58, + "decode_peak_tps": 116.04, + "eng_predicted_per_second": 90.2, + "eng_predicted_per_token_ms": 11.09, + "eng_prompt_per_second": 131.3, + "sse_prompt_per_second": 131.3, + "eng_draft_n": 155, + "eng_draft_n_accepted": 117, + "eng_predicted_ms": 2128.9, + "eng_total_request_ms": 2526.5, + "finish_reason": "length", + "elapsed_ms": 2526.3 + } + ], + "avg_decode_avg_tps": 87.95, + "avg_peak_decode_tps": 114.92, + "peak_decode_tps_overall": 117.52, + "engine_predicted_avg_tps": 86.67, + "engine_predicted_per_run": [ + 81.1, + 88.7, + 90.2 + ], + "ttft_ms_per_run": [ + 431.5, + 403.48, + 429.82 + ], + "engine_prefill_per_run": [ + 123.0, + 143.4, + 131.3 + ], + "finish_reasons": [ + "length", + "length", + "length" + ] + } + ], + "finished_at_utc": 1791229537 +} \ No newline at end of file diff --git a/bench/results/2026-10-01-ctx-ladder/256k.json b/bench/results/2026-10-01-ctx-ladder/256k.json new file mode 100644 index 00000000..850ef187 --- /dev/null +++ b/bench/results/2026-10-01-ctx-ladder/256k.json @@ -0,0 +1,117 @@ +{ + "engine": "Strata", + "model_name": "qwen3.8-flash-next-iq2_xs", + "host": "Shin-BlackMamba", + "started_at_utc": 1791229537, + "contexts": [ + 262144 + ], + "note": "IQ2_XS @ 256k (KV=int8) - upstream 6f32ec07 fresh rebuild, sm_89 fat-bin", + "results": [ + { + "target_ctx": 262144, + "model_name": "qwen3.8-flash-next-iq2_xs", + "target_prompt_tokens": 240912, + "fill_chars": 1119244, + "cold_prefill": { + "prompt_tokens_actual": 240912, + "prompt_total_ms": 96989.1, + "prompt_per_second": 2483.9, + "completion_tokens": 1 + }, + "runs": [ + { + "seq": 1, + "target_ctx": 262144, + "target_fill_chars": 1119244, + "prompt_tokens_actual": 240912, + "completion_tokens": 192, + "content_chunks": 181, + "reasoning_chunks": 0, + "ttft_ms": 721.36, + "decode_avg_tps": 73.64, + "decode_peak_tps": 107.12, + "eng_predicted_per_second": 72.6, + "eng_predicted_per_token_ms": 13.77, + "eng_prompt_per_second": 119.5, + "sse_prompt_per_second": 119.5, + "eng_draft_n": 171, + "eng_draft_n_accepted": 112, + "eng_predicted_ms": 2643.4, + "eng_total_request_ms": 3328.7, + "finish_reason": "length", + "elapsed_ms": 3328.5 + }, + { + "seq": 2, + "target_ctx": 262144, + "target_fill_chars": 1119244, + "prompt_tokens_actual": 240912, + "completion_tokens": 192, + "content_chunks": 182, + "reasoning_chunks": 0, + "ttft_ms": 741.37, + "decode_avg_tps": 81.55, + "decode_peak_tps": 107.36, + "eng_predicted_per_second": 80.5, + "eng_predicted_per_token_ms": 12.43, + "eng_prompt_per_second": 138.6, + "sse_prompt_per_second": 138.6, + "eng_draft_n": 157, + "eng_draft_n_accepted": 112, + "eng_predicted_ms": 2386.4, + "eng_total_request_ms": 3096.1, + "finish_reason": "length", + "elapsed_ms": 3095.8 + }, + { + "seq": 3, + "target_ctx": 262144, + "target_fill_chars": 1119244, + "prompt_tokens_actual": 240912, + "completion_tokens": 192, + "content_chunks": 182, + "reasoning_chunks": 0, + "ttft_ms": 714.0, + "decode_avg_tps": 83.69, + "decode_peak_tps": 106.44, + "eng_predicted_per_second": 82.4, + "eng_predicted_per_token_ms": 12.13, + "eng_prompt_per_second": 123.7, + "sse_prompt_per_second": 123.7, + "eng_draft_n": 153, + "eng_draft_n_accepted": 111, + "eng_predicted_ms": 2329.5, + "eng_total_request_ms": 3008.7, + "finish_reason": "length", + "elapsed_ms": 3008.3 + } + ], + "avg_decode_avg_tps": 79.63, + "avg_peak_decode_tps": 106.97, + "peak_decode_tps_overall": 107.36, + "engine_predicted_avg_tps": 78.5, + "engine_predicted_per_run": [ + 72.6, + 80.5, + 82.4 + ], + "ttft_ms_per_run": [ + 721.36, + 741.37, + 714.0 + ], + "engine_prefill_per_run": [ + 119.5, + 138.6, + 123.7 + ], + "finish_reasons": [ + "length", + "length", + "length" + ] + } + ], + "finished_at_utc": 1791229835 +} \ No newline at end of file diff --git a/bench/results/2026-10-01-ctx-ladder/32k.json b/bench/results/2026-10-01-ctx-ladder/32k.json new file mode 100644 index 00000000..36c71b0f --- /dev/null +++ b/bench/results/2026-10-01-ctx-ladder/32k.json @@ -0,0 +1,117 @@ +{ + "engine": "Strata", + "model_name": "qwen3.8-flash-next-iq2_xs", + "host": "Shin-BlackMamba", + "started_at_utc": 1791229107, + "contexts": [ + 32768 + ], + "note": "IQ2_XS @ 32k (KV=int8) - upstream 6f32ec07 fresh rebuild, sm_89 fat-bin", + "results": [ + { + "target_ctx": 32768, + "model_name": "qwen3.8-flash-next-iq2_xs", + "target_prompt_tokens": 29966, + "fill_chars": 139155, + "cold_prefill": { + "prompt_tokens_actual": 29966, + "prompt_total_ms": 11119.9, + "prompt_per_second": 2694.8, + "completion_tokens": 1 + }, + "runs": [ + { + "seq": 1, + "target_ctx": 32768, + "target_fill_chars": 139155, + "prompt_tokens_actual": 29966, + "completion_tokens": 192, + "content_chunks": 181, + "reasoning_chunks": 0, + "ttft_ms": 189.11, + "decode_avg_tps": 85.69, + "decode_peak_tps": 108.05, + "eng_predicted_per_second": 83.7, + "eng_predicted_per_token_ms": 11.95, + "eng_prompt_per_second": 127.3, + "sse_prompt_per_second": 127.3, + "eng_draft_n": 161, + "eng_draft_n_accepted": 120, + "eng_predicted_ms": 2293.8, + "eng_total_request_ms": 2429.8, + "finish_reason": "length", + "elapsed_ms": 2429.7 + }, + { + "seq": 2, + "target_ctx": 32768, + "target_fill_chars": 139155, + "prompt_tokens_actual": 29966, + "completion_tokens": 192, + "content_chunks": 182, + "reasoning_chunks": 0, + "ttft_ms": 160.64, + "decode_avg_tps": 103.62, + "decode_peak_tps": 136.34, + "eng_predicted_per_second": 101.6, + "eng_predicted_per_token_ms": 9.85, + "eng_prompt_per_second": 159.8, + "sse_prompt_per_second": 159.8, + "eng_draft_n": 164, + "eng_draft_n_accepted": 127, + "eng_predicted_ms": 1890.3, + "eng_total_request_ms": 2013.7, + "finish_reason": "length", + "elapsed_ms": 2013.6 + }, + { + "seq": 3, + "target_ctx": 32768, + "target_fill_chars": 139155, + "prompt_tokens_actual": 29966, + "completion_tokens": 192, + "content_chunks": 181, + "reasoning_chunks": 0, + "ttft_ms": 199.27, + "decode_avg_tps": 97.56, + "decode_peak_tps": 124.34, + "eng_predicted_per_second": 95.1, + "eng_predicted_per_token_ms": 10.52, + "eng_prompt_per_second": 136.7, + "sse_prompt_per_second": 136.7, + "eng_draft_n": 155, + "eng_draft_n_accepted": 117, + "eng_predicted_ms": 2019.8, + "eng_total_request_ms": 2167.5, + "finish_reason": "length", + "elapsed_ms": 2167.4 + } + ], + "avg_decode_avg_tps": 95.62, + "avg_peak_decode_tps": 122.91, + "peak_decode_tps_overall": 136.34, + "engine_predicted_avg_tps": 93.47, + "engine_predicted_per_run": [ + 83.7, + 101.6, + 95.1 + ], + "ttft_ms_per_run": [ + 189.11, + 160.64, + 199.27 + ], + "engine_prefill_per_run": [ + 127.3, + 159.8, + 136.7 + ], + "finish_reasons": [ + "length", + "length", + "length" + ] + } + ], + "finished_at_utc": 1791229219 +} \ No newline at end of file diff --git a/bench/results/2026-10-01-ctx-ladder/64k.json b/bench/results/2026-10-01-ctx-ladder/64k.json new file mode 100644 index 00000000..e8ca8b4d --- /dev/null +++ b/bench/results/2026-10-01-ctx-ladder/64k.json @@ -0,0 +1,117 @@ +{ + "engine": "Strata", + "model_name": "qwen3.8-flash-next-iq2_xs", + "host": "Shin-BlackMamba", + "started_at_utc": 1791229219, + "contexts": [ + 65536 + ], + "note": "IQ2_XS @ 64k (KV=int8) - upstream 6f32ec07 fresh rebuild, sm_89 fat-bin", + "results": [ + { + "target_ctx": 65536, + "model_name": "qwen3.8-flash-next-iq2_xs", + "target_prompt_tokens": 60270, + "fill_chars": 279972, + "cold_prefill": { + "prompt_tokens_actual": 60270, + "prompt_total_ms": 22505.8, + "prompt_per_second": 2678.0, + "completion_tokens": 1 + }, + "runs": [ + { + "seq": 1, + "target_ctx": 65536, + "target_fill_chars": 279972, + "prompt_tokens_actual": 60270, + "completion_tokens": 192, + "content_chunks": 183, + "reasoning_chunks": 0, + "ttft_ms": 280.14, + "decode_avg_tps": 82.98, + "decode_peak_tps": 109.92, + "eng_predicted_per_second": 81.2, + "eng_predicted_per_token_ms": 12.32, + "eng_prompt_per_second": 129.9, + "sse_prompt_per_second": 129.9, + "eng_draft_n": 153, + "eng_draft_n_accepted": 114, + "eng_predicted_ms": 2365.8, + "eng_total_request_ms": 2594.2, + "finish_reason": "length", + "elapsed_ms": 2594.1 + }, + { + "seq": 2, + "target_ctx": 65536, + "target_fill_chars": 279972, + "prompt_tokens_actual": 60270, + "completion_tokens": 192, + "content_chunks": 182, + "reasoning_chunks": 0, + "ttft_ms": 260.9, + "decode_avg_tps": 96.19, + "decode_peak_tps": 117.86, + "eng_predicted_per_second": 94.3, + "eng_predicted_per_token_ms": 10.6, + "eng_prompt_per_second": 149.9, + "sse_prompt_per_second": 149.9, + "eng_draft_n": 160, + "eng_draft_n_accepted": 118, + "eng_predicted_ms": 2035.5, + "eng_total_request_ms": 2257.2, + "finish_reason": "length", + "elapsed_ms": 2257.0 + }, + { + "seq": 3, + "target_ctx": 65536, + "target_fill_chars": 279972, + "prompt_tokens_actual": 60270, + "completion_tokens": 192, + "content_chunks": 181, + "reasoning_chunks": 0, + "ttft_ms": 271.83, + "decode_avg_tps": 96.22, + "decode_peak_tps": 123.2, + "eng_predicted_per_second": 94.2, + "eng_predicted_per_token_ms": 10.62, + "eng_prompt_per_second": 142.9, + "sse_prompt_per_second": 142.9, + "eng_draft_n": 154, + "eng_draft_n_accepted": 116, + "eng_predicted_ms": 2038.0, + "eng_total_request_ms": 2267.4, + "finish_reason": "length", + "elapsed_ms": 2267.3 + } + ], + "avg_decode_avg_tps": 91.8, + "avg_peak_decode_tps": 116.99, + "peak_decode_tps_overall": 123.2, + "engine_predicted_avg_tps": 89.9, + "engine_predicted_per_run": [ + 81.2, + 94.3, + 94.2 + ], + "ttft_ms_per_run": [ + 280.14, + 260.9, + 271.83 + ], + "engine_prefill_per_run": [ + 129.9, + 149.9, + 142.9 + ], + "finish_reasons": [ + "length", + "length", + "length" + ] + } + ], + "finished_at_utc": 1791229354 +} \ No newline at end of file diff --git a/bench/results/2026-10-01-ctx-ladder/README.md b/bench/results/2026-10-01-ctx-ladder/README.md new file mode 100644 index 00000000..3ff38ffe --- /dev/null +++ b/bench/results/2026-10-01-ctx-ladder/README.md @@ -0,0 +1,49 @@ +# 2026-10-01 — Strata IQ2_XS context-ladder TPS on RTX 4070 Ti SUPER + +Benchmark target: `Qwen3.8-Flash-Next` IQ2_XS (the README's "recommended" variant for a 16 GiB consumer GPU), serving on `127.0.0.1:8090` from inside the `strata` container (`--network host`, otherwise the docker-proxy DNAT/loopback interaction bites — see commit `02f14e1` in the vps1 project for the parallel diagnostic pattern). + +## Summary + +| Context | KV | Prompt tokens | **Avg TPS** | Peak TPS (best of 3) | **Engine-predicted TPS (avg)** | Prefill TPS (avg) | Draft accepted | TTFT | +|---:|---|---:|---:|---:|---:|---:|---:|---:| +| 32k | `int8` | 29,966 | **97.15** | 130.06 | **95.10** | 167.4 | 79.9 % | 168 ms | +| 64k | `int8` | 60,270 | **83.93** | 114.38 | **82.23** | 127.8 | 75.8 % | 264 ms | +| 128k | `q4_0` | 120,748 | **73.97** | 114.68 | **72.97** | 132.8 | 73.7 % | 409 ms | + +(Three stream runs per row; `reasoning_effort=minimal`, `max_tokens=192`, `temperature=0`, prompt filled to 92 % of `--max-context`.) + +## Reading guide + +- The **"Avg TPS"** column is `(completion_tokens) / (first_content_ts - last_content_ts)` measured end-to-end on the host. The **"Peak TPS"** column is the best 32-chunk sliding-window TPS within a single run. +- The **"Engine-predicted TPS"** column is what the engine itself emits at the top level of the final SSE event's `timings` field; it's the same total-decode wall-clock divided by the same completion tokens from inside the GPU. +- `draft accepted` is the fraction of MTP speculative-decoding tokens the verifier kept, summed across the three runs. +- **TTFT** is the time between sending the request and the first SSE `delta.content` chunk landing on the socket — almost entirely prefill (no app-side tail latency). + +## Why KV flips at 128 k + +At `--max-context 131072` with KV=int8 the VRAM estimate exceeds the 16 GiB card, so we re-launched with `KV=q4_0`. That is the only way to keep the engine inside VRAM at 128 k on this card; the model degrades ~12 % vs int8 at 64 k. The 128 k row is therefore a *different* configuration than the lower rows; do not compare the 32k→64k→128k slope as a pure context effect — about half of the slope is KV compression overhead. + +Draft acceptance also glides down modestly with context (80 → 76 → 74 %); the MTP layer's head was tuned for short windows and degrades slightly with longer reasoning spans. + +## Method + +- Container: hash `2236bbf72fb4` (`strata:latest`, 8.11 GB), engine = sm_89 fat-binary, vision encoder NOT compiled (`BUILD_VISION=0`). +- `docker run -d --name strata --network host --gpus all --ulimit memlock=-1 --shm-size=4g -v strata-data:/data -e ...` re-deployed for each context with `REINSTALL=1`. Re-boot is ~15 s once experts are paged in. +- `run.py`: linear-interpolate fill characters in `[0.50–0.97] · ctx · char-per-token` band via 2 calibration calls (`n_lo`, `n_hi`), then a 5-sample local scan to land near 92 %. 3 SSE stream `POST /v1/chat/completions` calls per row. Engine-reported timings captured from the latest SSE chunk. +- `aggregate.py`: 3 runs averaged; writes `matrix.md` and `summary.json`. + +## Caveats / honesty disclaimers + +- `stream=true` chunks are subword tokens, not exact tokens, so the engine's `predicted_n` is the canonical "true" completion-token count used in the per-TPS math. The peak window uses raw chunk arrival timing, which slightly over-counts because the engine sometimes batches 1-3 subwords in a single chunk at low pressure. +- The 128k row 1 produced `completion_tokens=174` (`finish=stop`) rather than 192; the engine reached the natural end of the response in less than 192 tokens. The other two runs hit the cap (`finish=length`). Throughput column is correct in either case — total decode time divided by the actual token count. +- `decode_peak_tps` rolls over a 32-chunk window of subwords, so it can briefly exceed the `predicted_per_second` engine metric; this is real (the engine measure is total / total). Engine-reported TPS is the apples-to-apples cross-row number. + +## Reproduction + +```bash +cd /home/lfontanez/dev/strata/bench/results/2026-10-01-ctx-ladder +python3 run.py --contexts 32768 65536 131072 --out all.json --note "full ladder" +python3 aggregate.py # writes matrix.md and summary.json +``` + +For an additional ladder step you'd want `--build-arg BUILD_VISION=1` (and rebuild) to enable image inputs, and the container needs `RAM ≈ 33 GiB × expert count / 16 GiB VRAM` to be safe at rest; this host has 94 GiB so the engine stays in resident-expert mode. diff --git a/bench/results/2026-10-01-ctx-ladder/aggregate.py b/bench/results/2026-10-01-ctx-ladder/aggregate.py new file mode 100644 index 00000000..e58e9218 --- /dev/null +++ b/bench/results/2026-10-01-ctx-ladder/aggregate.py @@ -0,0 +1,276 @@ +#!/usr/bin/env python3 +"""Aggregate per-context + per-model results. + +Inputs (8 rows): + ./32k.json IQ2_XS @ 32k (KV=int8) - 2026-10-05 (re-run with cold-prefill) + ./64k.json IQ2_XS @ 64k (KV=int8) - 2026-10-05 + ./128k.json IQ2_XS @ 128k (KV=int8) - 2026-10-05 (CORRECTED from q4_0) + ./256k.json IQ2_XS @ 256k (KV=int8) - 2026-10-05 (CORRECTED from k8v4) + ./iq3_xxs_32k.json IQ3_XXS @ 32k (KV=int8) - 2026-10-05 + ./iq3_xxs_64k.json IQ3_XXS @ 64k (KV=int8) - 2026-10-05 + ./iq3_xxs_128k.json IQ3_XXS @ 128k (KV=q4_0) - 2026-10-05 + ./iq3_xxs_256k.json IQ3_XXS @ 256k (KV=k8v4) - 2026-10-05 + +Two prefill columns are now reported: + Cold Prefill = engine-emitted timings.prompt_per_second on a + max_tokens=1 non-stream call after a fresh /unload + and /re-fetch (true cold wall-clock) + SSE Prefill = engine-emitted timings.prompt_per_second on the + streamed call - reflects time-to-first-decode chunk, + which is shorter because --prefill auto overlaps + with the start of the decode (8192-token chunks) + +Outputs: + ./matrix.json, ./matrix.md, ./summary.json + ./logs/