You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by mo...@apache.org on 2021/02/27 01:35:46 UTC

[tvm] branch main updated: Don't run non-tvm_op GraphRuntime nodes in Debug Runtime over RPC. (#7512)

This is an automated email from the ASF dual-hosted git repository.

moreau pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new f6d0fee  Don't run non-tvm_op GraphRuntime nodes in Debug Runtime over RPC. (#7512)
f6d0fee is described below

commit f6d0feef52f7b4c037150f405c37e693b4884f7f
Author: Andrew Reusch <ar...@octoml.ai>
AuthorDate: Fri Feb 26 17:32:43 2021 -0800

    Don't run non-tvm_op GraphRuntime nodes in Debug Runtime over RPC. (#7512)
    
    * Don't run non-tvm_op GraphRuntime nodes in Debug Runtime over RPC.
    
     * These are filtered out in SetupOpExecs for normal debug runtime
     operation.
    
    * retrigger CI
    
    * retrigger CI
    
    * address tkonolige comment
---
 src/runtime/graph/debug/graph_runtime_debug.cc | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/runtime/graph/debug/graph_runtime_debug.cc b/src/runtime/graph/debug/graph_runtime_debug.cc
index 0b8f39d..93bdd06 100644
--- a/src/runtime/graph/debug/graph_runtime_debug.cc
+++ b/src/runtime/graph/debug/graph_runtime_debug.cc
@@ -110,6 +110,19 @@ class GraphRuntimeDebug : public GraphRuntime {
   }
 
   double RunOpRPC(int index, int number, int repeat, int min_repeat_ms) {
+    // Right now we expect either "tvm_op" for nodes which run PackedFunc or "null" for nodes which
+    // represent inputs/parameters to the graph. Other types may be supported in the future, but
+    // consideration would be needed as to how to do that over RPC before we support it here.
+    if (nodes_[index].op_type != "tvm_op") {
+      CHECK_EQ(nodes_[index].op_type, "null")
+          << "Don't know how to run op type " << nodes_[index].op_type
+          << " remotely over RPC right now";
+
+      // NOTE: GraphRuntimeDebug expects graph nodes to have an "op" attribute of "tvm_op" or "null"
+      // and "null" is a placeholder node for a parameter or input.
+      return 0;
+    }
+
     const TVMContext& ctx = data_entry_[entry_id(index, 0)]->ctx;
     TVMOpParam param = nodes_[index].param;
     std::string name = param.func_name;