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



##########
File path: src/runtime/crt/host/main.cc
##########
@@ -136,9 +136,12 @@ int main(int argc, char** argv) {
            "failed to register GraphExecutor TVMModule");
 #endif
 
-  if (TVMFuncRegisterGlobal("tvm.testing.reset_server", 
(TVMFunctionHandle)&testonly_reset_server,
-                            0)) {
-    fprintf(stderr, "utvm runtime: internal error registering global 
packedfunc; exiting\n");
+  int error = TVMFuncRegisterGlobal("tvm.testing.reset_server",
+                                    (TVMFunctionHandle)&testonly_reset_server, 
0);
+  if (error) {
+    fprintf(stderr,
+            "utvm runtime: internal error (error#: %d) registering global 
packedfunc; exiting\n",

Review comment:
       done

##########
File path: src/runtime/rpc/rpc_endpoint.cc
##########
@@ -1042,12 +1069,38 @@ class RPCClientSession : public RPCSession, public 
DeviceAPI {
   bool IsLocalSession() const final { return false; }
 
  private:
+  void RPCMaxTransferRemoteReturnValue(TVMArgs args) {
+    // Use args[1] as return value, args[0] is tcode

Review comment:
       done

##########
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:
       done




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