Skip to content

[Research][Magellan] Autonomous Heuristic Discovery Engine #7

@copparihollmann

Description

@copparihollmann

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

  1. Template Injection: Create a C++ pass wrapper (e.g., inside Flow/Transforms) with // EVOLVE-BLOCK-START markers around the tiling logic.
  2. 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).
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions