Skip to content
Closed
230 changes: 230 additions & 0 deletions bench/results/2026-10-09-community-2x-rx-6900xt-0.1.41/README.md

Large diffs are not rendered by default.

135 changes: 135 additions & 0 deletions bench/results/2026-10-09-community-2x-rx-6900xt-0.1.41/benchmark.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
#!/usr/bin/env python3
"""Serial, fresh-prompt Strata benchmark. Run inside its prepared environment."""
import argparse
import hashlib
import json
import statistics
import sys
import time
import urllib.request
from pathlib import Path


def get(url):
with urllib.request.urlopen(url, timeout=30) as response:
return json.load(response)


def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--root", type=Path, default=Path("/workspace/Strata"))
parser.add_argument("--pack", type=Path, default=Path("/workspace/Strata-data/packs/iq2_xs"))
parser.add_argument("--url", default="http://127.0.0.1:18080")
parser.add_argument("--out", type=Path, default=Path("/workspace/results"))
parser.add_argument("--targets", default="4096,32768,128000")
parser.add_argument("--runs", type=int, default=3)
args = parser.parse_args()
args.out.mkdir(parents=True, exist_ok=True)
sys.path[:0] = [str(args.root), str(args.root / "tools")]
from strata_tokenizer import Tokenizer
from serve.frontend import ChatTemplate, openai_to_messages
directory = args.pack / "tokenizer"
vocab = json.loads((directory / "vocab.json").read_text())
tokens = [None] * len(vocab)
for token, number in vocab.items():
tokens[number] = token
tokenizer = Tokenizer(tokens, (directory / "merges.txt").read_text().splitlines(),
json.loads((directory / "token_type.json").read_text()))
template = ChatTemplate(directory / "chat_template.jinja")
initial = get(args.url + "/v1/status")
(args.out / "initial-status.json").write_text(json.dumps(initial, indent=2) + "\n")
rows = []

def request(content, maximum=256):
return {"model": "strata", "messages": [{"role": "user", "content": content}],
"temperature": 0, "reasoning_effort": "none", "max_tokens": maximum,
"stream": True, "stream_options": {"include_usage": True}}

def count(req):
messages, tools, kwargs = openai_to_messages(req)
return len(tokenizer.encode(template.render(messages, tools, **kwargs), parse_special=True))

def perform(label, req, expected=None):
body = json.dumps(req).encode()
(args.out / (label + "-request.json")).write_bytes(body + b"\n")
print("start", label, "tokens", expected, flush=True)
chunks, texts, first, finish = [], [], None, None
started = time.perf_counter()
wire = urllib.request.Request(args.url + "/v1/chat/completions", data=body,
headers={"Content-Type": "application/json"})
with urllib.request.urlopen(wire, timeout=1800) as response:
for line in response:
if not line.startswith(b"data: "):
continue
payload = line[6:].strip()
if payload == b"[DONE]":
break
chunk = json.loads(payload)
chunks.append(chunk)
for choice in chunk.get("choices", []):
delta = choice.get("delta", {})
text = (delta.get("content") or "") + (delta.get("reasoning_content") or "")
if text:
first = first if first is not None else time.perf_counter() - started
texts.append(text)
finish = choice.get("finish_reason") or finish
elapsed = time.perf_counter() - started
metrics = get(args.url + "/metrics")
engine = metrics["requests"][0]
usage = next((chunk["usage"] for chunk in reversed(chunks) if "usage" in chunk), {})
row = {"label": label, "expected_prompt_tokens": expected,
"request_sha256": hashlib.sha256(body).hexdigest(),
"client_ttft_s": first, "client_elapsed_s": elapsed, "finish_reason": finish,
"usage": usage, "engine": engine, "text": "".join(texts)}
if expected is not None and engine["prompt_tokens"] != expected:
raise RuntimeError(f"token count mismatch: {expected} vs {engine['prompt_tokens']}")
if not texts:
raise RuntimeError(f"no text received for {label}")
(args.out / (label + "-raw.json")).write_text(json.dumps({"chunks": chunks, "row": row}, indent=2) + "\n")
rows.append(row)
(args.out / "results.json").write_text(json.dumps(rows, indent=2) + "\n")
print("done", label, json.dumps({"ttft_s": first, "elapsed_s": elapsed, "engine": engine}), flush=True)
return row

