-
Notifications
You must be signed in to change notification settings - Fork 250
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
Conversation
felixhjh
commented
Jan 13, 2022
- new API for configuring dynamic shape tensorrt
- change configurations for ocr_v2 model
Thanks for your contribution! |
"x": [6, 3, 32, 100], | ||
"lstm_1.tmp_0": [25, 5, 128] | ||
} | ||
self.dynamic_shape_info = { |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
增加注释
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM