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

Institutions

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

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

Automatic Generation of GPU Code Using Multi-Dimensional Homomorphisms: A Conjugate-Gradient Case Study

Bazargul Matkerim, Moldir Nakibayeva, Nurislam Kassymbek, Sergei Petrovich Gorlatch et al.
Computation
Parallel Computing and Optimization Techniques
article

Automatic Generation of GPU Code Using Multi-Dimensional Homomorphisms: A Conjugate-Gradient Case Study

Bazargul Matkerim, Moldir Nakibayeva, Nurislam Kassymbek, Sergei Petrovich Gorlatch, Rahim Ahmed Druba, Nurdaulet Kabdygaliyev
article en

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.

ComputationVol. 14(11)
Al-Farabi Kazakh National University (KZ), University of Münster (DE), Atyrau University of Oil and Gas (KZ)
Ministry of Science and Higher Education of the Republic of Kazakhstan, Deutsche Forschungsgemeinschaft
Parallel Computing and Optimization Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon