Manuscript Offprint

arXiv:2609.03114

Enhancing the Power of Polyhedral-Based Optimizations with Coordinate-Based Hill Climbing

Gaurav Verma, Michael Canesche, Fernando Magno Quintão Pereira

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

GAURAV VERMA, Stony Brook University, USA

MICHAEL CANESCHE, Cadence, Brazil

FERNANDO MAGNO QUINTÃO PEREIRA, UFMG, Brazil

This paper describes our experience extending the polyhedral compiler Pluto with a lightweight, coordinate-wise hill-climbing tuner that adjusts numeric transformation parameters—such as tile sizes and thread-block dimensions—after Pluto selects the kernel's loop structure. To ensure fast convergence and escape local minima, hill climbing is augmented with two techniques: expanded neighborhood exploration and a shortest-hop refinement phase. On x86 and ARM CPUs, tuned kernels outperform Pluto's default configuration (1.06–1.28× geometric mean speedup across 11 benchmarks) and static optimizers (Clang -O3, Polly, IOOpt), reaching performance competitive with the AutoTVM autotuner at substantially lower search cost. Applying the same technique to GPU thread-block allocation on an NVIDIA A100 yields 5.5–8.5% improvement over default configurations. These results position post-optimization parameter tuning as a practical middle ground between fixed-cost-model polyhedral compilation and full autotuning.

CCS Concepts: • Software and its engineering → Compilers.

Additional Key Words and Phrases: Kernel, Polyhedron, Hill Climbing

1 INTRODUCTION

The polyhedral model is a mathematical framework that optimizes loops in programs by representing their iteration space as a polyhedron (a geometric shape in multi-dimensional space)¹. The theory of polyhedra is important because it allows the systematic representation and optimization of loop-intensive code. By modeling loop iterations as points in a high-dimensional geometric space, polyhedra enable precise analyses of data dependencies, allowing compilers to safely apply complex transformations such as loop interchange, tiling, and fusion to improve cache utilization and parallelism [2, 12, 28, 42, 48, 63, 71, 75].

Given the tremendous popularity of deep-learning models, plus the fact that these models are primarily implemented as nests of loops, one might expect the polyhedral model to be enjoying its golden age. However, modern kernel optimizers like Ansor [74], Atlas [68], AutoTVM [17], cuDNN [1], Halide [51], OpenTuner [4], Spiral [25], TensorComprehensions [66], and Tiramisu [6] often take a different approach. Rather than relying on purely static analyses, they perform an empirical exploration of the optimization space. These tools employ techniques such as evolutionary search, gradient-based methods, and machine learning to sample the universe of high-performance kernel implementations.

This empirical approach enables compilers to fine-tune performance for specific hardware platforms by capturing hardware characteristics—such as cache hierarchies, vectorization capabilities, and memory bandwidth—that static models like the polyhedral approach may not fully account for. By collecting performance data of multiple versions of the kernel, and iteratively refining them, these compilers can adapt to the intricacies of the target architecture. This dynamic search process is often referred to as auto-tuning. While auto-tuning is more hardware-aware than polyhedral-based optimizations, it requires the costly execution of multiple versions of the same program.

¹Notions of iteration and data space appeared independently in several works during the 80s and 90s [3, 21, 22, 24, 33, 36, 49, 50, 53–55, 60, 69, 69, 70], eventually leading to the theory known today as the Polyhedral Model.

Authors' addresses: Gaurav Verma, Stony Brook University, Stony Brook, USA, gaurav.verma@stonybrook.edu; Michael Canesche, Cadence, Belo Horizonte, Brazil, canesche@cadence.com; Fernando Magno Quintão Pereira, UFMG, Belo Horizonte, Brazil, fernando@dcc.ufmg.br.

The Contribution of this Work. This paper presents a practical methodology that enhances static polyhedral compilation with lightweight, post-generation parameter tuning. Unlike full autotuners that explore both kernel shape and numeric parameters empirically, we use polyhedral analysis to determine a promising kernel "shape" (the ordering of loops and memory access patterns) and then apply coordinate-wise hill climbing exclusively to numeric parameters such as tile sizes, unrolling factors, and thread-block dimensions. This hybrid approach offers three specific contributions:

A Focused Tuning Problem. Prior work on combining polyhedral analysis with search-based optimization has explored large, combinatorial spaces that include scheduling decisions, fusion/fission choices, and transformation sequences [44, 47, 65]. While powerful, these approaches incur significant search costs due to the size of the space they explore. In contrast, we observe that once a polyhedral compiler has committed to a kernel shape, the remaining optimization space (numeric parameters of already-selected transformations) is substantially smaller and amenable to lightweight local search. Our contribution is not a more expressive search, but rather a demonstration that this focused, post-hoc tuning recovers most of the available performance at a fraction of the cost of broader exploration.

Static Bootstrapping of the Search Space. Hill climbing and other gradient-based search methods require a well-defined starting point and search space to be effective [14, 37]. Prior applications of hill climbing to kernel optimization have relied on human-provided initial configurations or on seeding from other autotuning algorithms [14, 15]. We show that polyhedral analysis alone can provide both the search space (by fixing the kernel shape) and a competitive starting point (Pluto's default parameters), eliminating the need for manual intervention or expensive pre-tuning. This addresses a question left open by Canesche et al. [14] and Zhao et al. [72]: how to identify a promising optimization space for gradient-based tuning without empirical sampling.

Practical Effectiveness Across Architectures and Optimizations. We demonstrate that our lightweight tuning approach generalizes beyond CPU tiling to GPU thread-block allocation, a qualitatively different optimization with different performance trade-offs (register pressure vs. occupancy). Across 11 CPU benchmarks and 10 GPU benchmarks, our technique consistently improves upon static compilers and achieves performance competitive with AutoTVM [17], a full autotuner, while requiring substantially less search time. These results establish post-optimization parameter tuning as a cost-effective parameter tuner.

Summary of Results. As Section 4 shows, the proposed parameter tuning approach has been applied to two parametric compiler optimizations, each targeting a different execution environment:

Loop Tiling: a combination of strip-mining and loop interchange that reorganizes iteration spaces into blocks called tiles. This optimization, implemented in Pluto [12]², uses tile sizes as optimization parameters.

Thread Blocking: a GPU optimization that partitions threads into blocks, trading register pressure for hardware occupancy. The number of threads per block is typically fixed by the developer; in our approach, it is exposed as a tunable parameter.

Our evaluation on x86 and ARM CPUs shows that hill climbing, augmented with expanded neighborhoods and a shortest-hop refinement phase, consistently improves upon Pluto's default configuration, achieving geometric mean speedups of 1.06–1.28x across 11 benchmarks. Tuned kernels outperform static optimizers such as clang -03, Polly, and IOOpt [43], and match the performance of AutoTVM [17] at substantially lower search cost. Although search overhead remains

²The ideas discussed in this paper should be applicable to other polyhedral tools. We chose Pluto because a recent comparison of polyhedral compilers, including Polly, PoCC, and PPCG, shows that it achieves some of the highest observed speedups [62].

significant (40–75x relative to compilation time), it compares favorably to full autotuners that require orders of magnitude more samples. On GPU, the same technique improves thread-block allocation on an NVIDIA A100 by 5.5–8.5% over default configurations, with search times that are a fraction of exhaustive exploration. These results demonstrate that post-optimization parameter tuning offers a practical middle ground between fixed-cost-model polyhedral compilation and full autotuning.

References (31)