Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

add InferSymbolicShape for pd_op.mean #63231

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ZelinMa557
Copy link
Contributor

@ZelinMa557 ZelinMa557 commented Apr 4, 2024

PR Category

Others

PR Types

Others

Description

  • add InferSymbolicShape for pd_op.mean
  • add reduce_mean op in ops.yaml
  • add MeanOpPattern in pd_to_cinn_pass

Copy link

paddle-bot bot commented Apr 4, 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 Apr 4, 2024
@ZelinMa557 ZelinMa557 force-pushed the add_mean_symbolic_shape branch 5 times, most recently from f956bdc to 9d300ee Compare April 7, 2024 06:12
Signed-off-by: ZelinMa557 <3388706467@qq.com>
Comment on lines +41 to +49
- op : reduce_mean
args : (Tensor x, int64_t[] dim, bool keep_dim)
output : Tensor(out)
infer_meta :
func : ReduceInferMeta
kernel :
func : frobenius_norm
interfaces : paddle::dialect::InferSymbolicShapeInterface

Copy link
Contributor

Choose a reason for hiding this comment

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

mean算子进入CINN前会拆分成 sum 和 divide 等算子,不会直接进入到CINN,所以这里可以不加reduce_mean的定义

@@ -799,6 +827,7 @@ pir::RewritePatternSet PdOpToCinnOpPass::InitializePatterns(
ps.Add<ScaleOpPattern>(
context); // NOTE, scale op pattern should before AddBroadcastTo
ps.Add(paddle::drr::Create<SumOpPattern>(context));
ps.Add(paddle::drr::Create<MeanOpPattern>(context));
Copy link
Contributor

Choose a reason for hiding this comment

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

同上

Comment on lines +112 to +115
bool ReduceMeanOpInferSymbolicShape(
pir::Operation *op, pir::ShapeConstraintIRAnalysis *shape_analysis) {
return ReduceInferSymbolicShape(op, shape_analysis);
}
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

paddle-ci-bot bot commented Apr 15, 2024

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

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants