GreenWaves-Technologies / gap_sdk

SDK for Greenwaves Technologies' GAP8 IoT Application Processor
https://greenwaves-technologies.com/en/gap8-the-internet-of-things-iot-application-processor/
Apache License 2.0
141 stars 78 forks source link

Need Help with Modifying Input Image Allocation and Memory Configuration #418

Open paulxiongfree opened 5 months ago

paulxiongfree commented 5 months ago

Hello,

I am encountering some issues while trying to deploy certain applications and modify the input image size to allow for larger images. Here are the specific problems I am facing:

In the ImgIO.c file, the .ppm file requires L2 memory allocation, but the L2 memory limit is quite large, generally 512KB. I tried to modify this function to read the file into L3, but it resulted in errors and the application didn't run correctly. In the autotiler, the size of L2 is not set to 524,288 bytes (512KB), but is usually set to 200,000 bytes. I am wondering if this is to leave space for the input files. Unfortunately, I am not very proficient in C programming and would greatly appreciate any help or guidance you can provide. Thank you very much!

marco-fariselli commented 2 months ago

Hello, you should have some functions in the ImgIO.c that directly handle the writing of image in L3 (read from PC and write to L3). You will need though to add the L3 device configuration and setup. The autotiler tipycally have a smaller L2 budget to take into account the input space, yes. But you can also instruct the autotiler to manage the input space itself, i.e. it will count the input space as space for the NN run and it will reuse it during the NN inference (of course this will cause the input image to not be readable anymore after the NN ran).