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

[PIR] [DynamicShape] Support symbolic shape inference for some pd_ops #63016

Merged
merged 5 commits into from
Apr 12, 2024

Conversation

fty1777
Copy link
Contributor

@fty1777 fty1777 commented Mar 25, 2024

PR Category

Others

PR Types

Others

Description

Pcard-67164

Add symbolic shape inference for the following pd_op-s:

  • masked_select
  • searchsorted
  • expand_as
  • pad
  • unbind
  • unique
  • unique_consecutive

…d_select, searchsorted, expand_as, pad, unbind, unique and unique_consecutive
Copy link

paddle-bot bot commented Mar 25, 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 Mar 25, 2024
@fty1777 fty1777 changed the title [PIR] [DynamicShape] Support symbolic shape inference for pd_op.maske… [PIR] [DynamicShape] Support symbolic shape inference for some pd_ops Mar 25, 2024
@PaddlePaddle PaddlePaddle deleted a comment from paddle-bot bot Mar 26, 2024
Copy link

paddle-ci-bot bot commented Apr 2, 2024

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

Copy link

paddle-ci-bot bot commented Apr 10, 2024

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

…existent file; remove interfaces attrs of ops in legacy_ops.yaml
zhangbopd
zhangbopd previously approved these changes Apr 11, 2024
Copy link
Contributor

@zhangbopd zhangbopd left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines 207 to 226
// TODO(fty1777): Why is `y` marked optional in the yaml file? The shape of
// `y` is currently empty and target_shape is all -1. The symbolic inference
// cannot be done for now.

// const auto &y_shape_or_data =
// shape_analysis->GetShapeOrDataForValue(op->operand_source(1));

// // target_shape
// std::vector<int> target_shape =
// paddle::dialect::details::GetVectorAttr<int>(op, "target_shape");
// const std::vector<symbol::DimExpr> &output_dims = [&] {
// std::vector<symbol::DimExpr> output_dims;
// output_dims.reserve(target_shape.size());
// for (int shape : target_shape) {
// output_dims.push_back(shape_analysis->DimExprBuilder().ConstSize(shape));
// }
// return output_dims;
// }();

// shape_analysis->SetShapeOrDataForValue(op->result(0), y_shape_or_data);
Copy link
Contributor

Choose a reason for hiding this comment

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

全去掉。不要注释代码

Copy link
Contributor

@zhangbopd zhangbopd left a comment

Choose a reason for hiding this comment

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

LGTM

@zhangbopd zhangbopd merged commit 63b4407 into PaddlePaddle:develop Apr 12, 2024
29 checks passed
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.

3 participants