用现成 LLM 估算 GPU Roofline 算术强度:Compiler Artifacts 让准确率从 8-14% 提到 26-32%
Estimating GPU Roofline Arithmetic Intensity with Off-the-Shelf LLMs and Compiler Artifacts
没机器也能估 GPU 内核是算力瓶颈还是带宽瓶颈,编译器产物喂给 LLM 后分类正确率能到 78-92%。做 CUDA/HIP 性能优化的开发者可以先拿 LLM 筛出值得跑 profile 的内核,省下排队等卡的时间;但显存流量估算还不准,别直接当最终结论用。
一篇 arXiv 论文测试了 deepseek-v4-flash、gemini-3.7-flash 和 gpt-5.6-sol 三款现成 LLM,能否在不实际执行 GPU 工作负载的情况下估算 Roofline 算术强度(FLOPs 与显存字节数之比)。实验覆盖 179 种组合:5 个内核家族、4 块 NVIDIA 与 AMD GPU、CUDA/HIP/OpenMP/OpenCL 四种并行运行时,并比较了纯源码查询、加入编译器产物查询、沙箱化 agentic 分析三种方式。
结果显示,加入编译器产物后,算术强度估算落在实测值 1.20 倍容差内的比例从 8-14% 提升到 26-32%,带宽瓶颈与计算瓶颈的分类正确率达 78-92%;FLOP 估算有 59-88% 的运行满足 1.20 倍容差,而显存流量只有 36-40%。agentic 分析让 gpt-5.6-sol 的容差内比例再升 6.5 个百分点,但代价是成本为编译器辅助查询的 3.6 倍、延迟 2.5 倍,另外两个模型成本更高且提升不显著。
论文指出,在缺乏目标 GPU 时,LLM 估算可用于排序优化优先级;缓存依赖的显存流量是精确预测算术强度的最大障碍。
Estimating GPU Roofline Arithmetic Intensity with Off-the-Shelf LLMs and Compiler Artifacts
GPU developers use profiling to understand computation and data movement, but access to target hardware can delay optimization. We investigate whether off-the-shelf large language models (LLMs) can estimate Roofline arithmetic intensity (the ratio of floating-point operations (FLOPs) to device-memory bytes) without executing the target GPU workload. We evaluate three models (deepseek-v4-flash, gemini-3.7-flash, and gpt-5.6-sol) across 179 combinations of five kernel families, four NVIDIA and AMD GPUs, four parallel runtimes (CUDA, HIP, OpenMP, and OpenCL), and modified code variants, comparing source-only queries, queries with compiler artifacts, and sandboxed agentic analysis. Compiler artifacts raise the share of arithmetic-intensity estimates within a factor of 1.20 of profiled values from 8-14% to 26-32%, while the resulting bandwidth-bound or compute-bound classifications are correct in 78-92% of runs. With compiler artifacts, FLOP estimates meet the 1.20x tolerance in 59-88% of runs, compared with 36-40% for device-memory traffic. Agentic analysis increases the share of arithmetic-intensity estimates within the 1.20x tolerance by 6.5 percentage points for gpt-5.6-sol, at 3.6x the median cost and 2.5x the median latency of compiler-assisted queries; the other models incur higher costs without a statistically clear improvement. These findings suggest LLM estimates could help prioritize optimization when GPU access is constrained, while identifying cache-dependent device-memory traffic as the main obstacle to precise arithmetic-intensity prediction.
This report is categorized under AITOP's "Papers" desk, focusing on US frontier AI labs and Silicon Valley technology leaders. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows. Key entities and technical topics under continuous tracking include GPU, Roofline, DeepSeek, GPT.
Primary source verification: published directly by arXiv: DeepSeek with first-party authority.