mikepapadim opened a new pull request #8418:
URL: https://github.com/apache/tvm/pull/8418


   Following the forum discussion 
(https://discuss.tvm.apache.org/t/questions-about-tvm-executors-and-its-apis/10289/3)
 and the tutorials 
https://tvm.apache.org/docs/tutorials/frontend/from_keras.html#sphx-glr-tutorials-frontend-from-keras-py
 and 
https://tvm.apache.org/docs/tutorials/frontend/from_onnx.html#compile-the-model-with-relay
 there is some performance mismatch between the two apis. 
   
   This [repo](https://github.com/mikepapadim/tvm_issue) captures the 
performance issue. 
   
   It seems when one uses the relay API as in the example below, `params` are 
not passed properly to the TIR and all optimizations regarding constants (i.e., 
constant folding are prevented). Therefore, this leads to performance mismatch 
with the `relay.vm.compile(mod, target=target, params=params)` .
   
   Example usage:
   ```
   vm_executor = relay.create_executor("vm", mod, tvm.cpu(0), target)
   vm_executor.evaluate()(input_data, **params)
   ```
   This PR modifies the above to accept: 
   ```
   vm_executor = relay.create_executor("vm", mod, tvm.cpu(0), target, params)
   vm_executor.evaluate()(input_data)
   ```
   
   With this modification ```relay.vm.compile``` and 
```relay.create_executor``` generate the same bytecodes while applying the same 
opts.
   
   @jroesch  @tqchen @yuchen


-- 
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