Skip to content

[API] paddle.slogdet 返回值规范化 #72505

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 41 commits into
base: develop
Choose a base branch
from

Conversation

aquagull
Copy link
Contributor

@aquagull aquagull commented Apr 26, 2025

PR Category

User Experience

PR Types

Bug fixes

Description

接口变更说明

paddle.linalg.slogdet 的返回值结构已更新,与 PyTorch、NumPy对齐:

版本 返回值类型 输出结构
旧版 单个 Tensor 形状为 [2, *] 的堆叠 Tensor
(索引 0: sign, 索引 1: logdet)
新版 元组 (tuple) (sign, logdet) 两个独立 Tensor

参考标准:https://data-apis.org/array-api/latest/extensions/generated/array_api.linalg.slogdet.html#slogdet

不兼容变更说明

必须修改组网代码:新版本并且使用patch后,无法按照原有逻辑fetch到两个tensor。

res = paddle.slogdet(x)  <---- 只能fetch到一个tensor
  1. patch中的add_output适用于新增一个不使用的输出,因为接下来的op fetch的还是原来的那个输出,因此不会影响到program。
  2. slogdet原本就有两个输出,只不过在一个tensor里,因此之前的组网逻辑是fetch一个tensor。
  3. patch后变成了两个tensor输出,但按照之前的组网逻辑,就只能够fetch到一个tensor,所以只能更改组网逻辑。

paddle3.0.0 的program为:
029DC20700B33447807143E551CC53C6

patch后的program为:
51204675AE2B1FB98A1D5033974E2378

cn文档pr:

Pcard-75624

Copy link

paddle-bot bot commented Apr 26, 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.

@paddle-bot paddle-bot bot added the contributor External developers label Apr 26, 2025
@CLAassistant
Copy link

CLAassistant commented Apr 26, 2025

CLA assistant check
All committers have signed the CLA.

@fangfangssj
Copy link
Contributor

fangfangssj commented Apr 30, 2025

符号推导部分可以参考这个#66444 ,写一下测试过覆盖率测试
CE-Franework可以使用PaddleTest/framework/api/run_paddle_ci.sh和PaddleTest/inference/python_api_test/parallel_run.sh在本地测试debug

@aquagull
Copy link
Contributor Author

aquagull commented May 1, 2025

符号推导部分可以参考这个#66444 ,写一下测试过覆盖率测试 CE-Franework可以使用PaddleTest/framework/api/run_paddle_ci.sh和PaddleTest/inference/python_api_test/parallel_run.sh在本地测试debug

单测是有开启符号推导的。
image

    def test_check_output(self):
        self.check_output(check_pir=True) < --- check_symbol_infer 默认为true

CE-Framework的测试是针对之前的api,所以会出现错误。
image

@fangfangssj
Copy link
Contributor

符号推导部分可以参考这个#66444 ,写一下测试过覆盖率测试 CE-Franework可以使用PaddleTest/framework/api/run_paddle_ci.sh和PaddleTest/inference/python_api_test/parallel_run.sh在本地测试debug

单测是有开启符号推导的。 image

    def test_check_output(self):
        self.check_output(check_pir=True) < --- check_symbol_infer 默认为true

CE-Framework的测试是针对之前的api,所以会出现错误。 image

好的好的

Copy link

paddle-ci-bot bot commented Jun 6, 2025

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

@aquagull
Copy link
Contributor Author

/re-run all-failed

@HydrogenSulfate
Copy link
Contributor

/re-run distribute build

@codecov-commenter
Copy link

codecov-commenter commented Jul 6, 2025

Codecov Report

Attention: Patch coverage is 72.22222% with 20 lines in your changes missing coverage. Please review.

Please upload report for BASE (develop@e1842d4). Learn more about missing BASE report.

Files with missing lines Patch % Lines
python/paddle/tensor/linalg.py 10.00% 9 Missing ⚠️
.../interface/infer_symbolic_shape/unary_infer_sym.cc 0.00% 6 Missing ⚠️
...hi/kernels/impl/slogdeterminant_grad_kernel_impl.h 84.37% 5 Missing ⚠️

❌ Your patch status has failed because the patch coverage (72.22%) 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   #72505   +/-   ##
==========================================
  Coverage           ?   72.22%           
==========================================
  Files              ?        6           
  Lines              ?       72           
  Branches           ?        0           
==========================================
  Hits               ?       52           
  Misses             ?       20           
  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.

@aquagull
Copy link
Contributor Author

aquagull commented Jul 9, 2025

/re-run all-failed

@HydrogenSulfate
Copy link
Contributor

HydrogenSulfate commented Jul 15, 2025

@aquagull 麻烦合入一下最新的上游代码吧,好像CINN这个有点问题

@@ -3517,7 +3517,7 @@
inputs :
x : Input
outputs :
out : Out
{sign: Sign, logdet: Logdet}
Copy link
Contributor

Choose a reason for hiding this comment

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

Out的命名不能更改了

Copy link
Contributor

Choose a reason for hiding this comment

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

Out的命名不能更改了

已修改, Sign -> Out

heavengate
heavengate previously approved these changes Jul 17, 2025
Copy link
Contributor

@heavengate heavengate left a comment

Choose a reason for hiding this comment

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

LGTM for attr

rename Sign to Out for compatibility
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.

8 participants