mdw-octoml opened a new issue #7567:
URL: https://github.com/apache/tvm/issues/7567


   I have a unit test in the PR below for converting and compiling a simple 
ONNX model to uTVM.
   
   
https://github.com/apache/tvm/pull/7557/files#diff-a99b62f63c41000a38abda08f9320ac0c6917a81612223b77248d43f29a85abaR212
   
   In this test, if I do not specify `-link-params` in the target, and instead 
call `mod.set_input()` on the model parameters at runtime, the uTVM Zephyr 
runtime fails with the error `kTvmErrorWriteStreamLongWrite` being returned 
from `WriteStream::WriteAll()`.
   
   I spent some time debugging this and narrowed it down to the `p4` layer 
getting sent to the device which has size (10, 256). The other layers seemed to 
work fine. The bug happens because 
`tvm::runtime::micro_rpc::WriteStream::WriteAll` gets a return value from 
`Write` of 1026, where `data_size_bytes` is 1.
   
   Looking at the serial traffic from the host to the device, it seems that all 
of the data to the device is sent at once over the UART, but the device-side 
server loop processing it is returning this error.
   
   I have tried increasing the sizes of the various buffers to be large enough 
to hold this layer data, plus quite a bit more, but the error always happens.
   
   Note that this happens both on the nRF5340DK as well as under QEMU. So it 
does not seem to be hardware-dependent.
   
   For now, implementing the workaround of using `-link-params=1` in the 
target, but this really should be fixed as it will likely affect others.
   


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


Reply via email to