areusch commented on a change in pull request #7838:
URL: https://github.com/apache/tvm/pull/7838#discussion_r614969905



##########
File path: src/runtime/rpc/rpc_endpoint.cc
##########
@@ -801,14 +800,13 @@ void RPCEndpoint::CopyToRemote(void* from_bytes, 
DLTensor* to, uint64_t nbytes)
   std::lock_guard<std::mutex> lock(mutex_);
   RPCCode code = RPCCode::kCopyToRemote;
 
-  uint64_t num_data_bytes = static_cast<uint64_t>(GetDataSize(*to));
-  ICHECK_EQ(nbytes, num_data_bytes);
+  uint64_t tensor_total_size_bytes = static_cast<uint64_t>(GetDataSize(*to));
+  ICHECK_LE(to->byte_offset + nbytes, tensor_total_size_bytes)
+      << "CopyToRemote: overflow in tensor size: (" << to->byte_offset << ", " 
<< nbytes << ", "

Review comment:
       maybe also include byte_offset=, nbytes= in the error message




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