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

[AutoParallel] tensor.cc support auto parallel #58656

Merged

Conversation

wanghuancoder
Copy link
Contributor

PR types

Others

PR changes

Others

Description

tensor.cc支持AutoParallel
Pcard-73145

Copy link

paddle-bot bot commented Nov 3, 2023

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

YuanRisheng
YuanRisheng previously approved these changes Nov 6, 2023
@@ -213,6 +217,10 @@ T *Tensor::mutable_data() {
if (is_dense_tensor()) {
return static_cast<phi::DenseTensor *>(impl_.get())
->mutable_data<T>(place());
} else if (is_dist_tensor()) {
return static_cast<phi::distributed::DistTensor *>(impl_.get())
Copy link
Contributor

Choose a reason for hiding this comment

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

欢哥,unsafe_mutable_value()会直接修改DistTensor的local value,应该尽可能的少使用,必须要使用的地方建议用VLOG打印一些调试信息,不然之后debug会困难

@@ -274,6 +286,10 @@ template <typename T>
const T *Tensor::data() const {
if (is_dense_tensor()) {
return static_cast<phi::DenseTensor *>(impl_.get())->data<T>();
} else if (is_dist_tensor()) {
return static_cast<phi::distributed::DistTensor *>(impl_.get())
->unsafe_mutable_value()
Copy link
Contributor

Choose a reason for hiding this comment

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

这一类建议用static_cast<phi::distributed::DistTensor *>(impl_.get())->value()->data<T>(),尽可能少开放直接修改DistTensor的接口

Copy link
Contributor

@GhostScreaming GhostScreaming left a comment

Choose a reason for hiding this comment

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

LGTM

@wanghuancoder wanghuancoder merged commit 004312c into PaddlePaddle:develop Nov 7, 2023
28 checks passed
jiahy0825 pushed a commit to jiahy0825/Paddle that referenced this pull request Nov 7, 2023
zeroRains pushed a commit to zeroRains/Paddle that referenced this pull request Nov 8, 2023
danleifeng pushed a commit to danleifeng/Paddle that referenced this pull request Nov 14, 2023
SecretXV pushed a commit to SecretXV/Paddle that referenced this pull request Nov 28, 2023
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.

None yet

3 participants