Recipes, tried logs and result folders move under <gpu>/: recipes at <gpu>/<model>/<engine>-<profile>.md, tried logs at <gpu>/<model>/tried.md, runs at <gpu>/results/<run>/. build generates a README for every GPU in cookbook.toml and the GPU table in README.md. validate checks that a run sits in the folder of the GPU it ran on and warns about stray top-level folders. Format docs and host setup move to docs/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4673f0afb6
commit
562c7f2fb8
153 files changed
+445
-288
No files matched your search
@@ -11,7 +11,7 @@ import pytest
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
import cookbook # noqa: E402
|
||||
|
||||
RECIPE = "recipes/qwen3.8-27b/arc-pro-b65/vllm-single-user.md"
|
||||
RECIPE = "arc-pro-b65/qwen3.8-27b/vllm-single-user.md"
|
||||
|
||||
|
||||
def test_command_words_ignores_layout_and_comments():
|
||||
@@ -65,8 +65,8 @@ def test_repo_validates_and_is_built():
|
||||
def test_verified_needs_two_submitters():
|
||||
cb = cookbook.Cookbook()
|
||||
status = {r["id"]: r["status"] for r in cb.recipes}
|
||||
assert status["qwen3.8-27b/arc-pro-b65/vllm-single-user"] == "verified by 2"
|
||||
assert status["qwen3.8-27b/arc-pro-b65/vllm-throughput"] == "one submitter"
|
||||
assert status["arc-pro-b65/qwen3.8-27b/vllm-single-user"] == "verified by 2"
|
||||
assert status["arc-pro-b65/qwen3.8-27b/vllm-throughput"] == "one submitter"
|
||||
|
||||
|
||||
# ---------------------------------------------------------------- broken copies
|
||||
@@ -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 / "results").iterdir(): # validate only needs the reports to exist
|
||||
for d in root.glob("*/results/*"): # validate only needs the reports to exist
|
||||
if d.is_dir():
|
||||
(d / f"{d.name}.html").touch()
|
||||
return root
|
||||
@@ -113,11 +113,11 @@ def test_launch_command_must_be_the_benchmarked_one(repo):
|
||||
def test_only_arc_gpus(repo):
|
||||
edit(repo / RECIPE, 'gpu = "Arc Pro B65"', 'gpu = "RTX 4090"')
|
||||
e = errors(repo)
|
||||
assert "not an Intel Arc GPU" in e and "should be recipes/" in e
|
||||
assert "not an Intel Arc GPU" in e and "should be rtx-4090/" in e
|
||||
|
||||
|
||||
def test_edited_results_are_caught(repo):
|
||||
d = repo / "results" / "261022_demo_qwen3.8-27b_vllm_1x-arc-pro-b65"
|
||||
d = repo / "arc-pro-b65" / "results" / "261022_demo_qwen3.8-27b_vllm_1x-arc-pro-b65"
|
||||
meta = json.loads((d / "meta.json").read_text(encoding="utf-8"))
|
||||
meta["notes"]["spec"] = "none"
|
||||
(d / "meta.json").write_text(json.dumps(meta), encoding="utf-8")
|
||||
@@ -125,11 +125,23 @@ def test_edited_results_are_caught(repo):
|
||||
|
||||
|
||||
def test_placeholder_digest_only_for_demo(repo):
|
||||
(repo / "results" / "261019_demo_qwen3.5-9b_llama.cpp_1x-arc-pro-b65" / "DEMO").unlink()
|
||||
(repo / "arc-pro-b65" / "results" / "261019_demo_qwen3.5-9b_llama.cpp_1x-arc-pro-b65" / "DEMO").unlink()
|
||||
e = errors(repo)
|
||||
assert "all-zero placeholder" in e
|
||||
|
||||
|
||||
def test_tried_needs_an_existing_result(repo):
|
||||
edit(repo / "tried/qwen3.5-9b/arc-pro-b65.md", "_quick_2", "_quick_9")
|
||||
edit(repo / "arc-pro-b65/qwen3.5-9b/tried.md", "_quick_2", "_quick_9")
|
||||
assert "is not in results/" in errors(repo)
|
||||
|
||||
|
||||
def test_result_must_sit_in_its_gpu_folder(repo):
|
||||
run = "261024_demo_qwen3.5-9b_llama.cpp_1x-arc-b580"
|
||||
shutil.move(repo / "arc-b580" / "results" / run, repo / "arc-pro-b65" / "results" / run)
|
||||
e = errors(repo)
|
||||
assert "but it is in the Arc Pro B65 folder" in e and f"result {run} is not in results/" not in e
|
||||
|
||||
|
||||
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)
|
||||
Reference in new issue
Block a user