一句话:提出 AXPROF,用统计检验自动剖析随机近似程序是否满足精度、时间和内存规范,并发现 bug 与优化机会。
现代应用常用近似算法以降低延迟和内存,但现有剖析器不检查计算精度,也不验证输出是否满足精度规范。为此,作者提出 AXPROF:开发者用数学公式给出含概率或期望谓词的精度规范,AXPROF 自动生成统计推理代码,先建立精度、时间和内存的经验模型,再选择合适的统计检验,以高置信度判断实现是否满足规范。作者在数据分析、数值线性代数和近似计算三个领域的 15 个近似程序上评估了 AXPROF,发现它能有效定位缺陷并识别性能优化机会,包括找出 5 个此前未知的 bug 并在其指导下完成修复。
Many modern applications require low-latency processing of large data sets, often by using approximate algorithms that trade accuracy of the results for faster execution or reduced memory consumption. Although the algorithms provide probabilistic accuracy and performance guarantees, a software developer who implements these algorithms has little support from existing tools. Standard profilers do not consider accuracy of the computation and do not check whether the outputs of these programs satisfy their accuracy specifications. We present AXPROF, an algorithmic profiling framework for analyzing randomized approximate programs. The developer provides the accuracy specification as a formula in a mathematical notation, using probability or expected value predicates. AXPROF automatically generates statistical reasoning code. It first constructs the empirical models of accuracy, time, and memory consumption. It then selects and runs appropriate statistical tests that can, with high confidence, determine if the implementation satisfies the specification. We used AXPROF to profile 15 approximate applications from three domains - data analytics, numerical linear algebra, and approximate computing. AXPROF was effective in finding bugs and identifying various performance optimizations. In particular, we discovered five previously unknown bugs in the implementations of the algorithms and created fixes, guided by AXPROF.