Skip to main content
QUICK REVIEW

[论文解读] ML-EXray: Visibility into ML Deployment on the Edge

Hang Qiu, Ioanna Vavelidou|arXiv (Cornell University)|Nov 8, 2021
Advanced Neural Network Applications参考文献 32被引用 4
一句话总结

ML-EXray 是一个用于云到边缘部署验证的框架,通过插桩模型执行、通过参考流水线重放输入并对比输出与延迟,提供对边缘设备上机器学习推理的逐层可见性。它使开发者能够以少于15行代码检测和调试诸如预处理错误、量化误差和次优内核等问题,将模型准确率提升高达30%,并将内核延迟降低两个数量级。

ABSTRACT

Benefiting from expanding cloud infrastructure, deep neural networks (DNNs) today have increasingly high performance when trained in the cloud. Researchers spend months of effort competing for an extra few percentage points of model accuracy. However, when these models are actually deployed on edge devices in practice, very often, the performance can abruptly drop over 10% without obvious reasons. The key challenge is that there is not much visibility into ML inference execution on edge devices, and very little awareness of potential issues during the edge deployment process. We present ML-EXray, an end-to-end framework, which provides visibility into layer-level details of the ML execution, and helps developers analyze and debug cloud-to-edge deployment issues. More often than not, the reason for sub-optimal edge performance does not only lie in the model itself, but every operation throughout the data flow and the deployment process. Evaluations show that ML-EXray can effectively catch deployment issues, such as pre-processing bugs, quantization issues, suboptimal kernels, etc. Using ML-EXray, users need to write less than 15 lines of code to fully examine the edge deployment pipeline. Eradicating these issues, ML-EXray can correct model performance by up to 30%, pinpoint error-prone layers, and guide users to optimize kernel execution latency by two orders of magnitude. Code and APIs will be released as an open-source multi-lingual instrumentation library and a Python deployment validation library.

研究动机与目标

  • 解决云到边缘机器学习部署过程中存在的关键可见性缺口,因为性能下降超过10%的情况经常发生且无明确根本原因。
  • 弥合基于云的模型训练与边缘部署之间的脱节,使开发者能够追踪并调试整个推理流水线中的问题。
  • 提供系统化、插桩化的检测与诊断方法,以识别和排查跨多种边缘硬件的部署问题,如错误的预处理、量化错误和低效的内核执行。
  • 通过提供实际与参考模型执行之间的逐层对比,将调试时间从数周缩短至数分钟。
  • 使开发者能够以极低的代码开销和运行时性能影响,验证和优化边缘机器学习应用。

提出的方法

  • 使用多语言 API 套件插桩机器学习推理流水线,以在边缘设备上记录中间层输出和执行元数据。
  • 通过参考流水线(例如,已知正确的实现)重放相同的输入数据,生成用于对比的基准输出。
  • 对比实际执行与参考执行之间的逐层输出和执行延迟,以检测差异和性能回归。
  • 允许用户在特定操作或层周围定义自定义断言和日志钩子,以验证行为并检测异常。
  • 与现有机器学习框架(如 TensorFlow Lite、PyTorch Mobile)集成,并支持异构边缘硬件,包括移动 CPU、GPU 和 NPU。
  • 利用优化版本与参考版本的操作符解析器,识别由次优内核选择引起的性能瓶颈。

实验结果

研究问题

  • RQ1在边缘设备上部署机器学习模型时,未解释的性能下降的主要原因是什么?
  • RQ2开发者如何在边缘推理过程中获得中间层输出和执行行为的可见性,以检测隐藏的错误?
  • RQ3与参考流水线进行自动化对比,在多大程度上可以识别出预处理、量化和内核执行中的问题?
  • RQ4ML-EXray 在检测先前未知的问题(如故障量化操作符或低效内核实现)方面有多有效?
  • RQ5ML-EXray 的运行时开销是多少?它在不同硬件平台和模型类型上的可扩展性如何?

主要发现

  • ML-EXray 检测到此前未知的问题,包括 TensorFlow 中故障的量化操作,该问题后来被开发团队报告并正在修复。
  • 该框架识别出易出错的层,如 MobileNetv2 中的平均池化层,其在不同模型版本间表现出显著的输出差异。
  • 次优内核选择可导致延迟增加高达200倍——例如,在移动设备上,参考操作符解析器比优化版本慢三个数量级。
  • 在移动设备上,量化深度可分离卷积比标准卷积更快,但未优化的实现导致严重的性能下降。
  • 通过识别并指导优化低效操作,ML-EXray 将内核执行延迟最高降低了两个数量级。
  • 在纠正部署问题(如输入归一化不匹配和预处理错误)后,该框架使模型准确率最高提升了30%。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。