Skip to content

[Research][Autocomp] Automated Ukernel Synthesis Agent #8

@copparihollmann

Description

@copparihollmann

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

  1. Optimization Menu: Define a structured list of transformations (e.g., Loop Unroll, Accumulator Split, Vectorize) applicable to our target.
  2. Planner & Coder:
    • Phase 1 (Plan): LLM selects a sequence of menu items.
    • Phase 2 (Implement): LLM generates the specific C/Intrinsic code.
  3. Verification Loop:
    • Compiles candidate kernels using builder.py --profile riscv_spacemit.
    • Runs correctness checks on QEMU/Hardware.
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions