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

[CINN]add matmul shape constrain #62567

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

phlrain
Copy link
Collaborator

@phlrain phlrain commented Mar 8, 2024

PR types

Function optimization

PR changes

Others

Description

Pcard-67164

增强matmul的逻辑推导限制

Copy link

paddle-bot bot commented Mar 8, 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 Mar 8, 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.

@@ -844,6 +844,25 @@ bool MatmulOpInferSymbolicShape(
shape_analysis->SetShapeOrDataForValue(op->result(0),
ShapeOrData{TensorExprs(out_dims)});

if ((ndims_x == ndims_y) && ndims_x >= 2) {
if (transpose_x_attr == false && transpose_y_attr == false) {
shape_analysis->CreateDimExprBuilder().CstrEq(x_dims[ndims_x - 1],
Copy link
Contributor

Choose a reason for hiding this comment

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

这个CreateDimExprBuilder函数很奇怪。
直接来讲应该是shape_analysis ->dim_expr_builder()-> CstrEq (...),这里没有Create的感觉。

Copy link
Contributor

Choose a reason for hiding this comment

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

ShapeAnalysis 目前还没提供 dim_expr_builder() 接口,仅能通过 CreateDimExprBuilder 构造出来

image

@phlrain phlrain changed the title add matmul shape constrain [CINN]add matmul shape constrain Mar 11, 2024
@phlrain phlrain merged commit 2c924ed into PaddlePaddle:develop Mar 11, 2024
30 checks passed
hitywt pushed a commit to hitywt/Paddle that referenced this pull request Mar 11, 2024
hitywt pushed a commit to hitywt/Paddle that referenced this pull request Mar 11, 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.

3 participants