[论文解读] Hidden costs for inference with deep network on embedded system devices
该论文表明基于 MAC 的指标并不能可靠预测嵌入式推断时间,并分析在嵌入式设备上影响性能的额外张量运算,覆盖了 10 个模型。
This study evaluates the inference performance of various deep learning models under an embedded system environment. In previous works, Multiply-Accumulate operation is typically used to measure computational load of a deep model. According to this study, however, this metric has a limitation to estimate inference time on embedded devices. This paper poses the question of what aspects are overlooked when expressed in terms of Multiply-Accumulate operations. In experiments, an image classification task is performed on an embedded system device using the CIFAR-100 dataset to compare and analyze the inference times of ten deep models with the theoretically calculated Multiply-Accumulate operations for each model. The results highlight the importance of considering additional computations between tensors when optimizing deep learning models for real-time performing in embedded systems.
研究动机与目标
- 评估模型复杂度(参数量和 MACs)与嵌入式系统实际推断时间之间的关系。
- 识别在 MACs 之外对运行时占主导地位的推断组成部分。
- 评估不同架构在资源受限硬件上的实时性能差异。
- 提出在嵌入式部署中优化深度模型的设计考虑。
提出的方法
- 在 CIFAR-100 上评估 10 种 CNN 模型(VGG16、InceptionV3、InceptionV4、ResNet50、SeResNet50、Xception、MobileNet、MobileNetV2、ShuffleNet、ShuffleNetV2)。
- 在四核 64 位嵌入式设备(1.5–1.8 GHz)、8 GB RAM 的环境下测量推断时间。
- 使用 thop.profile 计算 MACs,并使用 torch.profile 测量实际推断时间。
- 分析 Conv2D、BatchNorm、ReLU、Concat 和 Add 对总推断时间的贡献。
- 将 Conv2D 分解为子操作(卷积、切片、窄化、空、视图),并比较各模型的运行时。

实验结果
研究问题
- RQ1MACs 与参数量是否与嵌入式设备的实际推断时间相关?
- RQ2除了 MACs 外,推断管线中哪些组件对运行时贡献最大?
- RQ3不同模型架构在嵌入式硬件上对意外张量运算开销有何差异?
- RQ4除了降低 MACs 之外的设计选择,是否能带来更好 的嵌入式系统实时性能?
主要发现
- 推断时间与 MACs 或参数量在各模型之间并不相关。
- Conv2D 操作在某些模型中占主导时间(>70%),但张量运算如切片、窄化和内存分配在其他模型(如 Xception)中可能成为主导。
- 某些模型(如 Xception)的 MACs 较低,但推断时间较长,是由于非卷积张量运算的开销较高。
- BN、ReLU、Concat 和 Add 在运行时的综合贡献显著,这些并未包含在 MAC 计算中。
- 在资源受限的嵌入式设备上,张量运算开销对性能的影响显著高于高端服务器。

阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。