Skip to content

【Infer Symbolic Shape No.131】Add infer_symbol_shape for cholesky_solve_op - #69005

Merged
luotao1 merged 3 commits into
PaddlePaddle:developfrom
AndPuQing:CINN-shapeinfer-5
Nov 25, 2024
Merged

luotao1 merged 3 commits into
PaddlePaddle:developfrom
AndPuQing:CINN-shapeinfer-5

Conversation

@AndPuQing

Copy link
Copy Markdown
Contributor

PR Category

CINN

PR Types

New features

Description

其中cholesky_solve_op 原本没有单测,但是搜索PR发现 #64457 曾经被划入deprecated,并在该PR中移除,目前可以通过symbol infer 检查

@paddle-bot

paddle-bot Bot commented Oct 28, 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 Oct 28, 2024
@gongshaotian gongshaotian self-assigned this Oct 30, 2024
@paddle-ci-bot

paddle-ci-bot Bot commented Nov 5, 2024

Copy link
Copy Markdown

Sorry to inform you that 42f1f36's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

@gongshaotian gongshaotian Nov 11, 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.

@wanghuancoder 欢哥单测文件需要revert吗

const auto &x_rank = x_shape.size();
const auto &y_rank = y_shape.size();

infer_context->AddEqualCstr(x_shape[x_rank - 2], x_shape[x_rank - 1]);

@gongshaotian gongshaotian Nov 11, 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.

这里约束是不是加错了
截屏2024-11-11 17 38 24

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.

如上述,应该是没有的,这里的 x 就是 API 的 Y

Comment on lines +2218 to +2223
const auto &x_shape_or_data =
infer_context->GetShapeOrDataForValue(op->operand_source(1));
const std::vector<symbol::DimExpr> &x_shape = x_shape_or_data.shape();
const auto &y_shape_or_data =
infer_context->GetShapeOrDataForValue(op->operand_source(0));
const std::vector<symbol::DimExpr> &y_shape = y_shape_or_data.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.

operand_source(0) 应该是x吧,这里为什么是y

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.

这个地方是因为Cholesky 第一个输入是B,第二个输入是 A 的Cholesky 分解的上三角矩阵,为了对齐其他的solve的实现,这里就反转了一下,可能语义上有问题。

wanghuancoder
wanghuancoder previously approved these changes Nov 11, 2024

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

LGTM

@paddle-ci-bot

paddle-ci-bot Bot commented Nov 14, 2024

Copy link
Copy Markdown

Sorry to inform you that f622054's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

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

LGTM

@luotao1
luotao1 merged commit 083488d into PaddlePaddle:develop Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants