okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

T-Cryptbench: community report, RTX 4090 + 32 GB RAM at 512K context (IQ2_XS) (#834)2cf6f8a6d

main
2.0 KiB36 linesraw
1#!/usr/bin/env python3
2"""Live check (0.1.39 rerun of 2026-10-03/strata-512k-live) of the running Strata 512K server (127.0.0.1:8080): long-prompt speed and recall at
332K/120K/240K/480K, then short follow-ups for stability (upstream #606), with RAM sampled. Reuses
4scripts/strata/ctx_sweep.py's haystack and chat helpers against the live port."""
5import json, sys, threading, time
6sys.path.insert(0, "~/bench-scripts")
7import ctx_sweep as cs
8cs.PORT = 8080
9out = "./results.jsonl"
10mem = {"min_avail": 99.0, "max_swap": 0.0}
11def sample():
12    while True:
13        m = dict(l.split(":")[0:2] for l in open("/proc/meminfo"))
14        a = int(m["MemAvailable"].split()[0]) / 1048576
15        sw = (int(m["SwapTotal"].split()[0]) - int(m["SwapFree"].split()[0])) / 1048576
16        mem["min_avail"] = min(mem["min_avail"], a); mem["max_swap"] = max(mem["max_swap"], sw)
17        time.sleep(1)
18threading.Thread(target=sample, daemon=True).start()
19def log(rec):
20    rec.update({k: round(v, 2) for k, v in mem.items()})
21    print(json.dumps(rec), flush=True)
22    open(out, "a").write(json.dumps(rec) + "\n")
23for n in (32000, 120000, 240000, 480000):
24    text, secret = cs.haystack(n, seed=11)
25    q = "\n\nWhat is the vault rotation code? Answer with the number only."
26    t0 = time.time(); r = cs.chat(text + q, 48)
27    r2 = cs.chat(text + q + "\n\nThen write a 200-word summary of what these logs show.", 300)
28    log({"target": n, "prompt_tokens": r["prompt_tokens"], "read_secs": r["secs"], "prefill_tps": r["prefill_tps"],
29         "recall": secret in r["text"], "answer": r["text"][:40], "decode_at_depth": r2["decode_tps"],
30         "summary_head": r2["text"][:120]})
31for i, p in enumerate(["What is 17 * 23? Answer with the number only.",
32                       "Name the capital of France in one word.",
33                       "Write a Python one-liner that reverses a string s."]):
34    r = cs.chat(p, 80)
35    log({"followup": i, "text": r["text"][:100], "decode_tps": r["decode_tps"]})
36log({"done": True})