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.170】【BUAA】 Add read_file op #67889

Merged
merged 5 commits into from
Sep 20, 2024

Conversation

MufanColin
Copy link
Contributor

PR Category

CINN

PR Types

Improvements

Description

添加 read_file 算子符号推导接口。

Copy link

paddle-bot bot commented Aug 31, 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 31, 2024
bool ReadFileOpInferSymbolicShape(
pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) {
std::vector<symbol::DimExpr> output_shape = {symbol::DimExpr(1),
symbol::DimExpr(-1)};
Copy link
Contributor

Choose a reason for hiding this comment

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

-1是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.

已修改。

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

PR-CI-Coverage 中没过的测试好像不是我改的内容。

std::vector<symbol::DimExpr> shape;
shape.push_back(unique_dim_sym);
return shape;
}();
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. Meta 函数里的维度是 {1, -1} ,rank 是 2,这里应该改成 {symbol::DimExpr(1), 新符号} ,而不是整体使用 {新符号}
  2. push_back() 可以替换成 empalce_back()
  3. 发生了冲突,也顺便解决一下

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改。

@gongshaotian
Copy link
Contributor

麻烦补充一下单测状态

@@ -29,6 +29,7 @@ OP_DECLARE_INFER_SYMBOLIC_SHAPE(FullIntArray)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(Gaussian)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(Randint)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(Randperm)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(ReadFile)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(Seed)
// OP_DECLARE_INFER_SYMBOLIC_SHAPE(ReadFile)
Copy link
Contributor

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

请问是否需要重新 rerun。

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

@luotao1
Copy link
Contributor

luotao1 commented Sep 19, 2024

650 - test_write_python_container (Failed)
@MufanColin @gongshaotian 看下是随机挂还是PR的问题?

@gongshaotian
Copy link
Contributor

650 - test_write_python_container (Failed) @MufanColin @gongshaotian 看下是随机挂还是PR的问题?

是随机挂问题

@luotao1 luotao1 merged commit 768e234 into PaddlePaddle:develop Sep 20, 2024
29 of 30 checks passed
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