Towards Safe Automated Refactoring of Imperative Deep Learning Programs
to Graph Execution
- URL: http://arxiv.org/abs/2308.11785v2
- Date: Tue, 10 Oct 2023 18:12:18 GMT
- Title: Towards Safe Automated Refactoring of Imperative Deep Learning Programs
to Graph Execution
- Authors: Raffi Khatchadourian, Tatiana Castro V\'elez, Mehdi Bagherzadeh, Nan
Jia, Anita Raja
- Abstract summary: More natural, less error-prone imperative DL frameworks encouraging eager execution have emerged at the expense of run-time performance.
We present our ongoing work on an automated approach that assists developers in specifying whether and how their otherwise imperative DL code could be reliably and efficiently executed as graphs.
The approach is being implemented as a PyDev Eclipse plug-in and uses the WALA Ariadne analysis framework.
- Score: 4.786072763033669
- License: http://creativecommons.org/licenses/by-nc-sa/4.0/
- 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 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.
Related papers
- COrAL: Order-Agnostic Language Modeling for Efficient Iterative Refinement [80.18490952057125]
Iterative refinement has emerged as an effective paradigm for enhancing the capabilities of large language models (LLMs) on complex tasks.
We propose Context-Wise Order-Agnostic Language Modeling (COrAL) to overcome these challenges.
Our approach models multiple token dependencies within manageable context windows, enabling the model to perform iterative refinement internally.
arXiv Detail & Related papers (2024-10-12T23:56:19Z) - Learning to Predict Program Execution by Modeling Dynamic Dependency on Code Graphs [11.347234752942684]
This paper introduces a novel machine learning-based framework called CodeFlow to predict code coverage and detect runtime errors.
CodeFlow represents all possible execution paths and the relationships between different statements.
It learns dynamic dependencies through execution traces, which reflect the impacts among statements during execution.
arXiv Detail & Related papers (2024-08-05T20:32:00Z) - Can Graph Learning Improve Planning in LLM-based Agents? [61.47027387839096]
Task planning in language agents is emerging as an important research topic alongside the development of large language models (LLMs)
In this paper, we explore graph learning-based methods for task planning, a direction that is to the prevalent focus on prompt design.
Our interest in graph learning stems from a theoretical discovery: the biases of attention and auto-regressive loss impede LLMs' ability to effectively navigate decision-making on graphs.
arXiv Detail & Related papers (2024-05-29T14:26:24Z) - TRACED: Execution-aware Pre-training for Source Code [24.101763959136058]
We introduce TRACED, an execution-aware pre-training strategy for source code.
Our goal is to teach code models the complicated execution logic during the pre-training, enabling the model to statically estimate the dynamic code properties.
TRACED relatively improves the statically pre-trained code models by 12.4% for complete execution path prediction and by 25.2% for runtime variable value predictions.
arXiv Detail & Related papers (2023-06-13T01:30:14Z) - CONCORD: Clone-aware Contrastive Learning for Source Code [64.51161487524436]
Self-supervised pre-training has gained traction for learning generic code representations valuable for many downstream SE tasks.
We argue that it is also essential to factor in how developers code day-to-day for general-purpose representation learning.
In particular, we propose CONCORD, a self-supervised, contrastive learning strategy to place benign clones closer in the representation space while moving deviants further apart.
arXiv Detail & Related papers (2023-06-05T20:39:08Z) - ReACC: A Retrieval-Augmented Code Completion Framework [53.49707123661763]
We propose a retrieval-augmented code completion framework, leveraging both lexical copying and referring to code with similar semantics by retrieval.
We evaluate our approach in the code completion task in Python and Java programming languages, achieving a state-of-the-art performance on CodeXGLUE benchmark.
arXiv Detail & Related papers (2022-03-15T08:25:08Z) - Challenges in Migrating Imperative Deep Learning Programs to Graph
Execution: An Empirical Study [4.415977307120617]
We conduct a data-driven analysis of challenges -- and resultant bugs -- involved in writing reliable yet performant imperative DL code.
We put forth several recommendations, best practices, and anti-patterns for effectively hybridizing imperative DL code.
arXiv Detail & Related papers (2022-01-24T21:12:38Z) - Terra: Imperative-Symbolic Co-Execution of Imperative Deep Learning
Programs [7.656446581986389]
Imperative programming allows users to implement their deep neural networks (DNNs) easily.
Several systems have been proposed to combine the usability of imperative programming with the optimized performance of symbolic graph execution.
We propose Terra, an imperative-symbolic co-execution system that can handle any imperative DL programs while achieving the optimized performance of symbolic graph execution.
arXiv Detail & Related papers (2022-01-23T09:04:48Z) - Software Vulnerability Detection via Deep Learning over Disaggregated
Code Graph Representation [57.92972327649165]
This work explores a deep learning approach to automatically learn the insecure patterns from code corpora.
Because code naturally admits graph structures with parsing, we develop a novel graph neural network (GNN) to exploit both the semantic context and structural regularity of a program.
arXiv Detail & Related papers (2021-09-07T21:24:36Z) - PolyDL: Polyhedral Optimizations for Creation of High Performance DL
primitives [55.79741270235602]
We present compiler algorithms to automatically generate high performance implementations of Deep Learning primitives.
We develop novel data reuse analysis algorithms using the polyhedral model.
We also show that such a hybrid compiler plus a minimal library-use approach results in state-of-the-art performance.
arXiv Detail & Related papers (2020-06-02T06:44:09Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.