Just coming back to this thread, I believe there’s a way to introduce the hooks in a less intrusive way to the LowerTEPass
, by placing it just above it in build_module.cc
. This should mean each Target can register a relay_to_tir
Pass
which is ran there rather than having to wire it via LowerTEPass
and any PrimFunc
will be skipped as they’re not relay functions anymore.
I’ve updated the RFC PR to reflect this: Additional Target Hooks RFC by Mousius · Pull Request #10 · apache/tvm-rfcs · GitHub