一句话:提出符号化程序剖析,用输入相关的符号公式代替动态插桩计算 ML 内核基本块计数,中位加速约 1.5 万倍。
现有基本块剖析依赖动态插桩统计每个基本块的执行次数,会引入运行时开销,并且必须实际运行程序,在大输入下耗时显著。本文提出符号化程序剖析:为基本块的执行计数生成以程序输入为自变量的符号公式,从而无需运行程序即可获得计数;该方法仅适用于一类特定程序,即机器学习(ML)内核。作者在 LLVM 编译器中实现了该技术,并在来自 50 个 ML 模型的 78 个 ML 算子上进行评估,这些算子由 ML 编译器 TVM 生成。实验表明,对 78 个内核中的 73 个,符号化剖析结果与动态插桩完全相同,中位加速比达到 15093 倍。
Current basic block profiling techniques obtain the count of executions of each basic block in a program using dynamic instrumentation. These profiling counters create runtime overheads and also require the execution of the program, which, for large input sizes, can take substantial time. We propose symbolic program profiling that generates symbolic formulae for a basic block’s count with inputs as the independent variables. Our technique is limited in applicability to a certain class of programs, namely machine learning (ML) kernels. We implement our technique in the LLVM compiler and evaluate it on 78 ML operators from 50 different ML models. These operators are generated by TVM, a machine learning compiler. Our symbolic profiles deliver exactly the same results as dynamic instrumentation for 73 out of 78 kernels with a median speedup of 15093×.
@article{paperbot12079,
title = {Symbolic Basic Block Profiling for Machine Learning Kernels},
author = {Jingyu Qiu and Rongcui Dong and Sreepathi Pai},
journal = {Proceedings of the ACM on Programming Languages},
volume = {10},
number = {OOPSLA2},
year = {2026},
doi = {10.1145/3839483}
}