One-file bench.sh, sources in dev/, BetterBench 0.6.1 or newer

- bench.sh at the root is generated by dev/build.sh and holds everything;
  people download just that file. It unpacks its helpers to a temp dir;
  results and bench.local.env stay next to it
- collect-env and the power sampler are subcommands (bench.sh collect-env,
  bench.sh power); --help is the manual, --version prints the versions
- BetterBench: minimum 0.6.1 instead of exactly 0.6.1; the version is
  recorded in the run note. Standard bumped to 0.4.0
- each run folder gets a copy of config.json
- AGENTS.md carries the install, the models with hashes and the agent
  procedure; README is a pointer; DETAILS.md moved to dev/

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
claudeandClaude Opus 5.5 committed 2026-10-29 12:58:02 +01:00
1 parent 9400c074bd
commit 1f4ea0b225
13 files changed
+1330 -209

No files matched your search

+64 -39
View File
@@ -1,8 +1,19 @@
# AGENTS.md
# bench-standard
Instructions for a coding agent that helps someone benchmark their LLM server with
this repo. The human-facing docs are [`README.md`](README.md) and
[`DETAILS.md`](DETAILS.md).
Benchmark your LLM server the way everyone in the group does. You need one file:
```sh
pip install git+https://github.com/GGZ14/BetterBench # BetterBench 0.6.1 or newer
curl -O https://git.linxweiler.xyz/miga/benchmarks/raw/branch/main/bench.sh && chmod +x bench.sh
./bench.sh --help
```
**Humans:** `./bench.sh --help` has everything. Serve one of the [models](#models) below,
run it, and send in the `results/<run>/` folder of a `--full` run.
**Agents:** the rest of this file is for you.
---
Your job: get one correct, comparable result folder out of `bench.sh`, and tell your
human what it says. A wrong declared value makes the result worthless, and a skipped
@@ -12,32 +23,50 @@ one makes the run fail. Correct is more important than fast.
- **Run benchmarks only through `./bench.sh`.** Never call `betterbench run` directly,
and never add BetterBench flags. `bench.sh` refuses them.
- **Don't change the standard to make a run pass.** Leave `config.json`,
`standard.env`, `bench.sh`, `collect-env.sh`, `gpu-power.sh` and `mem-bw.py` alone. If one
of them seems wrong, tell your human instead.
- **Don't edit `bench.sh`** to make a run pass. If it seems wrong, tell your human.
- **Never edit anything in a results folder.**
- **Never guess a declared value silently.** Derive it from the launch command (below),
- **Never guess a declared value silently.** Derive it from the launch command (step 4),
show your human what you derived, and ask when the command doesn't say.
`--submitter` always comes from the human.
- **Ask before `--full`.** It takes much longer than the quick run, and the GPU is busy
the whole time.
- **Don't restart, reconfigure or stop the inference server** without asking. Don't
start other GPU work while a benchmark runs.
- **API keys** go in `$BETTERBENCH_API_KEY`, never into files or committed commands.
- **Don't commit results.** `results/` and `bench.local.env` are git-ignored on purpose.
- **API keys** go in `$BETTERBENCH_API_KEY`, never into files or commands that get saved.
## Models
Results only count for these files. Check the hash before benchmarking. On a mismatch,
tell your human.
| model | engine | Hugging Face repo | file | `--quant` | SHA256 |
|---|---|---|---|---|---|
| Qwen3.5-9B | llama.cpp | `unsloth/Qwen3.5-9B-GGUF` | `Qwen3.5-9B-Q4_K_M.gguf` | `Q4_K_M` | `03b74727a860a56338e042c4420bb3f04b2fec5734175f4cb9fa853daf52b7e8` |
| Qwen3.8-27B | llama.cpp | `unsloth/Qwen3.8-27B-GGUF` | `Qwen3.8-27B-UD-Q4_K_M.gguf` | `UD-Q4_K_M` | `322e194ff79741c7baa497c240f677f54b201b0efab44ca8e50f122b39123482` |
| Qwen3.5-9B | vLLM & co. | `RedHatAI/Qwen3.5-9B-quantized.w4a16` | the repo | `w4a16` | `cca16f9855b9f92eee5876ddc8656ed6397316ffc65b9f17ca1939a9549e4c26` |
| Qwen3.8-27B | vLLM & co. | `RedHatAI/Qwen3.8-27B-INT4` | the repo | `w4a16` | `bffa6b23fa11be557fe9de4b122a8bb99f537ad7a1a4effa702f7d0c677778f7` |
```sh
sha256sum Qwen3.5-9B-Q4_K_M.gguf # a GGUF
cd MODEL_DIR && sha256sum *.safetensors | LC_ALL=C sort -k2 | sha256sum # a repo
```
`LC_ALL=C` matters: other locales sort the files differently and give another hash.
The RedHatAI repos include an MTP head for `--spec mtp:N`. The 27B GGUF repo has no plain
Q4_K_M, only Unsloth's `UD-Q4_K_M`. Hashes are as of 2026-10-29.
## Procedure
### 1. Check the tools
```sh
betterbench --version # must print 0.6.1
python3 --version # 3.10+
./bench.sh --version # bench-standard version and the BetterBench it needs
betterbench --version # 0.6.1 or newer
python3 --version # 3.10+
```
If BetterBench is missing or a different version, install it as the README shows
(`git checkout v0.6.1 && pip install -e .`). If an existing install has a different
version, ask before touching it.
If BetterBench is missing, install it (see the top). If an older one is installed, ask
before upgrading it.
### 2. Find the endpoint and the model id
@@ -52,33 +81,26 @@ curl -s http://localhost:8080/running # llama-swap only: loaded models + l
- **Behind llama-swap** (`/running` answers): nothing to do, `bench.sh` reads it.
- **Otherwise:** write the exact command the server was started with into
`server-cmd.txt`, including any `VAR=value` env prefixes and docker `-e` flags. Pass it
with `--server-cmd-file server-cmd.txt`. Get the command from your human, a
launch script, `docker inspect`, or `ps -o args= -p PID`.
`server-cmd.txt`, including `VAR=value` env prefixes and docker `-e` flags. Pass it
with `--server-cmd-file server-cmd.txt`. Get the command from your human, a launch
script, `docker inspect`, or `ps -o args= -p PID`.
Without it, the `launch` and `env_flags` notes read `unknown`, and those settings
swing results by 10-50%.
### 4. Check the model, derive the declared values
### 4. Derive the declared values
Results only count for the models in [`models.md`](models.md). Check the served file's
SHA256 against that table, with the commands at its end. On a mismatch, tell your
human before benchmarking. For those models, `--quant` is listed in `models.md`.
For the rest, use the launch command and confirm with your human:
`--quant` comes from the model table. For the rest, use the launch command and confirm
with your human:
| flag | llama.cpp | vLLM |
|---|---|---|
| `--quant` | quant in the GGUF filename (`Q4_K_M`, `Q8_0`, ...) | `--quantization`, or the checkpoint's format (`gptq-int4`, `awq`, `fp8`); `bf16`/`fp16` when unquantized |
| `--kv` | `-ctk`/`-ctv`; `f16` when unset; `q8_0/q4_0` when K and V differ | `--kv-cache-dtype`; with `auto` (or unset), the model dtype (`bf16`) |
| `--tp` / `--pp` | `1` / `1` on one GPU; multi-GPU: ask | `--tensor-parallel-size` / `--pipeline-parallel-size`; default `1` |
| `--spec` | `-md`/`--model-draft` with `--draft-max N` → `draft:N`; otherwise `none` | `--speculative-config` method and `num_speculative_tokens` → e.g. `mtp:5`, `eagle3:4`, `ngram:4`; otherwise `none` |
| `--thinking` | `--reasoning-budget 0` or `enable_thinking: false` in the template kwargs → `off`; unclear → ask | `enable_thinking`/effort in the chat template or default kwargs; nothing set → `default`; unclear → ask |
| `--submitter` | ask | ask |
`--spec` methods are `mtp`, `eagle`, `eagle3`, `ngram` and `draft`. `--thinking` values are
`off`, `on`, `low`, `medium`, `high` and `default`.
### 5. Dry run
```sh
@@ -86,8 +108,8 @@ For the rest, use the launch command and confirm with your human:
--spec none --thinking default --submitter NAME [--server-cmd-file server-cmd.txt] --dry-run
```
This sends the warm-up and the greedy check, detects everything, prints the notes it
would record, and stops. Read the notes:
This sends the warm-up and the greedy check, detects everything, prints what it would
run, and stops. Check the `--note` values in that output:
- `unknown` values should have a reason (VM PCIe, no cmd file, ...).
- Any `bench.sh: warning:` line needs fixing or explaining before the real run.
@@ -95,10 +117,8 @@ would record, and stops. Read the notes:
Run the same command without `--dry-run`. This is a quick check of a few minutes,
ending in a summary. If it looks sane, ask your human, then run again with `--full`.
That is the result that counts.
For long runs, use a terminal multiplexer or a background job, so a dropped
session doesn't kill the benchmark.
That is the result that counts. For long runs, use a terminal multiplexer or a
background job, so a dropped session doesn't kill the benchmark.
### 7. Report back
@@ -107,13 +127,13 @@ Tell your human:
- the summary block: decode t/s, TTFT, concurrency, prefill, bandwidth %, power, energy
- every warning, and whether the greedy check was `identical`
- that the folder is what they send in, and that they should check `server-cmd.txt` for
anything private first
anything private first (tokens, keys and passwords are already redacted)
## When something goes wrong
| message | what to do |
|---|---|
| `BetterBench 0.6.1 required, found ...` | install 0.6.1 (step 1) |
| `BetterBench 0.6.1 or newer required` | install or upgrade BetterBench (step 1) |
| `warm-up request failed (HTTP ...)` | server not up, or wrong `--endpoint`/`--model` (step 2). Behind llama-swap the first load can take minutes; `WARM_TIMEOUT=1800` gives it longer |
| `missing mandatory value(s)` | pass the listed flags (step 4) |
| `GPU power limit not detected here` | ask for the limit, pass `--power-limit W` or `stock` |
@@ -122,7 +142,12 @@ Tell your human:
| `mem_bw` has no measured figure | no torch in the server container. Set `BW_PYTHON` to a python with GPU torch, or install `clpeak`, or leave it |
| `launch=unknown (pass --server-cmd-file)` | step 3 |
| `betterbench failed (exit N)` | read `betterbench.log` in the `.failed` folder. Usually the server crashed or ran out of memory |
| `ReBAR ... but BetterBench reads ...` | BetterBench runs on another machine than the GPU. Use `--env-file` (see README) |
| `ReBAR ... but BetterBench reads ...` | BetterBench runs on another machine than the GPU. Use `--env-file` (below) |
BetterBench on a different machine than the GPU: run `collect-env.sh` on the GPU
machine and pass its output with `--env-file` (README, "More").
**BetterBench on another machine than the GPU:** run
`./bench.sh collect-env --endpoint URL --model ID > env.txt` on the GPU machine, then
add `--env-file env.txt` on the BetterBench machine. Power isn't sampled then. Run
`./bench.sh power > power.csv` on the GPU machine during the run if your human wants it.
What each recorded value means, and how it's detected:
[`dev/DETAILS.md`](dev/DETAILS.md).