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

[XPU]. Add multiclass_nms op on xpu. #9276

Merged
merged 2 commits into from
Jul 28, 2022

Conversation

wbn03
Copy link
Contributor

@wbn03 wbn03 commented Jul 22, 2022

增加multiclass_nms的xpu支持,其中nms3当前只支持昆仑1。

@paddle-bot
Copy link

paddle-bot bot commented Jul 22, 2022

Thanks for your contribution!

Copy link
Collaborator

@shentanyue shentanyue left a comment

Choose a reason for hiding this comment

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

LGTM

@shanliang1992
Copy link
Collaborator

LGTM

Copy link
Collaborator

@zhupengyang zhupengyang left a comment

Choose a reason for hiding this comment

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

有些小问题,后面提PR改下吧 ~

Comment on lines +52 to +54
CHECK(class_num <= 80)
<< "xpu MulticlassNms only support class_num <= 80 which is "
<< class_num;
Copy link
Collaborator

Choose a reason for hiding this comment

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

CHECK_LE(class_num, 80);

Comment on lines +179 to +201
// REGISTER_LITE_KERNEL(multiclass_nms,
// kXPU,
// kFloat,
// kNCHW,
// paddle::lite::kernels::xpu::MulticlassNmsCompute,
// def)
// .BindInput("BBoxes", {LiteType::GetTensorTy(TARGET(kXPU))})
// .BindInput("Scores", {LiteType::GetTensorTy(TARGET(kXPU))})
// .BindOutput("Out", {LiteType::GetTensorTy(TARGET(kHost))})
// .Finalize();

// REGISTER_LITE_KERNEL(multiclass_nms2,
// kXPU,
// kFloat,
// kNCHW,
// paddle::lite::kernels::xpu::MulticlassNmsCompute,
// def)
// .BindInput("BBoxes", {LiteType::GetTensorTy(TARGET(kXPU))})
// .BindInput("Scores", {LiteType::GetTensorTy(TARGET(kXPU))})
// .BindOutput("Out", {LiteType::GetTensorTy(TARGET(kHost))})
// .BindOutput("Index",
// {LiteType::GetTensorTy(TARGET(kHost), PRECISION(kInt32))})
// .Finalize();
Copy link
Collaborator

Choose a reason for hiding this comment

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

删掉不用的代码。如果目前有bug,那么修复bug后再加上注册。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

主要是流水线有一个模型用到了nms2算子,但是class_num大于512导致报错,等后面api这边修复后解除注释就可以使用了

@@ -0,0 +1,37 @@
// Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
Copy link
Collaborator

Choose a reason for hiding this comment

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

2022

Comment on lines +176 to +177
/* The current multiclass_nms2 op in xdnn only support topk_nms <= 512
Comment this to avoid yolov3_darknet53_fp32_baidu run error. */
Copy link
Collaborator

@zhupengyang zhupengyang Jul 28, 2022

Choose a reason for hiding this comment

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

大于 512 情况下,xdnn 会有明确报错吗?如果 xdnn 没有明确的报错,最好再 lite 代码中加 check,方便后面定位问题。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

xdnn会有明确报错,wrapper代码中有check

@zhupengyang zhupengyang merged commit 7421305 into PaddlePaddle:develop Jul 28, 2022
@wbn03 wbn03 deleted the multiclass_nms3 branch November 16, 2022 09:09
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.

4 participants