igotyuandme320 opened a new pull request, #18855:
URL: https://github.com/apache/tvm/pull/18855
## Problem
Issue #18824: The Cross Compilation and RPC tutorial fails when running over
RPC with error:
Mismatched type on argument #0 when calling: vm.builtin.reshape(0:
ffi.Tensor, 1: ffi.Shape) -> ffi.Tensor
This happens because `tvm.runtime.tensor()` creates tensors that become
`DLTensor*` when transmitted via RPC, but VM builtins like `vm.builtin.reshape`
expect `ffi.Tensor`.
## Solution
Update the tutorial to use `set_input()` + `invoke_stateful()` API instead
of direct function call `vm["main"](...)`. This API is designed for RPC and
handles the tensor type conversion internally.
## Changes
- Updated Step 5 to use `vm.set_input()`, `vm.invoke_stateful()`, and
`vm.get_outputs()`
- Updated Step 6 to use `time_evaluator("invoke_stateful", ...)` for RPC
compatibility
- Added explanatory comments about why this approach is needed
Fixes #18824
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]