[论文解读] pCAMP: Performance Comparison of Machine Learning Packages on the Edges
本文在若干边缘设备上对 TensorFlow, Caffe2, MXNet, PyTorch, 和 TensorFlow Lite 进行边缘推理比较,使用 AlexNet 与 SqueezeNet,评估延迟、内存占用和能耗。
Machine learning has changed the computing paradigm. Products today are built with machine intelligence as a central attribute, and consumers are beginning to expect near-human interaction with the appliances they use. However, much of the deep learning revolution has been limited to the cloud. Recently, several machine learning packages based on edge devices have been announced which aim to offload the computing to the edges. However, little research has been done to evaluate these packages on the edges, making it difficult for end users to select an appropriate pair of software and hardware. In this paper, we make a performance comparison of several state-of-the-art machine learning packages on the edges, including TensorFlow, Caffe2, MXNet, PyTorch, and TensorFlow Lite. We focus on evaluating the latency, memory footprint, and energy of these tools with two popular types of neural networks on different edge devices. This evaluation not only provides a reference to select appropriate combinations of hardware and software packages for end users but also points out possible future directions to optimize packages for developers.
研究动机与目标
- 在训练在云端、推理在边缘进行的场景中,推动对边缘设备上 ML 包的评估。
- 量化多种边缘硬件上代表性 CNN 模型的延迟、内存使用和能耗。
- 识别在不同硬件组合下各包的优势与权衡,为包与硬件的搭配提供指导。
提出的方法
- 评估五种 ML 包(TensorFlow、Caffe2、MXNet、PyTorch、TensorFlow Lite)的边缘推理。
- 使用来自官方模型库的预训练 AlexNet(大规模)与 SqueezeNet(小规模)模型。
- 在 MacBook Pro、Intel FogNode、NVIDIA Jetson TX2、Raspberry Pi 和 Nexus 6P 上进行 CPU/GPU 配置的测试。
- 测量推理时间、总时间、内存占用和能耗。
- 通过将推理分解为七个组件(加载模型、加载图像、推理等)来绘制时间分布。
- 通过使用公开可获取的预训练模型并报告能量计算所需的基线功率来确保公平性。
实验结果
研究问题
- RQ1在不同边缘硬件上,哪些 ML 包在大规模和小规模 CNN 上提供最佳推理延迟?
- RQ2在边缘设备上,不同包的内存占用和能耗如何比较?
- RQ3是否存在显著的取舍(时间 vs. 空间),以指导在给定设备和模型下选择合适的包?
- RQ4模型加载时间是否主导边缘设备的总推理时间,以及这在不同包与硬件下如何变化?
主要发现
- 没有任何一个包在所有硬件和模型上占据统治地位;每个包在不同的平台上各具优点。
- 加载模型通常比实际运行模型耗时更长,这表明存在潜在的优化机会。
- MXNet 在某些 GPU(如 Jetson TX2)上经常表现出色,能够用较少的内存换取更快的推理;而 TensorFlow 在 FogNode 上对 CPU 基的大模型可能更快,但内存占用较高。
- Caffe2 在某些平台上往往具有较高能效,但在某些配置下(例如 FogNode 上的 AlexNet)延迟可能更高。
- TensorFlow Lite 在小型设备(Nexus 6P)上实现就地推理,资源需求显著降低,尽管模型可用性有限(此处为 MobileNet)。
- 总体而言,MXNet、TensorFlow、PyTorch 与 Caffe2 在不同的硬件/模型组合下各有优势,强调需要将硬件与合适的推理包配对以实现边缘推理。
- 洞察:在测试配置中,延迟与能耗呈正相关。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。