[CINN] Clean unused pool2d symbolic infer path#78658
[CINN] Clean unused pool2d symbolic infer path#78658SigureMo merged 1 commit intoPaddlePaddle:developfrom
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
There was a problem hiding this comment.
Pull request overview
This PR removes a raw .cc inclusion that was aggregating unary symbolic-shape inference into cinn_op_infer_sym.o, which could misattribute incremental coverage to the wrong object file.
Changes:
- Replace the source-level include of
unary_infer_sym.ccwith the proper header includeunary_infer_sym.h. - Make
cinn::dialect::Pool2dOpInferSymbolicShapedelegate directly topaddle::dialect::Pool2dOpInferSymbolicShapeto avoid relying on internal helpers from the included.cc. - Minor cleanup in
GetRealPadding: fix lambda name typo and avoid unnecessary copies by usingconst¶meters.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/unary_infer_sym.cc | Minor parameter/lambda cleanup in pooling padding inference helpers. |
| paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/cinn_op_infer_sym.cc | Remove raw .cc inclusion; reuse Paddle Pool2d symbolic-shape inference to decouple object files and coverage attribution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
目前经常需要开发者自己来证明这个文件的代码确实覆盖到了,例如: #78441 (comment) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #78658 +/- ##
===========================================
Coverage ? 100.00%
===========================================
Files ? 1
Lines ? 2
Branches ? 0
===========================================
Hits ? 2
Misses ? 0
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
merge 下 develop 吧,覆盖率不够是没单测吗? |
209cc92 to
0958eaf
Compare
0958eaf to
fa559d6
Compare
| Pool2dRawInferSymbolicShape(op, kernel_size, infer_context)); | ||
| return true; | ||
| } | ||
| // bool Pool2dOpInferSymbolicShape(pir::Operation *op, |
There was a problem hiding this comment.
这个地方的逻辑本身就写的不对,所以直接注释了先
pd_to_cinn_pass 里面没有注册这个转换,这个地方跑不到,原来的实现也不对😭 |
|
怎么艾特不了小猫了 |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@ooooo-create 这个合入后,coverage就可以正常覆盖了吗 |
是的,把 include cpp 清理掉就恢复了 |
Signed-off-by: ooooo <3164076421@qq.com>
fa559d6 to
547326c
Compare
PR Category
CINN
PR Types
Improvements
Description
该 PR 延续 #78417
本次排查后确认:
paddle/cinn/hlir/dialect/operator/transforms/pd_to_cinn_pass.cc中虽然定义了Pool2dOpPattern,但在PdOpToCinnOpPass::InitializePatterns()里并没有注册这个 pattern。也就是说,当前pd_to_cinn_pass并不会把pd_op.pool2d改写成cinn_op.pool2d,因此cinn::dialect::Pool2dOpInferSymbolicShape这条路径当前并不在实际 pass 链路上。基于这个现状,这个 PR 做了下面几件事:
paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/cinn_op_infer_sym.cc中删除了unary_infer_sym.cc的 raw include。paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/cinn_op_infer_sym.h/.cc中删除了Pool2dOpInferSymbolicShape的声明和实现,避免保留一条当前不会被命中的 CINN pool2d symbolic infer 路径。paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/unary_infer_sym.cc中顺手做了小范围清理:GetRealPadding改为const ref传参,并把UpdataPadding更名为UpdatePadding。是否引起精度变化
否