Skip to content

[API Compatibility] Add out support for 11 APIs #74592

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

Open
wants to merge 26 commits into
base: develop
Choose a base branch
from

Conversation

LittleHeroZZZX
Copy link
Contributor

@LittleHeroZZZX LittleHeroZZZX commented Aug 13, 2025

PR Category

User Experience

PR Types

New features

Description

为 11 个 API 添加 out 、参数映射、下沉 C++,并添加对应单元测试。具体清单为:
paddle.polar
paddle.stack
paddle.cos
paddle.floor
paddle.log
paddle.pow
paddle.rsqrt
paddle.sign
paddle.sin
paddle.multiply

其中,multiply 由于不在 ops.yaml 清单中,留给 @DanielSun11 下沉至 C++。

下沉到 C++ 的算子不再支持就旧静态图组网,涉及到这部分的单测直接注释。

Copy link

paddle-bot bot commented Aug 13, 2025

你的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.

zhwesky2010
zhwesky2010 previously approved these changes Aug 13, 2025
Copy link
Contributor

@zhwesky2010 zhwesky2010 left a comment

Choose a reason for hiding this comment

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

LGTM

@zhwesky2010 zhwesky2010 requested review from SigureMo and zyfncg August 13, 2025 09:27
SigureMo
SigureMo previously approved these changes Aug 13, 2025
Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

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

LGTMeow 🐾 for type annotations

out (Tensor|None, optional): The output tensor. Default: None.
name(str|None, optional): For details, please refer to :ref:`api_guide_Name`. Generally, no setting is required. Default: None.
Copy link
Member

Choose a reason for hiding this comment

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

可以帮忙给这个 API 也加一下类型提示么?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment on lines 3397 to 3398
out: paddle.Tensor | None = None,
name: str | None = None,
Copy link
Member

@SigureMo SigureMo Aug 13, 2025

Choose a reason for hiding this comment

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

问一下,这些 API 里的 outname 是否应该作为「仅关键字参数」呢?即 3397 行前是不是应该加一个 *?只是疑问 @zhwesky2010

@LittleHeroZZZX LittleHeroZZZX dismissed stale reviews from SigureMo and zhwesky2010 via fdce7a4 August 13, 2025 11:20
SigureMo
SigureMo previously approved these changes Aug 13, 2025
SigureMo
SigureMo previously approved these changes Aug 14, 2025
zhwesky2010
zhwesky2010 previously approved these changes Aug 14, 2025
@LittleHeroZZZX
Copy link
Contributor Author

/re-run all-failed

SigureMo
SigureMo previously approved these changes Aug 14, 2025
XiaoguangHu01
XiaoguangHu01 previously approved these changes Aug 14, 2025
Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov-commenter
Copy link

codecov-commenter commented Aug 14, 2025

Codecov Report

❌ Patch coverage is 86.84211% with 5 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@f1ae790). Learn more about missing BASE report.

Files with missing lines Patch % Lines
python/paddle/tensor/creation.py 50.00% 2 Missing ⚠️
python/paddle/tensor/manipulation.py 0.00% 2 Missing ⚠️
python/paddle/nn/quant/functional_layers.py 88.88% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (86.84%) 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   #74592   +/-   ##
==========================================
  Coverage           ?   86.84%           
==========================================
  Files              ?        5           
  Lines              ?       38           
  Branches           ?        0           
==========================================
  Hits               ?       33           
  Misses             ?        5           
  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.

@LittleHeroZZZX
Copy link
Contributor Author

/re-run all-failed

@LittleHeroZZZX LittleHeroZZZX marked this pull request as draft August 15, 2025 07:03
@LittleHeroZZZX LittleHeroZZZX dismissed stale reviews from XiaoguangHu01 and SigureMo via 32a1211 August 18, 2025 03:08
@LittleHeroZZZX LittleHeroZZZX marked this pull request as ready for review August 20, 2025 08:03
@@ -1241,7 +1195,9 @@ def remainder_(x: Tensor, y: Tensor, name: str | None = None) -> Tensor:
"""


def multiply(x: Tensor, y: Tensor, name: str | None = None) -> Tensor:
def multiply(
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 Author

Choose a reason for hiding this comment

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

这个不在 ops.yaml 中

)
create_test_act_bf16_class(
TestRsqrt, check_prim=True, check_pir=True, check_prim_pir=True
TestRsqrt, check_prim=False, check_pir=True, check_prim_pir=True
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 Author

Choose a reason for hiding this comment

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

是的,check_prim 是测旧静态图的。

@LittleHeroZZZX
Copy link
Contributor Author

/re-run all-failed

@LittleHeroZZZX
Copy link
Contributor Author

/re-run all-failed

2 similar comments
@LittleHeroZZZX
Copy link
Contributor Author

/re-run all-failed

@LittleHeroZZZX
Copy link
Contributor Author

/re-run all-failed

zhwesky2010
zhwesky2010 previously approved these changes Aug 21, 2025
Copy link
Contributor

@zhwesky2010 zhwesky2010 left a comment

Choose a reason for hiding this comment

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

LGTM

@LittleHeroZZZX
Copy link
Contributor Author

/re-run all-failed

1 similar comment
@LittleHeroZZZX
Copy link
Contributor Author

/re-run all-failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants