0.5.0: model hash check, energy per phase, honest bandwidth %, CI
ci / check (push) Successful in 58s
ci / check (push) Successful in 58s
- The served model is hashed (cached) and checked against dev/models.tsv; the model_file note says standard or not, with warnings for a foreign file or a --quant that doesn't match. HASH_MODEL=0 skips it. - The BetterBench build (git commit or describe) goes into meta and, when it isn't the release, into the run note. - Energy per phase from a timestamped timeline.tsv: J/token for decode and each concurrency level, J/1k tokens for prefill. - Bandwidth %: vLLM's loaded weight size when available, MTP files left out of the stored size, bandwidth scaled by tp. - The notes and post-run Python moved to dev/notes.py and dev/postrun.py, with pytest tests; CI runs shellcheck, build --check and the tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b892e7b14d
commit
5bb750cece
17 files changed
+1482
-622
No files matched your search
@@ -0,0 +1,106 @@
|
||||
"""notes.py: launch parsing, the model check, the thinking check, the run note."""
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
DEV = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
STD_GGUF = "322e194ff79741c7baa497c240f677f54b201b0efab44ca8e50f122b39123482"
|
||||
|
||||
MANDATORY = {"submitter": "pascal", "tp": "1", "pp": "1", "quant": "UD-Q4_K_M", "kv": "q8_0",
|
||||
"spec": "none", "thinking": "default", "power_limit": "200",
|
||||
"power_limit_source": "detected", "betterbench": "0.6.1", "betterbench_build": "v0.6.1",
|
||||
"bench_standard": "0.4.1", "run_mode": "full", "concurrency": "on"}
|
||||
COLLECTED = {"engine": "llama.cpp", "engine_version": "b11913-7aca0d2ea", "gpu_vendor": "intel",
|
||||
"gpu_count": "1", "gpu_model": "Arc Pro B65", "model_file": "/models/x.gguf",
|
||||
"model_bytes": "16464440224", "model_sha256": STD_GGUF}
|
||||
MEASURED = {"greedy_check": "identical", "greedy_runs": "3", "greedy_variants": "1",
|
||||
"greedy_hash": "1d5105fe09dc", "greedy_reasoning": "yes"}
|
||||
LLAMA_CMD = ("GGML_SYCL_DISABLE_OPT=0 ZES_ENABLE_SYSMAN=1 HF_HUB_OFFLINE=1 /app/llama-server "
|
||||
"-m /models/x.gguf -c 32768 -ngl 99 -fa on -b 4096 -ub 1024 -ctk q8_0 -ctv q8_0 "
|
||||
"-np 4 --no-mmap --port 9000")
|
||||
VLLM_CMD = ("docker run --rm --name v -e K8V4_PREFILL=onednn -e HF_TOKEN=<redacted> img /model "
|
||||
"--max-num-batched-tokens=4224 --max-num-seqs=4 --kv-cache-dtype=int8_k_int4_v "
|
||||
"--no-enable-prefix-caching "
|
||||
"'--compilation-config={\"cudagraph_mode\": \"FULL_DECODE_ONLY\"}'")
|
||||
|
||||
|
||||
def run(tmp_path, cmd=LLAMA_CMD, **over):
|
||||
files = {}
|
||||
for name, base in (("m", MANDATORY), ("c", COLLECTED), ("x", MEASURED)):
|
||||
d = {**base, **over.get(name, {})}
|
||||
files[name] = tmp_path / name
|
||||
files[name].write_text("".join(f"{k}={v}\n" for k, v in d.items()))
|
||||
(tmp_path / "cmd").write_text(cmd)
|
||||
p = subprocess.run([sys.executable, os.path.join(DEV, "notes.py"), files["m"], files["c"],
|
||||
files["x"], tmp_path / "cmd", tmp_path / "launch.json",
|
||||
os.path.join(DEV, "models.tsv")], capture_output=True, text=True, check=True)
|
||||
notes = dict(line.split("=", 1) for line in p.stdout.splitlines())
|
||||
return notes, p.stderr, json.loads((tmp_path / "launch.json").read_text())
|
||||
|
||||
|
||||
def test_llama_launch_and_env(tmp_path):
|
||||
notes, err, launch = run(tmp_path)
|
||||
assert notes["launch"] == "b 4096 · ub 1024 · fa on · ctk q8_0 · ctv q8_0 · ngl 99 · np 4 · no-mmap"
|
||||
assert notes["env_flags"] == "GGML_SYCL_DISABLE_OPT=0 · ZES_ENABLE_SYSMAN=1" # offline switch left out
|
||||
assert launch["env"]["HF_HUB_OFFLINE"] == "1" # but kept in meta
|
||||
assert "warning" not in err
|
||||
|
||||
|
||||
def test_llama_defaults_shown(tmp_path):
|
||||
notes, _, _ = run(tmp_path, cmd="llama-server -m /m.gguf -ngl 99 -fa", m={"kv": "f16"})
|
||||
assert notes["launch"] == "b default · ub default · fa on · ctk default · ctv default · ngl 99"
|
||||
|
||||
|
||||
def test_vllm_launch_env_and_kv_warning(tmp_path):
|
||||
notes, err, _ = run(tmp_path, cmd=VLLM_CMD, c={"engine": "vllm"})
|
||||
assert "max-num-batched-tokens 4224" in notes["launch"]
|
||||
assert "no-enable-prefix-caching" in notes["launch"]
|
||||
assert 'compilation-config {"cudagraph_mode":"FULL_DECODE_ONLY"}' in notes["launch"]
|
||||
assert notes["env_flags"] == "K8V4_PREFILL=onednn · HF_TOKEN=<redacted>"
|
||||
assert "--kv q8_0 but the launch command sets int8_k_int4_v" in err
|
||||
|
||||
|
||||
def test_no_command(tmp_path):
|
||||
notes, _, _ = run(tmp_path, cmd="")
|
||||
assert notes["launch"] == "unknown (pass --server-cmd-file)"
|
||||
assert notes["env_flags"] == "unknown"
|
||||
|
||||
|
||||
def test_standard_model(tmp_path):
|
||||
notes, err, _ = run(tmp_path)
|
||||
assert notes["model_file"].endswith("standard: Qwen3.8-27B UD-Q4_K_M")
|
||||
assert "standard models" not in err
|
||||
|
||||
|
||||
def test_standard_model_wrong_quant(tmp_path):
|
||||
_, err, _ = run(tmp_path, m={"quant": "Q4_K_M"})
|
||||
assert "declare --quant UD-Q4_K_M" in err
|
||||
|
||||
|
||||
def test_other_model(tmp_path):
|
||||
notes, err, _ = run(tmp_path, c={"model_sha256": "ab" * 32})
|
||||
assert "not a standard model (sha256 abababababab)" in notes["model_file"]
|
||||
assert "won't count" in err
|
||||
|
||||
|
||||
def test_model_not_hashed(tmp_path):
|
||||
notes, _, _ = run(tmp_path, c={"model_sha256": ""})
|
||||
assert notes["model_file"].endswith("hash not checked")
|
||||
|
||||
|
||||
def test_thinking_checked_against_replies(tmp_path):
|
||||
notes, err, _ = run(tmp_path, m={"thinking": "off"})
|
||||
assert notes["thinking"] == "off · reasoning seen"
|
||||
assert "--thinking off, but the greedy replies contain reasoning" in err
|
||||
notes, err, _ = run(tmp_path, m={"thinking": "high"}, x={"greedy_reasoning": "no"})
|
||||
assert "--thinking high, but the greedy replies contain no reasoning" in err
|
||||
_, err, _ = run(tmp_path, m={"thinking": "default"}, x={"greedy_reasoning": "no"})
|
||||
assert "thinking" not in err
|
||||
|
||||
|
||||
def test_run_note_betterbench_build(tmp_path):
|
||||
notes, _, _ = run(tmp_path)
|
||||
assert notes["run"] == "full · concurrency on · bench-standard 0.4.1 · betterbench 0.6.1"
|
||||
notes, _, _ = run(tmp_path, m={"betterbench_build": "v0.6.1-3-gabc1234-dirty"})
|
||||
assert notes["run"].endswith("betterbench 0.6.1 @ v0.6.1-3-gabc1234-dirty")
|
||||
Reference in new issue
Block a user