[论文解读] A Unified Optimization Approach for CNN Model Inference on Integrated GPUs
本文提出了一种统一的优化框架,用于在各类边缘设备的集成GPU上实现高效CNN推理。该框架采用领域特定的中间表示(IR)和基于机器学习的调度机制,加速视觉专用算子的执行,在支持更广模型覆盖范围的同时,还能回退至CPU以确保兼容性,相较于厂商优化库最高可实现1.62倍的性能提升。
Modern deep learning applications urge to push the model inference taking place at the edge devices for multiple reasons such as achieving shorter latency, relieving the burden of the network connecting to the cloud, and protecting user privacy. The Convolutional Neural Network (\emph{CNN}) is one of the most widely used model family in the applications. Given the high computational complexity of the CNN models, it is favorable to execute them on the integrated GPUs at the edge devices, which are ubiquitous and have more power and better energy efficiency than the accompanying CPUs. However, programming on integrated GPUs efficiently is challenging due to the variety of their architectures and programming interfaces. This paper proposes an end-to-end solution to execute CNN model inference on the integrated GPUs at the edge, which uses a unified IR to represent and optimize vision-specific operators on integrated GPUs from multiple vendors, as well as leverages machine learning-based scheduling search schemes to optimize computationally-intensive operators like convolution. Our solution even provides a fallback mechanism for operators not suitable or convenient to run on GPUs. The evaluation results suggest that compared to state-of-the-art solutions backed up by the vendor-provided high-performance libraries on Intel Graphics, ARM Mali GPU, and Nvidia integrated Maxwell GPU, our solution achieves similar, or even better (up to 1.62$ imes$), performance on a number of popular image classification and object detection models. In addition, our solution has a wider model coverage and is more flexible to embrace new models. Our solution has been adopted in production services in AWS and is open-sourced.
研究动机与目标
- 为解决由于架构异构性及缺乏可移植优化而导致的边缘设备中集成GPU上GPU推理效率低下且不可移植的问题。
- 实现在集成GPU上对视觉专用算子(此前常因未充分优化或被卸载至CPU)的高性能执行。
- 通过自动化跨多种SoC平台的性能调优,减少开发者的负担,避免手动低级内核调优。
- 为不适合GPU执行的算子提供回退机制,确保广泛的模型兼容性。
- 在保持模型可移植性和可扩展性的前提下,实现与厂商优化库相当或更优的性能。
提出的方法
- 一种统一的中间表示(IR)抽象了视觉专用算子,并支持在不同GPU厂商的CUDA和OpenCL之间生成代码。
- 在图级和张量级均应用基于机器学习的调度,以搜索最优执行计划,从而减少手动调优的工作量。
- 框架对控制密集型算子(如NMS和ROIAlign)进行了专门优化,这些算子通常在GPU上效率低下。
- 当算子不支持或性能不佳时,回退机制会将其路由至同一SoC上的CPU,以确保兼容性和性能。
- 该系统基于受Halide启发的编译器式流水线构建,并扩展以处理集成GPU的独特特性。
- 通过强化学习或贝叶斯优化自动进行性能调优,以探索高效的线程和内存布局。
实验结果
研究问题
- RQ1如何在异构架构的集成GPU上高效执行具有复杂控制逻辑的视觉专用算子?
- RQ2统一的IR与自动化调度策略是否能在多种集成GPU上实现与厂商优化库相当的性能?
- RQ3自动化、基于机器学习的调度对边缘CNN推理中的推理延迟和能效有何影响?
- RQ4统一框架如何在支持多种SoC平台的同时,保持对广泛流行CNN模型的高性能?
- RQ5在不牺牲整体性能的前提下,CPU回退能在多大程度上提升模型覆盖率和部署灵活性?
主要发现
- 所提出的框架在英特尔、ARM和NVIDIA的集成GPU上,相较于厂商优化库(如cuDNN、ACL、clDNN),最高可实现1.62倍的性能提升。
- 在多种图像分类和目标检测模型(包括ResNet、SSD和YOLO)上,性能与当前最先进方案相当或更优。
- 与现有方案相比,该框架支持更广泛的模型,包括以往常被卸载至CPU的视觉专用算子(如NMS和ROIAlign)。
- 基于机器学习的调度显著减少了对手动调优的依赖,实现了在多种边缘平台上的快速部署。
- 回退机制确保即使在GPU加速不可行时,所有算子也能被高效执行,从而增强了模型的可移植性。
- 该解决方案已在AWS生产环境中部署,并已开源,证明了其在实际应用中的可行性与可扩展性。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。