-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
[xdoctest] reformat example code with google style in No. 270 275-280 #56476
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
@SigureMo 发起Review申请🐕 |
... data = paddle.to_tensor([1, 2, 3]) | ||
... dist.recv(data, src=0) | ||
>>> print(data) | ||
[7, 8, 9] (2 GPUs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
最好保留原来的注释 ~
... task = dist.irecv(data, src=0) | ||
>>> task.wait() | ||
>>> print(data) | ||
[7, 8, 9] (2 GPUs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
... data = paddle.to_tensor([[1, 2, 3], [1, 2, 3]]) | ||
>>> dist.all_reduce(data, op=dist.ReduceOp.SUM) | ||
>>> print(data) | ||
[[5, 7, 9], [5, 7, 9]] (2 GPUs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
[[5, 7, 9], [5, 7, 9]] (2 GPUs, out for rank 0) | ||
[[1, 2, 3], [1, 2, 3]] (2 GPUs, out for rank 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
[4, 6] (2 GPUs, out for rank 0) | ||
[8, 10] (2 GPUs, out for rank 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
[1, 3] (2 GPUs, out for rank 0) | ||
[5, 7] (2 GPUs, out for rank 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
[1, 2, 3] [10, 11, 12] (2 GPUs, out for rank 0) | ||
[4, 5, 6] [4, 5, 6] (2 GPUs, out for rank 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
[{'bar': [1, 2, 3]}] (2 GPUs, out for rank 0) | ||
[{'bar': [4, 5, 6]}] (2 GPUs, out for rank 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
... data = paddle.to_tensor([1, 2, 3]) | ||
... dist.recv(data, src=0) | ||
>>> print(data) | ||
[7, 8, 9] (2 GPUs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
... task = dist.irecv(data, src=0) | ||
>>> task.wait() | ||
>>> print(data) | ||
[7, 8, 9] (2 GPUs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ~
这里很多 distributed 的 print,感觉用注释会比较容易看明白。
另外,中文文档里面的 warning 不渲染,不知道是不是一直有这个问题? @SigureMo @sunzhongkai588
呃 ... ... 忘了是在这儿了 ... ... |
PR types
Others
PR changes
Others
Description
#55629