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:
@@ -11,7 +11,7 @@ def test_cli_verify_data_flag_parsed(monkeypatch):
|
||||
|
||||
monkeypatch.setattr(cli_main, "cmd_run", fake_cmd_run)
|
||||
rc = cli_main.main([
|
||||
"run", "--topology", "topology.yaml", "--bench", "qkv_gemm",
|
||||
"run", "--topology", "topology.yaml", "--bench", "qkv-gemm",
|
||||
"--verify-data",
|
||||
])
|
||||
assert rc == 0
|
||||
@@ -26,7 +26,7 @@ def test_cli_verify_data_flag_default(monkeypatch):
|
||||
|
||||
monkeypatch.setattr(cli_main, "cmd_run", fake_cmd_run)
|
||||
rc = cli_main.main([
|
||||
"run", "--topology", "topology.yaml", "--bench", "qkv_gemm",
|
||||
"run", "--topology", "topology.yaml", "--bench", "qkv-gemm",
|
||||
])
|
||||
assert rc == 0
|
||||
|
||||
@@ -34,7 +34,7 @@ def test_cli_verify_data_flag_default(monkeypatch):
|
||||
def test_cmd_run_verify_data_enables_engine():
|
||||
"""--verify-data runs full pipeline with enable_data=True and DataExecutor."""
|
||||
rc = cli_main.main([
|
||||
"run", "--topology", "topology.yaml", "--bench", "qkv_gemm",
|
||||
"run", "--topology", "topology.yaml", "--bench", "qkv-gemm",
|
||||
"--device", "sip:0", "--verify-data",
|
||||
])
|
||||
assert rc == 0
|
||||
@@ -43,7 +43,7 @@ def test_cmd_run_verify_data_enables_engine():
|
||||
def test_cmd_run_without_verify_data_no_op_log():
|
||||
"""Without --verify-data, engine runs in timing-only mode (no op_log)."""
|
||||
rc = cli_main.main([
|
||||
"run", "--topology", "topology.yaml", "--bench", "qkv_gemm",
|
||||
"run", "--topology", "topology.yaml", "--bench", "qkv-gemm",
|
||||
"--device", "sip:0",
|
||||
])
|
||||
assert rc == 0
|
||||
|
||||
Reference in New Issue
Block a user