Speeding up Log-Sum-Exp: Kernel Fusion at the Memory Wall, Integer Arithmetic at the Compute Wall (bibtex)

by Lingyun Yao, Martin Andraud, Niki Andreas Loppi, Andrea Pilzer, Anji Liu, Guy Van den Broeck and Martin Trapp
Abstract:
While the Log-Sum-Exp (LSE) function is a foundational numerical primitive for stable log-domain computation in modern machine learning, its fast and efficient computation on generic platforms (i.e., CPUs and GPUs) has been underexplored, potentially creating execution bottlenecks for large workloads. On GPU, the de facto implementation torch.logsumexp dispatches a chain of nine sub-kernels per call, incurring redundant High Bandwidth Memory (HBM) traffic and launch overhead. On CPU, exp and log operations are hardware-hungry, limiting the computing efficiency. To address these bottlenecks, we propose two drop-in kernels to significantly accelerate LSE computation on both GPUs and CPUs: FuseLSE, a single-pass fused kernel that evaluates LSE's exp and log functions on the GPU's Special Function Unit (SFU); and IntLSE, which further replaces the LSE computation with approximated integer arithmetic for CPU computation. Our experiments, validated by benchmarks across workload sizes and hardware platforms, show that both kernels are ~10-11× faster than PyTorch at small workloads and ~6× faster on larger ones on GPUs, where the speed-up is attributed to reduced launch overhead and HBM traffic. On CPU, where no SFU is available, LSE computation dominates the cost, allowing IntLSE to gain ~3-6× execution speed over FuseLSE.
Reference:
Lingyun Yao, Martin Andraud, Niki Andreas Loppi, Andrea Pilzer, Anji Liu, Guy Van den Broeck and Martin Trapp. Speeding up Log-Sum-Exp: Kernel Fusion at the Memory Wall, Integer Arithmetic at the Compute Wall, In Advances in Neural Information Processing Systems 39 (NeurIPS), 2026.
Bibtex Entry:
@inproceedings{YaoNeurIPS26,
  title     = {Speeding up Log-Sum-Exp: Kernel Fusion at the Memory Wall, Integer Arithmetic at the Compute Wall},
  author    = {Yao, Lingyun and Andraud, Martin and Loppi, Niki Andreas and Pilzer, Andrea and Liu, Anji and Van den Broeck, Guy and Trapp, Martin},
  booktitle = {Advances in Neural Information Processing Systems 39 (NeurIPS)},
  month     = 12,
  year      = {2026},
  keywords  = {conference,selective}
}
Powered by bibtexbrowser