用差异测试发现ONNX优化器9.2%的模型会崩溃或出错。
DiTOX: Fault Detection and Localization in the ONNX Optimizer
- 通过差异测试对比原模型与优化后模型行为,自动检测异常
- 在130个模型中发现30%分类模型输出不一致,16.6%目标检测模型出错
- 可定位问题优化模块,适用于其他编译器优化器,适合工具开发者
ONNX Optimizer 是官方 ONNX 库中广泛使用的图级模型优化工具,默认用于优化 ONNX 模型。尽管应用广泛,其对模型正确性的保障尚未系统评估。本文提出 DiTOX,一种基于差异测试、故障定位和泛化评估技术的自动化框架,用于全面验证 ONNX Optimizer 的正确性。DiTOX 对 ONNX Model Hub 中 130 个涵盖视觉与语言任务的模型执行优化流程,在用户定义输入下运行原始与优化版本,并检测行为偏差或优化器失败。当发现差异时,通过迭代细粒度分析定位具体导致问题的优化步骤。实验显示,9.2%的模型实例在默认设置下出现优化器崩溃或生成无效模型;30%的分类模型、16.6%的目标检测与分割模型存在输出差异,而文本类模型整体稳健。共发现 15 个问题(14 个此前未知),影响 9 个共 47 个优化模块及优化器基础设施。所有问题均已报告给 ONNX Optimizer 开发团队。结果表明,DiTOX 提供了一种简单有效的模型优化器验证方法,且易于扩展至其他编译器优化器。
原文摘要 · Abstract (English)
The ONNX Optimizer, part of the official ONNX repository and widely adopted for graph-level model optimizations, is used by default to optimize ONNX models. Despite its popularity, its ability to preserve model correctness has not been systematically evaluated. We present DiTOX, an automated framework for comprehensively assessing the correctness of the ONNX Optimizer using differential testing, fault localization, and evaluation techniques that generalize to other compiler optimizers. DiTOX applies optimization passes to a corpus of ONNX models, executes both original and optimized versions on user-defined inputs, and detects discrepancies in behavior or optimizer failures. When divergences are observed, DiTOX isolates the responsible optimization pass through iterative, fine-grained analysis. We evaluated DiTOX on 130 models from the ONNX Model Hub spanning vision and language tasks. We found that 9.2% of model instances crashed the optimizer or produced invalid models under default settings. Moreover, output discrepancies occurred in 30% of classification models and 16.6% of object detection and segmentation models, while text-based models were largely robust. Overall, DiTOX uncovered 15 issues -- 14 previously unknown -- affecting 9 of the 47 optimization passes as well as the optimizer infrastructure. All issues were reported to the ONNX Optimizer developers. Our results demonstrate that DiTOX provides a simple and effective approach for validating AI model optimizers and is readily extensible beyond ONNX.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。