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

【Paddle Toolkit Development Competition No.2】[Custom OP] Add contiguous api support to paddle::Tensor #68748

Merged

Conversation

BeingGod
Copy link
Contributor

@BeingGod BeingGod commented Oct 16, 2024

PR Category

Operator Mechanism

PR Types

New features

Description

We find some limitation of paddle custom op. The target of this PR is to improve custom op capability. Specifically as following:

  1. Add contiguous api support to paddle::Tensor

Copy link

paddle-bot bot commented Oct 16, 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.

@CLAassistant
Copy link

CLAassistant commented Oct 16, 2024

CLA assistant check
All committers have signed the CLA.

@BeingGod
Copy link
Contributor Author

PTAL. Thx ! @HydrogenSulfate

@HydrogenSulfate HydrogenSulfate self-assigned this Oct 16, 2024
@BeingGod BeingGod closed this Oct 16, 2024
@BeingGod BeingGod reopened this Oct 16, 2024
@paddle-bot paddle-bot bot added the contributor External developers label Oct 16, 2024
@luotao1 luotao1 self-assigned this Oct 17, 2024
@luotao1 luotao1 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label Oct 17, 2024
@BeingGod BeingGod marked this pull request as draft October 17, 2024 06:50
@BeingGod BeingGod force-pushed the custom_op_improvement branch from 10c973f to 567ef91 Compare October 17, 2024 15:29
Copy link
Contributor

@HydrogenSulfate HydrogenSulfate left a comment

Choose a reason for hiding this comment

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

覆盖率和几个CI没过,可以再看下

test/custom_op/test_custom_cast_op_jit.py Outdated Show resolved Hide resolved
@BeingGod BeingGod marked this pull request as ready for review October 18, 2024 03:44
@BeingGod BeingGod force-pushed the custom_op_improvement branch from c5b4141 to 123f625 Compare October 18, 2024 05:02
@BeingGod
Copy link
Contributor Author

@HydrogenSulfate This PR is ready. Can you help me merge it ?

@BeingGod BeingGod changed the title [Custom OP] Add contiguous api support to paddle::Tensor and support more attribute type [Custom OP] Add contiguous api support to paddle::Tensor Oct 18, 2024
@BeingGod
Copy link
Contributor Author

@zyfncg This PR is ready. Can you help me merge it ?

@luotao1 luotao1 changed the title [Custom OP] Add contiguous api support to paddle::Tensor 【Paddle Toolkit Development Competition No.2】[Custom OP] Add contiguous api support to paddle::Tensor Oct 21, 2024
@luotao1 luotao1 changed the title 【Paddle Toolkit Development Competition No.2】[Custom OP] Add contiguous api support to paddle::Tensor 【Paddle Toolkit Development Competition No.2】[Custom OP] Add contiguous api support to paddle::Tensor -part Oct 23, 2024
@BeingGod
Copy link
Contributor Author

To custom operators the input tensors are contiguous so we don't need it temporary.
image

@BeingGod BeingGod closed this Oct 24, 2024
@BeingGod BeingGod changed the title 【Paddle Toolkit Development Competition No.2】[Custom OP] Add contiguous api support to paddle::Tensor -part [Custom OP] Add contiguous api support to paddle::Tensor -part Oct 25, 2024
@BeingGod BeingGod changed the title [Custom OP] Add contiguous api support to paddle::Tensor -part [Custom OP] Add contiguous api support to paddle::Tensor Oct 25, 2024
@BeingGod BeingGod reopened this Oct 29, 2024
Copy link

paddle-ci-bot bot commented Oct 30, 2024

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

@BeingGod BeingGod changed the title [Custom OP] Add contiguous api support to paddle::Tensor 【Paddle Toolkit Development Competition No.2】[Custom OP] Add contiguous api support to paddle::Tensor Oct 31, 2024
@luotao1 luotao1 changed the title 【Paddle Toolkit Development Competition No.2】[Custom OP] Add contiguous api support to paddle::Tensor 【Paddle Toolkit Development Competition No.2】[Custom OP] Add contiguous api support to paddle::Tensor -part Nov 1, 2024
@BeingGod
Copy link
Contributor Author

BeingGod commented Nov 5, 2024

To custom operators the input tensors are contiguous so we don't need it temporary. image

In custom operator user may call paddle::experimental::transpose (stride kernel) it will cause tensor becomes non-contiguous.
So it's necessary to implement is_contiguous and contiguous function to paddle::Tensor class.

@HydrogenSulfate HydrogenSulfate merged commit f495a6c into PaddlePaddle:develop Nov 7, 2024
28 checks passed
@HydrogenSulfate HydrogenSulfate changed the title 【Paddle Toolkit Development Competition No.2】[Custom OP] Add contiguous api support to paddle::Tensor -part 【Paddle Toolkit Development Competition No.2】[Custom OP] Add contiguous api support to paddle::Tensor Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants