tinygo-org / tinygo

Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
https://tinygo.org
Other
14.72k stars 858 forks source link

Any Plan to support TinyML ? #1153

Open rsrini7 opened 4 years ago

rsrini7 commented 4 years ago

Loved tinygo and Thanks.

Is there any plan to support TinyML ? https://blog.arduino.cc/2020/05/26/edge-impulse-makes-tinyml-available-to-millions-of-arduino-developers/

aykevl commented 4 years ago

TinyML is a trend (running ML algorithms on embedded hardware), not an actual technology:

The trend to run ML on microcontrollers is called Embedded ML or TinyML.

There are a few software packages mentioned in the blog post that would be interesting. For example, there is CMSIS-NN. I think it would be fantastic to port these to TinyGo using CGo, for example for integration into Gorgonia. One advantage of TinyGo over the standard Go compiler is that there is basically no CGo overhead, which is something Gorgonia seems to be struggling with.

However, I do not think this is in scope for the TinyGo repository, which provides just the Go compiler. It might fit in the rest of the TinyGo project. If you want to contribute some work in this area, that would be greatly appreciated.

rsrini7 commented 4 years ago

Agree. It would be great if its as part of tinygo-org and not core tinygo. Tensorflow-lite (micro) having support for tinyml.

Based on my understanding, currently tflite model has to be generated with high level languages (mostly python) and saved model has to be converted as 'C' source or header file which has to be imported into Arduino sketches.

Looking for go-based approach using tiny-go to process the generated models in the micro-controller. https://github.com/mattn/go-tflite (CGo based)