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.
翻译:我们为 TensorFlow 提供动态抽象解析器 ShapeFlow, 快速捕捉高压不相容错误, 这是深层学习代码中最常见的错误之一。 ShapeFlow 与 TensorFlow 共享相同的 API, 但只捕捉和释放高压形状, 其抽象域。 ShapeFlow 构建了一个自定义的形状计算图, 类似于 TensorFlow 所使用的计算图。 ShapeFlow 不需要程序员的编码说明或代码修改, 因此使用起来非常方便。 我们评估了前经验研究所收集的52个程序 ShapeFlow, 以显示它能够与 TensorFlow 相比快速和准确地捕捉到不相容错误。 我们使用两个基线: 最坏的训练数据集大小和更加现实的数据设置大小。 ShapeFlow 检测出一个非常精确的不相容错误 -- 没有虚假的正数和单一的负数 -- 并且效率很高 -- 其第一和第二基线的平均速度为 499X 和 24X 。 我们相信 ShapeFlow 是一个实用的工具, 将让机器公开学习它。 我们将打开 。