Skip to content

[Paddle Tensorrt] add tensorrt converter and marker #69208

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

Merged
merged 5 commits into from
Nov 13, 2024

Conversation

Hanyonggong
Copy link
Contributor

@Hanyonggong Hanyonggong commented Nov 6, 2024

PR Category

Inference

PR Types

New features

Description

card-71500
添加equal 、not_equal、floor_div、bmm、full_like、silu、swish、floor、log的marker、converter和单测

Copy link

paddle-bot bot commented Nov 6, 2024

你的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.

@paddle-bot paddle-bot bot added the contributor External developers label Nov 6, 2024
Comment on lines 1508 to 1509
VLOG(3) << "Tanh op does not support 0 dim input when TensorRT < 8.6.";
return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

这个是tanh还是equal?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

Comment on lines 1566 to 1585
#else
if (hasAttr && dtype != phi::DataType::FLOAT32 &&
dtype != phi::DataType::FLOAT64 && dtype != phi::DataType::INT32 &&
dtype != phi::DataType::INT64) {
VLOG(3)
<< "the pd_op.full_like only supports int32/int64/float32/float64 by"
"trt8.4 below";
return false;
}
if (!hasAttr) {
if (!x_dtype.isa<pir::Float32Type>() &&
!x_dtype.isa<pir::Float64Type>() && !x_dtype.isa<pir::Int32Type>() &&
!x_dtype.isa<pir::Int64Type>()) {
VLOG(3) << "the pd_op.full_like only supports "
"int32/int64/float32/float64 by"
"trt8.4 below";
return false;
}
}
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

这段逻辑删了吧,后续我们默认的trt版本应该就是8.4以上的了

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已删除

@@ -23,6 +23,8 @@

@converter_registry.register("pd_op.greater_than", trt_version="8.x")
@converter_registry.register("pd_op.less_than", trt_version="8.x")
@converter_registry.register("pd_op.equal", trt_version="8.x")
@converter_registry.register("pd_op.not_equal", trt_version="8.x")
def logic_converter(network, paddle_op, inputs):
Copy link
Contributor

Choose a reason for hiding this comment

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

把这里的逻辑重构一下吧,也改成映射的形式,参考activation相关converter的做法

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已重构

@lizexu123 lizexu123 merged commit 989d454 into PaddlePaddle:develop Nov 13, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants