KireinaHoro commented on issue #5060: [uTVM][Runtime] Deprecate uTVM Standalone 
Runtime
URL: https://github.com/apache/incubator-tvm/issues/5060#issuecomment-603020546
 
 
   > Cross posting to here. I think it worth to think about memory allocation 
strategy. Specificially, we should design an API that contains a simple 
allocator(which is arena like and allocate memory from a stack, and release 
everything once done), and use that allocator for all memories in the 
program(including data structures and tensors). This will completely eliminate 
the usage of system calls and allow the program o run in bare metal.
   > 
   > ### Example API
   > ```c
   > // call use system call to get the memory, or directly points to memory 
segments in ucontroller
   > UTVMAllocator* arena = UTVMCreateArena(10000);
   > // Subsequent data structures are allocated from the allocator
   > // The free calls will recycle data into the allocator
   > // The simplest strategy is not to recycle at all
   > UTVMSetAllocator(arena);
   > 
   > // normal TVM API calls
   > ```
   
   @tqchen Removing all external allocator use and go with an embedded arena 
allocator sounds a little bit fishy.  Bare-metal platforms does not necessarily 
lack a proper allocator; `newlib`, for example, provides a pretty usable 
`dlmalloc` implementation.  Are there any other concerns?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to