[RFC] Unified Static Memory Planning

Hi @areusch

Thanks for taking time to read this!.

Yes, I do generally support the idea of having the whole program lowered to TIR. Im not sure about the VM and how important “static” memory planning is for VM. I think going forward graph executor might be able to load a packed function of the tvm_main instead of json – it’ll be less confusing as how the graph executor runtime is positioned as of today which is more of a (a very thin – as its supposed to be :slight_smile: ) middleware that connect the graph json and the compiled operator library.

Having said that, I can see this work enabling a path (to extend) towards that – though we only plan to create USMP component that is a TIR IRModule → TIR IRModule which we initially test and support for the AoT executor.

Here I am referencing what is being discussed here : [RFC] [uTVM] Embedded C Runtime Interface - #6 by Mousius. I think its better to reach an agreement there. Here Im trying to illustrate and motivate the design using the APIs.

Yes, the USMP will only touch tir.allocates that could be evaluated in the compile time will be translated to offset. We could just leave the rest untouched to be TVMBAWs that is ultimately handled in the runtime (using malloc or stack_allocator). I think thats the only thing we require. Do we miss anything here? – I’ll adjust the original text to reflect this.

No reason :slight_smile: . Yes we could use the names – so its more clear.