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

[SCU][Paddle TensorRT No.58] Add pd_op.unbind converter #70066

Closed
wants to merge 10 commits into from

Conversation

mori0umi
Copy link
Contributor

@mori0umi mori0umi commented Dec 9, 2024

PR Category

Inference

PR Types

New features

Description

新增了pd_op.unbind Marker 和 Converter

Copy link

paddle-bot bot commented Dec 9, 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 Dec 9, 2024
@luotao1 luotao1 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label Dec 9, 2024

if (op->HasAttribute("axis")) {
int axis = op->attribute<pir::Int32Attribute>("axis").data();
if (axis == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

?我如果第一维度不是动态shape,二三维度是动态shape呢

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改,但是我发现如果碰到动态shape,报错在marker pass之前,测试时不等进入这里的限制条件判断就报错崩溃了

Copy link
Contributor

@lizexu123 lizexu123 Dec 11, 2024

Choose a reason for hiding this comment

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

那这里就删除吧,convert先按照旧ir的写,如果还是出错,加一个TODO

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已经提交按旧ir写的converter的commit了,还是出错。请问TODO是加在测试还是marker

axis = paddle_op.attrs().get("axis", 0)
if axis < 0:
axis += input_rank
axis_tensor = add_1D_constant_layer(network, axis)
Copy link
Contributor

@lizexu123 lizexu123 Dec 9, 2024

Choose a reason for hiding this comment

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

以下代码和旧ir逻辑不同,请参考旧ir-trt

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的

shuffle_layer = network.add_shuffle(sliced_tensor)
shuffle_layer.set_input(1, newDims_tensor)
reshaped_tensor = shuffle_layer.get_output(0)
output_tensors.append(reshaped_tensor)
Copy link
Contributor

Choose a reason for hiding this comment

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

这里应该是直接返回reshaped_tensor吧,为什么要返回list

Copy link
Contributor Author

Choose a reason for hiding this comment

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

查阅paddle文档以及示例用法,unbind api应该返回一个list,list里面是一个个切割得到的tensor

Copy link

paddle-ci-bot bot commented Dec 20, 2024

Sorry to inform you that 1840c33's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

@luotao1 luotao1 closed this Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants