Efficiency is essential to support responsiveness w.r.t. ever-growing datasets, especially for Deep Learning (DL) systems. DL frameworks have traditionally embraced deferred execution-style DL code -- supporting symbolic, graph-based Deep Neural Network (DNN) computation. While scalable, such development tends to produce code that is error-prone, non-intuitive, and difficult to debug. Consequently, more natural, less error-prone imperative DL frameworks encouraging eager execution have emerged at the expense of run-time performance. Though hybrid approaches aim for the "best of both worlds," using them effectively requires subtle considerations to make code amenable to safe, accurate, and efficient graph execution -- avoiding performance bottlenecks and semantically inequivalent results. We present our ongoing work on an automated refactoring approach that assists developers in specifying whether and how their otherwise eagerly-executed imperative DL code could be reliably and efficiently executed as graphs at run-time in a semantics-preserving fashion. The approach, based on a novel tensor analysis specifically for imperative DL code, consists of refactoring preconditions for automatically determining when it is safe and potentially advantageous to migrate imperative DL code to graph execution and modifying decorator parameters or eagerly executing code already running as graphs. The approach is being implemented as a PyDev Eclipse IDE plug-in and uses the WALA Ariadne analysis framework. We discuss our ongoing work towards optimizing imperative DL code to its full potential.
翻译:效率对于支持应对不断增长的数据集的响应能力至关重要,尤其是在深度学习系统中。传统深度学习框架通常采用延迟执行风格的代码,支持基于符号的图式深度神经网络计算。尽管这种开发方式具有可扩展性,但生成的代码容易出错、不够直观且难以调试。因此,更自然、不易出错的命令式深度学习框架(鼓励即时执行)应运而生,但代价是运行时性能下降。尽管混合方法旨在实现"两全其美",但有效使用它们需要细致考量,以确保代码能够安全、准确且高效地适应图执行——避免性能瓶颈和语义不等价的结果。我们提出了正在进行的自动化重构方法研究,该方法帮助开发者指定其原本即时执行的命令式深度学习代码是否以及如何以保留语义的方式在运行时可靠且高效地以图形式执行。该方法基于专为命令式深度学习代码设计的新型张量分析,包括重构前置条件,用于自动确定何时将命令式深度学习代码迁移至图执行是安全且可能有益的,并修改装饰器参数或调整已在图模式下执行的代码。该方案正作为PyDev Eclipse IDE插件实现,并使用WALA Ariadne分析框架。我们讨论了在充分优化命令式深度学习代码性能方面的持续工作进展。