[XPU]. Add multiclass_nms op on xpu.#9276
Merged
zhupengyang merged 2 commits intoPaddlePaddle:developfrom Jul 28, 2022
Merged
Conversation
|
Thanks for your contribution! |
…darknet53_fp32_baidu run error.
Collaborator
|
LGTM |
zhupengyang
approved these changes
Jul 28, 2022
Comment on lines
+52
to
+54
| CHECK(class_num <= 80) | ||
| << "xpu MulticlassNms only support class_num <= 80 which is " | ||
| << class_num; |
Collaborator
There was a problem hiding this comment.
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(); |
Collaborator
There was a problem hiding this comment.
删掉不用的代码。如果目前有bug,那么修复bug后再加上注册。
Contributor
Author
There was a problem hiding this comment.
主要是流水线有一个模型用到了nms2算子,但是class_num大于512导致报错,等后面api这边修复后解除注释就可以使用了
| @@ -0,0 +1,37 @@ | |||
| // Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. | |||
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. */ |
Collaborator
There was a problem hiding this comment.
大于 512 情况下,xdnn 会有明确报错吗?如果 xdnn 没有明确的报错,最好再 lite 代码中加 check,方便后面定位问题。
Contributor
Author
There was a problem hiding this comment.
xdnn会有明确报错,wrapper代码中有check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
增加multiclass_nms的xpu支持,其中nms3当前只支持昆仑1。