Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure dynamic shape tensorrt #1590

Merged
merged 10 commits into from
Jan 14, 2022
Merged

configure dynamic shape tensorrt #1590

merged 10 commits into from
Jan 14, 2022

Conversation

felixhjh
Copy link
Collaborator

  1. new API for configuring dynamic shape tensorrt
  2. change configurations for ocr_v2 model

@paddle-bot-old
Copy link

Thanks for your contribution!

"x": [6, 3, 32, 100],
"lstm_1.tmp_0": [25, 5, 128]
}
self.dynamic_shape_info = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

增大一行中文注释说明:通过self.dynamic_shape_info成员设置trt dyn shape

@@ -88,7 +88,9 @@ def load_model_config(self,
mkldnn_op_list=None,
mkldnn_bf16_op_list=None,
use_feed_fetch_ops=False,
use_ascend_cl=False):
use_ascend_cl=False,
min_subgraph_size=3,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

增加Args 注释

use_static=False,
use_calib_mode=False)

if len(dynamic_shape_info):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

增加min_input_shape,max_input_shape, opt_input_shape 检查,判断key存在,类型判断

model_config, self._device_name, self._use_gpu, self._use_trt,
self._use_lite, self._use_xpu, device_type, self._devices,
self._mem_optim, self._ir_optim, self._use_profile,
self._thread_num, self._client_type, self._fetch_names,
self._precision, self._use_mkldnn, self._mkldnn_cache_capacity,
self._mkldnn_op_list, self._mkldnn_bf16_op_list,
self._use_ascend_cl))
self._use_ascend_cl, self.min_subgraph_size))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

此处增加有TRT dyn shape,False/True,但不用打印出具体信息

self.dynamic_shape_info = {}
self.set_dynamic_shape_info()

def set_dynamic_shape_info(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

增加注释

Copy link
Collaborator

@TeslaZhao TeslaZhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@TeslaZhao TeslaZhao merged commit 8c88895 into develop Jan 14, 2022
@felixhjh felixhjh deleted the dynamic_tensorrt branch January 20, 2022 03:47
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.

2 participants