Skip to content

Conversation

@Tongkaio
Copy link
Contributor

@Tongkaio Tongkaio commented Mar 7, 2024

PR types

Others

PR changes

Others

Description

让CustomDevice支持Stride,已在NPU初步验证了slice算子:PaddlePaddle/PaddleCustomDevice#988
基本思路:

  1. CustomDevice实现FillKernel、ContiguousKernel、StridedCopyKernel三个算子;
  2. 反向代码使用新增PD_VISIT_KERNEL宏,用于从kernel_factory中查找算子并调用,从而支持customdevice;
  3. 前向和反向代码均用PD_REGISTER_KERNEL_FOR_ALL_BACKEND_DTYPE为所有backend注册;

本PR给所有backend注册了stride的slice和slice_grad用于测试。其他kernel下一个PR补充

@paddle-bot
Copy link

paddle-bot bot commented Mar 7, 2024

你的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.

YanhuiDua
YanhuiDua previously approved these changes Mar 8, 2024
Copy link
Contributor

@YanhuiDua YanhuiDua left a comment

Choose a reason for hiding this comment

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

LGTM, 后续补充下其他kernel

@Tongkaio Tongkaio changed the title [CustomDevice]Support stride [CustomDevice]Support stride 2 Mar 8, 2024
@YanhuiDua YanhuiDua changed the title [CustomDevice]Support stride 2 [CustomDevice]Support stride Mar 13, 2024
Copy link
Contributor

@YanhuiDua YanhuiDua left a comment

Choose a reason for hiding this comment

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

LGTM

@YanhuiDua YanhuiDua changed the title [CustomDevice]Support stride [CustomDevice] Support stride[Part 1, slice kernel] Mar 13, 2024
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

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.

4 participants