LOOPer: A Learned Automatic Code Optimizer For Polyhedral Compilers

Massinissa Merouani, Afif Boudaoud, Iheb Nassim Aouadj, Nassim Tchoulak, Islem Kara Bernou, Hamza Benyamina, Fatima Benbouzid-Si Tayeb, Karima Benatchba, Hugh Leather, Riyadh Baghdadi · 2025

While polyhedral compilers have shown success in implementing advanced code transformations, they still face challenges in selecting the ones that lead to the most profitable speedups. This has motivated the use of machine learning based cost models to guide the search for polyhedral optimizations. State-of-the-art polyhedral compilers have demonstrated a viable proof-of-concept of such an approach. While promising, this approach still faces significant limitations. Existing polyhedral compilers using deep learning cost models typically support only a small subset of affine transformations, limiting their ability to explore complex code transformations. Furthermore, their applicability does not scale beyond simple programs, thus excluding many program classes from their scope, such as those with non-rectangular iteration domains or multiple loop nests. These limitations significantly impact the generality of such compilers and autoschedulers, raising questions about the overall approach. In this paper, we introduce LOOPER, the first polyhedral autoscheduler that uses a deep learning based cost model and covers a large space of affine transformations and programs. LOOPER allows the optimization of an extensive set of programs while being effective at applying complex sequences of polyhedral transformations. We implement and evaluate LOOPER and show that it achieves competitive speedups over the state-of-the-art. On the PolyBench benchmarks, LOOPER achieves a geometric mean speedup of $\mathbf{1 . 8 4} \mathbf{x}$ over the Tiramisu autoscheduler and $\mathbf{1 . 4 2} \mathbf{x}$ over Pluto, two state-of-the-art polyhedral autoschedulers.

Read the paper · More papers on PaperTik