paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Falcon: A Scalable Analytical Cache Model

Falcon:一个可扩展的解析式缓存模型
PLDI 8(PLDI)2024匹配度 3/10 · 该论文属于程序分析与编译器优化领域的静态分析/性能建模工作,虽在 ML 负载(TorchVision)上评估,但核心是仿射程序的缓存行为解析建模,不涉及 LLM/Agent、浮点程序分析或贝叶斯程序分析等用户画像中的核心交叉方向。引用 10 inbox
Arjun Pitchanathan, Kunwar Grover, Tobias Grosser
dblp: 2026-09-10crossref: 2026-09-10

AI 速览

一句话:提出首个可扩展的解析式缓存模型,通过分块计算避免 Presburger 求解器最坏复杂度,将大型仿射程序分析从数小时降至秒级。

编译器常用无噪声的性能模型指导优化,其中缓存缺失率估计可服务于超优化、最坏执行时间分析与手工调优。然而已有面向仿射程序的解析缓存模型只能处理 PolyBench 级别的小程序:它们把整个程序交给 Presburger 求解器,在庞大的公式上执行昂贵运算,因而无法扩展到代码行数高出几个数量级的生产级程序。Falcon 将缓存分析计算拆分为互不触发求解器最坏渐进行为的小块,并有效利用并行。作者在 46 个 TorchVision 神经网络上评估:Falcon 的几何平均运行时间为 44.9 秒,而此前最先进的模型超过 32 分钟,并在 54% 的网络上触及四小时上限;Falcon 最多 3 分 3 秒即可完成。其在 16 核上的运行比单线程快 8.2 倍;对程序做局部修改后,平均仅需 513 毫秒(几何平均)即可增量更新预测。

问题
现有解析式缓存模型将整个仿射程序交给 Presburger 求解器处理,公式规模巨大导致无法扩展到生产级的大型程序,只能应对 PolyBench 等小程序。
方法
Falcon 将缓存行为建模的计算拆分为小块,避免触发 Presburger 求解器的最坏情况渐进行为,并支持并行执行与局部修改后的增量更新。
评估
在 46 个 TorchVision 神经网络上与最先进缓存模型对比:Falcon 几何平均运行时间 44.9 秒,对手超过 32 分钟且在 54% 网络上超时;16 核并行加速 8.2 倍;局部修改后增量更新平均 513 毫秒。
原文摘要(Abstract)

Compilers often use performance models to decide how to optimize code. This is often preferred over using hardware performance measurements, since hardware measurements can be expensive, limited by hardware availability, and makes the output of compilation non-deterministic. Analytical models, on the other hand, serve as efficient and noise-free performance indicators. Since many optimizations focus on improving memory performance, memory cache miss rate estimations can serve as an effective and noise-free performance indicator for superoptimizers, worst-case execution time analyses, manual program optimization, and many other performance-focused use cases. Existing methods to model the cache behavior of affine programs work on small programs such as those in the Polybench benchmark but do not scale to the larger programs we would like to optimize in production, which can be orders of magnitude bigger by lines of code. These analytical approaches hand off the whole program to a Presburger solver and perform expensive mathematical operations on the huge resulting formulas. We develop a scalable cache model for affine programs that splits the computation into smaller pieces that do not trigger the worst-case asymptotic behavior of these solvers. We evaluate our approach on 46 TorchVision neural networks, finding that our model has a geomean runtime of 44.9 seconds compared to over 32 minutes for the state-of-the-art prior cache model, and the latter is actually smaller than the true value because the prior model reached our four-hour time limit on 54% of the networks, and this limit was never reached by our tool. Our model exploits parallelism effectively: running it on sixteen cores is 8.2x faster than running it single-threaded. While the state-of-the-art model takes over four hours to analyze a majority of the benchmark programs, Falcon produces results in at most 3 minutes and 3 seconds; moreover, after a local modification to the program being analyzed, our model efficiently updates the predictions in 513 ms on average (geomean). Thus, we provide the first scalable analytical cache model. CCS Concepts: • Software and its engineering → Compilers .

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@article{PitchanathanGG24,
  title = {Falcon: A Scalable Analytical Cache Model},
  author = {Arjun Pitchanathan and Kunwar Grover and Tobias Grosser},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {PLDI},
  year = {2024},
  doi = {10.1145/3656452}
}