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

[Paddle-TRT] Add check for TRT runtime dynamic shape #32155

Merged
merged 5 commits into from
Apr 14, 2021

Conversation

cryoco
Copy link
Contributor

@cryoco cryoco commented Apr 8, 2021

PR types

Function optimization

PR changes

Others

Describe

explicitly hints how runtime input shapes of TRT engines are inconsistent with min/max input shapes configured in SetTRTDynamicShapeInfo(). The error message is like:
image

@paddle-bot-old
Copy link

paddle-bot-old bot commented Apr 8, 2021

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

@@ -76,6 +76,53 @@ static void RuntimeStaticShapeCheck(std::vector<int64_t> runtime_input_shape,
model_input_shape_str, runtime_input_shape_str));
}

static void RuntimeDynamicShapeCheck(std::string x,
Copy link
Member

Choose a reason for hiding this comment

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

输入参数用const &

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

"TRT engine runtime input dims size(%d) inconsistent "
"with the dynamic shape size(%d)",
runtime_input_shape.size(), min_input_shape.size()));
auto is_input_shape_valid = [&](std::vector<int64_t> runtime_input_shape,
Copy link
Member

Choose a reason for hiding this comment

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

同上

self.check_output_with_option(use_gpu)


class TRTDynamicShapeOutOfBound2Test(TRTDynamicShapeTest):
Copy link
Member

Choose a reason for hiding this comment

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

增加lower bound测试case

shangzhizhou
shangzhizhou previously approved these changes Apr 13, 2021
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

@cryoco cryoco merged commit 8552a18 into PaddlePaddle:develop Apr 14, 2021
@cryoco cryoco deleted the check-trt-runtime-dynamic-shape branch April 14, 2021 07:12
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.

3 participants