Skip to content

Kron #72427

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

Draft
wants to merge 9 commits into
base: develop
Choose a base branch
from
Draft

Kron #72427

wants to merge 9 commits into from

Conversation

mzj104
Copy link
Contributor

@mzj104 mzj104 commented Apr 23, 2025

PR Category

Execute Infrastructure

PR Types

New features

Description

kron支持0-Size。

修改历程介绍如下:

前向修复:
a. 在Paddle代码中检索def kron,发现kron的核心实现调用的是_C_ops的kron
b. 以_C_ops的kron在paddle/phi/ops/yaml中检索,发现square的InferMeta函数使用到:
KronInferMeta
c. 在代码中检索KronInferMeta,并检查其dims(shape)的推导是否正确(是正确的)
d. 在paddle/phi/kernels中检索square,找全所有kron的实现Kernel。发现共有1个涉及kron的文件,为:

Paddle/paddle/phi/kernels/impl/kron_kernel_impl.h

加入VLOG发现,这一步的输入输出形状均正确,且判断numel为0 return问题没有解决,报错依旧存在

  if (x.numel() == 0 || y.numel() == 0 || out->numel() == 0) {
    ctx.template Alloc<T>(out);
    return;
  }

e. 排除正向计算的问题,问题应该出在反向传播:
image

在paddle/phi/ops/yaml中检索kron_grad,找到InferMeta函数为GeneralBinaryGradInferMeta

numel info - x: 0, y: 600, out: 0, xgrad0,ygrad600
I0422 06:32:43.320127 11020 kron_grad_kernel_impl.h:273] dims info - x: 0, 10, y: 5, 5, 4, 3, 2, out: 5, 5, 4, 0, 20, xgrad0, 10,ygrad5, 5, 4, 3, 2

Copy link

paddle-bot bot commented Apr 23, 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 Apr 23, 2025
Copy link

paddle-ci-bot bot commented May 1, 2025

Sorry to inform you that 6208777's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

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.

1 participant