[Paper Review] Rethinking Machine Learning Development and Deployment for Edge Devices
This paper proposes a new machine learning development and deployment pipeline optimized for edge devices, particularly ARM Cortex-M CPUs, by rethinking model training and inference through a specialized framework called KANJI. By training models directly in quantized 8-bit integer format with custom operators, the approach eliminates deployment mismatches, reduces model size by up to 75%, and maintains or improves accuracy compared to FP32 models, enabling efficient, high-quality inference on resource-constrained hardware.
Machine learning (ML), especially deep learning is made possible by the availability of big data, enormous compute power and, often overlooked, development tools or frameworks. As the algorithms become mature and efficient, more and more ML inference is moving out of datacenters/cloud and deployed on edge devices. This model deployment process can be challenging as the deployment environment and requirements can be substantially different from those during model development. In this paper, we propose a new ML development and deployment approach that is specially designed and optimized for inference-only deployment on edge devices. We build a prototype and demonstrate that this approach can address all the deployment challenges and result in more efficient and high-quality solutions.
Motivation & Objective
- To address the growing challenge of deploying machine learning models on resource-constrained edge devices where traditional frameworks create deployment mismatches.
- To reduce the gap between model development in high-level frameworks and efficient inference on edge hardware by unifying training and deployment under a single, optimized pipeline.
- To improve model efficiency and quality by enabling end-to-end training and deployment in low-precision integer formats (e.g., 8-bit asymmetric/symmetric quantization) without relying on post-training quantization.
- To eliminate deployment bottlenecks caused by operator availability and behavior differences between ML frameworks and inference engines.
- To demonstrate that training directly in low-precision formats can yield models with comparable or better accuracy than FP32 counterparts, especially when combined with appropriate pre-processing and optimization.
Proposed method
- Proposes a new ML development and deployment pipeline where model training and deployment are unified under a single framework (KANJI) that natively supports 8-bit integer operations and custom quantized operators.
- Introduces a novel training process that directly optimizes for 8-bit inference by using quantized operations from the start, avoiding the need for post-training quantization.
- Employs a custom operator implementation stack (e.g., CMSIS-NN) that supports specialized low-precision operations such as Winograd convolution and quantized matrix multiplication.
- Uses a unified model representation that maps directly from the training graph to the deployed inference graph, eliminating intermediate conversion steps and preserving model behavior.
- Applies input pre-processing techniques like per-image standardization and batch-normalization-like normalization to improve quantized model accuracy.
- Relies on a hybrid training strategy where pre-trained FP32 models can be re-targeted and fine-tuned in the KANJI framework to recover accuracy after quantization.
Experimental results
Research questions
- RQ1Can training deep neural networks directly in 8-bit integer format yield models with comparable or better accuracy than FP32 models when deployed on edge devices?
- RQ2To what extent can a unified training and deployment pipeline reduce deployment complexity and eliminate mismatches between framework and inference environments?
- RQ3How do different input pre-processing techniques affect the accuracy of quantized models in low-precision inference?
- RQ4What is the impact of optimizer choice and learning rate on convergence and final accuracy when training in 8-bit integer format?
- RQ5Can pre-trained FP32 models be effectively re-targeted and fine-tuned in the proposed pipeline to achieve high accuracy with minimal retraining cost?
Key findings
- Training directly in 8-bit integer format (KANJI) achieved 81.9% top-1 accuracy on CIFAR-10, matching or exceeding the 81.5–81.8% accuracy of FP32 models with different pre-processing techniques.
- The KANJI framework reduced model size by up to 75% compared to FP32 models while maintaining or improving accuracy, demonstrating significant efficiency gains.
- The use of batch-normalization-like pre-processing in KANJI improved accuracy to 81.9%, outperforming standard per-image normalization and binaryproto-based pre-processing.
- Training in KANJI was 20–25% slower per step than FP32 training, but convergence could be improved by increasing the initial learning rate, suggesting trade-offs in training speed and optimization.
- The hybrid approach of pre-training in FP32 and fine-tuning in KANJI successfully recovered accuracy loss, enabling reuse of well-optimized pre-trained models.
- The proposed pipeline eliminated deployment challenges related to operator availability and behavior differences, enabling direct mapping from training graph to optimized inference graph.
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.