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 argsort op into TRT GenericPlugin #59409

Merged
merged 41 commits into from
Dec 8, 2023

Conversation

lizexu123
Copy link
Contributor

PR types

Others

PR changes

OPs

Description

Pcard-71501
添加了argsort,采用通用plugin的方式进TensorRT

Copy link

paddle-bot bot commented Nov 27, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@lizexu123 lizexu123 changed the title argsort [Paddle-TRT ]add argsort op into TRT GenericPlugin Nov 28, 2023
@@ -0,0 +1,106 @@
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

2023

return (in_out[pos].type == in_out[0].type &&
in_out[pos].format == in_out[0].format);
}
// 确保输出数据类型和输入一致
Copy link
Contributor

Choose a reason for hiding this comment

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

这个注释是给哪一个输出的呢?pos=2 的时候没有一致

self, program_config
) -> (paddle_infer.Config, List[int], float):
def generate_dynamic_shape():
self.dynamic_shape.min_input_shape = {
Copy link
Contributor

Choose a reason for hiding this comment

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

dynamic shape设置成动态,min和max不一样

int nb_inputs,
nvinfer1::IExprBuilder& expr_builder, // NOLINT
const framework::OpDesc& op_desc) {
PADDLE_ENFORCE_LE(
Copy link
Contributor

Choose a reason for hiding this comment

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

这里的所有检查都不要放在自定义plugin 中,要提前到 op_teller中。这样运行不符合条件的时候不会报错,只会回退到原生推理

phi::errors::InvalidArgument("argsort only has two "
"output, but received asvector: %d.",
output_index));
PADDLE_ENFORCE_EQ(
Copy link
Contributor

Choose a reason for hiding this comment

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

同上

Copy link
Contributor

@yuanlehome yuanlehome left a comment

Choose a reason for hiding this comment

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

LGTM

@yuanlehome yuanlehome merged commit 6e4163a into PaddlePaddle:develop Dec 8, 2023
29 checks passed
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.

None yet

3 participants