Skip to content

Conversation

@jiweibo
Copy link
Contributor

@jiweibo jiweibo commented Aug 11, 2021

PR types

New features

PR changes

Others

Describe

trt support tuned_dynamic_shape mode.

1、Use offline data for autotune, get the shape range information at runtime and save it in the shape_range_info.pbtxt .

config.CollectShapeRangeInfo("shape_range_info.pbtxt")

the file looks like

shape_range_info {
  name: "fc_11.tmp_0"
  min_shape: 1
  min_shape: 32
  min_shape: 768
  max_shape: 1
  max_shape: 128
  max_shape: 768
  opt_shape: 1
  opt_shape: 32
  opt_shape: 768
}
shape_range_info {
  name: "fc_11.tmp_1"
  min_shape: 1
  min_shape: 32
  min_shape: 768
  max_shape: 1
  max_shape: 128
  max_shape: 768
  opt_shape: 1
  opt_shape: 32
  opt_shape: 768
}
shape_range_info {
  name: "fc_12.tmp_0"
  min_shape: 1
  min_shape: 32
  min_shape: 768
  max_shape: 1
  max_shape: 128
  max_shape: 768
  opt_shape: 1
  opt_shape: 32
  opt_shape: 768
}
...

2、Comment config.CollectShapeInfo("shape_range_info.pbtxt") and set config.EnableTunedTensorRtDynamicShape("shape_range_info.pbtxt", /*allow_build_at_runtime*/ true);

3、DEMO:https://github.com/PaddlePaddle/Paddle-Inference-Demo/tree/master/c%2B%2B/paddle-trt/tuned_dynamic_shape

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

cryoco
cryoco previously approved these changes Sep 10, 2021
Copy link

@cryoco cryoco left a comment

Choose a reason for hiding this comment

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

LGTM

CheQiXiao
CheQiXiao previously approved these changes Sep 10, 2021
@jiweibo jiweibo dismissed stale reviews from CheQiXiao and cryoco via d816963 September 10, 2021 08:24
Copy link
Member

@shangzhizhou shangzhizhou left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@lanxianghit lanxianghit left a comment

Choose a reason for hiding this comment

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

LGTM for API changes, compatibility confirmed.

Copy link
Member

@raindrops2sea raindrops2sea left a comment

Choose a reason for hiding this comment

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

LGTM

@jiweibo jiweibo merged commit 7c96efe into PaddlePaddle:develop Sep 14, 2021
@jiweibo jiweibo deleted the tuned_dynamic_shape branch September 14, 2021 02:23
AnnaTrainingG pushed a commit to AnnaTrainingG/Paddle that referenced this pull request Sep 29, 2021
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.

7 participants