Robust Resource Bounds with Static Analysis and Bayesian Inference

被引:0
作者
Pham, Long [1 ]
Saad, Feras A. [1 ]
Hoffmann, Jan [1 ]
机构
[1] Carnegie Mellon Univ, Pittsburgh, PA 15213 USA
来源
PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL | 2024年 / 8卷 / PLDI期
基金
美国国家科学基金会;
关键词
resource analysis; worst-case costs; static analysis; data-driven analysis; hybrid analysis; Bayesian inference; AMORTIZED COMPLEXITY; COST; IMPLEMENTATION;
D O I
10.1145/3656380
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
There are two approaches to automatically deriving symbolic worst-case resource bounds for programs: static analysis of the source code and data-driven analysis of cost measurements obtained by running the program. Static resource analysis is usually sound but incomplete. Data-driven analysis can always return a result, but its lack of robustness often leads to unsound results. This paper presents the design, implementation, and empirical evaluation of hybrid resource bound analyses that tightly integrate static analysis and data-driven analysis. The static analysis part builds on automatic amortized resource analysis (AARA), a state-of-the-art type-based resource analysis method that performs cost bound inference using linear optimization. The data-driven part is rooted in novel Bayesian modeling and inference techniques that improve upon previous data-driven analysis methods by reporting an entire probability distribution over likely resource cost bounds. A key innovation is a new type inference system called Hybrid AARA that coherently integrates Bayesian inference into conventional AARA, combining the strengths of both approaches. Hybrid AARA is proven to be statistically sound under standard assumptions on the runtime cost data. An experimental evaluation on a challenging set of benchmarks shows that Hybrid AARA (i) effectively mitigates the incompleteness of purely static resource analysis; and (ii) is more accurate and robust than purely data-driven resource analysis.
引用
收藏
页数:26
相关论文
共 91 条
[1]   Measurement-Based Worst-Case Execution Time Estimation Using the Coefficient of Variation [J].
Abella, Jaume ;
Padilla, Maria ;
Del Castillo, Joan ;
Cazorla, Francisco J. .
ACM TRANSACTIONS ON DESIGN AUTOMATION OF ELECTRONIC SYSTEMS, 2017, 22 (04)
[2]  
Afshar HM, 2015, ADV NEUR IN, V28
[3]  
Albert E, 2007, LECT NOTES COMPUT SC, V4421, P157
[4]  
Albert E, 2008, LECT NOTES COMPUT SC, V5382, P113, DOI 10.1007/978-3-540-92188-2_5
[5]  
Andersen Per K., 2015, Wiley StatsRef: Statistics Reference Online, DOI [10.1002/9781118445112.stat02177.pub2, DOI 10.1002/9781118445112.STAT02177.PUB2]
[6]   Automating sized-Type inference for complexity analysis [J].
Avanzini M. ;
Dal Lago U. .
Proceedings of the ACM on Programming Languages, 2017, 1 (ICFP)
[7]   A Modular Cost Analysis for Probabilistic Programs [J].
Avanzini, Martin ;
Moser, Georg ;
Schaper, Michael .
PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2020, 4 (OOPSLA)
[8]  
Avanzini M, 2015, PROCEEDINGS OF THE 20TH ACM SIGPLAN INTERNATIONAL CONFERENCE ON FUNCTIONAL PROGRAMMING (ICFP'15), P152, DOI 10.1145/2784731.2784753
[9]   A combination framework for complexity [J].
Avanzini, Martin ;
Moser, Georg .
INFORMATION AND COMPUTATION, 2016, 248 :22-55
[10]  
Bernat G., 2003, pwcet: A tool for probabilistic worst-case execution time analysis of real-time systems