FrozenGene commented on a change in pull request #8808:
URL: https://github.com/apache/tvm/pull/8808#discussion_r694443709



##########
File path: src/runtime/contrib/tensorrt/tensorrt_runtime.cc
##########
@@ -66,7 +78,16 @@ class TensorRTRuntime : public JSONRuntimeBase {
         use_implicit_batch_(true),
         max_workspace_size_(size_t(1) << 30),
         max_batch_size_(-1),
-        multi_engine_mode_(false) {}
+        multi_engine_mode_(false) {
+          const bool use_int8 = dmlc::GetEnv("TVM_TENSORRT_USE_INT8", false);

Review comment:
       I don't think use environment value is a perfect solution. I prefer 
making `use_int8` and `int8_calibration_batch` be an option of `tensorrt 
config` and writing is inside json. The api usage will be like this `mod, 
config = partition_for_tensorrt(mod, params, use_int8=True, 
int8_calibration_batches=10)`. cc @jcf94 

##########
File path: src/runtime/contrib/tensorrt/tensorrt_builder.cc
##########
@@ -156,8 +161,18 @@ TensorRTEngineAndContext TensorRTBuilder::BuildEngine() {
   config_ = builder_->createBuilderConfig();
   config_->setMaxWorkspaceSize(max_workspace_size_);
   if (use_fp16_) {
+    config_->setFlag(nvinfer1::BuilderFlag::kGPU_FALLBACK);

Review comment:
       I think this is not needed

##########
File path: src/runtime/contrib/tensorrt/tensorrt_runtime.cc
##########
@@ -125,17 +147,26 @@ class TensorRTRuntime : public JSONRuntimeBase {
 
   /*! \brief Run inference using built engine. */
   void Run() override {
+    
     auto& engine_and_context = GetOrBuildEngine();
+    // LOG(INFO) << "start running inference";
+    // this->CreateCalibratorIfUsingInt8(engine_and_context, data_entry_);

Review comment:
       If not needed, please remove it.




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to