Evaluate kernels on held-out shapes#
2026-07-15
2 min read time
The optional src.held_out module evaluates whether an optimized kernel
generalizes to input shapes that were not visible during the original run.
This is a manually invoked post-run workflow; normal docker-run and
docker-parallel-run commands do not execute it automatically.
Generated shape configurations are written to held_out_tests/, which is
excluded from Git so private evaluation inputs are not committed.
Supported task scopes#
Task type |
Supported scope |
Injection target |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Enter the runtime#
Generation and evaluation require the same agent, Python, ROCm, and GPU access as a normal experiment. From the repository root, enter the Docker runtime:
make docker-shell
Run the remaining commands inside that shell from the mounted repository root.
Generate held-out shapes#
Generate configurations with one authenticated first-class agent CLI:
python3 -m src.held_out.generate_heldout \
--tasks-dir tasks/ \
--output-dir held_out_tests/ \
--backend claude_code \
--timeout 600
Use --dry-run to list supported tasks without launching an agent. Use
--tasks hip2hip/gpumode/SiLU to select a specific task. Supported backends are
claude_code, codex, and cursor.
Evaluate a completed run#
Pass a completed run directory and the generated held-out configurations:
python3 -m src.held_out.run_heldout_eval \
--run-dir workspace_MI300_claude_code/run_<timestamp> \
--heldout-dir held_out_tests/ \
--tasks-dir tasks/
The evaluator creates a sibling directory ending in _heldout. For each task,
it restores and evaluates the original kernel under orig/, evaluates the
optimized kernel under opt/, and injects the same held-out shapes into both.
Results distinguish four outcomes:
Original |
Optimized |
Status |
|---|---|---|
Pass |
Pass |
|
Pass |
Fail |
|
Fail |
Fail |
|
Fail |
Pass |
|
Each task writes heldout_task_result.yaml; the run-level output is
heldout_summary.yaml. The aggregate includes conditional correctness,
P(optimized correct | original correct), and held-out speedup retention.
For injection formats and implementation details, see the module README.