New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello model RAM size required #5
Comments
Add this function to show memory information. `static void display_mallinfo(void)
}` ============== Before alloc context ============== ============== After alloc context ============== ============== Befor onnx run ============== ============== After onnx run ============== 2MB memory is enough. mnist is the smallest model, you can usinig xxd -i for other models. |
Thanks. Unfortunately I'm not running on Linux. It's a cortex-a7 with ThreadX and debugging is very limited (no JTAG). I'm unable to run much at the moment as it fails and I can trace it easily. |
Hi, I traced the fault down to memalign. I had to add my own implementation as I have done for malloc ,free and realloc. It run the benchmark but freeing some objects isn't performed well, probably due to memalign. Thanks! |
just using malloc instead of memalign,512 bytes align is not necessary. |
So leaving it as align 4 and allocating the len shall be sufficient? |
It worked ;) |
Must ensure 8-byte alignment, double type。for 32-bits system, malloc usually 8-byte aligned, for 64-bits system, usually 16-byte aligned, the twice of void * type, Confirm your malloc alignment。 |
I have added this: UCHAR mem_heap[MALLOC_BYTE_POOL_SIZE] attribute ((aligned (8))); |
write customized malloc may be ok. 8-bytes align for onnx_tensor_t's datas. |
I just need to append LF on every CR as I'm on windows. |
Hi,
I'm trying to run the hello example on a small embedded system but im unsure of the memory required to allocate this model ( when running
onnx_context_alloc
).I have roughly 2MB, is that enough?
Is there a smaller model that I can test with the model defined as a const char array?
Like the
static const unsigned char mnist_onnx[] = { ... }
The text was updated successfully, but these errors were encountered: