Repository navigation
【BUAA】【Infer Symbolic Shape】Add moe, multiclass_nms3, shadow_feed_tensor operator for CINN compiler - #67337
Merged
Conversation
Sf tensor
|
你的PR提交成功,感谢你对开源项目的贡献! |
Contributor
Author
|
已修改单测 |
| box_dims.size())); | ||
|
|
||
| if (score_size == 3) { | ||
| PADDLE_ENFORCE_EQ( |
Contributor
There was a problem hiding this comment.
这个5个dim的约束需要修改为使用Addequalcstr()添加
Contributor
Author
There was a problem hiding this comment.
score_size和box_dims.size()均为int类型
Collaborator
There was a problem hiding this comment.
不包含
||的约束已进行修改
剩下的约束目前shape dialect无法表示了,直接删掉或者写成TODO,不能直接使用静态值判断
| out_shape.emplace_back(box_dims[2] + 2); | ||
|
|
||
| std::vector<symbol::DimExpr> index_shape; | ||
| index_shape.emplace_back(next_symbol_out_and_index); |
Contributor
There was a problem hiding this comment.
怎么确定的out_shape 与 index_shape的第一维是相同的动态维度
| index_shape.emplace_back(1); | ||
|
|
||
| std::vector<symbol::DimExpr> nms_rois_num_shape; | ||
| nms_rois_num_shape.emplace_back(next_symbol_nms_rois_num); |
Contributor
There was a problem hiding this comment.
如果能确定这个动态维度与上面两个无关,这里就可以不再使用中间变量了,直接emplace_back(infer_context->GetNextSymName());
| OP_DECLARE_INFER_SYMBOLIC_SHAPE(Scatter_) | ||
| OP_DECLARE_INFER_SYMBOLIC_SHAPE(Select) | ||
| OP_DECLARE_INFER_SYMBOLIC_SHAPE(ShadowFeed) | ||
| OP_DECLARE_INFER_SYMBOLIC_SHAPE(ShadowFeedTensors) |
Contributor
There was a problem hiding this comment.
moe这个算子符号推导逻辑比较简单,而且注意到已有test_moe_api.py测试文件存在,建议删除这个单测文件
Hongqing-work
approved these changes
Aug 16, 2024
33 of 35 tasks
6 of 33 tasks
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.
PR Category
CINN
PR Types
Others
Description
shadow_feed_tensor缺失单测,multiclass_nms3有单测但未开启check_pir测试,仿照fused_moe为moe添加一个单测