Automatic Generation of GPU Code Using Multi-Dimensional Homomorphisms: A Conjugate-Gradient Case Study
Bazargul Matkerim, Nurislam Kassymbek, Moldir Nakibayeva, Nurdaulet Kabdygaliyev, Rahim Ahmed Druba, Sergei Gorlatch
Key points
From the paper's conclusion- We address this using Multi-Dimensional Homomorphisms (MDH), generating correct-by-construction GPU code from high-level formulations, tuned via an automated (scripted) sweep, cross-checked against the auto-tuning framework (ATF).
Abstract
Developing efficient, performance-portable GPU code for multi-stage numerical pipelines is difficult; automated compilers struggle to parallelize them. We address this using Multi-Dimensional Homomorphisms (MDH), generating correct-by-construction GPU code from high-level formulations, tuned via an automated (scripted) sweep, cross-checked against the auto-tuning framework (ATF). We apply this to the conjugate-gradient (CG) method for the matrix-free 2D/3D Poisson equation, generating the stencil, dot product, and vector update; CG is not claimed to be the fastest algorithm for this problem, addressed via a multigrid comparison. On two NVIDIA GPUs (RTX 3050 Laptop, RTX 5090), up to 268 million unknowns, tuned MDH kernels take 0.91 to 1.12 times the time of a hand-tuned kernel, and PPCG with tuned tile and block sizes takes 0.83 to 1.09 times the time of tuned MDH, neither uniformly faster; the up-to-8× gap against PPCG’s default schedule comes from engaging a single streaming multiprocessor. The fully generated GPU-resident CG iteration, run to convergence, is 1.62 to 1.99 times faster than CSR and cuSPARSE beyond the cache. A geometric multigrid solver, run to CG’s own 3.2×10−6 accuracy target, outperforms all CG variants by 1.6× to 5.3×; ILU(0) preconditioning reduces iteration counts but increases wall-clock time.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- EvoCG: Self-Evolving Precision Control for Faster Conjugate GradientarXiv · 2026
- Portable GPU Acceleration of snMECP+COSx via Algorithm-Architecture Codesign.The journal of physical chemistry. A · 2026
- JAX-AMG: A GPU-accelerated differentiable sparse linear solver library for JAX.SoftwareX · 2026
- Rasterization-based discontinuous integration on the GPUarXiv · 2026
- Multi-GPU Acceleration of Interface Problems in FEniCS, with Application to Cardiac ModelingarXiv · 2026
- Global optimization tailored for graphics processing units: Complete and rigorous search for large-scale nonlinear minimizationPNAS Nexus · 2026