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

[Infer Symbolic Shape No.166][BUAA] rms_norm #67294

Merged
merged 2 commits into from
Aug 13, 2024

Conversation

MufanColin
Copy link
Contributor

PR Category

CINN

PR Types

Others

Description

添加 rms_norm 中等难度算子的符号推导接口实现,由于中等难度的算子对我而言难度比较大,所以这个算子我先单独提交的,已通过本地测试。

Copy link

paddle-bot bot commented Aug 10, 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 10, 2024
@MufanColin
Copy link
Contributor Author

这里 coverage 没过的测试好像都不是我改的内容,麻烦帮忙看一下。

@gongshaotian
Copy link
Contributor

这里 coverage 没过的测试好像都不是我改的内容,麻烦帮忙看一下。

timeout了,帮你rerun了

// }
bool RmsNormOpInferSymbolicShape(
pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) {
const symbol::ShapeOrDataDimExprs &x_shape =
Copy link
Contributor

Choose a reason for hiding this comment

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

命名不规范,x_shape_or_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.

已修改。

pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) {
const symbol::ShapeOrDataDimExprs &x_shape =
infer_context->GetShapeOrDataForValue(op->operand_source(0));
std::vector<symbol::DimExpr> x_dims = x_shape.shape();
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 Author

Choose a reason for hiding this comment

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

已修改。

const symbol::ShapeOrDataDimExprs &x_shape =
infer_context->GetShapeOrDataForValue(op->operand_source(0));
std::vector<symbol::DimExpr> x_dims = x_shape.shape();
size_t x_dims_size = x_dims.size();
Copy link
Contributor

Choose a reason for hiding this comment

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

x_shape_size

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改。


const auto &norm_weight_shape =
infer_context->GetShapeOrDataForValue(op->operand_source(3));
const std::vector<symbol::DimExpr> norm_weight_dims =
Copy link
Contributor

@gongshaotian gongshaotian Aug 12, 2024

Choose a reason for hiding this comment

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

const std::vectorsymbol::DimExpr &,避免拷贝

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

@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.

请修改上述问题

@MufanColin
Copy link
Contributor Author

请修改上述问题

收到

@luotao1 luotao1 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label Aug 12, 2024
@gongshaotian
Copy link
Contributor

LGTM

@luotao1 luotao1 merged commit 60fe1c6 into PaddlePaddle:develop Aug 13, 2024
30 checks passed
Jeff114514 pushed a commit to Jeff114514/Paddle that referenced this pull request Aug 14, 2024
* Finished rms_norm op

* Resolved suggested changes
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.

3 participants