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

【BUAA】【Infer Symbolic Shape】Add moe, multiclass_nms3, shadow_feed_tensor operator for CINN compiler #67337

Merged
merged 34 commits into from
Aug 16, 2024

Conversation

Jeff114514
Copy link
Contributor

@Jeff114514 Jeff114514 commented Aug 12, 2024

PR Category

CINN

PR Types

Others

Description

shadow_feed_tensor缺失单测,multiclass_nms3有单测但未开启check_pir测试,仿照fused_moe为moe添加一个单测

Copy link

paddle-bot bot commented Aug 12, 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.

@Jeff114514 Jeff114514 closed this Aug 12, 2024
@Jeff114514 Jeff114514 reopened this Aug 12, 2024
@paddle-bot paddle-bot bot added the contributor External developers label Aug 12, 2024
@luotao1 luotao1 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label Aug 13, 2024
@Jeff114514
Copy link
Contributor Author

已修改单测

box_dims.size()));

if (score_size == 3) {
PADDLE_ENFORCE_EQ(
Copy link
Contributor

Choose a reason for hiding this comment

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

这个5个dim的约束需要修改为使用Addequalcstr()添加

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
Contributor Author

Choose a reason for hiding this comment

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

score_size和box_dims.size()均为int类型

Copy link
Contributor

Choose a reason for hiding this comment

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

不包含||的约束已进行修改

剩下的约束目前shape dialect无法表示了,直接删掉或者写成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.

已完成修改

out_shape.emplace_back(box_dims[2] + 2);

std::vector<symbol::DimExpr> index_shape;
index_shape.emplace_back(next_symbol_out_and_index);
Copy link
Contributor

@gongshaotian gongshaotian Aug 14, 2024

Choose a reason for hiding this comment

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

怎么确定的out_shape 与 index_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.

MultiClassNMSKernel out和index第一维总是相同的

index_shape.emplace_back(1);

std::vector<symbol::DimExpr> nms_rois_num_shape;
nms_rois_num_shape.emplace_back(next_symbol_nms_rois_num);
Copy link
Contributor

Choose a reason for hiding this comment

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

如果能确定这个动态维度与上面两个无关,这里就可以不再使用中间变量了,直接emplace_back(infer_context->GetNextSymName());

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已完成修改

@@ -138,6 +138,7 @@ OP_DECLARE_INFER_SYMBOLIC_SHAPE(Scatter)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(Scatter_)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(Select)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(ShadowFeed)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(ShadowFeedTensors)
Copy link
Contributor

Choose a reason for hiding this comment

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

这个算子有点问题先不添加了

Copy link
Contributor

Choose a reason for hiding this comment

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

moe这个算子符号推导逻辑比较简单,而且注意到已有test_moe_api.py测试文件存在,建议删除这个单测文件

@luotao1 luotao1 merged commit 28908c4 into PaddlePaddle:develop Aug 16, 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.

4 participants