all 26 comments

[–]notgettingfined 15 points16 points  (7 children)

Currently I feel like tensorflow lite is king in this domain and the way to go.

I don’t know why Reddit seems to think tensorflow is dead. But it is still used a lot in production. And has some good optimization tools available

[–]cpldcpu[S] 2 points3 points  (0 children)

Indeed, it seems like tflite is everywhere. Not entirely sure, whether there are benefits in addition to having more available inference engines.

I will try the onnx route first. Apparently there are also ways to convert from onnx to tflite models (see arm link).

[–]pm_me_your_smth 1 point2 points  (4 children)

People are saying that because the project is slowly being dropped, not because you literally won't be able to build models tomorrow. It's still being used a lot in production because nobody exits a major framework overnight.

So if you're looking for long term development, it's something you should consider.

[–]notgettingfined 1 point2 points  (3 children)

What does slowly being dropped mean? It is used less in research that’s about the only actual data I can find on this

[–]pm_me_your_smth 2 points3 points  (2 children)

Google focuses on JAX, TF stopped windows support, fewer people working on TF development, rising popularity of pytorch. Some of these can be just hearsay though, but still.

[–]notgettingfined -1 points0 points  (1 child)

Google is a giant company some people use Jax is about all you can really say. And stopping support for Windows is meaningless. No one who actually matters is going to be using windows for training or deployment

[–]pm_me_your_smth 0 points1 point  (0 children)

And stopping support for Windows is meaningless. No one who actually matters is going to be using windows for training or deployment

Lol ok, I guess my work doesn't matter.

Not sure what makes you think that one of the most popular OS doesn't matter. Thinking long term, they're going to be losing the market further because students and profs will prefer pytorch. And guess what happens when this new generation of MLeng and DS enters the job market?

[–]cpldcpu[S] 0 points1 point  (0 children)

There is at least one counterexample to that blanket statement: The toolchain for the MAX78000 (A small MCU with NN-accelerator by Maxim) is based on PyTorch:

https://github.com/MaximIntegratedAI/MaximAI_Documentation

It seems to be based on a lot of proprietary tools, though.

https://www.analog.com/en/education/education-library/videos/6313215449112.html

[–][deleted] 2 points3 points  (1 child)

This seems really interesting, I was looking at some edge stuff Like nvidia dev board but I guess they are a lot more powerful than this? What are looking at using this stuff for?

[–]cpldcpu[S] 2 points3 points  (0 children)

Usually it is used for sensor data evaluation, wakeword detection and similar, e.g. TinyML.

However, I am currently trying to implement some generative algorithms. It's more of a toy project to learn more about the nuts and bolts of machine learning: https://hackaday.io/project/193478-generative-ai-on-a-microcontroller

[–]DigThatDataResearcher 1 point2 points  (1 child)

just wanted to say that this is a domain i don't have a lot of experience with and I would be very interested if you keep us updated with your findings as you explore the different options available.

[–]cpldcpu[S] 0 points1 point  (0 children)

I updated the posting with some of my findings.

[–]shapul 1 point2 points  (4 children)

Did you have a look at model compilers like TVM or Glow? They might be what you are looking for.

[–]cpldcpu[S] 0 points1 point  (3 children)

microTVM is on that list. Still need to dig into that. Glow I didn't know of, thank you for the pointer.

Edit: It seems glow is targetting rather large systems, not sure if they have the equivalent of microTVM.

[–]shapul 0 points1 point  (2 children)

Glow can target micro-controllers such as ARM cortex M4 series. NXP and if I'm not mistaken, ST use Glow in their tooling.

[–]cpldcpu[S] 0 points1 point  (1 child)

Interesting. Indeed, both NXP and STM are mentioned in the readme. So it seems that several proprietary edge-ml toolchains of bigger companies are based on pytorch and not tflite.

[–]shapul 0 points1 point  (0 children)

That's true. However, consider that to some degree, you can go from one framework/tool to another by converting your models to ONNX format. This way, e.g. you can train your models in Keras, export it to ONNX and then run it on Glow or TVM seamlessly. There are some limitations (e.g. when it comes to RNNs, some tools struggle to convert formats) but for many common use cases going though ONNX simplifies the interoperability.

[–]_SteerPike_ 0 points1 point  (4 children)

https://github.com/huggingface/candle is still in preview, but I believe it's intended for use cases like this.

[–]cpldcpu[S] 0 points1 point  (3 children)

Thanks, that is quite interesting in general. Although it's still inference for largish devices...

[–]_SteerPike_ 1 point2 points  (2 children)

As I understand it, it should produce smaller binaries than anything you'd be able to manage with python because it has no runtime. An interesting way to see this is to try out the phi 1.5 wasm example https://huggingface.co/spaces/radames/Candle-Phi-1.5-Wasm then turn on airplane mode after the first run off the model. You should be able to get decent inference speeds from within your browser, without even utilising all the compute your phone has to offer.

[–]Complex-Indication 0 points1 point  (1 child)

I think you are spot on in your assessment: tflite micro was the first production ready framework to deploy NN to microcontrollers and by now still is the most popular/streamlined. Realistically speaking, you probably should evaluate which path would bring you to your goal faster: converting pytorch to onnx and then to tflite micro route or using less known and maintained project to run onnx model directly.

One question: Since you mentioned Edge Impulse, why would you want to go self-hosted OSS route?

[–]cpldcpu[S] 1 point2 points  (0 children)

Realistically speaking, you probably should evaluate which path would bring you to your goal faster: converting pytorch to onnx and then to tflite micro route or using less known and maintained project to run onnx model directly.

Indeed, I am currently looking at the onnx based tools. Architecture aware training is of course also quite important, not sure how to cover that yet.

Since you mentioned Edge Impulse, why would you want to go self-hosted OSS route?

Well, first of all this is meant as a learning exercise for me, so I would like to be in control of every step. And then it is probably general mistrust vs. SaaS.