zhiics edited a comment on issue #4864: [Relay] Ignore Primitive functions in 
Visitors
URL: https://github.com/apache/incubator-tvm/pull/4864#issuecomment-584769286
 
 
   I think there are at least two solutions to prevent Relay passes from 
touching the external functions:
   - S0: lifting the external functions to the module scope, i.g. making them 
as a global function, and marking them as external. The pass infra will skip 
optimization of them automatically. This is okay for VM. However, for graph 
runtime, we may need to have an inline pass to inline these global functions, 
as build_module and graph_runtime_codegen really only focus on the main 
function and globalvar is not allowed.
   - S1: Look at the passes and skip the optimizing `FunctionNode` if the 
function doesn't use default compiler from TVM
   
https://github.com/apache/incubator-tvm/blob/4fce5137ddd30ea56d1951703de43727043090b9/src/relay/ir/expr.cc#L168
   This looks a little easier because some passes can ignore this, but it 
doesn't seem that clean.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to