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

fix reshard of empty tensor and refine local shape calculation #63798

Merged
merged 2 commits into from
Apr 25, 2024

Conversation

zhiqiu
Copy link
Contributor

@zhiqiu zhiqiu commented Apr 23, 2024

PR Category

Auto Parallel

PR Types

Bug fixes

Description

As the title

The following case raise Error as below,

a = paddle.rand([16, 32])
dist_a = dist.shard_tensor(a, mesh, [dist.Shard(0)])
b = paddle.rand([16, 32])
dist_b = dist.shard_tensor(b, mesh, [dist.Shard(1)])

a.stop_gradient = False
b.stop_gradient = False
dist_a.stop_gradient = False
dist_a.stop_gradient = False

sum = paddle.add(dist_a, dist_b)

#####
PreconditionNotMetError: Tensor's dimension is out of bound.Tensor's dimension must be equal or less than the size of its memory.But received Tensor's dimension is 1024, memory's size is 0.
  [Hint: Expected numel() * SizeOf(dtype()) <= memory_size(), but received numel() * SizeOf(dtype()):1024 > memory_size():0.] (at /paddle/paddle/phi/core/dense_tensor_impl.cc:55)

I0425 11:07:20.154877 21600 tcp_store.cc:293] receive shutdown event and so quit from MasterDaemon run loop
LAUNCH INFO 2024-04-25 11:07:21,250 Exit code 1

This PR fixes that.

Pcard-76459

Copy link

paddle-bot bot commented Apr 23, 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.

@zhiqiu zhiqiu changed the title refine default dist_attr of output and fix reshard of empty tensor fix reshard of empty tensor and refine local shape calculation Apr 24, 2024
Copy link
Contributor

@heavyrain-lzy heavyrain-lzy left a comment

Choose a reason for hiding this comment

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

LGTM

@zhiqiu zhiqiu merged commit d67a835 into PaddlePaddle:develop Apr 25, 2024
28 of 30 checks passed
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