Ehsan Aghapour, Dolly Sapra, A. Pimentel, A. Pathania
{"title":"CPU-GPU Layer-Switched Low Latency CNN Inference","authors":"Ehsan Aghapour, Dolly Sapra, A. Pimentel, A. Pathania","doi":"10.1109/DSD57027.2022.00051","DOIUrl":null,"url":null,"abstract":"Convolutional Neural Networks (CNNs) inference on Heterogeneous Multi-Processor System-on-Chips (HMPSoCs) in edge devices represent cutting-edge embedded machine learning. Embedded CPU and GPU within an HMPSoC can both perform inference using CNNs. However, common practice is to run a CNN on the HMPSoC component (CPU or GPU) provides the best performance (lowest latency) for that CNN. CNNs are not monolithic and are composed of several layers of different types. Some of these layers have lower latency on the CPU, while others execute faster on the GPU. In this work, we investigate the reason behind this observation. We also propose an execution of CNN that switches between CPU and GPU at the layer granularity, wherein a CNN layer executes on the component that provides it with the lowest latency. Switching between the CPU and the GPU back and forth mid-inference introduces additional overhead (delay) in the inference. Regardless of overhead, we show in this work that a CPU-GPU layer switched execution results in, on average, having 4.72% lower CNN inference latency on the Khadas VIM 3 board with Amlogic A311D HMPSoC.","PeriodicalId":211723,"journal":{"name":"2022 25th Euromicro Conference on Digital System Design (DSD)","volume":"20 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2022-08-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"5","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2022 25th Euromicro Conference on Digital System Design (DSD)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/DSD57027.2022.00051","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 5
Abstract
Convolutional Neural Networks (CNNs) inference on Heterogeneous Multi-Processor System-on-Chips (HMPSoCs) in edge devices represent cutting-edge embedded machine learning. Embedded CPU and GPU within an HMPSoC can both perform inference using CNNs. However, common practice is to run a CNN on the HMPSoC component (CPU or GPU) provides the best performance (lowest latency) for that CNN. CNNs are not monolithic and are composed of several layers of different types. Some of these layers have lower latency on the CPU, while others execute faster on the GPU. In this work, we investigate the reason behind this observation. We also propose an execution of CNN that switches between CPU and GPU at the layer granularity, wherein a CNN layer executes on the component that provides it with the lowest latency. Switching between the CPU and the GPU back and forth mid-inference introduces additional overhead (delay) in the inference. Regardless of overhead, we show in this work that a CPU-GPU layer switched execution results in, on average, having 4.72% lower CNN inference latency on the Khadas VIM 3 board with Amlogic A311D HMPSoC.
卷积神经网络(cnn)在边缘设备异构多处理器片上系统(hmpsoc)上的推理代表了嵌入式机器学习的前沿。HMPSoC内的嵌入式CPU和GPU都可以使用cnn进行推理。然而,通常的做法是在HMPSoC组件(CPU或GPU)上运行CNN,为该CNN提供最佳性能(最低延迟)。cnn不是一个整体,它是由不同类型的多层组成的。其中一些层在CPU上的延迟较低,而另一些层在GPU上的执行速度更快。在这项工作中,我们调查了这一观察背后的原因。我们还提出了一种在层粒度上在CPU和GPU之间切换的CNN执行,其中CNN层在提供最低延迟的组件上执行。在推理过程中在CPU和GPU之间来回切换会在推理过程中引入额外的开销(延迟)。无论开销如何,我们在这项工作中表明,CPU-GPU层切换执行导致在具有Amlogic A311D HMPSoC的Khadas VIM 3板上平均降低4.72%的CNN推理延迟。