Skip to content

Conversation

@crazyxiaoxi
Copy link
Contributor

@crazyxiaoxi crazyxiaoxi commented Jul 29, 2024

PR Category

CINN

PR Types

improvements

Description

添加mode , margin_cross_entropy,box_clip算子符号推导接口
均已检查Optest

@paddle-bot
Copy link

paddle-bot bot commented Jul 29, 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.

@paddle-bot paddle-bot bot added the contributor External developers label Jul 29, 2024
@luotao1 luotao1 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label Jul 29, 2024
@crazyxiaoxi
Copy link
Contributor Author

crazyxiaoxi commented Aug 5, 2024

test_index_select_strided.py 中已包含OpTest单测,self.check_output() 确认使用,申请approve流水线

change

change

for (size_t i = 0; i < logits_rank; i++) {
if (i != axis) {
infer_context->AddBroadcastableCstr(logits_dims[i], labels_dims[i]);
Copy link
Contributor

Choose a reason for hiding this comment

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

这里应该是 Equal 约束吧?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

Comment on lines 743 to 746

if (labels_dims.size() > 1) {
infer_context->AddEqualCstr(logits_dims[axis], one);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

这里逻辑和infer meta不太符合,和之前的相等约束一并修改后再合并吧

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

Merge branch 'cinn/boxclip' into cinn/margin
@crazyxiaoxi
Copy link
Contributor Author

crazyxiaoxi commented Aug 9, 2024

把mode和boxclip放在一起测试,
原pr mode见#66621
原pr boxclip见#66629
test_mode_op.py中已包含OpTest单测,self.check_output() 确认使用,申请approve流水线
截屏2024-08-09 10 42 50
test_box_clip_op.py中已包含OpTest单测,本地测试通过
截屏2024-08-09 11 10 10

Merge branch 'cinn/mode' into cinn/margin
@crazyxiaoxi crazyxiaoxi changed the title 【Infer Symbolic Shape BUAA No.73】Add margin_cross_entropy op 【Infer Symbolic Shape BUAA No.10 No.73 No.78】Add mode , margin_cross_entropy , box_clipop Aug 9, 2024
@crazyxiaoxi crazyxiaoxi changed the title 【Infer Symbolic Shape BUAA No.10 No.73 No.78】Add mode , margin_cross_entropy , box_clipop 【Infer Symbolic Shape BUAA No.10 No.73 No.78】Add mode , margin_cross_entropy , box_clip. op Aug 9, 2024
Copy link
Contributor

@gongshaotian gongshaotian left a comment

Choose a reason for hiding this comment

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

LGTM


if (labels_dims.size() > 1) {
infer_context->AddEqualCstr(logits_dims[axis], one);
infer_context->AddEqualCstr(labels_dims[axis - 1], one);
Copy link
Contributor

Choose a reason for hiding this comment

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

infer meta里是检查labels_dims[logits_rank - 1]是否等于1,再确认下是否一致吧

Copy link
Contributor Author

@crazyxiaoxi crazyxiaoxi Aug 12, 2024

Choose a reason for hiding this comment

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

上面是infermeta的定义
截屏2024-08-12 11 39 34
检查labels_dims[logits_rank - 1]是否等于1

下面是opinfersymbolicshape
截屏2024-08-12 11 35 36

确实在写的时候不需要 ' axis-1' 只用axis = logits_rank -1

Copy link
Contributor

Choose a reason for hiding this comment

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

那下一个PR顺带修复一下吧,提的时候把这个PR链接带上

@Hongqing-work Hongqing-work merged commit 7232797 into PaddlePaddle:develop Aug 12, 2024
Jeff114514 pushed a commit to Jeff114514/Paddle that referenced this pull request Aug 14, 2024
…entropy , box_clip. op (PaddlePaddle#66730)

* mode

* boxclip

* test_op

* testop

* margin_cross_entropy_op

* resolve conflict

* resolve conflict

* resolve conflict

* testop

* testop

* testop

* tensor

* fix

fix conflict

fix conflict

fix conflict

* fix

* test

* fix problem

* fix equal

* Update unused viriable

* static check

* rerun

* add cstr

* fix small problem

* equal constrain

* change

change

change

* codestyle

* fix error

* comment fix

* fix comment

* fix
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.

5 participants