areusch commented on a change in pull request #7838:
URL: https://github.com/apache/tvm/pull/7838#discussion_r617704348
##########
File path: src/runtime/rpc/rpc_endpoint.cc
##########
@@ -980,7 +980,9 @@ class RPCClientSession : public RPCSession, public
DeviceAPI {
void CopyToRemote(void* local_from_bytes, DLTensor* remote_to, uint64_t
nbytes) final {
RPCCode code = RPCCode::kCopyToRemote;
uint64_t overhead = RemoteCopyCalculatePacketOverheadSize(remote_to, code,
nbytes);
- const uint64_t block_size = GetRPCMaxTransferSize() - overhead;
+ uint64_t rpc_max_size = GetRPCMaxTransferSize();
+ ICHECK_GT(rpc_max_size - overhead, 0) << "CopyToRemote: Invalid block
size!";
Review comment:
change to `ICHECK_GT(rpc_max_size, overhead)` to avoid wrap-around
--
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]