Skip to content

[SCU][Paddle TensorRT No.40] Add pd_op.index_select converter #69762

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 19 commits into from
Dec 23, 2024

Conversation

wwwuyan
Copy link
Contributor

@wwwuyan wwwuyan commented Nov 27, 2024

PR Category

User Experience

PR Types

New features

Description

trt_op_maker_pass.cc文件里的相关内容已经改过了,所以没有再修改

Copy link

paddle-bot bot commented Nov 27, 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 27, 2024
@luotao1 luotao1 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label Nov 27, 2024
def index_select_converter(network, paddle_op, inputs):
input_tensor = inputs[0]
index_tensor = inputs[1]
axis = paddle_op.attrs().get("dim", 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

index_select的参数是axis,仔细看pd_op2.cc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

index_select_op.cc文件里的axis也是从dim属性里取值的,可能参数名就是dim?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

index_tensor = inputs[1]
axis = paddle_op.attrs().get("axis", 0)

gather_layer = network.add_gather(input_tensor, index_tensor, axis)
Copy link
Contributor

Choose a reason for hiding this comment

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

旧ir下这里是shuffle layer

input_tensor, reshape_layer.get_output(0), axis
)

output_layer = network.add_shuffle(gather_layer.get_output(0))
Copy link
Contributor

Choose a reason for hiding this comment

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

旧ir下只有一个shuffle和gather层,这里为什么又加一个shuffle

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

self.max_shape = {"x": [5, 3, 3], "index": [5]}

def test_trt_result_fp16(self):
self.check_trt_result(precision_mode="fp16")
Copy link
Contributor

Choose a reason for hiding this comment

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

这个输入是int64,怎么测试fp16的,这个什么也不填

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

Copy link

paddle-ci-bot bot commented Dec 20, 2024

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

@luotao1 luotao1 merged commit e55d200 into PaddlePaddle:develop Dec 23, 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 HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants