HARP: Holistic Analysis for Refactoring Python-Based Analytics Programs

HARP: Holistic Analysis for Refactoring Python-Based Analytics Programs
复制标题

DOI:
10.1145/3377811.3380434
复制
发表时间:
2020-06
期刊:
2020 IEEE/ACM 42nd International Conference on Software Engineering (ICSE)
影响因子:
--
通讯作者:
Weijie Zhou;Yue Zhao;Guoqiang Zhang;Xipeng Shen
Weijie Zhou;Yue Zhao;Guoqiang Zhang;Xipeng Shen
中科院分区:
其他
文献类型:
--
作者:
Weijie Zhou;Yue Zhao;Guoqiang Zhang;Xipeng Shen

文献摘要

相似文献

现代机器学习程序通常用Python编写,主要计算通过调用一些高度优化的库(例如,TensorFlow、PyTorch)。如何最大限度地提高这些程序的计算效率对于许多应用领域来说是至关重要的,这引起了人们的广泛关注。这项工作指出了现有工作中的一个共同局限性:他们只关注库API指定的静态计算图,但在很大程度上没有考虑托管Python代码的影响。这种限制往往会导致他们错过大局,从而错过许多重要的优化机会。这项工作提出了一种新的方法命名为HARP来解决这个问题。HARP支持跨计算图及其托管Python代码的整体分析。HARP通过一组新颖的技术实现了这一点:分析意识的推测分析,以规避Python的复杂性,一个统一的表示增强计算图,以捕获与整体分析相关的知识的所有维度,以及有条件的反馈机制,以允许风险控制的积极分析。基于HARP的重构在一组TensorFlow和PyTorch程序上提供了1.3- 3倍和2.07倍的平均加速。
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.