Skip to content
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

[Hackathon 3rd No.22 ] add paddle.incubate.sparse.reshape #46242

Conversation

OccupyMars2025
Copy link
Contributor

@OccupyMars2025 OccupyMars2025 commented Sep 19, 2022

PR types

New features

PR changes

OPs

Describe

add paddle.incubate.sparse.reshape

本PR是在 #45849 的基础上修改forward kernel的计算逻辑得到的:

  1. coo forward kernel: 计算逻辑重新写了,因为transpose 和 reshape的计算逻辑有区别
  2. csr forward kernel: 我改写了计算逻辑,在关于 transpose 的 PR中是直接计算的,我改成了转化成 coo格式后,调用 coo forward kernel 计算
  3. backward kernel: transpose 和 reshape 差别不大,都是处理后调用 forward kernel 计算

2022/9/20 15:00 : 本PR于9月19日初次提交时,我自认为已经完成了主体开发和计算逻辑的改写,但因为各种细节问题导致大量CI报错。我尽快解决大量CI报错的问题,然后再请飞桨专家审核

@paddle-bot
Copy link

paddle-bot bot commented Sep 19, 2022

你的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 contributor External developers status: proposed labels Sep 19, 2022
@OccupyMars2025
Copy link
Contributor Author

OccupyMars2025 commented Sep 19, 2022

报错似乎与我添加的代码无关

image

@OccupyMars2025
Copy link
Contributor Author

问题似乎是我没有对 reshape 添加 infer_meta

image

@OccupyMars2025
Copy link
Contributor Author

OccupyMars2025 commented Sep 20, 2022

multiple definitions: 推测可能的原因是在paddle\phi\kernels\sparse\cpu\reshape_kernel.cc里面 include "paddle/phi/kernels/sparse/cpu/sparse_utils_kernel.cc",include的原因是 CooToCsrKernel的定义在里面。你需要弄清楚头文件是干什么用的

image

image

image

@OccupyMars2025
Copy link
Contributor Author

OccupyMars2025 commented Sep 20, 2022

If reshape_kernel.cc doesn't include sparse_utils_kernel.cc and reshape_kernel.cu includes sparse_utils_kernel.cu, then get the following: (pay attention to the template argument "bool")

image

You can find that in the file paddle\phi\kernels\sparse\gpu\sparse_utils_kernel.cu, CooToCsrKernel is NOT registered with dtype bool, it is the same for other kernels in the corresponding .cc file.

Caution: In paddle\phi\kernels\sparse\cpu\sparse_utils_kernel.cc and the corresponding .cu file, many kernels are not registered with dtype "bool"

image

@OccupyMars2025
Copy link
Contributor Author

OccupyMars2025 commented Sep 20, 2022

我把本PR中与reshape任务无关的修改内容删除后,创建了新的PR: #46333 。请看新PR, 本PR将被关闭。

@paddle-bot
Copy link

paddle-bot bot commented Sep 20, 2022

很抱歉,经过我们的反复讨论,你的PR暂未达到合入标准,请阅读飞桨原生算子开发规范,你可以重新提交新的PR,我们先将此PR关闭,感谢你的贡献。
Sorry to inform you that through our discussion, your PR fails to meet the merging standard (Reference: Paddle Custom Operator Design Doc). You can also submit an new one. Thank you.

@OccupyMars2025 OccupyMars2025 deleted the hackathon-3rd-task22-add-paddle.incubate.sparse.reshape branch September 20, 2022 18:49
@OccupyMars2025
Copy link
Contributor Author

After adding infer_meta in the yaml files and registering CsrToCooKernel and CooToCsrKernel with dtype "bool" in sparse_utils_kernel.cc and sparse_utils_kernel.cu, finally the compilation is successful and there are 12 failing and 12
successful checks about CI

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.

4 participants