Relay IR + TE example?

The documentation has a number of examples of how to work with the Relay IR or with Tensor Expressions (TE) independently.

Are there any examples about how to use Relay IR together with TE (ie. how to incorporate TE into a Relay IR function)?

Thanks!

You might want to check the project we are working on:

cc @yuchenj

2 Likes

@lemo, we can do this on Relax(Relay Next).

For example, in the program on the left, we call emit_te and pass a te/topi function to it, this will result in the IRModule on the right shown in the TVMScript format.

Relax has symbolic integer shape as the first class, which te and topi rely on, so the integration of Relax and TE is organic and clean. Relax is an exploratory effort within TVM Unity, which allows the high-level IR to directly interact and call into lower-level TensorIR and PackedFunc, and will unlock cross-layer optimization opportunities. Please check out the links posted by @ziheng if you are interested.

1 Like