Skip to content

[CINN] Remove raw unary infer sym cc include#78658

Open
ooooo-create wants to merge 1 commit intoPaddlePaddle:developfrom
ooooo-create:codex/remove-raw-cc-include-78417
Open

[CINN] Remove raw unary infer sym cc include#78658
ooooo-create wants to merge 1 commit intoPaddlePaddle:developfrom
ooooo-create:codex/remove-raw-cc-include-78417

Conversation

@ooooo-create
Copy link
Copy Markdown
Contributor

PR Category

CINN

PR Types

Improvements

Description

该 PR 参考已关闭的 #78417,移除 cinn_op_infer_sym.cc 对 unary_infer_sym.cc 的源码级 include,避免同一份 unary 符号推导逻辑被聚合进 cinn_op_infer_sym.o,导致增量 coverage 命中归属到错误对象文件。

主要改动:

  • 将 raw .cc include 改为 unary_infer_sym.h。
  • cinn::dialect::Pool2dOpInferSymbolicShape 直接复用 paddle::dialect::Pool2dOpInferSymbolicShape。
  • 修正 GetRealPadding 中局部 lambda 拼写并用 const ref 传参,保持改动范围收敛,不将具体推导规则搬进 utils。

验证:prek 通过;按要求未在本地编译。

是否引起精度变化

Co-authored-by: Codex <codex@openai.com>
Copilot AI review requested due to automatic review settings April 13, 2026 07:29
@paddle-bot
Copy link
Copy Markdown

paddle-bot bot commented Apr 13, 2026

你的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
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.cc with the proper header include unary_infer_sym.h.
  • Make cinn::dialect::Pool2dOpInferSymbolicShape delegate directly to paddle::dialect::Pool2dOpInferSymbolicShape to avoid relying on internal helpers from the included .cc.
  • Minor cleanup in GetRealPadding: fix lambda name typo and avoid unnecessary copies by using const& parameters.

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.

@ooooo-create
Copy link
Copy Markdown
Contributor Author

目前经常需要开发者自己来证明这个文件的代码确实覆盖到了,例如: #78441 (comment)

@ooooo-create ooooo-create requested a review from SigureMo April 13, 2026 08:35
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@212a3f6). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...nterface/infer_symbolic_shape/cinn_op_infer_sym.cc 0.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (66.66%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop   #78658   +/-   ##
==========================================
  Coverage           ?   66.66%           
==========================================
  Files              ?        2           
  Lines              ?        3           
  Branches           ?        0           
==========================================
  Hits               ?        2           
  Misses             ?        1           
  Partials           ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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