Skip to content

Conversation

@co63oc
Copy link
Contributor

@co63oc co63oc commented Jul 9, 2025

PR Category

Operator Mechanism

PR Types

Bug fixes

Description

[0-size Tensor Job2 No.72-74] Add 0-size Tensor support for paddle.scatter

scatter_nd 调用的是scatter_nd_add
index 为0-size在 python部分判断,scatter修改有性能问题,改在kernel中使用phi::Copy,同时修改infermeta判断,符号推导没有对应代码
scatter_nd_add 返回x.clone() + updates, PaddleAPITest 中也是同样实现
https://github.com/PFCCLab/PaddleAPITest/blob/f360ad9c78a0c7ce095ec911ec52a29392a80404/tester/paddle_to_torch/rules.py#L5166
image

输出维度和输入x维度相同

修改前向,反向,反向updates填充0,PaddleAPITest中为自定义规则
https://github.com/PFCCLab/PaddleAPITest/blob/f360ad9c78a0c7ce095ec911ec52a29392a80404/tester/paddle_to_torch/rules.py#L5124
image

增加单测,取消已有 TestScatterNdAddWithEmptyIndex 测试

PaddleAPITest测试通过,错误为numpy error
paddle.scatter
image

paddle.scatter_nd
image

paddle.scatter_nd_add
image

@paddle-bot
Copy link

paddle-bot bot commented Jul 9, 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 Jul 9, 2025
@luotao1 luotao1 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label Jul 9, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jul 9, 2025

Codecov Report

Attention: Patch coverage is 33.33333% with 18 lines in your changes missing coverage. Please review.

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

Files with missing lines Patch % Lines
...ddle/phi/kernels/cpu/scatter_nd_add_grad_kernel.cc 0.00% 7 Missing ⚠️
paddle/phi/kernels/cpu/scatter_grad_kernel.cc 16.66% 5 Missing ⚠️
paddle/phi/kernels/cpu/scatter_kernel.cc 28.57% 5 Missing ⚠️
paddle/phi/kernels/cpu/scatter_nd_add_kernel.cc 50.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (33.33%) 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 #73933 +/- ## ========================================== Coverage ? 33.33% ========================================== Files ? 6 Lines ? 27 Branches ? 0 ========================================== Hits ? 9 Misses ? 18 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.
@co63oc co63oc changed the title [0-size Tensor Job2 No.72-74] Add 0-size Tensor support for paddle.scatter CI测试不review paddle.scatter Jul 9, 2025
@co63oc co63oc changed the title CI测试不review paddle.scatter CI测试不review paddle.scatter [fluid_ops] Jul 10, 2025
@co63oc co63oc changed the title CI测试不review paddle.scatter [fluid_ops] [0-size Tensor Job2 No.72-74] Add 0-size Tensor support for paddle.scatter [fluid_ops] Jul 10, 2025
@co63oc
Copy link
Contributor Author

co63oc commented Jul 10, 2025

/re-run all-failed

1 similar comment
@co63oc
Copy link
Contributor Author

co63oc commented Jul 12, 2025

/re-run all-failed

@co63oc
Copy link
Contributor Author

co63oc commented Jul 14, 2025

/re-run all-failed

@co63oc co63oc changed the title [0-size Tensor Job2 No.72-74] Add 0-size Tensor support for paddle.scatter [fluid_ops] [0-size Tensor Job2 No.72-74、66、55] Add 0-size Tensor support for paddle.scatter [fluid_ops] Jul 15, 2025
@co63oc co63oc changed the title [0-size Tensor Job2 No.72-74、66、55] Add 0-size Tensor support for paddle.scatter [fluid_ops] [0-size Tensor Job2 No.72-74] Add 0-size Tensor support for paddle.scatter [fluid_ops] Jul 15, 2025
@co63oc co63oc force-pushed the g61 branch 2 times, most recently from 572f4e6 to c979c1b Compare July 16, 2025 00:20
@co63oc
Copy link
Contributor Author

co63oc commented Jul 17, 2025

@DanielSun11 CI已完成需要review

Copy link
Contributor

@DanielSun11 DanielSun11 left a comment

Choose a reason for hiding this comment

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

LGTM

@luotao1 luotao1 merged commit f2d3d06 into PaddlePaddle:develop Jul 18, 2025
56 of 57 checks passed
co63oc added a commit to co63oc/Paddle that referenced this pull request Jul 18, 2025
@co63oc co63oc deleted the g61 branch July 18, 2025 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 skip-ci: approval

4 participants