Skip to content

[Kernel] Fix GroupNormGradKernel when d_x is nullptr #72358

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

Merged

Conversation

HydrogenSulfate
Copy link
Contributor

@HydrogenSulfate HydrogenSulfate commented Apr 18, 2025

PR Category

Operator Mechanism

PR Types

Bug fixes

Description

Pcard-75624

当x.stop_gradient=True时,d_x为空,CPU的GroupNormGradKernel没有处理这种情况导致报错,因此将逻辑对齐 CUDA GroupNormGradKernel,当d_x为空时去掉对应的内存申请和相关计算逻辑

Copy link

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

@HydrogenSulfate HydrogenSulfate merged commit 2f5d0d0 into PaddlePaddle:develop Apr 25, 2025
40 checks passed
@HydrogenSulfate HydrogenSulfate deleted the fix_group_norm_cpu branch April 25, 2025 05:45
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files
@@             Coverage Diff             @@
##             develop    #72358   +/-   ##
===========================================
  Coverage           ?   100.00%           
===========================================
  Files              ?         1           
  Lines              ?        40           
  Branches           ?         0           
===========================================
  Hits               ?        40           
  Misses             ?         0           
  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.

YqGe585 pushed a commit to YqGe585/Paddle that referenced this pull request May 7, 2025
…e#72358)

* fix GroupNormGradKernel when d_x is nullptr

* update UT

* fix relative import

* fix coverage

* fix rtol and atol

* fix for coverage

* update UT

* add nhwc for coverage
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.

3 participants