You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/02/09 00:34:12 UTC

[GitHub] [tvm] trevor-m commented on a change in pull request #7162: Fix Segmentation Fault For Tensorrt BYOC when TVM_TENSORRT_CACHE_DIR is Set

trevor-m commented on a change in pull request #7162:
URL: https://github.com/apache/tvm/pull/7162#discussion_r572479897



##########
File path: src/runtime/contrib/tensorrt/tensorrt_runtime.cc
##########
@@ -211,6 +218,16 @@ class TensorRTRuntime : public JSONRuntimeBase {
       builder.AddOutput(outputs_[i], EntryID(outputs_[i]));
     }
 
+    // Allocate Device Buffers
+    if (trt_engine_cache_.count(std::make_pair(symbol_name_, batch_size_))) {
+      TensorRTEngineAndContext& engine_and_context =
+          trt_engine_cache_.at(std::make_pair(symbol_name_, batch_size_));
+      if (engine_and_context.device_buffers.size() == 0) {
+        builder.CreateDeviceBuffers(&engine_and_context);
+        return;

Review comment:
       I think the best solution is to move `CreateDeviceBuffers` out of TensorRTBuilder and into the runtime module. That way we can call it without the unnecessary allocations and creations done by TensorRTBuilder




----------------------------------------------------------------
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:
users@infra.apache.org