Skip to content

Conversation

@DanielSun11
Copy link
Contributor

@DanielSun11 DanielSun11 commented May 14, 2025

PR Category

Execute Infrastructure

PR Types

Improvements

Description

#70125 的完善。
#70125 中未对OneDNN对应的kernel进行更改,而且OneDNN存在很明显的问题。
OneDNN中的expand kernel对shape中存在0的情况未进行处理。进而不支持如下几个case:
image
image
这几个case在torch中能正常执行,但是在paddle broadcast_to OneDNN 版本中输出的shape和torch中的shape不一致。

修复方法:

  • 在OneDNN 的ExpandKernel添加对shape中存在0这一情况的处理
  • 添加OneDNN Expand的单测

Pcard-67164

@paddle-bot
Copy link

paddle-bot bot commented May 14, 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.

@DanielSun11 DanielSun11 marked this pull request as ready for review May 14, 2025 14:44
wanghuancoder
wanghuancoder previously approved these changes May 15, 2025
Copy link
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

@DanielSun11 DanielSun11 changed the title [0-size Tensor No.351、378] Add 0-size Tensor support for broadcast_to API. [0-size Tensor No.27、290] Add 0-size Tensor support for broadcast_to API. May 16, 2025
Copy link
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

@wanghuancoder wanghuancoder merged commit de7742e into PaddlePaddle:develop May 20, 2025
49 of 51 checks passed
co63oc pushed a commit to co63oc/Paddle that referenced this pull request May 22, 2025
…API. (PaddlePaddle#72721)

* fix 0 size Tensor for expand kernel in onednn

* format

* expand_grad support 0 size Tensor

* fix bug and add  unittest

* modify the unittest for onednn kernel

* modify expand unittest to force enable onednn op
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.

3 participants