Sync the repo with the working directory: full NOTES.md (rounds 4-5, LFM3-VL), VL tests and test images, quality eval, AutoRound W4A16 quantization scripts and calibration recipe, the variant.sh MODEL/DOCKER_ENV options, and the remaining benchmark results. Large regenerable artifacts (INT4 checkpoint, ref_vl.pt, raw logprob dumps) stay out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
511 lines
31 KiB
HTML
511 lines
31 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>BetterBench — lfm3-1.7b</title>
|
|
<style>
|
|
:root {
|
|
color-scheme: light;
|
|
--page:#f9f9f7; --surface:#fcfcfb;
|
|
--ink:#0b0b0b; --ink-2:#52514e; --muted:#898781;
|
|
--grid:#e1e0d9; --axis:#c3c2b7; --border:rgba(11,11,11,0.10);
|
|
--s1:#2a78d6; --s2:#eb6834;
|
|
--s1-mid:#86b6ef; --s1-soft:rgba(42,120,214,0.13);
|
|
--tip-bg:#ffffff;
|
|
--sans:system-ui,-apple-system,"Segoe UI",sans-serif;
|
|
--mono:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,monospace;
|
|
}
|
|
@media (prefers-color-scheme: dark) {
|
|
:root:not([data-theme="light"]) {
|
|
color-scheme: dark;
|
|
--page:#0d0d0d; --surface:#1a1a19;
|
|
--ink:#ffffff; --ink-2:#c3c2b7; --muted:#898781;
|
|
--grid:#2c2c2a; --axis:#383835; --border:rgba(255,255,255,0.10);
|
|
--s1:#3987e5; --s2:#d95926;
|
|
--s1-mid:#256abf; --s1-soft:rgba(57,135,229,0.16);
|
|
--tip-bg:#232322;
|
|
}
|
|
}
|
|
:root[data-theme="dark"] {
|
|
color-scheme: dark;
|
|
--page:#0d0d0d; --surface:#1a1a19;
|
|
--ink:#ffffff; --ink-2:#c3c2b7; --muted:#898781;
|
|
--grid:#2c2c2a; --axis:#383835; --border:rgba(255,255,255,0.10);
|
|
--s1:#3987e5; --s2:#d95926;
|
|
--s1-mid:#256abf; --s1-soft:rgba(57,135,229,0.16);
|
|
--tip-bg:#232322;
|
|
}
|
|
|
|
* { box-sizing:border-box; }
|
|
body { background:var(--page); color:var(--ink); font-family:var(--sans);
|
|
line-height:1.55; margin:0; padding:32px 20px 72px; }
|
|
.wrap { max-width:1080px; margin:0 auto; display:flex; flex-direction:column; gap:26px; }
|
|
|
|
header { display:flex; flex-direction:column; gap:13px; }
|
|
.eyebrow { font-family:var(--mono); font-size:11px; letter-spacing:.13em;
|
|
text-transform:uppercase; color:var(--muted); }
|
|
h1 { font-size:clamp(26px,4vw,36px); line-height:1.12; margin:0;
|
|
letter-spacing:-.02em; text-wrap:balance; }
|
|
.runbar { display:flex; flex-wrap:wrap; gap:8px; }
|
|
.chip { font-family:var(--mono); font-size:12px; color:var(--ink-2);
|
|
border:1px solid var(--border); border-radius:6px; padding:4px 9px;
|
|
background:var(--surface); display:inline-flex; align-items:center; gap:7px; }
|
|
.chip code { font-family:var(--mono); font-size:12px; }
|
|
.swatch { width:9px; height:9px; border-radius:2px; flex:none; }
|
|
|
|
.thin { color:var(--muted); cursor:help; font-weight:400; padding-left:1px; }
|
|
.tiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:13px; }
|
|
.tile { background:var(--surface); border:1px solid var(--border); border-radius:10px;
|
|
padding:15px 16px; display:flex; flex-direction:column; gap:4px; }
|
|
.tile .label { font-family:var(--mono); font-size:10.5px; letter-spacing:.1em;
|
|
text-transform:uppercase; color:var(--muted); }
|
|
.tile .val { font-size:26px; font-weight:600; letter-spacing:-.02em; line-height:1.15; }
|
|
.tile .val small { font-size:14px; font-weight:400; color:var(--ink-2); letter-spacing:0; }
|
|
.tile .sub { font-family:var(--mono); font-size:11.5px; color:var(--muted); }
|
|
|
|
figure { margin:0; background:var(--surface); border:1px solid var(--border);
|
|
border-radius:10px; padding:18px 18px 14px;
|
|
display:flex; flex-direction:column; gap:2px; }
|
|
figcaption { display:flex; flex-direction:column; gap:3px; margin-bottom:8px; }
|
|
figcaption .t { font-size:15.5px; font-weight:600; letter-spacing:-.01em; }
|
|
figcaption .d { font-size:13px; color:var(--ink-2); max-width:76ch; }
|
|
.legend { display:flex; gap:16px; flex-wrap:wrap; margin:2px 0 10px; }
|
|
.legend span { font-family:var(--mono); font-size:12px; color:var(--ink-2);
|
|
display:inline-flex; align-items:center; gap:6px; }
|
|
.chartbox { position:relative; width:100%; }
|
|
.chartbox svg { display:block; width:100%; height:auto; overflow:visible; }
|
|
.note { font-size:12.5px; color:var(--muted); margin:9px 0 0; }
|
|
|
|
text { font-family:var(--mono); }
|
|
.tick { font-size:10.5px; fill:var(--muted); }
|
|
.axtitle { font-size:10.5px; fill:var(--muted); letter-spacing:.08em; }
|
|
.dlabel { font-size:11px; font-weight:600; }
|
|
.gridline { stroke:var(--grid); stroke-width:1; }
|
|
.baseline { stroke:var(--axis); stroke-width:1; }
|
|
.refline { stroke:var(--muted); stroke-width:1; stroke-dasharray:4 4; }
|
|
.cross { stroke:var(--axis); stroke-width:1; stroke-dasharray:3 3; }
|
|
|
|
.tip { position:absolute; pointer-events:none; opacity:0; transition:opacity .1s ease;
|
|
z-index:5; background:var(--tip-bg); border:1px solid var(--border);
|
|
border-radius:7px; padding:8px 10px; box-shadow:0 3px 14px rgba(0,0,0,.13);
|
|
font-family:var(--mono); font-size:11.5px; color:var(--ink);
|
|
white-space:nowrap; min-width:132px; }
|
|
.tip .th { color:var(--muted); font-size:10px; letter-spacing:.08em;
|
|
text-transform:uppercase; margin-bottom:5px; }
|
|
.tip .row { display:flex; align-items:center; gap:10px; justify-content:space-between; }
|
|
.tip .nm { display:inline-flex; align-items:center; gap:6px; color:var(--ink-2); }
|
|
.tip b { font-weight:600; }
|
|
|
|
details { background:var(--surface); border:1px solid var(--border);
|
|
border-radius:10px; padding:0 18px; }
|
|
summary { cursor:pointer; padding:15px 0; font-size:14.5px; font-weight:600;
|
|
list-style:none; display:flex; align-items:center; gap:9px; }
|
|
summary::-webkit-details-marker { display:none; }
|
|
summary::before { content:"\25B8"; color:var(--muted); font-family:var(--mono); }
|
|
details[open] summary::before { content:"\25BE"; }
|
|
summary:focus-visible { outline:2px solid var(--s1); outline-offset:3px; border-radius:4px; }
|
|
.tscroll { overflow-x:auto; padding-bottom:14px; }
|
|
table { border-collapse:collapse; width:100%; font-size:12.5px; font-family:var(--mono);
|
|
font-variant-numeric:tabular-nums; margin-bottom:10px; }
|
|
caption { text-align:left; font-family:var(--sans); font-size:13px; color:var(--ink-2);
|
|
padding:10px 0 8px; }
|
|
th, td { padding:6px 11px 6px 0; text-align:right; white-space:nowrap; }
|
|
th:first-child, td:first-child { text-align:left; }
|
|
thead th { color:var(--muted); font-weight:500; font-size:10.5px; letter-spacing:.07em;
|
|
text-transform:uppercase; border-bottom:1px solid var(--axis); }
|
|
tbody tr + tr td { border-top:1px solid var(--grid); }
|
|
tbody td:first-child { color:var(--ink-2); }
|
|
|
|
footer { font-size:12.5px; color:var(--muted); border-top:1px solid var(--border);
|
|
padding-top:16px; }
|
|
footer code { font-family:var(--mono); font-size:12px; color:var(--ink-2); }
|
|
noscript p { font-size:13px; color:var(--ink-2); }
|
|
@media (prefers-reduced-motion: reduce) { * { transition:none !important; } }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="wrap">
|
|
<header>
|
|
<div class="eyebrow">BetterBench 0.6.1 · 29 Oct 2026 · 08:52 · llm</div>
|
|
<h1>lfm3-1.7b</h1>
|
|
<div class="runbar"><span class="chip"><span class="swatch" style="background:var(--s1)"></span>lfm3-1.7b</span><span class="chip"><code>http://127.0.0.1:8001/v1</code></span><span class="chip">corpus v1.0</span><span class="chip">5 passes/cat</span><span class="chip">temp 0.7</span><span class="chip">cold prefix cache (nonce)</span><span class="chip">32,768 tok context</span><span class="chip"><span class="swatch" style="background:var(--s2)"></span>variant: w4_eager</span></div>
|
|
</header>
|
|
<section class="tiles">
|
|
<div class="tile">
|
|
<span class="label">Combined decode</span>
|
|
<span class="val">33.2 <small>t/s</small></span>
|
|
<span class="sub">weighted across categories</span>
|
|
</div>
|
|
<div class="tile">
|
|
<span class="label">Combined ITL 1% low</span>
|
|
<span class="val">25.1 <small>t/s</small></span>
|
|
<span class="sub">the trustworthy tail metric</span>
|
|
</div>
|
|
<div class="tile">
|
|
<span class="label">Combined TTFT p50</span>
|
|
<span class="val">116 <small>ms</small></span>
|
|
<span class="sub">single-stream, batch = 1</span>
|
|
</div>
|
|
<div class="tile">
|
|
<span class="label">Aggregate @ 8 concurrent</span>
|
|
<span class="val">213.1 <small>t/s</small></span>
|
|
<span class="sub">48/48 ok</span>
|
|
</div>
|
|
<div class="tile">
|
|
<span class="label">Prefill @ 32,000 tok</span>
|
|
<span class="val">13,940 <small>t/s</small></span>
|
|
<span class="sub">median prompt processing</span>
|
|
</div>
|
|
</section>
|
|
<noscript><p>Charts need JavaScript — the full numbers are in the tables below.</p></noscript>
|
|
<figure>
|
|
<figcaption>
|
|
<span class="t">Decode throughput by category</span>
|
|
<span class="d">Median per-pass decode t/s at batch = 1, 5 passes per category. The dashed line is the weighted combined score.</span>
|
|
</figcaption>
|
|
|
|
<div class="chartbox" id="cb-decode"></div>
|
|
<p class="note">Hover a bar for its IQR and coefficient of variation — a high CV means the category's passes disagree, so read small differences there with care.</p>
|
|
</figure>
|
|
<figure>
|
|
<figcaption>
|
|
<span class="t">Inter-token latency range by category</span>
|
|
<span class="d">Each bar spans the 1% low to the 99% high instantaneous token rate, with a tick at the median. Wide bars stutter; narrow bars feel smooth.</span>
|
|
</figcaption>
|
|
<div class="legend"><span><span class="swatch" style="background:var(--s1-mid)"></span>1% low → 99% high</span><span><span class="swatch" style="background:var(--ink)"></span>median</span></div>
|
|
<div class="chartbox" id="cb-itl"></div>
|
|
|
|
</figure>
|
|
<figure>
|
|
<figcaption>
|
|
<span class="t">Aggregate throughput under concurrency</span>
|
|
<span class="d">Total tokens/sec across all in-flight requests as load rises — where this flattens is the throughput knee.</span>
|
|
</figcaption>
|
|
|
|
<div class="chartbox" id="cb-conc"></div>
|
|
|
|
</figure>
|
|
<figure>
|
|
<figcaption>
|
|
<span class="t">Time-to-first-token under concurrency</span>
|
|
<span class="d">Queueing shows up here first: p50 is the typical wait, p99 the tail.</span>
|
|
</figcaption>
|
|
<div class="legend"><span><span class="swatch" style="background:var(--s1)"></span>TTFT p50</span><span><span class="swatch" style="background:var(--s2)"></span>TTFT p99</span></div>
|
|
<div class="chartbox" id="cb-ttft"></div>
|
|
<p class="note">With a modest request count per level, p99 rests on very few observations — treat a spike as a prompt to re-run, not a conclusion.</p>
|
|
</figure>
|
|
<figure>
|
|
<figcaption>
|
|
<span class="t">Prompt processing throughput by depth</span>
|
|
<span class="d">Median prefill t/s (prompt tokens ÷ TTFT) at increasing input depth, cold prefix cache. The band spans the 1% low to the 99% high.</span>
|
|
</figcaption>
|
|
|
|
<div class="chartbox" id="cb-prefill"></div>
|
|
<p class="note">Skipped depth 64,000 — deeper than the model's context window.</p>
|
|
</figure>
|
|
<details open>
|
|
<summary>Full numbers</summary>
|
|
<div class="tscroll">
|
|
<table>
|
|
<caption>Single-stream, batch = 1</caption>
|
|
<thead><tr><th>category</th><th>passes</th><th>TTFT p50</th><th>TTFT p99</th><th>ITL 1% low</th><th>ITL med</th><th>ITL 99% high</th><th>decode med</th><th>±IQR</th><th>CV</th></tr></thead>
|
|
<tbody>
|
|
<tr><td>chat</td><td>5</td><td>117.8</td><td>235.6<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>26.3</td><td>34.1</td><td>35.4</td><td>34.4</td><td>0.1</td><td>2.9%</td></tr>
|
|
<tr><td>code</td><td>5</td><td>119.9</td><td>189.6<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>23.9</td><td>33.4</td><td>35.2</td><td>33.2</td><td>0.4</td><td>0.8%</td></tr>
|
|
<tr><td>file edit</td><td>5</td><td>116.0</td><td>130.1<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>25.9</td><td>34.4</td><td>35.7</td><td>34.1</td><td>0.8</td><td>3.7%</td></tr>
|
|
<tr><td>json</td><td>5</td><td>122.6</td><td>188.5<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>24.7</td><td>32.9</td><td>34.9</td><td>32.8</td><td>0.3</td><td>1.6%</td></tr>
|
|
<tr><td>math</td><td>5</td><td>116.6</td><td>120.6<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>24.6</td><td>33.5</td><td>35.2</td><td>33.3</td><td>0.1</td><td>0.9%</td></tr>
|
|
<tr><td>prose</td><td>5</td><td>96.5</td><td>116.7<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>27.3</td><td>33.9</td><td>35.2</td><td>33.2</td><td>0.5</td><td>1.2%</td></tr>
|
|
<tr><td>reasoning</td><td>5</td><td>116.7</td><td>118.8<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>25.8</td><td>33.4</td><td>35.2</td><td>33.0</td><td>0.2</td><td>1.1%</td></tr>
|
|
<tr><td>summarization</td><td>5</td><td>119.6</td><td>122.1<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>23.8</td><td>33.7</td><td>35.0</td><td>33.2</td><td>0.5</td><td>1.6%</td></tr>
|
|
</tbody>
|
|
</table>
|
|
<table>
|
|
<caption>Concurrency sweep</caption>
|
|
<thead><tr><th>level</th><th>ok/req</th><th>aggregate t/s</th><th>TTFT p50</th><th>TTFT p99</th><th>per-req decode med</th></tr></thead>
|
|
<tbody>
|
|
<tr><td>1</td><td>48/48</td><td>33.4</td><td>115.7</td><td>130.7<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>33.6</td></tr>
|
|
<tr><td>2</td><td>48/48</td><td>65.2</td><td>137.4</td><td>1,116.0<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>33.4</td></tr>
|
|
<tr><td>4</td><td>48/48</td><td>121.2</td><td>138.2</td><td>243.6<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>32.6</td></tr>
|
|
<tr><td>8</td><td>48/48</td><td>213.1</td><td>139.6</td><td>276.8<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>32.3</td></tr>
|
|
</tbody>
|
|
</table>
|
|
<table>
|
|
<caption>Reasoning / answer split · TTFA is time to the first answer token</caption>
|
|
<thead><tr><th>category</th><th>runs w/ split</th><th>reasoning share (est)</th><th>TTFA p50 (ms)</th><th>never reached answer</th></tr></thead>
|
|
<tbody>
|
|
<tr><td>chat</td><td>5/5</td><td>100%</td><td>—</td><td>5/5</td></tr>
|
|
<tr><td>code</td><td>5/5</td><td>100%</td><td>—</td><td>5/5</td></tr>
|
|
<tr><td>file edit</td><td>5/5</td><td>100%</td><td>—</td><td>5/5</td></tr>
|
|
<tr><td>json</td><td>5/5</td><td>100%</td><td>—</td><td>5/5</td></tr>
|
|
<tr><td>math</td><td>5/5</td><td>100%</td><td>—</td><td>5/5</td></tr>
|
|
<tr><td>prose</td><td>5/5</td><td>100%</td><td>—</td><td>5/5</td></tr>
|
|
<tr><td>reasoning</td><td>5/5</td><td>100%</td><td>—</td><td>5/5</td></tr>
|
|
<tr><td>summarization</td><td>5/5</td><td>100%</td><td>—</td><td>5/5</td></tr>
|
|
</tbody>
|
|
</table>
|
|
<table>
|
|
<caption>Prefill sweep · cold prefix cache</caption>
|
|
<thead><tr><th>target depth</th><th>prompt tok med</th><th>TTFT p50</th><th>PP 1% low</th><th>PP median</th><th>PP 99% high</th></tr></thead>
|
|
<tbody>
|
|
<tr><td>2,000</td><td>1,494</td><td>133.1</td><td>10,965.7<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>11,292.6</td><td>11,688.8<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td></tr>
|
|
<tr><td>8,000</td><td>5,884</td><td>397.4</td><td>13,896.2<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>14,824.2</td><td>15,053.2<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td></tr>
|
|
<tr><td>16,000</td><td>11,794</td><td>804.2</td><td>14,594.2<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>14,641.5</td><td>14,796.1<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td></tr>
|
|
<tr><td>32,000</td><td>23,570</td><td>1,690.5</td><td>13,850.7<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>13,940.1</td><td>14,002.1<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td></tr>
|
|
<tr><td>64,000</td><td>—</td><td>—</td><td>—</td><td><em>skipped</em></td><td>—</td></tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</details>
|
|
<footer>Generated by BetterBench 0.6.1 from a corpus v1.0 run. Corpus hash <code>e332dceff176d033</code>. Combined-score weights — code 0.3, reasoning 0.2, prose 0.15, json 0.15, file_edit 0.1, summarization 0.1. Results are only comparable within a corpus version. Stopped at <code>max_tokens</code>: 40/40 runs (100%) — on a thinking model a truncated run measures the thinking phase, not a complete answer. 16 percentiles are marked † — they rest on fewer samples than <code>n · tail ≥ 5</code> requires (a p99 needs 500 observations), so read them as roughly the worst observed rather than as percentiles. The full list is under <code>sample_gate</code> in the results JSON. See METHODOLOGY.md §sample-size.</footer>
|
|
</div>
|
|
<script>
|
|
"use strict";
|
|
const D = {"cats": ["chat", "code", "file edit", "json", "math", "prose", "reasoning", "summarization"], "runs": [5, 5, 5, 5, 5, 5, 5, 5], "decode": [34.364733434962375, 33.19206700440281, 34.10821096816195, 32.76713673397436, 33.318806838793066, 33.17756427541256, 33.007235359554755, 33.1709535872013], "decodeIqr": [0.09530121503854616, 0.4183902933158734, 0.7986241396958604, 0.33852509671814346, 0.12757571564406334, 0.5498731917661672, 0.21400139071031532, 0.5360245512686888], "cv": [2.9103341724572043, 0.8237452790049035, 3.699727341804556, 1.6436389955278474, 0.9351396350597124, 1.1638532904726029, 1.1420439914926659, 1.5979790716943685], "itlLow": [26.279823223409803, 23.865030111541248, 25.91591603944243, 24.735945967602934, 24.562721801358283, 27.33269241871767, 25.75828487541669, 23.818259957041686], "itlMed": [34.118922661691144, 33.37045685449799, 34.38842169895646, 32.88143777454523, 33.51890628831423, 33.89081119216718, 33.4353999163892, 33.65796787698919], "itlHigh": [35.442519143371364, 35.15556080207443, 35.68373537134876, 34.851110525626375, 35.17102280226893, 35.189666668297995, 35.18643371577241, 35.03328901283396], "batched": false, "updP50": [29.309249002835713, 29.96662599980482, 29.079554995405488, 30.412295502173947, 29.83390900044469, 29.506523002055474, 29.908420499850763, 29.71064700250281], "updP99": [34.46770500217095, 34.7841154284106, 34.395019498333546, 36.62071083686894, 34.53626389891725, 33.11266059899936, 35.4027832792781, 36.517120537318995], "tokPerUpd": [1.0017889087656529, 1.0024196335983409, 1.001908396946565, 1.0018214936247722, 1.0016556291390728, 1.0006949270326615, 1.0010921004732436, 1.0030090270812437], "ttft50": [117.75696499535115, 119.86463700304739, 116.01784199592657, 122.63084099686239, 116.55026300286409, 96.47268199478276, 116.67418499564519, 119.62975400092546], "combined": 33.17868878017616, "conc": {"levels": [1, 2, 4, 8], "agg": [33.42378281555534, 65.18869095668147, 121.2331531660247, 213.05177552665992], "t50": [115.69820800286834, 137.36145349685103, 138.24324049710413, 139.63057000000845], "t99": [130.6545384853962, 1116.0005903353158, 243.57994026955566, 276.84766213227704], "per": [33.62028163890565, 33.40584144555079, 32.55145359853637, 32.34807286660677], "ok": [48, 48, 48, 48], "req": [48, 48, 48, 48]}, "pre": {"depths": [2000, 8000, 16000, 32000], "tok": [1494.5, 5883.5, 11793.5, 23570.5], "low": [10965.739988811689, 13896.165264854135, 14594.210526012417, 13850.726364722612], "med": [11292.638075967563, 14824.214668973385, 14641.463887404954, 13940.070580404934], "high": [11688.792926724736, 15053.20803295585, 14796.138460310447, 14002.103685615717], "t50": [133.08033649809659, 397.4307964963373, 804.163189499377, 1690.4636899998877]}};
|
|
const NS = "http://www.w3.org/2000/svg";
|
|
const el = (n, a) => { const e = document.createElementNS(NS, n);
|
|
for (const k in a) e.setAttribute(k, a[k]); return e; };
|
|
const fmt = (v, d) => (v === null || v === undefined) ? "—"
|
|
: v.toLocaleString("en-US", { minimumFractionDigits: d, maximumFractionDigits: d });
|
|
const has = v => v !== null && v !== undefined;
|
|
const maxOf = arrs => Math.max(...arrs.flat().filter(has));
|
|
const niceTop = v => { if (!(v > 0)) return 1;
|
|
const p = Math.pow(10, Math.floor(Math.log10(v)) - 1);
|
|
return Math.ceil(v / (2 * p)) * 2 * p; };
|
|
const box = id => document.getElementById(id);
|
|
|
|
function mkTip(b) { const t = document.createElement("div"); t.className = "tip";
|
|
b.appendChild(t); return t; }
|
|
function showTip(tip, b, x, y, html) {
|
|
tip.innerHTML = html; tip.style.opacity = "1";
|
|
let left = x + 14;
|
|
if (left + tip.offsetWidth > b.clientWidth) left = x - tip.offsetWidth - 14;
|
|
tip.style.left = Math.max(0, left) + "px";
|
|
tip.style.top = Math.max(0, y - tip.offsetHeight - 10) + "px";
|
|
}
|
|
const row = (color, name, val) =>
|
|
`<div class="row"><span class="nm">${color
|
|
? `<span class="swatch" style="background:${color}"></span>` : ""}${name}</span><b>${val}</b></div>`;
|
|
|
|
function frame(svg, M, iw, ih, yMin, yMax, yTitle, ticks) {
|
|
for (let k = 0; k <= (ticks || 4); k++) {
|
|
const v = yMin + ((yMax - yMin) * k) / (ticks || 4);
|
|
const y = M.t + ih - (ih * (v - yMin)) / (yMax - yMin);
|
|
svg.appendChild(el("line", { x1: M.l, x2: M.l + iw, y1: y, y2: y, class: "gridline" }));
|
|
const tx = el("text", { x: M.l - 10, y: y + 3.5, class: "tick", "text-anchor": "end" });
|
|
tx.textContent = fmt(v, v < 10 ? 1 : 0); svg.appendChild(tx);
|
|
}
|
|
svg.appendChild(el("line", { x1: M.l, x2: M.l + iw, y1: M.t + ih, y2: M.t + ih, class: "baseline" }));
|
|
const ay = el("text", { x: M.l, y: M.t - 7, class: "axtitle" });
|
|
ay.textContent = yTitle; svg.appendChild(ay);
|
|
}
|
|
function xLabels(svg, labels, X, y) {
|
|
labels.forEach((lab, i) => {
|
|
const t = el("text", { x: X(i), y: y, class: "tick", "text-anchor": "middle" });
|
|
t.textContent = lab; svg.appendChild(t);
|
|
});
|
|
}
|
|
|
|
/* --- grouped / single bars, zero-based --- */
|
|
function bars(id, o) {
|
|
const b = box(id); if (!b) return;
|
|
const W = 900, H = o.height || 340, M = { t: 20, r: 16, b: 50, l: 64 };
|
|
const iw = W - M.l - M.r, ih = H - M.t - M.b;
|
|
const svg = el("svg", { viewBox: `0 0 ${W} ${H}`, role: "img", "aria-label": o.aria });
|
|
const n = o.x.length, yMax = o.yMax;
|
|
const Y = v => M.t + ih - (ih * v) / yMax;
|
|
frame(svg, M, iw, ih, 0, yMax, o.yTitle);
|
|
const band = iw / n, ns = o.series.length, GAP = 2;
|
|
const bw = Math.min(40, (band - 24 - GAP * (ns - 1)) / ns);
|
|
xLabels(svg, o.x, i => M.l + band * i + band / 2, M.t + ih + 20);
|
|
if (has(o.ref)) {
|
|
const y = Y(o.ref);
|
|
svg.appendChild(el("line", { x1: M.l, x2: M.l + iw, y1: y, y2: y, class: "refline" }));
|
|
const t = el("text", { x: M.l + iw, y: y - 6, class: "tick", "text-anchor": "end" });
|
|
t.textContent = o.refLabel; svg.appendChild(t);
|
|
}
|
|
const tip = mkTip(b);
|
|
o.x.forEach((lab, i) => {
|
|
const cx = M.l + band * i + band / 2;
|
|
const start = cx - (ns * bw + (ns - 1) * GAP) / 2;
|
|
o.series.forEach((s, si) => {
|
|
const v = s.v[i]; if (!has(v)) return;
|
|
const x = start + si * (bw + GAP);
|
|
const r = el("rect", { x: x, y: Y(v), width: bw, height: Math.max(2, ih - (Y(v) - M.t)),
|
|
rx: 4, ry: 4, fill: s.color });
|
|
r.style.cursor = "crosshair";
|
|
const html = `<div class="th">${lab}</div>` +
|
|
o.series.map(q => row(ns > 1 ? q.color : null, q.name, o.tipVal(q.v[i]))).join("") +
|
|
(o.extra ? o.extra(i) : "");
|
|
r.addEventListener("pointerenter", () => {
|
|
const rc = svg.getBoundingClientRect();
|
|
showTip(tip, b, ((x + bw / 2) / W) * rc.width, (Y(v) / H) * rc.height, html);
|
|
});
|
|
r.addEventListener("pointerleave", () => { tip.style.opacity = "0"; });
|
|
svg.appendChild(r);
|
|
});
|
|
});
|
|
b.appendChild(svg);
|
|
}
|
|
|
|
/* --- floating range bars with a median tick --- */
|
|
function rangeBars(id, o) {
|
|
const b = box(id); if (!b) return;
|
|
const W = 900, H = 340, M = { t: 20, r: 16, b: 50, l: 64 };
|
|
const iw = W - M.l - M.r, ih = H - M.t - M.b;
|
|
const svg = el("svg", { viewBox: `0 0 ${W} ${H}`, role: "img", "aria-label": o.aria });
|
|
const n = o.x.length, yMax = o.yMax;
|
|
const Y = v => M.t + ih - (ih * v) / yMax;
|
|
frame(svg, M, iw, ih, 0, yMax, o.yTitle);
|
|
const band = iw / n, bw = Math.min(34, band - 26);
|
|
xLabels(svg, o.x, i => M.l + band * i + band / 2, M.t + ih + 20);
|
|
const tip = mkTip(b);
|
|
o.x.forEach((lab, i) => {
|
|
const lo = o.low[i], hi = o.high[i], md = o.med[i];
|
|
if (!has(lo) || !has(hi)) return;
|
|
const cx = M.l + band * i + band / 2, x = cx - bw / 2;
|
|
const r = el("rect", { x: x, y: Y(hi), width: bw, height: Math.max(3, Y(lo) - Y(hi)),
|
|
rx: 4, ry: 4, fill: "var(--s1-mid)" });
|
|
r.style.cursor = "crosshair";
|
|
svg.appendChild(r);
|
|
if (has(md)) svg.appendChild(el("line", { x1: x, x2: x + bw, y1: Y(md), y2: Y(md),
|
|
stroke: "var(--ink)", "stroke-width": 2 }));
|
|
const html = `<div class="th">${lab}</div>` +
|
|
row(null, "99% high", o.tipVal(hi)) + row(null, "median", o.tipVal(md)) +
|
|
row(null, "1% low", o.tipVal(lo)) + (o.extra ? o.extra(i) : "");
|
|
r.addEventListener("pointerenter", () => {
|
|
const rc = svg.getBoundingClientRect();
|
|
showTip(tip, b, (cx / W) * rc.width, (Y(hi) / H) * rc.height, html);
|
|
});
|
|
r.addEventListener("pointerleave", () => { tip.style.opacity = "0"; });
|
|
});
|
|
b.appendChild(svg);
|
|
}
|
|
|
|
/* --- line chart with optional band --- */
|
|
function line(id, o) {
|
|
const b = box(id); if (!b) return;
|
|
const W = 900, H = 320, M = { t: 20, r: 24, b: 52, l: 64 };
|
|
const iw = W - M.l - M.r, ih = H - M.t - M.b;
|
|
const svg = el("svg", { viewBox: `0 0 ${W} ${H}`, role: "img", "aria-label": o.aria });
|
|
const n = o.x.length, yMin = o.yMin, yMax = o.yMax;
|
|
const X = i => M.l + (n === 1 ? iw / 2 : (iw * i) / (n - 1));
|
|
const Y = v => M.t + ih - (ih * (v - yMin)) / (yMax - yMin);
|
|
frame(svg, M, iw, ih, yMin, yMax, o.yTitle);
|
|
xLabels(svg, o.x, X, M.t + ih + 20);
|
|
if (o.xTitle) {
|
|
const t = el("text", { x: M.l, y: H - 8, class: "axtitle" });
|
|
t.textContent = o.xTitle; svg.appendChild(t);
|
|
}
|
|
if (o.band && o.band.low.every(has) && o.band.high.every(has)) {
|
|
const up = o.band.high.map((v, i) => (i ? "L" : "M") + X(i) + " " + Y(v)).join(" ");
|
|
const dn = o.band.low.map((v, i) => "L" + X(n - 1 - i) + " " + Y(o.band.low[n - 1 - i])).join(" ");
|
|
svg.appendChild(el("path", { d: up + " " + dn + " Z", fill: "var(--s1-soft)", stroke: "none" }));
|
|
}
|
|
svg.appendChild(el("path", {
|
|
d: o.v.map((v, i) => (i ? "L" : "M") + X(i) + " " + Y(v)).join(" "),
|
|
fill: "none", stroke: "var(--s1)", "stroke-width": 2,
|
|
"stroke-linejoin": "round", "stroke-linecap": "round" }));
|
|
o.v.forEach((v, i) => svg.appendChild(el("circle", {
|
|
cx: X(i), cy: Y(v), r: 5, fill: "var(--s1)", stroke: "var(--surface)", "stroke-width": 2 })));
|
|
const cross = el("line", { class: "cross", y1: M.t, y2: M.t + ih, opacity: 0 });
|
|
svg.appendChild(cross);
|
|
const hit = el("rect", { x: M.l, y: M.t, width: iw, height: ih, fill: "transparent" });
|
|
svg.appendChild(hit);
|
|
b.appendChild(svg);
|
|
const tip = mkTip(b);
|
|
hit.addEventListener("pointermove", ev => {
|
|
const rc = svg.getBoundingClientRect();
|
|
const px = ((ev.clientX - rc.left) / rc.width) * W;
|
|
let i = 0, best = Infinity;
|
|
for (let k = 0; k < n; k++) { const d = Math.abs(X(k) - px); if (d < best) { best = d; i = k; } }
|
|
cross.setAttribute("x1", X(i)); cross.setAttribute("x2", X(i)); cross.setAttribute("opacity", 1);
|
|
showTip(tip, b, (X(i) / W) * rc.width, (Y(o.v[i]) / H) * rc.height,
|
|
`<div class="th">${o.tipHead(i)}</div>` + o.tipBody(i));
|
|
});
|
|
hit.addEventListener("pointerleave", () => { tip.style.opacity = "0"; cross.setAttribute("opacity", 0); });
|
|
}
|
|
|
|
/* ------------------------------ build ------------------------------ */
|
|
if (D.cats.length) {
|
|
bars("cb-decode", {
|
|
aria: "Median decode throughput per category.",
|
|
x: D.cats, yTitle: "DECODE T/S (MEDIAN)",
|
|
yMax: niceTop(maxOf([D.decode])), height: 350,
|
|
ref: D.combined, refLabel: "combined " + fmt(D.combined, 1),
|
|
series: [{ name: "decode t/s", color: "var(--s1)", v: D.decode }],
|
|
tipVal: v => fmt(v, 1) + " t/s",
|
|
extra: i => row(null, "±IQR", fmt(D.decodeIqr[i], 1)) +
|
|
row(null, "CV", fmt(D.cv[i], 1) + "%") +
|
|
row(null, "passes", D.runs[i])
|
|
});
|
|
if (D.batched) {
|
|
/* Grouped bars, not a floating range bar: p50 and p99 can differ by two
|
|
orders of magnitude (a 17 ms rhythm against a 1.3 s stall), and a bar
|
|
floating between them collapses the p50 end onto the axis. */
|
|
bars("cb-itl", {
|
|
aria: "Stream-update gap p50 and p99 by category.",
|
|
x: D.cats, yTitle: "UPDATE GAP (MS)",
|
|
yMax: niceTop(maxOf([D.updP99, D.updP50])), height: 320,
|
|
series: [{ name: "p50", color: "var(--s1)", v: D.updP50 },
|
|
{ name: "p99", color: "var(--s2)", v: D.updP99 }],
|
|
tipVal: v => fmt(v, 1) + " ms",
|
|
extra: i => row(null, "tok/update", fmt(D.tokPerUpd[i], 2)) +
|
|
row(null, "passes", D.runs[i])
|
|
});
|
|
} else {
|
|
rangeBars("cb-itl", {
|
|
aria: "Inter-token latency range per category, 1% low to 99% high.",
|
|
x: D.cats, yTitle: "INSTANTANEOUS T/S",
|
|
yMax: niceTop(maxOf([D.itlHigh])),
|
|
low: D.itlLow, med: D.itlMed, high: D.itlHigh,
|
|
tipVal: v => fmt(v, 1) + " t/s",
|
|
extra: i => row(null, "spread", has(D.itlHigh[i]) && has(D.itlLow[i])
|
|
? fmt(D.itlHigh[i] - D.itlLow[i], 1) + " t/s" : "—")
|
|
});
|
|
}
|
|
}
|
|
if (D.conc.levels.length > 1) {
|
|
line("cb-conc", {
|
|
aria: "Aggregate throughput as concurrency rises.",
|
|
x: D.conc.levels.map(String), xTitle: "CONCURRENCY LEVEL",
|
|
yTitle: "AGGREGATE T/S", yMin: 0, yMax: niceTop(maxOf([D.conc.agg])),
|
|
v: D.conc.agg,
|
|
tipHead: i => "concurrency " + D.conc.levels[i] + " · " + D.conc.ok[i] + "/" + D.conc.req[i] + " ok",
|
|
tipBody: i => row(null, "aggregate", fmt(D.conc.agg[i], 1) + " t/s") +
|
|
row(null, "per-req", fmt(D.conc.per[i], 1) + " t/s") +
|
|
row(null, "TTFT p50", fmt(D.conc.t50[i], 1) + " ms")
|
|
});
|
|
bars("cb-ttft", {
|
|
aria: "TTFT p50 and p99 by concurrency level.",
|
|
x: D.conc.levels.map(String), yTitle: "TTFT (MS)",
|
|
yMax: niceTop(maxOf([D.conc.t99, D.conc.t50])), height: 300,
|
|
series: [{ name: "p50", color: "var(--s1)", v: D.conc.t50 },
|
|
{ name: "p99", color: "var(--s2)", v: D.conc.t99 }],
|
|
tipVal: v => fmt(v, 1) + " ms",
|
|
extra: i => row(null, "requests", D.conc.ok[i] + "/" + D.conc.req[i])
|
|
});
|
|
}
|
|
if (D.pre.depths.length > 1) {
|
|
const lo = Math.min(...D.pre.low.filter(has).concat(D.pre.med.filter(has)));
|
|
const hi = Math.max(...D.pre.high.filter(has).concat(D.pre.med.filter(has)));
|
|
const pad = (hi - lo) * 0.25 || hi * 0.1;
|
|
line("cb-prefill", {
|
|
aria: "Prefill throughput by input depth.",
|
|
x: D.pre.depths.map(d => d >= 1000 ? (d / 1000) + "k" : String(d)),
|
|
xTitle: "TARGET INPUT DEPTH (TOKENS)", yTitle: "PP T/S (MEDIAN)",
|
|
yMin: Math.max(0, lo - pad), yMax: hi + pad,
|
|
v: D.pre.med, band: { low: D.pre.low, high: D.pre.high },
|
|
tipHead: i => D.pre.depths[i].toLocaleString() + " target · "
|
|
+ fmt(D.pre.tok[i], 0) + " actual tok",
|
|
tipBody: i => row(null, "99% high", fmt(D.pre.high[i], 1)) +
|
|
row(null, "median", fmt(D.pre.med[i], 1)) +
|
|
row(null, "1% low", fmt(D.pre.low[i], 1)) +
|
|
row(null, "TTFT p50", fmt(D.pre.t50[i], 0) + " ms")
|
|
});
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|