08256c1326
RuntimeContext._ensure_allocators() now limits SIP range to target_device (single SIP or all). Prevents cross-SIP tensor deployment that caused PE_TCM routing errors. Also accept 'sip0' format (without colon) in DeviceSelector. 331 passed, 8 skipped Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
23 lines
737 B
Python
23 lines
737 B
Python
import kernbench.cli.main as cli_main
|
|
|
|
|
|
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.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"])
|
|
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"])
|
|
assert rc == 0
|