Leonid: Exploring Automated Kernel Fusion in Performance-Portable Programming Models for Scientific Computation
Chenchen Zhang, Hao Luo, Chao Yang · 2025
With advances in hardware performance, architectural divergence and the growing gap between computational power and memory bandwidth have become increasingly pronounced.Existing performance-portable models address hardware divergence but lack automated kernel fusion to optimize memory-bound scientific applications.To address this issue, we propose Leonid, a performance-portable programming model designed to support automated kernel fusion.Leonid integrates separate modules for unified global and scratchpad memory management, and for unified parallel and serial execution patterns, both specifically tailored for automated kernel fusion, alongside an integrated automated kernel fusion module.These components ensure the compatibility across CPUs, GPUs, and Sunway platforms for automated kernel fusion.Performance evaluations demonstrate that Leonid achieves up to 1.52× speedup (averaging 1.19×) over manually implemented code, outperforms Kokkos and RAJA, and matches the efficiency of manually fused code in bandwidthlimited algorithms and applications.For bandwidth-limited and fusion-eligible code, Leonid offers a significant advantage over other performance-portable models that lack automated kernel fusion capabilities.