Skip to content

[Paddle Tensorrt] add pd_op.assign,pd_op.assign_value_,pd_op.assign_out converter #68775

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 7 commits into from
Oct 22, 2024

Conversation

lizexu123
Copy link
Contributor

@lizexu123 lizexu123 commented Oct 17, 2024

PR Category

Inference

PR Types

New features

Description

card-71500
添加了pd_op.assign,pd_op.assign_value_,pd_op.assign_out converter,以及修复了pd_op.split_with_num的bug

Copy link

paddle-bot bot commented Oct 17, 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.

@lizexu123 lizexu123 marked this pull request as draft October 18, 2024 03:44
@lizexu123 lizexu123 marked this pull request as ready for review October 18, 2024 03:44
def setUp(self):
self.python_api = paddle.assign
self.api_args = {
"x": np.array([[2.5, 2.5], [2.5, 2.5], [2.5, 2.5]], dtype='float32')
Copy link
Contributor

Choose a reason for hiding this comment

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

converter里写了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.

已修改

dtype = np.bool

constant_layer = network.add_constant(
shape, np.array(values, dtype=np.float32)
Copy link
Contributor

Choose a reason for hiding this comment

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

为啥固定死数据类型是float32?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里写错了,我改下

def setUp(self):
self.python_api = paddle.split
self.api_args = {
"x": np.random.randn(1, 2).astype(np.float32),
Copy link
Contributor

Choose a reason for hiding this comment

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

同样的, 这个单测似乎过于简单, 应该考虑到更多的case, 例如num_or_sections=1或者等于shape的值会是什么结果?

Copy link
Contributor Author

@lizexu123 lizexu123 Oct 21, 2024

Choose a reason for hiding this comment

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

前面都测过了,这个是补充的有bug场景的组网

return identity_layer.get_output(0)


@converter_registry.register("pd_op.assign_value_", trt_version="8.x")
Copy link
Contributor

Choose a reason for hiding this comment

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

单测似乎没有测试pd_op.assign_value_

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TestAssignValueFloat32TRTPattern这个是

@lizexu123 lizexu123 marked this pull request as draft October 21, 2024 10:38
@lizexu123 lizexu123 marked this pull request as ready for review October 21, 2024 10:39
@lizexu123 lizexu123 merged commit 8f67128 into PaddlePaddle:develop Oct 22, 2024
27 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.

3 participants