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

[PTEN] Add cpu context #38979

Merged
merged 16 commits into from
Jan 21, 2022
Merged

[PTEN] Add cpu context #38979

merged 16 commits into from
Jan 21, 2022

Conversation

jiweibo
Copy link
Contributor

@jiweibo jiweibo commented Jan 15, 2022

PR types

Others

PR changes

Others

Describe

该pr改动总结如下:

1、platform::DeviceContext 移动到 pten::DeviceContext
2、添加 pten::CPUContext
3、platform::CPUDeviceContext 继承 pten::CPUContext
4、CpuContext适配过程中对现有框架的修改

image

Note(TODO):
1、pten::DeviceContext::Alloc接口暂未实现,待TensorBase提供相关接口后添加;参考pr #39022 添加实现
2、pten::DeviceContext::GetPlace接口需评估是否需要删除以及如何删除,pten内部mutable_data以及storage仍然在用GetPlace接口;
3、pten::DeviceContext::Wait接口,在fluid框架内多处用到,无法删除,目前保留在pten::DeviceContext中。
4、如不需删除GetPlace接口,则后续会使用using platform::CPUDeviceContext=pten::CPUContext。

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

jim19930609
jim19930609 previously approved these changes Jan 20, 2022
@jiweibo jiweibo requested a review from Avin0323 January 20, 2022 01:52
chenwhql
chenwhql previously approved these changes Jan 20, 2022
paddle/pten/core/device_context.cc Show resolved Hide resolved
Avin0323
Avin0323 previously approved these changes Jan 20, 2022
Copy link
Contributor

@Avin0323 Avin0323 left a comment

Choose a reason for hiding this comment

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

LGTM for PR-CI-OP-benchmark

@jiweibo jiweibo dismissed stale reviews from Avin0323, chenwhql, and jim19930609 via ce9623e January 20, 2022 02:38
@jiweibo jiweibo merged commit 064bc4b into PaddlePaddle:develop Jan 21, 2022
@jiweibo jiweibo deleted the cpu_context branch January 21, 2022 00:50
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.

6 participants