-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
@@ -0,0 +1,106 @@ | |||
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. |
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.
2023
return (in_out[pos].type == in_out[0].type && | ||
in_out[pos].format == in_out[0].format); | ||
} | ||
// 确保输出数据类型和输入一致 |
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.
这个注释是给哪一个输出的呢?pos=2 的时候没有一致
self, program_config | ||
) -> (paddle_infer.Config, List[int], float): | ||
def generate_dynamic_shape(): | ||
self.dynamic_shape.min_input_shape = { |
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.
dynamic shape设置成动态,min和max不一样
int nb_inputs, | ||
nvinfer1::IExprBuilder& expr_builder, // NOLINT | ||
const framework::OpDesc& op_desc) { | ||
PADDLE_ENFORCE_LE( |
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.
这里的所有检查都不要放在自定义plugin 中,要提前到 op_teller中。这样运行不符合条件的时候不会报错,只会回退到原生推理
phi::errors::InvalidArgument("argsort only has two " | ||
"output, but received asvector: %d.", | ||
output_index)); | ||
PADDLE_ENFORCE_EQ( |
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
PR types
Others
PR changes
OPs
Description
Pcard-71501
添加了argsort,采用通用plugin的方式进TensorRT