perform("warmup", request("Reply with exactly the word READY.", 16))
# Each nonce occurs before the filler so previous long prompts cannot be reused.
filler = "\n".join(f"def task_{i:05d}(value: int) -> int: return (value * {(i % 97) + 1} + {i}) % 100003"
for i in range(12000))
ending = ("\n\nWrite a detailed explanation of the code above. Discuss deterministic integer transforms, "
"modulo arithmetic, testing, naming, complexity, and maintainability. Write at least 600 words.")
for target in map(int, args.targets.split(",")):
for run in range(1, args.runs + 1):
prefix = f"Benchmark nonce: series-{target}-trial-{run}.\nReview this synthetic Python module:\n"
lo, hi = 0, len(filler)
while lo < hi:
middle = (lo + hi + 1) // 2
if count(request(prefix + filler[:middle] + ending)) <= target:
lo = middle
else:
hi = middle - 1
req = request(prefix + filler[:lo] + ending)
actual = count(req)
if actual < target - 20 or actual > target:
raise RuntimeError(f"could not construct target {target}: {actual}")
perform(f"tokens-{target}-run-{run}", req, actual)
measured = [row for row in rows if row["label"] != "warmup"]
groups = {}
for target in map(int, args.targets.split(",")):
subset = [r for r in measured if r["label"].startswith(f"tokens-{target}-")]
values = {
"prompt_tokens": [r["engine"]["prompt_tokens"] for r in subset],
"cached_tokens": [r["engine"].get("reused", 0) for r in subset],
"output_tokens": [r["engine"]["engine_generated"] for r in subset],
"client_ttft_s": [r["client_ttft_s"] for r in subset],
"client_elapsed_s": [r["client_elapsed_s"] for r in subset],
"prefill_tok_s": [(r["engine"]["prompt_tokens"] - (r["engine"].get("reused") or 0)) / (r["engine"]["prompt_ms"] / 1000) for r in subset],
"decode_tok_s": [r["engine"]["engine_generated"] / (r["engine"]["decode_ms"] / 1000) for r in subset],
}
groups[str(target)] = {key: {"median": statistics.median(v), "min": min(v), "max": max(v)}
for key, v in values.items()}
(args.out / "summary.json").write_text(json.dumps(groups, indent=2) + "\n")
print("summary", json.dumps(groups), flush=True)


if __name__ == "__main__":
main()
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name helper-prs
worktree /work/prs
binary sha256 7ab4a52016bd9b9d26f9cdfc6cbdcb3adce5925e779a1bab21a06e8c15b8d612
env STRATA_HIP_PROMPT_F16=1,STRATA_SH_STREAM=1,STRATA_ROCBLAS_TUNING=/work/prs/tools/hip,STRATA_TUNING_CACHE=/home/user/.cache/strata,STRATA_SELECT_SGEMM=1,STRATA_SELECT_SGEMM_VERBOSE=1,STRATA_IO_THREADS=128,STRATA_PREFILL_CPU_SHARE=auto,STRATA_HIP_ADAPT_KERNEL_COPY=1
extra args
gfxoff knob at start: dri/0: 00000001 00000001 00000001 00000001 * 00000001 00000000 00000000 00000000 00000000 00000000 00000000 00000000 dri/1: 00000001 00000001 00000001 00000001 *

Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"exe": "/work/prs/strata-engine",
"args": [
"--pack",
"/m/packs/iq3_s",
"--native",
"/m/IQ3_S/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf",
"--ple-gguf",
"/m/IQ3_S/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00002-of-00002.gguf",
"--expert-profile",
"/work/prs/expert-profile.bin",
"--expert-cache",
"auto",
"--prefill",
"auto",
"--spec",
"4",
"--spec-min-p",
"0.5",
"--mtp",
"/m/mtp/rt",
"--max-context",
"131072",
"--kv",
"int8",
"--kv-resident",
"32768",
"--expert-cache-device1",
"auto",
"--remote-expert-opt",
"--ple-io",
"ram"
],
"cwd": "/work/prs",
"tokenizer": "/m/packs/iq3_s/tokenizer",
"model_name": "strata-helper",
"log": "/bench/helper-prs/engine.log",
"lib_dirs": [
"/opt/rocm/lib"
],
"port": 8080,
"backend": "hip",
"gpu": 1,
"gpus_asked": true,
"env": {
"HIP_VISIBLE_DEVICES": "1,0",
"STRATA_HIP_PROMPT_F16": "1",
"STRATA_SH_STREAM": "1",
"STRATA_ROCBLAS_TUNING": "/work/prs/tools/hip",
"STRATA_TUNING_CACHE": "/home/user/.cache/strata",
"STRATA_SELECT_SGEMM": "1",
"STRATA_SELECT_SGEMM_VERBOSE": "1",
"STRATA_IO_THREADS": "128",
"STRATA_PREFILL_CPU_SHARE": "auto",
"STRATA_HIP_ADAPT_KERNEL_COPY": "1"
}
}
Loading