Skip to content

[Cherry-pick][Feature] Add masked_scatter C++ kernel for CPU and GPU (#78412)#78527

Merged
sneaxiy merged 4 commits intoPaddlePaddle:release/3.3from
zhengshengning:cp_masked_scatter
Apr 1, 2026
Merged

[Cherry-pick][Feature] Add masked_scatter C++ kernel for CPU and GPU (#78412)#78527
sneaxiy merged 4 commits intoPaddlePaddle:release/3.3from
zhengshengning:cp_masked_scatter

Conversation

@zhengshengning
Copy link
Copy Markdown
Contributor

PR Category

Operator Mechanism

PR Types

Improvements

Description

devPR:#78412

是否引起精度变化

…#78412)

* Add masked_scatter C++ kernel for CPU and GPU

- Add MaskedScatterInferMeta in infermeta/multiary
- Add CPU/GPU forward kernels (masked_scatter_kernel)
- Add CPU/GPU backward kernels (masked_scatter_grad_kernel)
- Register op in ops.yaml and backward.yaml
- Update Python API to call C++ kernel when CUDA is available

* fix unittest

* fix

* fix

* fix 0-size

* fix

* fix masked_scatter backward
@paddle-bot
Copy link
Copy Markdown

paddle-bot bot commented Mar 30, 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.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.00000% with 11 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release/3.3@13d1d65). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...ddle/phi/kernels/cpu/masked_scatter_grad_kernel.cc 83.63% 9 Missing ⚠️
paddle/phi/kernels/cpu/masked_scatter_kernel.cc 94.11% 2 Missing ⚠️

❌ Your patch status has failed because the patch coverage (89.00%) 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               @@
##             release/3.3   #78527   +/-   ##
==============================================
  Coverage               ?   89.00%           
==============================================
  Files                  ?        4           
  Lines                  ?      100           
  Branches               ?        0           
==============================================
  Hits                   ?       89           
  Misses                 ?       11           
  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.

Copy link
Copy Markdown
Contributor

@wanghuancoder wanghuancoder left a comment

Choose a reason for hiding this comment

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

LGTM

@sneaxiy sneaxiy merged commit 8a61375 into PaddlePaddle:release/3.3 Apr 1, 2026
82 of 89 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants