File size: 8,561 Bytes
5ce45af
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7c3bd43
5ce45af
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
"""Write results/baseline.md from the raw files on the node. Every figure is read from a file; a missing one is said.

    python tools/report_baseline.py /data/train/mini > results/baseline.md
"""
import glob
import json
import os
import sys

R = sys.argv[1] if len(sys.argv) > 1 else "/data/train/mini"


def load(p):
    try:
        return json.load(open(p))
    except Exception:
        return None


def speed_rows(folder):
    rows = []
    for c in ("vllm-plain", "vllm-dspark", "sglang-plain", "sglang-dspark"):
        d = load(f"{folder}/{c}.json")
        if not d:
            rows.append(f"| {c} | not measured | | | | | | | |")
            continue
        L, P = d["levels"], d["prefill"]
        g = lambda k, f: (L.get(k) or {}).get(f)
        pf = lambda k: (P.get(k) or {}).get("prefill_tps_median")
        fmt = lambda v, n=0: "not measured" if v is None else (f"{v:,.{n}f}")
        rows.append(f"| {c} | {fmt(g('1', 'per_stream_decode_tps_median'), 1)} | {fmt(g('1', 'ttft_ms_median'), 1)} | "
                    f"{fmt(g('8', 'per_stream_decode_tps_median'), 1)} / {fmt(g('8', 'sum_out_tps'))} | "
                    f"{fmt(g('32', 'per_stream_decode_tps_median'), 1)} / {fmt(g('32', 'sum_out_tps'))} | "
                    f"{fmt(g('64', 'per_stream_decode_tps_median'), 1)} / {fmt(g('64', 'sum_out_tps'))} | "
                    f"{fmt(pf('4000'))} | {fmt(pf('64000'))} | {d['started_utc']} |")
    return rows


def main():
    out = []
    w = out.append
    sub = load(f"{R}/src/eval/subset.json")
    images = open(f"{R}/results/images.txt").read().strip().splitlines() if os.path.exists(f"{R}/results/images.txt") else []
    w("# Baseline: the stock model on this node")
    w("")
    w("Measured on 2026-12-01 on one node with 8 GPUs. Every figure below was measured here; nothing is")
    w("copied from a model card or a vendor page. A figure that could not be measured says so.")
    w("")
    w("- Model: `thinkingmachines/Inkling-2-Mini` at revision `fcd43a4241eb71e9f56f5f4d4bb125438cc613d9` (Apache-2.0).")
    for line in images:
        w(f"- Engine image: `{line}`")
    w("- One GPU per engine. Each engine was started as its own documentation says (see `tools/serve.sh`).")
    w("")
    w("## Speed")
    w("")
    w("Client: `tools/bench.py`, the same for every engine. Greedy decoding, 64 fixed coding prompts, 512 new tokens")
    w("per request, token counts from the server's own usage report. Single stream: 16 requests one after another.")
    w("At 8, 32 and 64 streams: that many requests in flight, at least 32 requests. Tokens per second per stream is")
    w("counted after the first token (median over streams); the sum is all output tokens over the wall time.")
    w("Prefill: one prompt of real source code, one output token, not streamed; prompt tokens over the request time,")
    w("median of 3, each prompt with a new prefix so nothing is cached.")
    w("")
    w("| Engine line | 1 stream, tok/s | First token, ms | 8 streams, per stream / sum | 32 streams | 64 streams | Prefill 4K, tok/s | Prefill 64K, tok/s | Started (UTC) |")
    w("|---|---|---|---|---|---|---|---|---|")
    for r in speed_rows(f"{R}/results/raw/speed"):
        w(r)
    w("")
    w("`plain` is the engine with no speculative decoding. `dspark` is the engine's own fast recipe, which drafts with")
    w("the draft head that ships inside the checkpoint.")
    w("")
    if os.path.isdir(f"{R}/results/raw/speed-run1-under-load"):
        w("A first sweep ran while other jobs loaded the machine's CPUs (one benchmark test took 222 of 256 cores during")
        w("the SGLang rows). It is kept in `raw/speed-run1-under-load/` and not used. For this sweep, cores 0 to 31 were")
        w("kept free for the engine under test and its client.")
        w("")
        w("| Engine line (first sweep, not used) | 1 stream, tok/s | First token, ms | 8 streams | 32 streams | 64 streams | Prefill 4K | Prefill 64K | Started (UTC) |")
        w("|---|---|---|---|---|---|---|---|---|")
        for r in speed_rows(f"{R}/results/raw/speed-run1-under-load"):
            w(r)
        w("")
    strata = f"{R}/results/raw/strata.txt"
    w("### Strata")
    w("")
    w(open(strata).read().strip() if os.path.exists(strata) else "Not measured.")
    w("")
    w("## The evaluation subset")
    w("")
    if sub:
        w(f"{sub['n']} of the {sub['total_instances']} instances of `{sub['dataset']}` (split `{sub['split']}`), drawn once: "
          f"`{sub['method']}` with seed {sub['seed']}. The list is `eval/subset.json`.")
        w("")
        w("| Repository | Instances |")
        w("|---|---|")
        for k, v in sub["instances_per_repo"].items():
            w(f"| {k} | {v} |")
    w("")
    w("## Scores on the subset")
    w("")
    w("Agent: mini-swe-agent 2.4.6 with its own `swebench.yaml` (one bash tool, no other tools), 250 steps at most,")
    w("16,384 new tokens at most per step. One attempt per task. Scoring: the SWE-bench harness 4.0.4 with the")
    w("benchmark's own images and tests. A task with no patch counts as not resolved: every score is out of 100.")
    w("")
    w("| Run | Model | Resolved of 100 | Submitted a patch | Agent pass (UTC) | Notes |")
    w("|---|---|---|---|---|---|")
    notes = load(f"{R}/results/raw/run_notes.json") or {}
    for d in sorted(glob.glob(f"{R}/results/agent/*/")):
        label = os.path.basename(d.rstrip("/"))
        if not (label.startswith("stock-") or label.startswith("opus")):
            continue
        s = load(d + "summary.json")
        meta = open(d + "meta.txt").read() if os.path.exists(d + "meta.txt") else ""
        t = [x.split()[3] for x in meta.splitlines() if " start " in x and "scoring" not in x][:1] + \
            [x.split()[4] for x in meta.splitlines() if "agent done" in x][:1]
        model = "Opus 5.5, through OpenRouter (`anthropic/claude-opus-5.5`)" if label.startswith("opus") else "stock Inkling 2 Mini, vLLM plain, temperature 0"
        if s:
            extra = 0
            for rf in glob.glob(d + "rescore/*.json"):
                rr = load(rf) or {}
                extra += len(set(rr.get("resolved_ids") or []) - set(s.get("resolved_ids") or []))
            ra = s.get("rescored_alone")
            if ra is not None and ra.get("resolved"):
                res = (f"**{s['resolved']}** ({s['resolved_first_scoring']} in the scoring run; {len(ra['resolved'])} more when the instance "
                       "whose scoring errored was scored alone)")
            elif ra is not None:
                res = f"**{s['resolved']}** (the instance whose scoring errored was scored again alone: not resolved)"
            else:
                res = f"**{s['resolved'] + extra}**" + (f" ({s['resolved']} in the scoring run; {extra} more when the instance whose scoring errored was scored alone)" if extra else "")
                if s.get("error") and not extra:
                    res += " (one instance's scoring errored; not yet scored again alone)"
            w(f"| {label} | {model} | {res} | {s.get('submitted')} | {' to '.join(t)} | {notes.get(label, '')} |")
        else:
            w(f"| {label} | {model} | not scored yet | | {' to '.join(t)} | {notes.get(label, '')} |")
    w("")
    led = f"{R}/results/or_ledger.jsonl"
    if os.path.exists(led):
        rows = [json.loads(x) for x in open(led) if x.strip()]
        allok = [x for x in rows if x.get("status") == 200]
        first = min((x.get("t") or 0) for x in allok) if allok else 0
        ok = [x for x in allok if (x.get("t") or 0) < first + 3600]          # the benchmark pass took under 15 minutes
        later = [x for x in allok if x not in ok]
        if later:
            w(f"(The relay served {len(later)} more call(s) to Opus 5.5 later that day, when the demo page was tried once: "
              f"USD {sum(x.get('cost') or 0 for x in later):.2f}. They are not part of the figures below.)")
            w("")
        w(f"Opus 5.5 was called {len(ok)} times ({sum(x['in'] for x in ok):,} prompt tokens, {sum(x['out'] for x in ok):,} output tokens) "
          f"for USD {sum(x.get('cost') or 0 for x in ok):.2f}, as OpenRouter reported per call. It ran with the provider's default "
          "sampling (no temperature was sent) and prompt caching on.")
        w("")
    inc = f"{R}/results/raw/incidents.md"
    if os.path.exists(inc):
        w("## What went wrong during these runs")
        w("")
        w(open(inc).read().strip())
        w("")
    print("\n".join(out))


if __name__ == "__main__":
    main()