Skip to content

[BYOC][TENSORRT] minor fix after loading trt engine from disk#11614

Merged
masahi merged 1 commit intomainfrom
unknown repository
Jun 8, 2022
Merged

[BYOC][TENSORRT] minor fix after loading trt engine from disk#11614
masahi merged 1 commit intomainfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Jun 7, 2022

Before the fix, after GetCachedEnginesFromDisk(), max_batch_size_ is -1 which results in the batch_size <= max_batch_size_ to be False. Engine will be rebuilt because find_engine_flag is False.

Log before the fix:

[19:41:41] /home/ubuntu/neo-ai/apache_tvm/tvm/src/runtime/contrib/tensorrt/tensorrt_runtime.cc:356: Loading cached TensorRT engine from ./tvmgen_default_tensorrt_main_0_fp32.plan
[19:41:43] /home/ubuntu/neo-ai/apache_tvm/tvm/src/runtime/contrib/tensorrt/tensorrt_runtime.cc:379: finished saving engine and context ... 
[19:41:43] /home/ubuntu/neo-ai/apache_tvm/tvm/src/runtime/contrib/tensorrt/tensorrt_runtime.cc:356: Loading cached TensorRT engine from ./tvmgen_default_tensorrt_main_1_fp32.plan
[19:41:43] /home/ubuntu/neo-ai/apache_tvm/tvm/src/runtime/contrib/tensorrt/tensorrt_runtime.cc:379: finished saving engine and context ... 
[19:41:43] /home/ubuntu/neo-ai/apache_tvm/tvm/src/runtime/contrib/tensorrt/tensorrt_runtime.cc:287: Building new TensorRT engine for subgraph tvmgen_default_tensorrt_main_0 with batch size 1

Log after the fix:

[19:42:46] /home/ubuntu/neo-ai/apache_tvm/tvm/src/runtime/contrib/tensorrt/tensorrt_runtime.cc:356: Loading cached TensorRT engine from ./tvmgen_default_tensorrt_main_0_fp32.plan
[19:42:48] /home/ubuntu/neo-ai/apache_tvm/tvm/src/runtime/contrib/tensorrt/tensorrt_runtime.cc:380: finished loading engine and context ... 
[19:42:48] /home/ubuntu/neo-ai/apache_tvm/tvm/src/runtime/contrib/tensorrt/tensorrt_runtime.cc:356: Loading cached TensorRT engine from ./tvmgen_default_tensorrt_main_1_fp32.plan
[19:42:48] /home/ubuntu/neo-ai/apache_tvm/tvm/src/runtime/contrib/tensorrt/tensorrt_runtime.cc:380: finished loading engine and context ... 

@ghost ghost changed the title minor fix after loading trt engine from disk [BYOC][TENSORRT] minor fix after loading trt engine from disk Jun 7, 2022
@ghost
Copy link
Author

ghost commented Jun 8, 2022

@masahi masahi merged commit 8ba4300 into apache:main Jun 8, 2022
ghost pushed a commit to neo-ai/tvm that referenced this pull request Jun 8, 2022
ghost pushed a commit to neo-ai/tvm that referenced this pull request Jun 8, 2022
Kathryn-cat pushed a commit to Kathryn-cat/tvm that referenced this pull request Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant