Reinforcement Learning Assisted Loop Distribution for Locality and Vectorization
DescriptionWe present a Reinforcement Learning (RL) based approach to efficiently perform loop-distribution with the goals of optimizing for vectorization and locality. We generate the SCC Dependence Graph for each loop of the program. Our RL model learns to predict the distribution order of the loop by performing a topological walk of graph. The RL-reward is computed using instruction cost and number of cache misses. For training purposes, we also propose a novel strategy to extend the training set by generating new loops.
We show results on x86 architecture on various benchmarks: TSVC, LLVM-Test-Suite, PolyBench, PolyBenchNN. Our framework achieves an average improvement of 3.63% on TSVC, 4.61% on LLVM-Test-Suite MicroBenchmarks, 1.78% on PolyBench and 1.95% on PolyBenchNN benchmark suites for performance, with LLVM-O3 flag as baseline. We also show the improvements on other performance metrics like Instruction Per Cycle (IPC), Number of loops distributed and vectorized, and L1 cache performance.
We show results on x86 architecture on various benchmarks: TSVC, LLVM-Test-Suite, PolyBench, PolyBenchNN. Our framework achieves an average improvement of 3.63% on TSVC, 4.61% on LLVM-Test-Suite MicroBenchmarks, 1.78% on PolyBench and 1.95% on PolyBenchNN benchmark suites for performance, with LLVM-O3 flag as baseline. We also show the improvements on other performance metrics like Instruction Per Cycle (IPC), Number of loops distributed and vectorized, and L1 cache performance.
Event Type
Workshop
TimeSunday, 13 November 20229:30am - 10am CST
LocationD220
W
Recorded