[论文解读] Bolt: Bridging the Gap between Auto-tuners and Hardware-native Performance
Bolt 通过使自动调优器能够在模板化、可配置的厂商库(如 CUTLASS)中搜索,弥合了自动调优器与硬件原生库之间的性能差距,从而实现了硬件优化的张量程序生成。它在卷积神经网络上实现了 2.5 倍的推理加速,且自动调优耗时不足 20 分钟,得益于模板化搜索、持久内核融合以及系统-模型联合设计原则。
Today's auto-tuners (e.g., AutoTVM, Ansor) generate efficient tensor programs by navigating a large search space to identify effective implementations, but they do so with opaque hardware details. Thus, their performance could fall behind that of hardware-native libraries (e.g., cuBLAS, cuDNN), which are hand-optimized by device vendors to extract high performance. On the other hand, these vendor libraries have a fixed set of supported functions and lack the customization and automation support afforded by auto-tuners. Bolt is based on the recent trend that vendor libraries are increasingly modularized and reconfigurable via declarative control (e.g., CUTLASS). It enables a novel approach that bridges this gap and achieves the best of both worlds, via hardware-native templated search. Bolt provides new opportunities to rethink end-to-end tensor optimizations at the graph, operator, and model levels. Bolt demonstrates this concept by prototyping on a popular auto-tuner in TVM and a class of widely-used platforms (i.e., NVIDIA GPUs) -- both in large deployment in our production environment. Bolt improves the inference speed of common convolutional neural networks by 2.5x on average over the state of the art, and it auto-tunes these models within 20 minutes.
研究动机与目标
- 弥合自动调优器与 cuBLAS 和 cuDNN 等硬件原生库之间的性能差距。
- 使自动调优器能够利用硬件优化的模板化库(如 CUTLASS)进行更快、更高效的搜索。
- 引入新型图级优化技术,如持久内核融合,用于连续的 GEMM 和 Conv2D 操作。
- 探索系统-模型联合设计原则,以在不损失准确率的前提下提升模型效率。
- 通过将底层硬件知识整合到搜索空间中,证明自动调优既快速又高性能。
提出的方法
- Bolt 与自动调优器(如 TVM 中的 Ansor)集成,对来自 CUTLASS 等模板化库的硬件原生模板执行搜索。
- 通过暴露厂商库的声明式参数,实现模板化搜索,使自动调优器能够在无需低级 CUDA 编码的情况下探索优化配置。
- 引入持久内核融合技术,将多个连续的 GEMM 或 Conv2D 操作融合为单个内核,提升内存带宽利用率。
- 通过向自动调优管道暴露硬件感知抽象,支持在图、算子和模型层级上的联合优化。
- 提出系统-模型联合设计原则,指导模型设计以兼容 Bolt 的优化策略,例如使用 1×1 卷积和 ReLU 类激活函数。
- 该方法在 NVIDIA GPU 上基于 CUTLASS 进行评估,结果已在生产环境中验证并开源。
实验结果
研究问题
- RQ1自动调优器是否能够通过在模板化、可配置的厂商库中操作,实现硬件原生性能?
- RQ2持久内核融合是否能够以传统融合无法实现的方式,提升 GEMM 和 Conv2D 等内存带宽受限操作的性能?
- RQ3系统-模型联合设计原则是否能够使模型在保持高准确率的同时,高效地在现代硬件上执行?
- RQ4将硬件优化的模板集成到自动调优中,是否能够缩短调优时间并同时提升性能?
- RQ5Bolt 在推理速度和调优效率方面,与最先进的自动调优器(如 Ansor)相比,其性能优势有多大?
主要发现
- Bolt 在广泛使用的卷积神经网络上,平均实现了比现有最先进方法 2.5 倍的推理性能加速。
- 使用 Bolt 的自动调优耗时不足 20 分钟,显著优于以往需数小时甚至数天的方法。
- 持久内核融合在内存带宽受限的工作负载上,使 GEMM 性能最高提升 1.3 倍,Conv2D 性能最高提升 2.0 倍。
- 通过在 RepVGG 模型中增加 1×1 卷积和 Hardswish 激活函数,Top-1 准确率提升 1.83%,同时保持相近的推理速度,证明了系统-模型联合设计的有效性。
- RepVGGAug-B0 模型实现了 77.22% 的 Top-1 准确率,推理速度达 3,842 张/秒,表明面向硬件的设计能同时提升准确率与效率。
- Bolt 已在生产环境中部署并开源,验证了其在真实工作负载中的实用性与可扩展性。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。