arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2604.10387cs.DC
收藏

利用大语言模型的数学推理实现高效的GPU线程映射

Leveraging Mathematical Reasoning of LLMs for Efficient GPU Thread Mapping

Universidad Austral de Chile(智利南方大学);Instituto de Informática, Universidad Austral de Chile(智利南方大学计算机研究所)

Jose Maureira, Cristóbal A. Navarro, Hector Ferrada, Luis Veas-Castillo

AI总结:

本文提出利用大语言模型的符号推理自动化GPU非矩形域线程映射,通过上下文学习推导出精确的O(1)和O(log N)映射方程,显著优于传统符号回归方法,实现高效能资源优化。

摘要:

在GPU计算中,将并行线程映射到非矩形形状的域是一个已知的挑战;高效的映射可以防止不必要的资源分配带来的性能惩罚。目前,实现这一目标需要大量的人工分析工作来手动推导每个几何形状的定制映射函数。本文介绍了一种新的方法,利用大语言模型(LLMs)的符号推理能力,通过上下文学习完全自动化这一推导过程。专注于最先进的开源模型,我们对日益复杂的空间域进行了严格的比较分析。我们的结果表明,现代本地LLMs能够为复杂的2D/3D密集域和2D分形推导出精确的O(1)和O(log N)映射方程,显著优于传统符号回归方法。至关重要的是,我们评估了该方法在高性能基础设施上的能耗可行性,区分了代码生成和执行阶段。虽然一次推理会带来较高的能耗惩罚——特别是对于以推理为导向的模型如DeepSeek-R1——但这是一次性的前期投入。一旦集成,生成的分析内核会完全消除块浪费,从而在实际GPU工作负载中带来巨大的能耗和时间节省(例如,速度提升高达4833倍,能耗降低高达2890倍)。最后,我们识别出当这些模型面对高度递归的3D分形(如Menger海绵)时存在当前的“推理上限”。这一限制衡量了当前开源架构的成熟度,为实现完全自动化的、节能的GPU资源优化指明了可行路径。

英文摘要:

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 this approach on high-performance infrastructure, distinguishing between the code-generation and execution phases. While one-time inference incurs a high energy penalty -- particularly for reasoning-focused models like DeepSeek-R1 -- this is a single upfront investment. Once integrated, the generated analytical kernels eliminate block waste entirely, yielding massive energy and time savings (e.g., up to 4833x speedup and 2890x energy reduction) during actual GPU workloads. Finally, we identify a current "reasoning ceiling" when these models face highly recursive 3D fractals (e.g., the Menger Sponge). This limitation benchmarks the present maturity of open-weight architectures, charting a viable path toward fully automated, energy-efficient GPU resource optimization.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