Automatic Generation of GPU Code Using Multi-Dimensional Homomorphisms: A Conjugate-Gradient Case Study
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.
Authors
- Bazargul Matkerim (ORCID: https://orcid.org/0000-0002-5336-687X)
- Moldir Nakibayeva (ORCID: https://orcid.org/0000-0001-8501-111X)
- Nurislam Kassymbek (ORCID: https://orcid.org/0000-0001-5663-2267)
- Sergei Petrovich Gorlatch (ORCID: https://orcid.org/0000-0003-3857-9380)
- Rahim Ahmed Druba (ORCID: https://orcid.org/0009-0001-2177-9960)
- Nurdaulet Kabdygaliyev (ORCID: https://orcid.org/0009-0004-9533-7948)
Institutions
- Al-Farabi Kazakh National University (KZ)
- University of Münster (DE)
- Atyrau University of Oil and Gas (KZ)
Publication Details
- Journal
- Computation
- Published
- 2026-11-18
- DOI
- https://doi.org/10.3390/computation14110297
- Primary Topic
- Parallel Computing and Optimization Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- Ministry of Science and Higher Education of the Republic of Kazakhstan
- Deutsche Forschungsgemeinschaft