[论文解读] Analysis of Failures and Risks in Deep Learning Model Converters: A Case Study in the ONNX Ecosystem
本文首次对 ONNX 生态系统中的深度学习模型转换器进行了故障分析,研究了 PyTorch 和 TensorFlow 转换器中的崩溃和错误行为。研究发现节点转换是主要的故障来源(占缺陷的 75%),揭示了单个算子难以准确预测故障,同时暴露了当前测试策略的薄弱环节,主张通过合成模型测试和稳定算子集来提升转换器的鲁棒性和可维护性。
Software engineers develop, fine-tune, and deploy deep learning (DL) models using a variety of development frameworks and runtime environments. DL model converters move models between frameworks and to runtime environments. Conversion errors compromise model quality and disrupt deployment. However, the failure characteristics of DL model converters are unknown, adding risk when using DL interoperability technologies. This paper analyzes failures in DL model converters. We survey software engineers about DL interoperability tools, use cases, and pain points (N=92). Then, we characterize failures in model converters associated with the main interoperability tool, ONNX (N=200 issues in PyTorch and TensorFlow). Finally, we formulate and test two hypotheses about structural causes for the failures we studied. We find that the node conversion stage of a model converter accounts for ~75% of the defects and 33% of reported failure are related to semantically incorrect models. The cause of semantically incorrect models is elusive, but models with behaviour inconsistencies share operator sequences. Our results motivate future research on making DL interoperability software simpler to maintain, extend, and validate. Research into behavioural tolerances and architectural coverage metrics could be fruitful.
研究动机与目标
- 理解 ONNX 模型转换器在 PyTorch 和 TensorFlow 中的故障症状、原因和发生位置。
- 通过测试 5,149 个真实和合成模型,评估模型转换器失败的原因。
- 评估当前测试策略在模型转换器中的有效性,并识别其缺陷。
- 探究算子类型或算子序列是否与转换器故障相关。
- 提出改进深度学习互操作性工具鲁棒性、可维护性和验证能力的方案。
提出的方法
- 对来自 PyTorch 和 TensorFlow ONNX 转换器的 200 个已关闭的 GitHub 问题进行故障分析,以分类故障症状、原因和发生位置。
- 测试了 5,149 个模型(包括真实世界模型和使用 NNSmith 生成的合成模型),以衡量转换器的可靠性并检测缺陷。
- 应用故障原因与症状的联合分布分析,识别跨转换器的故障模式。
- 测试两个假设:(1) 算子类型可预测故障,(2) 算子序列与故障相关,通过分析不匹配模型序列的频率来验证。
- 审查现有测试套件,发现其严重依赖真实模型且缺乏对合成模型的覆盖,暴露了关键的测试盲区。
- 提出一个小型稳定算子集作为潜在替代方案,以减少转换错误,其设计灵感来自 RISC 和 JVM 的设计原则。
实验结果
研究问题
- RQ1ONNX 模型转换器在 PyTorch 和 TensorFlow 中最常见的故障症状、原因和发生位置是什么?
- RQ2模型转换器为何会失败?是否存在某些算子或算子序列更容易导致故障?
- RQ3当前测试套件在检测转换器缺陷方面的有效性如何?其主要局限性是什么?
- RQ4一个小型稳定算子集是否能减少转换错误并提升模型转换器的可维护性?
主要发现
- 节点转换导致了约 75% 的所有已识别缺陷,是转换器中最易出错的阶段。
- 最常见的故障症状为崩溃(28%)和模型行为错误(36%),其中类型问题和不兼容性是最主要的原因。
- 崩溃主要由不兼容性和类型问题引起,而行为错误则源于类型问题、算法错误和张量形状不匹配。
- 研究未发现单个算子与故障概率之间存在显著相关性,但观察到算子序列可能存在潜在关联,提示存在复杂的交互效应。
- 在发现的 11 个缺陷中,有 5 个此前未知,凸显了现有测试套件的局限性——它们依赖真实模型且缺乏对合成模型的覆盖。
- 当前的端到端测试策略不足,因其仅检查少量真实模型且完全未涉及合成模型,因而遗漏了合成生成可暴露的关键故障模式。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。