Leveraging Mathematical Reasoning of LLMs for Efficient GPU Thread Mapping
Jose Maureira, Crist\'obal A. Navarro, Hector Ferrada, Luis Veas-Castillo

TL;DR
This paper demonstrates how Large Language Models can automate the derivation of efficient GPU thread mappings for complex geometries, significantly reducing energy and time costs in GPU computing.
Contribution
It introduces a novel method using LLMs for symbolic reasoning to automate GPU thread mapping derivations, outperforming traditional methods in accuracy and efficiency.
Findings
LLMs successfully infer exact mapping equations for complex domains.
One-time inference incurs high energy cost but enables massive savings during GPU execution.
Current models face limitations with highly recursive 3D fractals like the Menger Sponge.
Abstract
Mapping parallel threads onto non-box-shaped domains is a known challenge in GPU computing; efficient mapping prevents performance penalties from unnecessary resource allocation. Currently, achieving this requires significant analytical human effort to manually derive bespoke mapping functions for each geometry. This work introduces a novel approach leveraging the symbolic reasoning of Large Language Models (LLMs) to automate this derivation entirely through in-context learning. Focusing on state-of-the-art open-weights models, we conducted a rigorous comparative analysis across spatial domains of increasing complexity. Our results demonstrate that modern local LLMs successfully infer exact O(1) and O(log N) mapping equations for complex 2D/3D dense domains and 2D fractals, vastly outperforming traditional symbolic regression methods. Crucially, we profile the energetic viability of…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
