vix.ing · top · new · best · stats · spec

ShapeFlow: Dynamic Shape Interpreter for TensorFlow

2020/11/26 by Sahil Verma, Zhendong Su, Verma, Sahil +1
Computer Science · Mathematics · #Adversarial Robustness in Machine Learning #Annotation #Artificial intelligence #Baseline (sea) #Code (set theory) #Computer science #Deep learning #Domain (mathematical analysis) #FOS: Computer and information sciences #False positive paradox #Graph #Interpreter #Machine Learning (cs.LG) #Machine learning #Mathematics #Natural language processing #Programmer #Programming language #Software Engineering (cs.SE) #Software Engineering Research #Software Testing and Debugging Techniques #Source code #Theoretical computer science #cs.LG #cs.SE

paper · pdf · doi:10.48550/arxiv.2011.13452

14 pages, 9 figures. Work done about one and half year before the submission to Arxiv

arxiv created 2020/11/26 · openalex publication_date 2020/11/26 · arxiv updated 2020/11/30 · openalex created_date 2025/10/10 · openalex updated_date 2026/07/28

Abstract

We present ShapeFlow, a dynamic abstract interpreter for TensorFlow which quickly catches tensor shape incompatibility errors, one of the most common bugs in deep learning code. ShapeFlow shares the same APIs as TensorFlow but only captures and emits tensor shapes, its abstract domain. ShapeFlow constructs a custom shape computational graph, similar to the computational graph used by TensorFlow. ShapeFlow requires no code annotation or code modification by the programmer, and therefore is convenient to use. We evaluate ShapeFlow on 52 programs collected by prior empirical studies to show how fast and accurately it can catch shape incompatibility errors compared to TensorFlow. We use two baselines: a worst-case training dataset size and a more realistic dataset size. ShapeFlow detects shape incompatibility errors highly accurately -- with no false positives and a single false negative -- and highly efficiently -- with an average speed-up of 499X and 24X for the first and second baseline, respectively. We believe ShapeFlow is a practical tool that benefits machine learning developers. We will open-source ShapeFlow on GitHub to make it publicly available to both the developer and research communities.

Citations

Related