Build a gated tuning loop for a NumPy kernel
CPU · your Macscript150 minrequiredGoal · A propose, verify, measure, keep loop that searches schedule configurations (tile size, unroll, vectorization) for a NumPy matmul or softmax, with a differential correctness gate and noise-budgeted timing, producing a verified-best config and the full candidate ledger.
- 1Write a parameterized kernel (tile size, unroll factor, vectorization flag) and a differential tester against a reference on random inputs.
- 2Implement the measurement protocol, warmup runs, N timed repeats, median with spread, and a noise budget that rejects improvements smaller than the spread.
- 3Implement the loop over a config space of at least 48 candidates, gate then measure then keep, logging every candidate, verdict, timing and decision to a ledger.
- 4Add canary inputs designed to catch a config that only works for the benchmark shapes, and re-verify the winner.
- 5Produce the final table, best config, verified speedup over the naive baseline, and the three most interesting failures the gate caught.
- Deliverable
- tuning_loop.py, the candidate ledger, and the final verified-results table.
- Check
- The winner passes the gate on canary inputs; the claimed speedup exceeds the measured noise spread; the ledger records every candidate with a decision reason.