Multi-GPU recipes and mixed setups
ci / check (push) Successful in 11s

Several of one GPU: <gpu>/<model>/<N>x-<engine>-<profile>.md with gpus,
tp and pp (tp × pp = gpus) and a declared PCIe topology. Different GPUs:
mixed/<setup>/, named after its cards, with the same layout as a GPU
folder and a generated mixed/README.md. Runs must sit in their recipe's
setup folder. Energy, and bandwidth for pipeline parallel or mixed, are
left out where bench-standard measures one GPU only; docs/
bench-standard-gaps.md lists those gaps for the benchmarks repo. The
wanted lists take the fewest of one GPU a model fits in.

Demo: 2x Arc B580 with vLLM TP 2 and llama.cpp layer split for
Qwen3.8-27B, -sm row as what lost, and Arc Pro B60 + Arc B580 mixed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-29 18:59:51 +01:00
1 parent 753bdadf7a
commit 976a8b40e5
59 files changed
+39381 -119

No files matched your search

+209 -81
View File
@@ -37,7 +37,18 @@ FIELDS = ("title", "summary", "model", "quant", "kv", "engine", "gpu", "profile"
"spec", "thinking", "results")
ZERO_DIGEST = "0" * 64
# Top-level folders that are not GPU folders.
RESERVED = {"docs", "tools", "site"}
RESERVED = {"docs", "tools", "site", "mixed"}
def setup(gpu, n=1):
"""(folder, gpu_model as bench.sh records it, label) for a recipe's GPUs:
one name with a count, or for a mixed setup a list with one name per card."""
if isinstance(gpu, list):
names = sorted(gpu)
counts = {g: names.count(g) for g in dict.fromkeys(names)}
return ("mixed/" + "_".join(f"{c}x-{slug(g)}" for g, c in counts.items()), "+".join(counts),
" + ".join(f"{c}× {g}" if c > 1 else g for g, c in counts.items()))
return slug(gpu), gpu, gpu if n == 1 else f"{n}× {gpu}"
def slug(s):
@@ -115,6 +126,10 @@ def metrics(meta, res):
"decode_j_per_token": decode_e.get("j_per_token"), "decode_w": decode_e.get("avg_w")}
def plural(n, word):
return f"{n} {word}{'' if n == 1 else 's'}"
def num(x, dec=1):
return "—" if x is None else f"{x:,.{dec}f}"
@@ -131,20 +146,25 @@ class Cookbook:
self.root = Path(root)
self.errors, self.warnings = [], []
self.config = tomllib.loads((self.root / "cookbook.toml").read_text(encoding="utf-8"))
# One folder per GPU: <gpu>/<model>/<engine>-<profile>.md, <gpu>/<model>/tried.md
# and <gpu>/results/<run>/.
# One folder per GPU: <gpu>/<model>/[<N>x-]<engine>-<profile>.md,
# <gpu>/<model>/tried.md and <gpu>/results/<run>/. Setups of different GPUs
# get the same layout under mixed/<setup>/.
self.gpu_dirs = {slug(g): g for g in self.config["gpus"]}
for d in sorted(self.root.iterdir()):
if d.is_dir() and not d.name.startswith(".") and d.name not in RESERVED | set(self.gpu_dirs):
self.warning(d.name, "not a GPU in cookbook.toml, so nothing in it is checked")
mixed = self.root / "mixed"
self.homes = list(self.gpu_dirs) + (
[d.relative_to(self.root).as_posix() for d in sorted(mixed.iterdir()) if d.is_dir()]
if mixed.exists() else [])
self.results = self._load_results()
docs = [p for g in self.gpu_dirs for p in sorted((self.root / g).glob("*/*.md"))
docs = [p for h in self.homes for p in sorted((self.root / h).glob("*/*.md"))
if p.parent.name != "results"]
self.recipes = self._load_docs([p for p in docs if p.name != "tried.md"], self._recipe)
self.tried = self._load_docs([p for p in docs if p.name == "tried.md"], self._tried)
for r in self.results.values():
if not r["used"]:
self.warning(f"results/{r['id']}", "not cited by any recipe or tried log")
self.warning(f"{r['home']}/results/{r['id']}", "not cited by any recipe or tried log")
def error(self, where, msg):
self.errors.append(f"{where}: {msg}")
@@ -155,9 +175,10 @@ class Cookbook:
# ------------------------------------------------------------ loading
def _load_results(self):
out = {}
dirs = [(gpu, d) for g, gpu in self.gpu_dirs.items() if (self.root / g / "results").exists()
for d in sorted((self.root / g / "results").iterdir()) if d.is_dir()]
for gpu, d in dirs:
dirs = [(h, d) for h in self.homes if (self.root / h / "results").exists()
for d in sorted((self.root / h / "results").iterdir()) if d.is_dir()]
for home, d in dirs:
gpu = self.gpu_dirs.get(home) # None in mixed/: the recipes check those
where = d.relative_to(self.root).as_posix()
try:
meta = json.loads((d / "meta.json").read_text(encoding="utf-8"))
@@ -170,12 +191,12 @@ class Cookbook:
self.error(where, f"{f} missing")
if ((res.get("env") or {}).get("notes") or {}) != meta.get("notes"):
self.error(where, "the notes in meta.json and the results file differ (edited?)")
if (meta.get("collected") or {}).get("gpu_model") != gpu:
if gpu and (meta.get("collected") or {}).get("gpu_model") != gpu:
self.error(where, f"ran on {(meta.get('collected') or {}).get('gpu_model')}, "
f"but it is in the {gpu} folder")
m = meta.get("mandatory") or {}
cmd = d / "server-cmd.txt"
out[d.name] = {"id": d.name, "dir": d, "meta": meta, "res": res,
out[d.name] = {"id": d.name, "dir": d, "home": home, "meta": meta, "res": res,
"demo": (d / "DEMO").exists(), "submitter": m.get("submitter"),
"full": m.get("run_mode") == "full",
"created": (meta.get("created") or "")[:10],
@@ -204,14 +225,31 @@ class Cookbook:
return None
rid = rel[:-len(".md")]
tp, pp = int(f.get("tp", 1)), int(f.get("pp", 1))
want = f"{slug(f['gpu'])}/{slug(f['model'])}/{slug(f['engine'])}-{f['profile']}"
mixed = isinstance(f["gpu"], list)
names = list(f["gpu"]) if mixed else [f["gpu"]]
n = len(names) if mixed else int(f.get("gpus", 1))
if mixed and len(set(names)) < 2:
self.error(rel, "a mixed setup needs two different GPUs; for N of one GPU use "
"gpu = NAME and gpus = N")
if mixed and int(f.get("gpus", n)) != n:
self.error(rel, f"gpus = {f['gpus']} but gpu lists {n}")
home, gpu_model, setup_label = setup(f["gpu"], n)
prefix = f"{n}x-" if n > 1 and not mixed else ""
want = f"{home}/{slug(f['model'])}/{prefix}{slug(f['engine'])}-{f['profile']}"
if rid != want:
self.error(rel, f"should be {want}.md for its gpu, model, engine and profile")
self.error(rel, f"should be {want}.md for its gpu, gpus, model, engine and profile")
if f["profile"] not in PROFILES:
self.error(rel, f"profile {f['profile']!r}: use one of {', '.join(PROFILES)}")
return None
if f["gpu"] not in self.config["gpus"]:
self.error(rel, f"gpu {f['gpu']!r} is not an Intel Arc GPU listed in cookbook.toml")
for g in dict.fromkeys(names):
if g not in self.config["gpus"]:
self.error(rel, f"gpu {g!r} is not an Intel Arc GPU listed in cookbook.toml")
if tp * pp != n:
self.error(rel, f"tp × pp is {tp * pp}, but the recipe runs on {n} GPU{'s' if n > 1 else ''}")
topology = f.get("topology")
if n > 1 and not (isinstance(topology, list) and len(topology) == n):
example = ", ".join(['"Gen5 x8 CPU"'] * n)
self.error(rel, f"declare topology: one PCIe link per GPU, e.g. topology = [{example}]")
if f["model"] not in self.config["models"]:
self.error(rel, f"model {f['model']!r} is not a standard model listed in cookbook.toml")
cmd = launch_block(body)
@@ -224,7 +262,9 @@ class Cookbook:
self.error(rel, f"result {rid_} is not in results/")
continue
res["used"] = True
self._check_run(rel, f, tp, pp, res)
if res["home"] != home:
self.error(rel, f"{rid_} is in {res['home']}/results, not {home}/results")
self._check_run(rel, f, tp, pp, gpu_model, res)
if cmd is not None:
if res["cmd"] is None:
self.error(rel, f"{rid_} has no server-cmd.txt")
@@ -262,10 +302,12 @@ class Cookbook:
if age > self.config["stale_after_days"]:
self.warning(rel, f"stale: the newest run is {age} days old; re-run it on a current engine")
return {"id": rid, "rel": rel, "path": path, "front": f, "body": body, "cmd": cmd,
"runs": runs, "demo": demo, "status": status, "tp": tp, "pp": pp,
"runs": runs, "demo": demo, "status": status, "tp": tp, "pp": pp, "n": n,
"mixed": mixed, "home": home, "gpu_model": gpu_model, "label": setup_label,
"group": f"mixed: {setup_label}" if mixed else f["gpu"], "topology": topology or [],
"value": runs[0]["metrics"][metric] if runs else None}
def _check_run(self, rel, f, tp, pp, res):
def _check_run(self, rel, f, tp, pp, gpu_model, res):
m = res["meta"].get("mandatory") or {}
c = res["meta"].get("collected") or {}
notes = res["meta"].get("notes") or {}
@@ -283,22 +325,25 @@ class Cookbook:
self.error(rel, f"{w}: {k} is {f[k]!r} in the recipe but {m.get(k)!r} in the run")
if (m.get("tp"), m.get("pp")) != (str(tp), str(pp)):
self.error(rel, f"{w}: tp/pp {tp}/{pp} in the recipe but {m.get('tp')}/{m.get('pp')} in the run")
self._check_where(rel, f, res)
self._check_where(rel, gpu_model, f["engine"], res)
def _check_where(self, rel, f, res):
def _check_where(self, rel, gpu_model, engine, res):
# gpu_count isn't checked: bench.sh counts every GPU in the machine, not
# the ones the server uses. tp × pp says how many it uses.
c = res["meta"].get("collected") or {}
if c.get("gpu_vendor") != "intel" or c.get("gpu_model") != f["gpu"]:
if c.get("gpu_vendor") != "intel" or c.get("gpu_model") != gpu_model:
self.error(rel, f"{res['id']} ran on {c.get('gpu_vendor')} {c.get('gpu_model')}, "
f"not {f['gpu']}")
if c.get("engine") != f["engine"]:
self.error(rel, f"{res['id']} ran on {c.get('engine')}, not {f['engine']}")
f"not {gpu_model}")
if c.get("engine") != engine:
self.error(rel, f"{res['id']} ran on {c.get('engine')}, not {engine}")
def _tried(self, rel, path, f, body):
for k in ("model", "gpu"):
if k not in f:
self.error(rel, f"front matter lacks {k}")
return None
want = f"{slug(f['gpu'])}/{slug(f['model'])}/tried.md"
home, _, label = setup(f["gpu"])
want = f"{home}/{slug(f['model'])}/tried.md"
if rel != want:
self.error(rel, f"should be {want}")
entries = []
@@ -315,14 +360,18 @@ class Cookbook:
self.error(rel, f"{res['id']}: say what changed (change = ...)")
res["used"] = True
bf = base["front"]
if (bf["model"], bf["gpu"]) != (f["model"], f["gpu"]):
if (bf["model"], base["home"]) != (f["model"], home):
self.error(rel, f"recipe {base['id']} is for another model or GPU")
if res["home"] != home:
self.error(rel, f"{res['id']} is in {res['home']}/results, not {home}/results")
if f"standard: {bf['model']} " not in res["meta"].get("notes", {}).get("model_file", ""):
self.error(rel, f"{res['id']}: not the standard {bf['model']} file")
self._check_where(rel, bf, res)
self._check_where(rel, base["gpu_model"], bf["engine"], res)
entries.append({"change": t.get("change", ""), "note": t.get("note", ""),
"recipe": base, "result": res})
return {"rel": rel, "path": path, "front": f, "body": body, "entries": entries}
mixed = isinstance(f["gpu"], list)
return {"rel": rel, "path": path, "front": f, "body": body, "entries": entries, "home": home,
"label": label, "group": f"mixed: {label}" if mixed else f["gpu"]}
# ------------------------------------------------------------ generated Markdown
def link(self, target, src):
@@ -339,11 +388,14 @@ class Cookbook:
if not rc["runs"]:
return "No runs yet."
p = rc["runs"][0]["metrics"]
n = len(rc["runs"])
runs = len(rc["runs"])
L += [f"**{label}: {num(rc['value'], dec)} {unit}** · {rc['status']} · "
f"{n} run{'s' if n > 1 else ''}", "",
"| metric | first run |", "|---|---|",
f"| decode at batch 1 (median) | {num(p['decode_tps'])} t/s |",
f"{runs} run{'s' if runs > 1 else ''}", "",
"| metric | first run |", "|---|---|"]
if rc["n"] > 1:
L += [f"| GPUs | {rc['label']} · tp {rc['tp']} · pp {rc['pp']} |",
f"| PCIe topology (declared) | {' · '.join(rc['topology'])} |"]
L += [f"| decode at batch 1 (median) | {num(p['decode_tps'])} t/s |",
f"| time to first token (median) | {num(p['ttft_ms'], 0)} ms |"]
if p["concurrency"]:
L.append("| concurrency, aggregate | " + " · ".join(
@@ -351,13 +403,21 @@ class Cookbook:
if p["prefill"]:
L.append("| prefill | " + " · ".join(
f"{k // 1000}k: {num(v, 0)}" for k, v in sorted(p["prefill"].items())) + " t/s |")
if rc["n"] > 1 and unit == "t/s" and rc["value"]:
L.append(f"| {label} per GPU | {num(rc['value'] / rc['n'])} t/s |")
# bench-standard scales bandwidth by tp only, and samples the power of one GPU.
if f["spec"] != "none":
L.append("| memory bandwidth reached | n/a: speculative decoding makes several tokens "
"per pass over the weights |")
elif rc["pp"] > 1 or rc["mixed"]:
L.append("| memory bandwidth reached | n/a: bench-standard computes it for tensor parallel "
"over equal GPUs only |")
elif p["bw_pct"] is not None:
L.append(f"| memory bandwidth reached | {num(p['bw_pct'], 0)}% of "
f"{num(p['mem_bw_gbs'], 0)} GB/s measured |")
if p["decode_j_per_token"] is not None:
if rc["n"] > 1:
L.append("| decode energy | n/a: bench-standard samples the power of one GPU |")
elif p["decode_j_per_token"] is not None:
L.append(f"| decode energy | {num(p['decode_j_per_token'], 2)} J/token at "
f"{num(p['decode_w'], 0)} W |")
L += ["", f"| run | submitter | date | {label} | TTFT | report |", "|---|---|---|---|---|---|"]
@@ -374,6 +434,9 @@ class Cookbook:
f" --tp {rc['tp']} --pp {rc['pp']} --quant {f['quant']} --kv {f['kv']} "
f"--spec {f['spec']} --thinking {f['thinking']} \\",
" --submitter YOUR_NAME --server-cmd-file server-cmd.txt --full", "```"]
if rc["n"] > 1:
L += ["", "bench.sh records PCIe and power for one GPU only: put the link of every GPU in "
"`--special-notes`, as in the recipe's `topology`."]
return "\n".join(L)
def tried_md(self, td):
@@ -397,11 +460,11 @@ class Cookbook:
return "\n".join(L)
def best(self):
"""The fastest recipe per (gpu, model, profile)."""
"""The fastest recipe per (setup folder, GPU count, model, profile)."""
top = {}
for rc in self.recipes:
f = rc["front"]
key = (f["gpu"], f["model"], f["profile"])
key = (rc["home"], rc["n"], f["model"], f["profile"])
higher = PROFILES[f["profile"]][3]
cur = top.get(key)
if rc["value"] is not None and (cur is None or
@@ -409,32 +472,64 @@ class Cookbook:
top[key] = rc
return top
def gpu_recipes(self, gpu):
return sorted((r for r in self.recipes if r["front"]["gpu"] == gpu),
key=lambda r: (r["front"]["model"], list(PROFILES).index(r["front"]["profile"]),
def starred(self, rc):
return self.best().get((rc["home"], rc["n"], rc["front"]["model"], rc["front"]["profile"])) is rc
def home_recipes(self, home):
return sorted((r for r in self.recipes if r["home"] == home),
key=lambda r: (r["front"]["model"], r["n"], list(PROFILES).index(r["front"]["profile"]),
r["front"]["engine"]))
def headline(self, rc, star=False):
_, label, unit, _ = PROFILES[rc["front"]["profile"]]
return f"{num(rc['value'], 2 if unit == 'J/tok' else 1)} {unit} {label}{' ★' if star else ''}"
def fastest_single_user(self, homes):
"""Per model, the fastest single-user recipe in these folders, any GPU count."""
top = {}
for rc in self.recipes:
m = rc["front"]["model"]
if rc["home"] in homes and rc["front"]["profile"] == "single-user" and rc["value"] is not None \
and (m not in top or rc["value"] > top[m]["value"]):
top[m] = rc
def count(rc):
return "" if rc["n"] == 1 or rc["mixed"] else f", {rc['n']}×"
return " · ".join(f"{m}: {num(rc['value'])} t/s ({rc['front']['engine']}{count(rc)})"
for m, rc in sorted(top.items()))
def index_md(self):
"""The GPU table in the top-level README."""
best = self.best()
L = ["| GPU | VRAM | bandwidth (spec) | recipes | fastest for one user |", "|---|---|---|---|---|"]
for gpu, g in self.config["gpus"].items():
rows = self.gpu_recipes(gpu)
fastest = [best[k] for k in sorted(best) if k[0] == gpu and k[2] == "single-user"]
top = " · ".join(f"{rc['front']['model']}: {num(rc['value'])} t/s ({rc['front']['engine']})"
for rc in fastest) or "none yet: wanted"
L.append(f"| [{gpu}]({slug(gpu)}/README.md) | {g['vram_gb']} GB | {g['mem_bw_gbs']} GB/s | "
f"{len(rows)} | {top} |")
d = slug(gpu)
L.append(f"| [{gpu}]({d}/README.md) | {g['vram_gb']} GB | {g['mem_bw_gbs']} GB/s | "
f"{len(self.home_recipes(d))} | {self.fastest_single_user([d]) or 'none yet: wanted'} |")
mixed = [h for h in self.homes if h.startswith("mixed/")]
n = sum(len(self.home_recipes(h)) for h in mixed)
L.append(f"| [Mixed setups](mixed/README.md) | {len(mixed)} setup{'s' if len(mixed) != 1 else ''} | — | "
f"{n} | {self.fastest_single_user(mixed) or 'none yet'} |")
return "\n".join(L)
def recipe_table(self, rows, home):
L = ["| model | GPUs | profile | engine | headline | status | recipe |", "|---|---|---|---|---|---|---|"]
for rc in rows:
f = rc["front"]
L.append(f"| {f['model']} | {rc['n']} | {f['profile']} | {f['engine']} | "
f"{self.headline(rc, self.starred(rc))} | {'demo' if rc['demo'] else rc['status']} | "
f"[{f['title']}]({rc['id'].removeprefix(home + '/')}.md) |")
return L
def results_md(self, home, up):
n = sum(1 for r in self.results.values() if r["home"] == home)
where = (f"{plural(n, 'result folder')} in [`results/`](results/), as bench.sh wrote them."
if n else "None yet. Runs go in `results/` here, as bench.sh writes them.")
return ["", "## Results", "", where,
f"Host setup for every recipe: [docs/host-setup.md]({up}docs/host-setup.md)."]
def gpu_md(self, gpu):
"""A GPU folder's README, generated whole."""
g, d, best = self.config["gpus"][gpu], slug(gpu), self.best()
rows = self.gpu_recipes(gpu)
g, d = self.config["gpus"][gpu], slug(gpu)
rows = self.home_recipes(d)
L = [f"# {gpu}", "",
"<!-- Generated by tools/cookbook.py build from cookbook.toml and this folder. Don't edit. -->",
"", f"{g['vram_gb']} GB VRAM · {g['mem_bw_gbs']} GB/s memory bandwidth (spec) · {g['arch']}", ""]
@@ -445,38 +540,70 @@ class Cookbook:
"`tools/demo/make_demo.py`. Nothing here was measured.", ""]
L += ["## Recipes", ""]
if rows:
L += ["| model | profile | engine | headline | status | recipe |", "|---|---|---|---|---|---|"]
for rc in rows:
f = rc["front"]
star = best.get((gpu, f["model"], f["profile"])) is rc
L.append(f"| {f['model']} | {f['profile']} | {f['engine']} | {self.headline(rc, star)} | "
f"{'demo' if rc['demo'] else rc['status']} | "
f"[{f['title']}]({rc['id'].removeprefix(d + '/')}.md) |")
L += ["", "★ the fastest recipe for that model and profile on this GPU."]
L += self.recipe_table(rows, d)
L += ["", "★ the fastest recipe for that model, GPU count and profile. Several of this GPU: "
"files named `<N>x-<engine>-<profile>.md`. With other GPUs: [mixed setups](../mixed/README.md)."]
else:
L.append("None yet.")
tried = [t for t in self.tried if t["front"]["gpu"] == gpu]
tried = [t for t in self.tried if t["home"] == d]
if tried:
L += ["", "## What lost", ""] + [
f"- [{t['front']['model']}]({t['rel'].removeprefix(d + '/')}): {len(t['entries'])} variants"
f"- [{t['front']['model']}]({t['rel'].removeprefix(d + '/')}): {plural(len(t['entries']), 'variant')}"
for t in tried]
wanted = [m for gg, m in self.wanted() if gg == gpu]
wanted = [m + (f" on {setup(gpu, n)[2]}" if n > 1 else "") for gg, n, m in self.wanted() if gg == gpu]
if wanted:
L += ["", "## Wanted", "", "Fits in VRAM, no single-user recipe yet: " + ", ".join(wanted) +
". See [CONTRIBUTING.md](../CONTRIBUTING.md)."]
n = sum(1 for r in self.results.values() if r["dir"].parent.parent.name == d)
where = (f"{n} result folder{'s' if n != 1 else ''} in [`results/`](results/), as bench.sh wrote them."
if n else "None yet. Runs go in `results/` here, as bench.sh writes them.")
L += ["", "## Results", "", where,
"Host setup for every recipe: [docs/host-setup.md](../docs/host-setup.md)."]
return "\n".join(L + self.results_md(d, "../")) + "\n"
def mixed_md(self):
"""mixed/README.md: setups of different Arc GPUs in one server."""
homes = [h for h in self.homes if h.startswith("mixed/")]
rows = [rc for h in homes for rc in self.home_recipes(h)]
L = ["# Mixed setups", "",
"<!-- Generated by tools/cookbook.py build from cookbook.toml and this folder. Don't edit. -->", "",
"Different Arc GPUs in one server. Each setup has a folder named after its cards, "
"`<N>x-<gpu>_<N>x-<gpu>` in name order (e.g. `1x-arc-b580_1x-arc-pro-b60`), with the same "
"layout as a GPU folder. Several of the *same* GPU go in that GPU's folder.", ""]
if any(r["demo"] for r in rows):
L += ["> **Demo data.** The results in this folder are synthetic, made by "
"`tools/demo/make_demo.py`. Nothing here was measured.", ""]
L += ["## Recipes", ""]
if rows:
L += ["| setup | model | GPUs | profile | engine | headline | status | recipe |",
"|---|---|---|---|---|---|---|---|"]
for rc in rows:
f = rc["front"]
L.append(f"| {rc['label']} | {f['model']} | {rc['n']} | {f['profile']} | {f['engine']} | "
f"{self.headline(rc, self.starred(rc))} | {'demo' if rc['demo'] else rc['status']} | "
f"[{f['title']}]({rc['id'].removeprefix('mixed/')}.md) |")
else:
L.append("None yet.")
tried = [t for t in self.tried if t["home"].startswith("mixed/")]
if tried:
L += ["", "## What lost", ""] + [
f"- [{t['front']['model']} on {t['label']}]({t['rel'].removeprefix('mixed/')}): "
f"{plural(len(t['entries']), 'variant')}" for t in tried]
L += ["", "## Results", ""] + [
f"- {h.removeprefix('mixed/')}: [{plural(sum(1 for r in self.results.values() if r['home'] == h), 'result folder')}]"
f"({h.removeprefix('mixed/')}/results/)" for h in homes
if (self.root / h / "results").exists()]
L += ["", "Host setup for every recipe: [docs/host-setup.md](../docs/host-setup.md)."]
return "\n".join(L) + "\n"
def wanted(self):
have = {(r["front"]["gpu"], r["front"]["model"]) for r in self.recipes
"""(gpu, count, model): the fewest of one GPU the model fits in, without a
single-user recipe for that count yet."""
have = {(r["home"], r["n"], r["front"]["model"]) for r in self.recipes
if r["front"]["profile"] == "single-user"}
return [(g, m) for g, gv in self.config["gpus"].items()
for m, mv in self.config["models"].items()
if gv["vram_gb"] >= mv["min_vram_gb"] and (g, m) not in have]
out = []
for g, gv in self.config["gpus"].items():
for m, mv in self.config["models"].items():
n = next((k for k in sorted(self.config.get("gpu_counts", [1, 2]))
if gv["vram_gb"] * k >= mv["min_vram_gb"]), None)
if n and (slug(g), n, m) not in have:
out.append((g, n, m))
return out
# ------------------------------------------------------------ build
def outputs(self):
@@ -492,6 +619,7 @@ class Cookbook:
out[readme] = fill(readme.read_text(encoding="utf-8"), "index", self.index_md())
for gpu in self.config["gpus"]:
out[self.root / slug(gpu) / "README.md"] = self.gpu_md(gpu)
out[self.root / "mixed" / "README.md"] = self.mixed_md()
out[self.root / "site" / "index.html"] = site_html(self, out)
return out
@@ -659,23 +787,22 @@ def site_html(cb, generated):
return Path(os.path.relpath(target, site)).as_posix() + (f"#{frag}" if frag else "")
return link
def attrs(f):
return (f'data-gpu="{html.escape(f["gpu"])}" data-model="{html.escape(f["model"])}" '
def attrs(rc):
f = rc["front"]
return (f'data-gpu="{html.escape(rc["group"])}" data-model="{html.escape(f["model"])}" '
f'data-profile="{html.escape(f["profile"])}"')
def opts(name, values):
return (f'<label>{name}<select name="{name}"><option value="">all</option>' +
"".join(f'<option>{html.escape(v)}</option>' for v in values) + "</select></label>")
best = cb.best()
rows = []
for rc in sorted(cb.recipes, key=lambda r: (list(cb.config["gpus"]).index(r["front"]["gpu"])
if r["front"]["gpu"] in cb.config["gpus"] else 99,
r["front"]["model"], r["front"]["profile"], -(r["value"] or 0))):
for rc in sorted(cb.recipes, key=lambda r: (cb.homes.index(r["home"]), r["front"]["model"], r["n"],
r["front"]["profile"], -(r["value"] or 0))):
f = rc["front"]
_, label, unit, _ = PROFILES[f["profile"]]
star = best.get((f["gpu"], f["model"], f["profile"])) is rc
rows.append(f'<tr {attrs(f)}><td>{html.escape(f["gpu"])}</td><td>{html.escape(f["model"])}</td>'
star = cb.starred(rc)
rows.append(f'<tr {attrs(rc)}><td>{html.escape(rc["label"])}</td><td>{html.escape(f["model"])}</td>'
f'<td>{f["profile"]}</td><td>{html.escape(f["engine"])}</td>'
f'<td><strong>{num(rc["value"], 2 if unit == "J/tok" else 1)} {unit}</strong> '
f'{label}{" ★" if star else ""}</td>'
@@ -688,11 +815,13 @@ def site_html(cb, generated):
_, body = split_front(generated[rc["path"]])
chips = [f["engine"], f"{f['quant']} · kv {f['kv']}", f"spec {f['spec']}",
f"thinking {f['thinking']}", f"tp {rc['tp']} · pp {rc['pp']}"]
if rc["n"] > 1:
chips[:0] = [rc["label"], "PCIe " + " · ".join(rc["topology"])]
status = ('<span class="chip demo">demo data</span>' if rc["demo"] else
f'<span class="chip{" good" if rc["status"].startswith("verified") else ""}">'
f'{rc["status"]}</span>')
articles.append(
f'<article id="r-{anchor(rc["id"])}" {attrs(f)}><h2>{html.escape(f["title"])}</h2>'
f'<article id="r-{anchor(rc["id"])}" {attrs(rc)}><h2>{html.escape(f["title"])}</h2>'
f'<p>{md_inline(f["summary"], linker(rc["path"]))}</p><div class="chips">{status}' +
"".join(f'<span class="chip">{html.escape(c)}</span>' for c in chips) + "</div>" +
md_to_html(body, linker(rc["path"]), shift=1, prefix=anchor(rc["id"]) + "-") +
@@ -703,13 +832,12 @@ def site_html(cb, generated):
f = td["front"]
_, body = split_front(generated[td["path"]])
body = re.sub(r"\A\s*# .*\n", "", body) # the article has its own heading
tried.append(f'<article id="t-{anchor(td["rel"])}" data-gpu="{html.escape(f["gpu"])}" '
tried.append(f'<article id="t-{anchor(td["rel"])}" data-gpu="{html.escape(td["group"])}" '
f'data-model="{html.escape(f["model"])}"><h2>{html.escape(f["model"])} on '
f'{html.escape(f["gpu"])}: what lost</h2>' +
f'{html.escape(td["label"])}: what lost</h2>' +
md_to_html(body, linker(td["path"]), shift=1, prefix=anchor(td["rel"]) + "-") + "</article>")
gpus = sorted({r["front"]["gpu"] for r in cb.recipes}, key=lambda g: list(cb.config["gpus"]).index(g)
if g in cb.config["gpus"] else 99)
gpus = list(dict.fromkeys(r["group"] for r in sorted(cb.recipes, key=lambda r: cb.homes.index(r["home"]))))
models = sorted({r["front"]["model"] for r in cb.recipes})
profiles = [p for p in PROFILES if any(r["front"]["profile"] == p for r in cb.recipes)]
newest = max((r["created"] for r in cb.results.values()), default="—")
@@ -738,8 +866,8 @@ def site_html(cb, generated):
<h2>Fastest setups</h2>
<div class="table"><table><thead><tr><th>GPU</th><th>model</th><th>profile</th><th>engine</th><th>headline</th>
<th>status</th><th>recipe</th></tr></thead><tbody>{"".join(rows)}</tbody></table></div>
<p>★ the fastest recipe for that GPU, model and profile.
{("<strong>Wanted:</strong> " + ", ".join(f"{html.escape(m)} on {html.escape(g)}" for g, m in wanted) + ".") if wanted else ""}</p>
<p>★ the fastest recipe for that GPU setup, model and profile.
{("<strong>Wanted:</strong> " + ", ".join(f"{html.escape(m)} on {setup(g, n)[2]}" for g, n, m in wanted) + ".") if wanted else ""}</p>
</section>
<section>
<h2>Recipes</h2>
+21 -7
View File
@@ -43,6 +43,7 @@ SPEC_MID = statistics.median(c[2] for c in CATEGORIES.values())
GPUS = {
"Arc Pro B65": {"vram": "32", "power": "200", "link": "Gen4 x16", "bw": "532", "mhz": 2800},
"Arc B580": {"vram": "12", "power": "190", "link": "Gen4 x8", "bw": "401", "mhz": 2850},
"Arc Pro B60": {"vram": "24", "power": "200", "link": "Gen5 x8", "bw": "402", "mhz": 2400},
}
# (model, engine): served id, file, bytes, loaded GiB as vLLM logs it
MODELS = {
@@ -94,6 +95,15 @@ RUNS = [
"decode": 64.0, "ttft": 205, "pp": 1500, "conc": [62, 118, 205, 296], "watts": 170},
{"recipe": "arc-b580/qwen3.5-9b/llama.cpp-single-user", "date": "261024",
"decode": 48.2, "ttft": 120, "pp": 2500, "conc": [47, 48, 48, 48], "watts": 140},
{"recipe": "arc-b580/qwen3.8-27b/2x-vllm-single-user", "date": "261027",
"decode": 52.0, "ttft": 260, "pp": 1650, "conc": [51, 51, 52, 52], "watts": 120},
{"recipe": "arc-b580/qwen3.8-27b/2x-llama.cpp-single-user", "date": "261027",
"decode": 15.9, "ttft": 330, "pp": 620, "conc": [15, 16, 16, 16], "watts": 95},
{"recipe": "arc-b580/qwen3.8-27b/2x-llama.cpp-single-user", "date": "261027", "quick": True,
"sub": [("-sm layer", "-sm row")], "declare": {"tp": 2, "pp": 1},
"decode": 11.8, "ttft": 410, "pp": 480, "conc": [11, 12, 12, 12], "watts": 88},
{"recipe": "mixed/1x-arc-b580_1x-arc-pro-b60/qwen3.8-27b/llama.cpp-single-user", "date": "261028",
"decode": 16.4, "ttft": 300, "pp": 680, "conc": [16, 16, 16, 16], "watts": 110},
{"recipe": "arc-pro-b65/qwen3.8-27b/vllm-single-user", "date": "261026", "submitter": "demo-2",
"decode": 82.1, "ttft": 196, "pp": 1490, "conc": [81, 81, 82, 82], "watts": 175},
]
@@ -210,13 +220,17 @@ def make(run, bench, ids):
declared = {k: front[k] for k in ("quant", "kv", "spec", "thinking")} | run.get("declare", {})
quick = run.get("quick", False)
submitter = run.get("submitter", "demo")
gpu, engine = GPUS[front["gpu"]], ENGINES[front["engine"]]
names = front["gpu"] if isinstance(front["gpu"], list) else [front["gpu"]] * int(front.get("gpus", 1))
home, gpu_model, _ = cookbook.setup(front["gpu"], len(names))
# bench.sh reads PCIe, power and bandwidth from the first GPU only
gpu, engine = GPUS[names[0]], ENGINES[front["engine"]]
served, mfile, mbytes, loaded = MODELS[(front["model"], front["engine"])]
tp, pp = (str(run.get("declare", {}).get(k, front.get(k, 1))) for k in ("tp", "pp"))
sha = next(l.split("\t")[3].strip() for l in (bench / "dev" / "models.tsv").open()
if l.startswith(front["model"] + "\t") and f"\t{front['quant']}\t" in l)
slug = cookbook.slug
name = f"{slug(served)}_{slug(front['engine'])}_1x-{slug(front['gpu'])}"
name = f"{slug(served)}_{slug(front['engine'])}_{int(tp) * int(pp)}x-{slug(gpu_model)}"
rid = f"{run['date']}_{slug(submitter)}_{name}" + ("_quick" if quick else "")
base, i = rid, 1
while rid in ids:
@@ -230,7 +244,7 @@ def make(run, bench, ids):
t0 = 1792000000 + int(run["date"]) % 1000 * 86400 + 36000 + (i - 1) * 7200
endpoint = f"http://localhost:{engine['port']}/v1"
mandatory = {"submitter": submitter, "tp": "1", "pp": "1", **declared,
mandatory = {"submitter": submitter, "tp": tp, "pp": pp, **declared,
"power_limit": gpu["power"], "power_limit_source": "detected",
"special_notes": "DEMO DATA: synthetic, made by tools/demo/make_demo.py, not measured",
"betterbench": "0.6.1", "betterbench_build": "v0.6.1", "bench_standard": "0.5.0",
@@ -239,7 +253,7 @@ def make(run, bench, ids):
"power_limit", "power_limit_source", "special_notes",
"betterbench", "betterbench_build", "bench_standard",
"run_mode", "concurrency")}
collected = {"gpu_vendor": "intel", "gpu_model": front["gpu"], "gpu_count": "1",
collected = {"gpu_vendor": "intel", "gpu_model": gpu_model, "gpu_count": str(len(names)),
"gpu_vram_gb": gpu["vram"], "gpu_driver": "1.17.39395", "gpu_power_limit_w": gpu["power"],
"gpu_bdf": "0000:03:00.0", "pcie_link": gpu["link"], "pcie_max": gpu["link"], "rebar": "on",
"cpu_model": "AMD Ryzen 7 7700", "ram_gb": "64", "os": "Ubuntu 26.04 LTS",
@@ -248,13 +262,13 @@ def make(run, bench, ids):
"engine_image": engine["image"], "model_file": mfile, "model_bytes": str(mbytes),
"model_sha256": sha, "ctx": str(ctx), "gpu_mem_bw_gbs": gpu["bw"],
"gpu_mem_bw_tool": "torch copy, random, 1024 MiB"}
if loaded:
collected["model_loaded_gib"] = loaded
if loaded: # vLLM logs the weights per worker
collected["model_loaded_gib"] = f"{float(loaded) / int(tp):.2f}"
measured = {"greedy_check": "identical", "greedy_runs": "3",
"greedy_hash": hashlib.sha256(f"{front['model']}{front['quant']}".encode()).hexdigest()[:12],
"greedy_reasoning": "yes"}
d = ROOT / cookbook.slug(front["gpu"]) / "results" / rid
d = ROOT / home / "results" / rid
shutil.rmtree(d, ignore_errors=True)
d.mkdir(parents=True)
with tempfile.TemporaryDirectory() as tmp:
+49 -1
View File
@@ -74,7 +74,7 @@ def test_verified_needs_two_submitters():
def repo(tmp_path):
root = tmp_path / "cookbook"
shutil.copytree(cookbook.ROOT, root, ignore=shutil.ignore_patterns(".git", "__pycache__", "*.html"))
for d in root.glob("*/results/*"): # validate only needs the reports to exist
for d in [*root.glob("*/results/*"), *root.glob("mixed/*/results/*")]: # only the reports' existence matters
if d.is_dir():
(d / f"{d.name}.html").touch()
return root
@@ -145,3 +145,51 @@ def test_result_must_sit_in_its_gpu_folder(repo):
def test_stray_top_level_folder_warns(repo):
(repo / "arc-b999").mkdir()
assert any("arc-b999: not a GPU" in w for w in cookbook.Cookbook(repo).warnings)
# ---------------------------------------------------------------- multi-GPU and mixed
MULTI = "arc-b580/qwen3.8-27b/2x-vllm-single-user.md"
MIXED = "mixed/1x-arc-b580_1x-arc-pro-b60/qwen3.8-27b/llama.cpp-single-user.md"
def test_setup_names_folders_like_bench_sh_names_gpus():
assert cookbook.setup("Arc B580", 2) == ("arc-b580", "Arc B580", "2× Arc B580")
assert cookbook.setup(["Arc Pro B60", "Arc B580"]) == \
("mixed/1x-arc-b580_1x-arc-pro-b60", "Arc B580+Arc Pro B60", "Arc B580 + Arc Pro B60")
def test_multi_gpu_needs_topology(repo):
edit(repo / MULTI, 'topology = ["Gen4 x8 CPU", "Gen4 x8 CPU"]\n', "")
assert "declare topology" in errors(repo)
def test_tp_times_pp_is_the_gpu_count(repo):
edit(repo / MULTI, "tp = 2\n", "")
assert "tp × pp is 1, but the recipe runs on 2 GPUs" in errors(repo)
def test_gpu_count_is_in_the_file_name(repo):
shutil.move(repo / MULTI, repo / "arc-b580/qwen3.8-27b/vllm-single-user.md")
assert "should be arc-b580/qwen3.8-27b/2x-vllm-single-user.md" in errors(repo)
def test_mixed_needs_different_gpus(repo):
edit(repo / MIXED, 'gpu = ["Arc Pro B60", "Arc B580"]', 'gpu = ["Arc B580", "Arc B580"]')
assert "a mixed setup needs two different GPUs" in errors(repo)
def test_mixed_run_must_be_in_its_setup_folder(repo):
run = "261028_demo_qwen3.8-27b_llama.cpp_2x-arc-b580-arc-pro-b60"
src = repo / "mixed/1x-arc-b580_1x-arc-pro-b60/results" / run
dst = repo / "mixed/1x-arc-a770_1x-arc-b580/results"
dst.mkdir(parents=True)
shutil.move(src, dst / run)
assert f"{run} is in mixed/1x-arc-a770_1x-arc-b580/results, not mixed/1x-arc-b580_1x-arc-pro-b60/results" \
in errors(repo)
def test_wanted_takes_the_fewest_gpus_that_fit():
wanted = cookbook.Cookbook().wanted()
assert ("Arc A770", 2, "Qwen3.8-27B") in wanted
assert not any(g == "Arc B580" and m == "Qwen3.8-27B" for g, _, m in wanted) # has a 2× recipe
assert not any(g == "Arc B570" and m == "Qwen3.8-27B" for g, _, m in wanted) # 2 × 10 GB is too small