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 set_value_with_tensor, sigmoid_cross_entropy_with_logits,swiglu #67098

Merged
merged 9 commits into from
Aug 12, 2024

Conversation

uanu2002
Copy link
Contributor

@uanu2002 uanu2002 commented Aug 6, 2024

PR Category

CINN

PR Types

Others

Description

添加set_value_with_tensor, sigmoid_cross_entropy_with_logits,swiglu算子符号推导接口实现。

Copy link

paddle-bot bot commented Aug 6, 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 Aug 6, 2024
@luotao1 luotao1 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label Aug 7, 2024
@uanu2002
Copy link
Contributor Author

test_set_value_op.py, test_sigmoid_cross_entropy_with_logits_op.py,test_swiglu_op.py 中有对应optest单测, CI-Coverage 未覆盖位置并不是修改添加的op。

Comment on lines 775 to 781
} else {
std::vector<symbol::DimExpr> x_shape = x_shape_or_data.shape();
int x_last = static_cast<int>(x_shape[rank - 1].Get<std::int64_t>());
infer_context->AddEqualCstr(symbol::DimExpr{x_last % 2},
symbol::DimExpr{0});
x_shape[rank - 1] = symbol::DimExpr{x_last / 2};
infer_context->SetShapeOrDataForValue(
Copy link
Contributor

Choose a reason for hiding this comment

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

直接对DimExpr添加约束,取int就默认是静态shape了

pos_shape_or_data.shape()[i]);
}
}
infer_context->SetShapeOrDataForValue(op->result(0), input_shape_or_data);
Copy link
Contributor

Choose a reason for hiding this comment

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

最好将Shape取出来单独设置,这里输入输出的data区应该不一样吧

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 -102 to +103
// OP_DECLARE_INFER_SYMBOLIC_SHAPE(SetValueWithTensor)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(SetValue)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(SetValue_)
Copy link
Contributor

Choose a reason for hiding this comment

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

这个PR没有给set_value在yaml中加接口,下一个PR可以顺带加一下(或者给加set_value的同学说一声)

@luotao1 luotao1 merged commit 245e289 into PaddlePaddle:develop Aug 12, 2024
31 checks passed
Jeff114514 pushed a commit to Jeff114514/Paddle that referenced this pull request Aug 14, 2024
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