[USMP] [BYOC] [Unity] Unity BYOC intermediate buffer support

[USMP] [BYOC] [Unity] Unity BYOC intermediate workspace

I am trying to write a c-codegen to interact with an external library (microTVM, AOT, USMP)

My understanding is that for non-unity TVM, the standard BYOC flow has no way to allocate a buffer for an offloaded subgraph intermediate with USMP. If you wanted to do that you should use the Additional Target Hooks RFC

See my WIP at using this method here

I’m learning the basics of Unity and I wanted to make sure my understanding was correct. It seems like RunCodegen is a Relax → Relax transformation that generates and links to a runtime module for offloaded subgraphs. So it seems like using RunCodegen we still can’t allocate space for subgraph intermediates with USMP. If we want to allocate space for intermediates we need to create a custom pass that performs custom lowering for offloaded fused nodes similar to LegalizeOps. Is this correct?

cc: @sunggg