Unity AOT Support?

I see in the unity RFC that AOT execution is a goal. From looking at the unity branch, it doesn’t seem like this is implemented yet-- I don’t see any c codegens in src/relax/backend/contrib and I don’t see AOTExecutor referenced in the relax compilation flow

Can someone confirm that AOT codegen is not supported in Unity? And assuming it is not supported, I was wondering how soon this is being planned for?

As of now there is a compiled mode in the relax vm, that compiles most of the graph code to executables. However, due to the fact that we would need to support a richer set of data structures, we would need a runtime that also supports things like object system to get a full set of features. In some sense this compiled mode can be viewed as AOT with a richer set of runtime support

Note that this was different from the original AOT executor. In that case it would be more akin to a limited set of runtime for resource constrained setting. In such cases, likely we won’t be able to get a full set of unity features(especially those that comes with nested data structures and recursive objects), but it may indeed be possible to create a backend for the limited usecases. As of now this part is not supported, and likely would need community’s involvement depending on interest in this area.

1 Like

Ok that makes sense. It doesn’t sound like the compiled mode generates a binary for bare metal, which is what I’m looking for. In my opinion unity would be a good fit for bare-metal/resource-constrained settings because of its plan to support inplace dataflow blocks, which can yield large memory savings.

1 Like