HARP: holistic analysis for refactoring Python-based analytics programs
Weijie Zhou, Yue Zhao, Guoqiang Zhang, Xipeng Shen
Abstract
Modern machine learning programs are often written in Python, with the main computations specified through calls to some highly optimized libraries (e.g., TensorFlow, PyTorch). How to maximize the computing efficiency of such programs is essential for many application domains, which has drawn lots of recent attention. This work points out a common limitation in existing efforts: they focus their views only on the static computation graphs specified by library APIs, but leave the influence from the hosting Python code largely unconsidered. The limitation often causes them to miss the big picture and hence many important optimization opportunities. This work proposes a new approach named HARP to address the problem. HARP enables holistic analysis that spans across computation graphs and their hosting Python code. HARP achieves it through a set of novel techniques: analytics-conscious speculative analysis to circumvent Python complexities, a unified representation augmented computation graphs to capture all dimensions of knowledge related with the holistic analysis, and conditioned feedback mechanism to allow risk-controlled aggressive analysis. Refactoring based on HARP gives 1.3--3X and 2.07X average speedups on a set of TensorFlow and PyTorch programs.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext f5b9f7b0-7ac6-43a6-bd69-63e516c3fdd6Cited by top-tier papers3
- Toward efficient interactions between Python and native librariesJialiang Tan, Yu Chen, Zhenming Liu, Bin Ren et al.FSE 2021 · 10 citations
- Speculative Automated Refactoring of Imperative Deep Learning Programs to Graph ExecutionRaffi Khatchadourian, Tatiana Castro Vélez, Mehdi Bagherzadeh, Nan Jia et al.ASE 2025 · 1 citation
- From Code Changes to Quality Gains: An Empirical Study in Python ML Systems with PyQuMohamed Almukhtar, Anwar Ghammam, Marouane Kessentini, Hua MingICSE 2026
Related papers
- MAGPY: Compiling Eager Mode DNN Programs by Monitoring Execution StatesChen Zhang, Rongchao Dong, Haojie Wang, Runxin Zhong et al.USENIX ATC 2024 · 5 citations
- Discovering Parallelisms in Python ProgramsSiwei Wei, Guyang Song, Senlin Zhu, Ruoyi Ruan et al.FSE 2023 · 1 citation
- PyGlove: Symbolic Programming for Automated Machine LearningDaiyi Peng, Xuanyi Dong, Esteban Real, Mingxing Tan et al.NeurIPS 2020 · 35 citations
- Heron: Automatically Constrained High-Performance Library Generation for Deep Learning AcceleratorsJun Bi, Qi Guo, Xiaqing Li, Yongwei Zhao et al.ASPLOS 2023 · 30 citations
- Your Fix Is My Exploit: Enabling Comprehensive DL Library API Fuzzing with Large Language ModelsKunpeng Zhang, Shuai Wang, Jitao Han, Xiaogang Zhu et al.ICSE 2025 · 6 citations
