• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

Computer Engineering & Science ›› 2023, Vol. 45 ›› Issue (12): 2121-2134.

• High Performance Computing • Previous Articles     Next Articles

Loop permutation and auto-tuning under polyhedral model

PENG Chang1,2,LIU Qing-zhi1,2,CHEN Chang-bo1,2   

  1. (1Chongqing Institute of Green and Intelligent Technology,Chinese Academy of Sciences,Chongqing 400714;
    2..Chongqing  School,University of Chinese Academy of Sciences,Chongqing 400714,China)
  • Received:2023-03-06 Revised:2023-08-22 Accepted:2023-12-25 Online:2023-12-25 Published:2023-12-14

Abstract: Aiming at improving the performance of the default loop scheduling and tile size of Pluto, a commonly used polyhedral compiler, this paper proposes a method to compute a variety of legal permutations for its default scheduling and auto-tune its performance according to the configuration space composed of permutations and tile sizes. Through the processing of scalar dimension that defines loop fusion, both intra and inter permutations for imperfect loop nest are realized. Four machine learning driven auto-tuning strategies are proposed to find the optimized combination of permutation order and tile size for a loop with a given problem size. Under the default tile size, the optimal permutation gene- rated by the extended Pluto compiler in a parallel environment achieves a maximum speedup of 4.02  and a geometric mean of 2.12 compared with the default scheduling of Pluto. By further searching for a better combination of permutation order and tile size, the best auto-tuning strategy achieves a maximum speedup of 5.48  and a geometric mean of 2.86 compared with Pluto's default optimization in a parallel environment. In addition, the best configuration and the learned model obtained by auto-tuning for a particular problem size, when being applied to similar problem sizes, also outperform the default optimization of Pluto in various degrees.



Key words: loop permutation, loop tiling, polyhedral model, auto-tuning, machine learning