[VTA] Transforms for Code Generation: When are they called?

I am not sure to get the initial question well but I can share some resources for code generation. Just about me, I am relatively new to TVM and compilation, I’ve managed to get a dummy codegen running last week under the unity branch.

You should check BYOC (bring your own codegen).

Once you’ll know how to write a codegen you’ll need to know how to get it called. There is a new branch of TVM in active development which makes calling into BYOC much more natural and flexible among other things, it’s called unity. If that interests you, there is a notebook showcasing how to you can get your BYOC codegen running under unity.

For calling your codegen without unity you may find what you need in this BYOC blogpost.

Note: The BYOC documentation and blogpost might not be fully up to date, I suggest using existing implementations as a complement to validate. For unity it’s in src/relax/backend/contrib (see the cutlass implementation for a C codegen and the tensorrt one for a json codegen) and for pre-unity in src/relay/backend/contrib.

1 Like