arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2512.04355cs.DCcs.AIcs.PF
收藏

无需运行即可计数:评估LLM对代码复杂度的推理能力

Counting Without Running: Evaluating LLMs' Reasoning About Code Complexity

Gregory Bolet, Giorgis Georgakoudis, Konstantinos Parasyris, Harshitha Menon, Niranjan Hasabnis, Kirk W. Cameron, Gal Oren

AI总结:

本文提出gpuFLOPBench基准测试,评估LLM在无需运行代码的情况下预测CUDA内核FLOP计数的能力,揭示现有代码助手在硬件特定微码效应方面的局限性。

摘要:

现代GPU软件栈要求开发者在从未启动内核之前就能预见性能瓶颈;误判浮点工作负载可能会导致调优、调度甚至硬件采购受阻。然而,尽管在代码生成方面取得了快速进展,目前的大型语言模型(LLMs)很少被测试在这种前瞻推理方面的能力。我们通过gpuFLOPBench基准测试填补了这一空白,该基准要求模型通过预测577个CUDA内核的单精度和双精度FLOP计数来“无需运行即可计数”,这些内核来自HeCBench,已标注有真实性能剖面和八个执行属性,以区分可以轻易分析的代码与那些FLOP依赖于隐藏的编译器或运行时行为的内核。评估当前闭源推理模型显示了明显的但不均衡的进步:最新LLMs在简单内核上可以实现完美分类,但在出现隐含FLOP时,如除法、内建数学函数或常见子表达式时,仍会出现多个数量级的错误。这些结果揭示了现有代码助手的核心限制——无法内部化硬件特定的微码效应——并将gpuFLOPBench定位为开发能够以经验GPU开发者同等严谨性进行性能推理的LLM工具的专门测试平台。源代码可在我们的仓库中获得:https://github.com/Scientific-Computing-Lab/gpuFLOPBench

英文摘要:

Modern GPU software stacks demand developers who can anticipate performance bottlenecks before ever launching a kernel; misjudging floating-point workloads upstream can derail tuning, scheduling, and even hardware procurement. Yet despite rapid progress in code generation, today's Large Language Models (LLMs) are rarely tested on this kind of forward-looking reasoning. We close that gap with gpuFLOPBench, a benchmark that asks models to "count without running" by predicting single and double-precision FLOP counts for 577 CUDA kernels drawn from HeCBench, annotated with ground-truth profiles and eight execution attributes that distinguish trivially analyzable code from kernels whose FLOPs depend on hidden compiler or runtime behavior. Evaluating current closed-source reasoning models shows clear but uneven progress: the newest LLMs achieve perfect classification on straightforward kernels but still incur multiple order-of-magnitude errors whenever implicit FLOPs arise from division, intrinsic math functions, or common subexpressions. These results surface a core limitation of existing code assistants -- the inability to internalize hardware-specific microcode effects -- and position gpuFLOPBench as a focused testbed for developing LLM tooling that can reason about performance with the same rigor as experienced GPU developers. Sources are available at our repository: https://github.com/Scientific-Computing-Lab/gpuFLOPBench

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

↑