-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Conversation
Thanks for your contribution! |
…darknet53_fp32_baidu run error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有些小问题,后面提PR改下吧 ~
CHECK(class_num <= 80) | ||
<< "xpu MulticlassNms only support class_num <= 80 which is " | ||
<< class_num; |
There was a problem hiding this comment.
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);
// 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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
删掉不用的代码。如果目前有bug,那么修复bug后再加上注册。
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2022
/* The current multiclass_nms2 op in xdnn only support topk_nms <= 512 | ||
Comment this to avoid yolov3_darknet53_fp32_baidu run error. */ |
There was a problem hiding this comment.
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,方便后面定位问题。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xdnn会有明确报错,wrapper代码中有check
增加multiclass_nms的xpu支持,其中nms3当前只支持昆仑1。