Skip to content

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

Merged
luotao1 merged 2 commits into
PaddlePaddle:developfrom
MufanColin:cinn_rms_norm_latest
Aug 13, 2024
Merged

luotao1 merged 2 commits into
PaddlePaddle:developfrom
MufanColin:cinn_rms_norm_latest

Conversation

@MufanColin

Copy link
Copy Markdown
Contributor

PR Category

CINN

PR Types

Others

Description

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

@paddle-bot

paddle-bot Bot commented Aug 10, 2024

Copy link
Copy Markdown

你的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
Copy Markdown
Contributor Author

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

@gongshaotian

Copy link
Copy Markdown
Contributor

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

timeout了,帮你rerun了

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

同上

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 =

@gongshaotian gongshaotian Aug 12, 2024 •

Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

已修改。

@gongshaotian gongshaotian left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

请修改上述问题

@MufanColin

Copy link
Copy Markdown
Contributor Author

请修改上述问题

收到

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

Copy link
Copy Markdown
Contributor

LGTM

@luotao1
luotao1 merged commit 60fe1c6 into PaddlePaddle:develop Aug 13, 2024
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