Arena Size is too small for all buffers

Hello all,

I’m trying to deploy a custom NN model for img_class use case on MPS3 board and I ran into the following error.

INFO - Allocating tensors
Arena size is too small for all buffers. Needed 2430048 but only 1950208 was available.
[ERROR] allocateTensors() failed

If I set -Dimg_ACTIVATION_BUF_SZ anything greater than 0x0020000 while building the application I’m getting SRAM overflowed error.

So I would like to know if its possible to deploy my custom model on MPS3 board?Also, is there any SRAM limit which I need to know and choose a simpler model to deploy?

I’m just getting used to this ARM MPS3 board and any details about the memory constraints would be very helpful :slight_smile:

Hi @surya00060,

The implementation defined FPGA SRAM limit for AN552 running on MPS3 is 2 MiB (there are two blocks of 1MiB each). This limit is propagated from corstone-sse-300.cmake line 70. The implementation documentation is available here.

If you’re using a physical FPGA board (and not the FVP), you can choose to optimise the model’s SRAM usage for size instead of performance and see if it brings down the tensor arena usage.
See Vela options → optimise.

Alternatively, you can chose to run on the workload on an FVP which will then give you the option of using the Arm Ethos-U65 NPU instead. See deploying-on-an-fvp-emulating-mps3, especially the section with Ethos-U65. Overall deployment instructions are on the same page here.

This will then enable you to run the models which use more SRAM than this, we’d suggest using Dedicated_Sram memory mode to optimise the models when using Vela. This is done by passing the following argument when executing Vela (already done by the Python script that optimises models):


See Vela Options → memory mode.

Then you should be able to provide activation buffer sizes greater than the 2MiB limit as the tensor arena itself will live in the DDR (simulating a flash or a DRAM device). See mps3-sse-300.sct line 101 or mps3-sse-300.ld line 193.

Hope this helps.