[Paper Review] ML-EXray: Visibility into ML Deployment on the Edge
ML-EXray is a cloud-to-edge deployment validation framework that provides layer-level visibility into ML inference on edge devices by instrumenting model execution, replaying inputs via a reference pipeline, and comparing outputs and latency. It enables developers to detect and debug issues like preprocessing bugs, quantization errors, and suboptimal kernels with under 15 lines of code, improving model accuracy by up to 30% and reducing kernel latency by two orders of magnitude.
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.
Motivation & Objective
- Address the critical gap in visibility during cloud-to-edge ML deployment, where performance drops of over 10% often occur without clear root causes.
- Bridge the disconnect between cloud-based model training and edge deployment by enabling developers to trace and debug issues across the entire inference pipeline.
- Provide a systematic, instrumented approach to detect and diagnose deployment issues—such as incorrect preprocessing, quantization errors, and inefficient kernel execution—across diverse edge hardware.
- Reduce debugging time from weeks to minutes by offering automated, per-layer comparison between actual and reference model execution.
- Enable developers to validate and optimize edge ML applications with minimal code overhead and low runtime performance impact.
Proposed method
- Instrument ML inference pipelines using a multi-lingual API suite to log intermediate layer outputs and execution metadata on edge devices.
- Replay the same input data through a reference pipeline (e.g., a known correct implementation) to generate ground-truth outputs for comparison.
- Compare per-layer outputs and execution latency between actual and reference executions to detect discrepancies and performance regressions.
- Allow users to define custom assertions and logging hooks around specific operations or layers to validate behavior and detect anomalies.
- Integrate with existing ML frameworks (e.g., TensorFlow Lite, PyTorch Mobile) and support heterogeneous edge hardware, including mobile CPUs, GPUs, and NPUs.
- Leverage optimized vs. reference operator resolvers to identify performance bottlenecks caused by suboptimal kernel selection.
Experimental results
Research questions
- RQ1What are the primary causes of unexplained performance degradation in ML models when deployed on edge devices?
- RQ2How can developers gain visibility into intermediate layer outputs and execution behavior during edge inference to detect hidden bugs?
- RQ3To what extent can automated comparison with a reference pipeline identify issues in preprocessing, quantization, and kernel execution?
- RQ4How effective is ML-EXray in detecting previously unknown issues such as malfunctioning quantization ops or inefficient kernel implementations?
- RQ5What is the runtime overhead of ML-EXray, and how does it scale across different hardware platforms and model types?
Key findings
- ML-EXray detected previously unknown issues, including malfunctioning quantization operations in TensorFlow, which were later reported and are now being fixed by the development team.
- The framework identified error-prone layers such as average pooling layers in MobileNetv2, which showed significant output discrepancies across model versions.
- Suboptimal kernel selection caused up to 200× latency increase—e.g., reference op resolver was 3 orders of magnitude slower than optimized versions on mobile devices.
- Quantized depthwise convolution was faster than standard convolution on mobile, but unoptimized implementations caused severe performance degradation.
- ML-EXray reduced kernel execution latency by up to two orders of magnitude by identifying and guiding optimization of inefficient operations.
- The framework improved model accuracy by up to 30% after correcting deployment issues such as input normalization mismatches and preprocessing bugs.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.