edge_ml
Putting intelligence on chips small enough to be in disconcerting places
October 14, 2016 — August 14, 2023
The art of doing ML stuff on small controllers, such as single board computers or even individual microcontrollers, or some weird chip embedded in some medical device. A.k.a. edge ml,1
I do not have much to say here RN.
1 Making neural models small
Obviously, if your target model is a neural net one important step is making it be as small as possible in the sense of having as few parameters as possible.
2 Low precision nets
There is another sense of small: Using 16-bit float, fixed point, or even single bit, arithmetic so that the numbers involved are compact. TBD.
3 Multi-task learning
Training one learning algorithm to solve several problems simultaneously. Probably needs its own page.
4 Tooling
Tensorflow appears to have intimate microcontroller integration via TensorFlow Lite for Microcontrollers.
Browser ML in particular has some quirks.
Other frameworks convert to intermediate format ONNX which can be run on microcontrollers, although I suspect with higher overhead.
Introducing ONNX Runtime mobile: a reduced size, high performance package for edge devices
Deploying a PyTorch MobileNetV2 Classifier on the Intel Neural Compute Stick 2
jomjol/AI-on-the-edge-device implements an image AI network on an ESP32 device
-
Apache TVM is a compiler stack for deep learning systems. It is designed to close the gap between the productivity-focused deep learning frameworks, and the performance- and efficiency-focused hardware backends. TVM works with deep learning frameworks to provide end-to-end compilation to different backends.
Apache TVM Unity: a vision for the ML software & hardware ecosystem in 2022
Introducing ONNX Script: Authoring ONNX with the ease of Python - Microsoft Open Source Blog
5 Minifying neural nets
6 Compiling neural nets
- openvinotoolkit/openvino: OpenVINO™ is an open-source toolkit for optimising and deploying AI inference
- apache/tvm: Open deep learning compiler stack for cpu, gpu and specialized accelerators
- tiny-dnn/tiny-dnn: header only, dependency-free deep learning framework in C++14 (defunct)
- pytorch/glow: Compiler for Neural Network hardware accelerators in AOT mode
- Minimalist tiny-dnn is a C++11 implementation of certain tools for deep learning. It targets deep learning on limited-compute, embedded systems and IoT devices.
7 Link slurry
Huawei’s full stack AI toolchain looks interesting and efficient
8 References
Footnotes
I do not like this term, because it tends to imply that we care especially about some kind of centre-edge distinction, which we only do sometimes. It tends to imply that large NN models in data centres are the default type of ML. Chris Mountford’s Hasn’t AI Been the Wrong Edgy for Too Long?, mentioned in the comments riffs on this harder than I imagined, though↩︎