Towards Safe Automated Refactoring of Imperative Deep Learning Programs to Graph Execution
Raffi Khatchadourian, Tatiana Castro V\'elez, Mehdi Bagherzadeh, Nan, Jia, Anita Raja

TL;DR
This paper introduces an automated refactoring approach that helps developers convert imperative deep learning code to graph execution safely and efficiently, improving performance while preserving semantics.
Contribution
It presents a novel tensor analysis for imperative DL code and a refactoring method to determine when and how to safely migrate code to graph execution.
Findings
Refactoring preconditions can identify safe migration points.
The approach uses a tensor analysis tailored for imperative DL code.
Implementation as a PyDev plugin demonstrates practical applicability.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsMachine Learning in Materials Science · Parallel Computing and Optimization Techniques · Software System Performance and Reliability
