benches: package as kernbench.benches, add @bench registry + list subcommand
Move benches/ -> src/kernbench/benches/ and src/kernbench/cli/probe.py -> src/kernbench/probes/probe.py. Each bench self-registers via @bench(name=..., description=...); kernbench list enumerates benches with auto-assigned indices, --bench accepts kebab-case name or numeric index. Audit at package-import time fails if any non-underscore module forgets the decorator. ADR-0010 (EN + KO) updated to reflect the new resolver path, list subcommand, and probes package separation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+3
-3
@@ -6,17 +6,17 @@ def test_cli_main_arg_parsing(monkeypatch):
|
||||
def fake_cmd_run(args) -> int:
|
||||
assert args.cmd == "run"
|
||||
assert args.topology == "topology.yaml"
|
||||
assert args.bench == "qkv_gemm"
|
||||
assert args.bench == "qkv-gemm"
|
||||
assert args.device == None
|
||||
return 0
|
||||
|
||||
# monkey patch the handler to test arg parsing without running the actual bench
|
||||
monkeypatch.setattr(cli_main, "cmd_run", fake_cmd_run)
|
||||
rc = cli_main.main(["run", "--topology", "topology.yaml", "--bench", "qkv_gemm"])
|
||||
rc = cli_main.main(["run", "--topology", "topology.yaml", "--bench", "qkv-gemm"])
|
||||
assert rc == 0
|
||||
|
||||
|
||||
def test_cli_main():
|
||||
"""CLI bench run on single SIP device."""
|
||||
rc = cli_main.main(["run", "--topology", "topology.yaml", "--bench", "qkv_gemm", "--device", "sip:0"])
|
||||
rc = cli_main.main(["run", "--topology", "topology.yaml", "--bench", "qkv-gemm", "--device", "sip:0"])
|
||||
assert rc == 0
|
||||
|
||||
Reference in New Issue
Block a user