Context
Writing optimized micro-kernels for new architectures (e.g., SpacemiT X60, RISC-V V-Extension) is labor-intensive. Leveraging the "Autocomp" paper (UC Berkeley), we will build an agent that synthesizes verified micro-kernels by searching over an "Optimization Menu" (Unroll, Vectorize, Reorder).
Objective
Implement the Autocomp Beam Search agent (src/tools/autocomp/) to generate high-performance MLIR/C micro-kernels.
Scope of Work
- Optimization Menu: Define a structured list of transformations (e.g.,
Loop Unroll, Accumulator Split, Vectorize) applicable to our target.
- Planner & Coder:
- Phase 1 (Plan): LLM selects a sequence of menu items.
- Phase 2 (Implement): LLM generates the specific C/Intrinsic code.
- Verification Loop:
- Compiles candidate kernels using
builder.py --profile riscv_spacemit.
- Runs correctness checks on QEMU/Hardware.
- Feedback: Use cycle counts (from
iree-benchmark-module) to guide the Beam Search.
Acceptance Criteria
- Test 1: Input a scalar
matmul. Agent successfully applies "Vectorize" plan and produces valid RVV intrinsics.
- Test 2: Agent discovers a kernel for
riscv_spacemit that outperforms the generic llvm-cpu lowering by >1.5x.
Context
Writing optimized micro-kernels for new architectures (e.g., SpacemiT X60, RISC-V V-Extension) is labor-intensive. Leveraging the "Autocomp" paper (UC Berkeley), we will build an agent that synthesizes verified micro-kernels by searching over an "Optimization Menu" (Unroll, Vectorize, Reorder).
Objective
Implement the Autocomp Beam Search agent (
src/tools/autocomp/) to generate high-performance MLIR/C micro-kernels.Scope of Work
Loop Unroll,Accumulator Split,Vectorize) applicable to our target.builder.py --profile riscv_spacemit.iree-benchmark-module) to guide the Beam Search.Acceptance Criteria
matmul. Agent successfully applies "Vectorize" plan and produces validRVVintrinsics.riscv_spacemitthat outperforms the genericllvm-cpulowering by >1.5x.