YuchenJin commented on pull request #8586:
URL: https://github.com/apache/tvm/pull/8586#issuecomment-889390156


   @ganler Thanks, I agree with you that moving the callable expression outside 
provides greater flexibility. Btw, one caveat of using the `create_executor` 
API is that it's better to directly pass params to it, otherwise constant 
folding will not be applied and it degrades the inference performance (more 
details in #8418).
   
   I don't like the `create_executor` API actually, I think it's a convenient 
API to try out different executors. I prefer the following VM style API which 
is clearer:
   ```
   with tvm.transform.PassContext(opt_level=3):
       exe = relay.vm.compile(mod, target, params)
   vm = vm_rt.VirtualMachine(exe, tvm.cpu(0))
   vm.run(input_data)
   ```
   
   It has a clear model->executable->run pattern. However, the graph runtime 
api has another style. I hope we can unify the APIs in the future...


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to