Perf runtime device

From hw-native-sys/simpler · View interactive version

Perf runtime device is an AI agent skill from the GitHub repository hw-native-sys/simpler. Benchmark the hardware performance of all scene tests under a runtime (tests/st/<arch>/<runtime>/, $ARGUMENTS). Use when the user asks to benchmark all examples of a runtime on hardware.

How to use this skill

Skill file

Benchmark the hardware performance of all scene tests under `tests/st/<arch>/<runtime>/`

If $ARGUMENTS is provided, use it as the runtime name. Otherwise default to

tensormap_and_ringbuffer. Reference tools/benchmark_rounds.sh for the full

implementation pattern (device log resolution, timing parsing, reporting

format). Detection / isolation procedures live in

CODE0.

  1. Validate the runtime is one of: host_build_graph,

tensormap_and_ringbuffer. If not, list valid runtimes and stop.

  1. If command -v npu-smi is not found, tell the user this requires hardware

and stop.

  1. Precheck + detect platform (§A) — gate on real silicon, then read the

detected arch into PLATFORM.

  1. Select a single idle device (§C) — or let task-submit pick via

--device auto --device-num 1. Hold one lock for the whole sweep (let

task-submit own the loop) rather than re-locking per example.

  1. Enumerate all subdirectories under tests/st/<platform>/$ARGUMENTS/ that

contain a test_*.py directly beneath them.

  1. Run through task-submit (§E). For each example, run the same

run_bench() pattern from tools/benchmark_rounds.sh: snapshot logs, run

python <example>/test_<name>.py -p <platform> -d $TASK_DEVICE --rounds 10 --skip-golden,

find the new log, parse timing, report results.

  1. Print only metrics backed by captured markers: TMR normally has Host /

Device / Effective / Orch / Sched; HBG has Host / Device. Never render a

missing HBG phase as zero. Include average, trimmed average, and pass/fail.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.