2025-08-27 6:45 AM
Dear all,
I'm in the process of converting a convolutional neural network from quantized ONNX format to run on the STM32N6 Neural ART NPU, using the STEdgeAI tool. I do not have access to external RAM on our custom hardware, so everything has to fit in the NPU's RAM (AXISRAM3 to AXISRAM6). However, I found it frustratingly difficult to do so using the STEdgeAI CLI. Using just the default options results in a model that takes roughly twice as much RAM as would theoretically be needed to store the activations (and in some extreme cases even 10x as much).
So my question is: are there any tips, tricks, or tools or other command line options that are useful when trying to squeeze a model into the small internal RAM? It looks like the "out-of-the-box" options to STEdgeAI-CLI prioritize execution speed over RAM usage, which is of course unfortunate if that means the model cannot run at all due to RAM restrictions.
In particular:
I'm grateful for any useful advice, the N6-NPU is really a great piece of work, but the process of fitting a model in RAM has turned out to be pretty painful so far (compared to other NPU/TPUs I've used previously).
Thanks, Michael
2025-09-09 1:25 AM
Hello @asdfasdf,
Concerning your questions:
No there isn't such mode. Even if it you tweak the mempool file to reduce internal RAM to try influence the compiler decision, it will most likely provide the same results but with everything that does not fit in internal RAM, in external memory.
No, we don't have such option.
We have received some similar complains (not as much as I would have expected personally). There are two possibilities:
a) the compiler is not doing the right thing and then it should be improved (for that I transmitted your model in your other post to see if this is the case)
b) the solution is already optimal, (with what we currently provide)
When asking internally what we could propose to help answer question similar to yours, regarding how to optimize the memory used, I was surprised to see that it is not a common question. I would have expected that we had received similar question in the past, but this is not the case.
There are not really things we can do to be honest, except if this is a bug.
Have a good day,
Julian