Skip to content

Conversation

@tjujingzong
Copy link
Contributor

@tjujingzong tjujingzong commented Jan 28, 2026

PR Category

Operator Mechanism

PR Types

Bug fixes

Description

利用 PaddleAPITest 发现以下 XPU Kernel 在处理 0-size Tensor(例如某些维度为 0、或元素数为 0 的输入)时支持不足,可能出现异常访问、报错或行为不一致。为此:

  1. 编写单测覆盖 0-size Tensor 输入场景,稳定复现问题。
  2. 修复实现:在 kernel 内补齐对 0-size Tensor 的健壮性处理

本次涉及并修复/加固的 XPU kernel(算子)如下:

  • fused_layernormpaddle/phi/kernels/fusion/xpu/fused_layernorm_kernel.cc
  • activationpaddle/phi/kernels/xpu/activation_kernel.cc
  • atanpaddle/phi/kernels/xpu/atan_kernel.cc
  • bce_loss_gradpaddle/phi/kernels/xpu/bce_loss_grad_kernel.cc
  • bitwisepaddle/phi/kernels/xpu/bitwise.cc
  • convpaddle/phi/kernels/xpu/conv_kernel.cc
  • cumprodpaddle/phi/kernels/xpu/cumprod_kernel.cc
  • diagpaddle/phi/kernels/xpu/diag_kernel.cc
  • embedding_gradpaddle/phi/kernels/xpu/embedding_grad_kernel.cc
  • gather_nd_gradpaddle/phi/kernels/xpu/gather_nd_grad_kernel.cc
  • huber_losspaddle/phi/kernels/xpu/huber_loss_kernel.cc
  • label_smoothpaddle/phi/kernels/xpu/label_smooth_kernel.cc
  • logicalpaddle/phi/kernels/xpu/logical_kernel.cc
  • padpaddle/phi/kernels/xpu/pad_kernel.cc
  • prelu_gradpaddle/phi/kernels/xpu/prelu_grad_kernel.cc
  • scatter_gradpaddle/phi/kernels/xpu/scatter_grad_kernel.cc
  • signpaddle/phi/kernels/xpu/sign_kernel.cc
  • take_along_axis_gradpaddle/phi/kernels/xpu/take_along_axis_grad_kernel.cc

@paddle-bot
Copy link

paddle-bot bot commented Jan 28, 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.

@paddle-bot paddle-bot bot added the contributor External developers label Jan 28, 2026
@tjujingzong tjujingzong changed the title [0-size XPU Tensor] [0-size XPU Tensor] Fix bugs for 0-size tensor handling in XPU kernels Jan 28, 2026
Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

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

LGTM

@tjujingzong
Copy link
Contributor Author

/re-run all-failed

1 similar comment
@tjujingzong
Copy link
Contributor Author

/re-run all-failed

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.

2 participants