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 that supports symbolic, graph-based Deep Neural Network (DNN) computation. While scalable, such development tends to produce DL 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 but at the expense of run-time performance. While hybrid approaches aim for the "best of both worlds," the challenges in applying them in the real world are largely unknown. We conduct a data-driven analysis of challenges -- and resultant bugs -- involved in writing reliable yet performant imperative DL code by studying 250 open-source projects, consisting of 19.7 MLOC, along with 470 and 446 manually examined code patches and bug reports, respectively. The results indicate that hybridization: (i) is prone to API misuse, (ii) can result in performance degradation -- the opposite of its intention, and (iii) has limited application due to execution mode incompatibility. We put forth several recommendations, best practices, and anti-patterns for effectively hybridizing imperative DL code, potentially benefiting DL practitioners, API designers, tool developers, and educators.
翻译:效率对于支持反应能力(r.t.t.t.)不断增长的数据集至关重要。DL框架历来采用推迟执行式的DL代码,支持象征性的、基于图形的深神经网络(DNN)计算。虽然可以推广,但这种开发往往产生易出错、非直观和难以调试的DL代码。因此,出现了更自然、更不易出错的鼓励急迫执行的DL紧急框架,但牺牲了运行时的性能。混合方法的目的是“两个世界的最佳,”在现实世界中应用它们的挑战基本上未知。我们对挑战 -- -- 和由此产生的错误 -- -- 进行数据驱动分析,通过研究250个公开源项目(分别由19.7 MLOC和470和446人工审查的代码补丁和错误报告),参与编写可靠但必须履行的DL代码。结果表明,混合方法:(一) 容易被滥用,(二) 可能导致业绩退化 -- -- 与其意图相反,我们在现实世界中采用的挑战 -- -- 以及由此产生的错误 -- -- 参与最佳做法 -- -- 限制了执行模式。