You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/12/14 21:34:07 UTC

[GitHub] [tvm] masahi commented on pull request #13606: [Relay][TIR] Add utility to lower Relay func to TIR prim func

masahi commented on PR #13606:
URL: https://github.com/apache/tvm/pull/13606#issuecomment-1352236597

   @Mousius The new function simply composes the existing interface to the TECompiler, `LowerTECompute` and `CreatePrimFunc` that converts lowered TE compute to TensorIR. `LowerTECompute` was introduced after the compile engine refactor you mentioned completed, and made only possible thanks to that refactoring work. So I don't get your concern here.
   
   What I wanted to add is a simple interface that converts one Relay primitive function to the corresponding TIR prim func. Then I realized that `backend/task_extraction.cc` already has code that does exactly that, so I simply extracted into a reusable function and exposed it to Python. We require the input to be a primitive function, so we never generates multiple TIR prim funcs. 
   
   > Implies we wanted it in IRModule form anyway, so creating an IRModule with a Function and running LowerTE(mod) seems the best result here?
   
   This is just MetaSchedule storing an IRModule in a task. I didn't change any behavior about task extraction in this PR. What we want is a `relay::Function -> tir::PrimFunc` interface, `IRModule -> IRModule` is valid but it wouldn't convey what this new API is meant for.  
    


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org