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分析框架。我们讨论了在优化命令式深度学习代码以充分发挥其潜力方面的持续工作。