Introduction
High-Performance Computing (HPC) performance is fundamentally tied to the efficiency of loop execution. While modern optimizing compilers like GCC and Clang, along with advanced polyhedral optimizers such as Polly or Pluto, have made significant strides, they frequently encounter limitations when processing complex, "messy" loops. These limitations typically stem from non-affine (non-linear) memory accesses, loop-carried dependencies that force sequential execution, and high register pressure leading to performance-degrading memory spills.
This paper introduces SILO (Symbolic, Inductive Loop Optimization), a novel technique designed to overcome these hurdles by shifting the focus from modeling the entire iteration space to analyzing how data accesses change inductively between successive iterations.
The SILO Architecture
SILO operates within the Data-Centric (DaCe) framework, leveraging a high-level Intermediate Representation (IR) to perform sophisticated symbolic mathematics using libraries like SymPy. Unlike traditional polyhedral models that attempt to map every point in a loop's execution—a process that often fails with non-linear indices—SILO focuses on the symbolic stride. This is the mathematical difference between iteration $i$ and $i+1$.
As shown in the architecture diagram, SILO's workflow begins with Symbolic Inductive Loop Analysis, which feeds into two primary optimization tracks: Maximizing Parallelism (including dependency resolution and loop pipelining) and Memory Scheduling (covering software prefetching and pointer incrementation). These optimizations are then integrated back into standard optimization passes and lowering stages of the HPC compiler stack.
Inductive Dependency Analysis and Parallelization
A core strength of SILO is its ability to resolve "false" dependencies that typically stymie compilers. By modeling data accesses as injective functions and solving symbolic equations, SILO can prove whether memory regions accessed in different iterations actually overlap.
When genuine dependencies exist, SILO utilizes DOACROSS parallelization. This technique inserts fine-grained synchronization primitives (wait/release), allowing iterations to run in a staggered, pipelined fashion across multiple processor cores. This approach enables parallelism even in loops with complex Write-After-Write (WAW), Write-After-Read (WAR), and Read-After-Write (RAW) dependencies, as illustrated in the dependency graph analysis.
Memory and Register Optimization
Beyond parallelization, SILO addresses memory bottlenecks through two key mechanisms:
- Automatic Software Prefetching: SILO identifies unpredictable jumps in data access, which are common in tiled loops, and inserts prefetch hints. This allows the CPU to prime its cache before the data is actually needed.
- Pointer Incrementation: To reduce register pressure, SILO replaces expensive index recomputations (e.g.,
A[i*stride + j]) with simple pointer additions (ptr += stride). This form of loop strength reduction frees up registers, preventing the "spills" to slow memory that often tank performance in complex kernels.
Experimental Results
The effectiveness of SILO was evaluated using standard HPC benchmarks, including the Thomas algorithm for Vertical Advection and the NPBench suite.
- Vertical Advection: SILO achieved a massive 12× speedup over LLVM's Polly optimizer by successfully parallelizing the vertical dimension through its pipelining analysis.
- NPBench Kernels: Pointer incrementation improved performance in 27 out of 30 tested kernels. Notably, the
softmaxkernel saw a 3.62× speedup solely due to reduced register pressure. - Prefetching: On Intel systems, automated prefetching hints provided a 1.37× speedup for tiled matrix multiplication by assisting the hardware in anticipating non-linear memory jumps.
Conclusion
SILO demonstrates that an inductive approach to loop analysis can unlock significant performance gains in scientific computing kernels that are otherwise "un-analyzable" by traditional tools. By focusing on symbolic transitions and integrating memory-aware scheduling, SILO bridges the gap between high-level code abstractions and low-level hardware efficiency. Future work aims to integrate these techniques into broader compiler chains like MLIR and extend the analysis to handle irregular, data-dependent access patterns.
Summary updated