Deep Learning (DL) compilers are widely adopted to optimize advanced DL models for efficient deployment at diverse hardware. However, the optimization of high-level intermediate representation (IR) is found to be error-prone. Testing the implementation of high-level optimization is challenging. First, generating high-level IRs that conform to the integrity constraints required by high-level optimization is non-trivial. Non-conforming IRs are readily rejected by DL compilers before entering the optimization stage, and therefore these IRs are not useful to detect bugs at the stage. Second, it is challenging to expose high-level optimization bugs that does not result in crashes. To address the challenges, we propose HIRFuzz, a fuzzing technique that aims to reveal bugs occurring at the optimization of high-level IR in DL compilers. HIRFuzz generates computational graphs, which are then converted to their underlying high-level IRs for optimization. To reveal high-level optimization bugs, the computational graphs are so generated to explore possible combinations of data types, tensor shapes and operators while conforming to the IR's integrity constraints. In addition, novel test oracles are designed to detect bugs occurring at high-level optimization. HIRFuzz has successfully detected 24 new high-level optimization bugs that occur at TVM, with 19 bugs confirmed and 14 fixed. Furthermore, our experiment results show that HIRFuzz outperforms the state-of-the-art DL compiler fuzzers that can cover high-level optimization stage. Specifically, HIRFuzz found 12 more bugs than the second best fuzzer within the same time budget.
翻译:深度学习( DL) 编译器被广泛采用, 优化高级 DL 模型, 以在各种硬件中高效部署。 然而, 高级中级代表( IR) 的优化被认为容易出错。 测试高层次优化的实施具有挑战性。 首先, 生成符合高层次优化所要求的完整性限制的高级 IR 是非三角的。 不兼容的 IR 在进入优化阶段之前很容易被 DL 编译器拒绝, 因此这些 IR 无法在阶段中检测错误。 其次, 暴露不导致崩溃的高层次优化错误( IR) 具有挑战性。 为了应对挑战, 我们建议 HIRFu, 这是一种模糊的技术, 目的是揭示高层次 IR 优化所需的高层次 IR 的错误。 HIRF 生成相同的计算图, 然后转换为新的高层次的 IRRF 。 计算图表可以用来探索高层次数据类型、 沙压形状和操作者在高层次上测试高层次的IRF 。 在更新的 RF 中, 发现, 最高级的 RF 正在测试高层次的 RBR 。