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

Adapt to dim expr #60843

Merged
merged 10 commits into from
Jan 22, 2024
Merged

Adapt to dim expr #60843

merged 10 commits into from
Jan 22, 2024

Conversation

6clc
Copy link
Contributor

@6clc 6clc commented Jan 16, 2024

PR types

Others

PR changes

Others

Description

Pcard-78120
In the check for Int32, insert TryElevateInt32ToInt64(). This function checks the data type of ir and raises it to int64 if an expression contains an Int64.
int64 is imported only with shape expressions passed in by dim_expr.

Copy link

paddle-bot bot commented Jan 16, 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.

Copy link

paddle-bot bot commented Jan 16, 2024

❌ The PR is not created using PR's template. You can refer to this Demo.
Please use PR's template, it helps save our maintainers' time so that more developers get helped.

@6clc 6clc force-pushed the adapt_to_dim_expr branch from 0236f29 to d9f068f Compare January 17, 2024 14:36
@6clc 6clc force-pushed the adapt_to_dim_expr branch from d9f068f to d8d4091 Compare January 19, 2024 07:11
@6clc 6clc force-pushed the adapt_to_dim_expr branch from d8d4091 to 247baa8 Compare January 19, 2024 07:22
for (int i = 0; i < shape.size(); i++) {
CHECK_EQ(shape[i].type(), Int(32));
CHECK(shape[i].type() == Int(64) || shape[i].type() == Int(32));
Copy link
Member

Choose a reason for hiding this comment

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

Add hint message for check error?

auto type = vs.front().type();
for (auto &v : vs) CHECK_EQ(v.type(), type) << vs.front() << " " << v;
for (auto &v : vs) {
CHECK_EQ(v.type(), type) << "(" << v << " vs " << vs.front() << ")";
Copy link
Member

Choose a reason for hiding this comment

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

Add some English hint for what's wrong here.

} else {
dims.emplace_back(_axis_with_reduce[i]->name,
Expr(0),
Sub::Make(dim, cinn::common::make_const(1)));
Copy link
Member

Choose a reason for hiding this comment

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

Should we make "make_const" with type template? Now it seems make_const only returns int32

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This code is intended to be compatible with previous int32,
and if you pass the shape property through dim_expr, you will not enter this branch of the code.

@@ -61,8 +61,35 @@ std::string Domain::__str__() const {
}

isl::set Domain::to_isl() const {
// TODO(6clc): will be removed in future
Copy link
Member

Choose a reason for hiding this comment

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

Please delete in the future we found we can get rid of isl

Copy link
Member

@zhhsplendid zhhsplendid left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

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

LGTM

@zhhsplendid zhhsplendid merged commit 1345e24 into PaddlePaddle:develop Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants