Context
Compiler heuristics for Tiling, Fusion, and Vectorization are brittle. Following the "Magellan" paper (Google DeepMind), we aim to replace hand-tuned C++ heuristics with evolved policies. This system iterates on C++ template code to find optimal decision logic for specific workloads (e.g., "Always tile by 32 if cache pressure > X").
Objective
Develop a Magellan module (src/tools/magellan/) that treats Compiler Heuristics as a search problem.
Scope of Work
- Template Injection: Create a C++ pass wrapper (e.g., inside
Flow/Transforms) with // EVOLVE-BLOCK-START markers around the tiling logic.
- Evolver Agent: A Python loop that:
- Asks LLM to propose a C++ policy change (e.g.,
if (L1_Size < 32KB) tile = 16;).
- Recompiles IREE (using
builder.py).
- Benchmarks performance (using
profiler.py).
- Autotuner Integration: Use
optuna to tune the numerical constants exposed by the evolved policy (e.g., tile sizes).
Acceptance Criteria
- Test 1: Can successfully inject a dummy policy into
Pass.cpp and recompile.
- Test 2: Discovery loop finds a tiling configuration for
matmul_f32 that is >5% faster than the default static heuristic on Host CPU.
Context
Compiler heuristics for Tiling, Fusion, and Vectorization are brittle. Following the "Magellan" paper (Google DeepMind), we aim to replace hand-tuned C++ heuristics with evolved policies. This system iterates on C++ template code to find optimal decision logic for specific workloads (e.g., "Always tile by 32 if cache pressure > X").
Objective
Develop a
Magellanmodule (src/tools/magellan/) that treats Compiler Heuristics as a search problem.Scope of Work
Flow/Transforms) with// EVOLVE-BLOCK-STARTmarkers around the tiling logic.if (L1_Size < 32KB) tile = 16;).builder.py).profiler.py).optunato tune the numerical constants exposed by the evolved policy (e.g., tile sizes).Acceptance Criteria
Pass.cppand recompile.matmul_f32that is >5% faster than the default static heuristic on Host CPU.