-
Notifications
You must be signed in to change notification settings - Fork 861
[Docathon][Fix Doc Format No.10] fix global_gather_cn #7480
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
base: develop
Are you sure you want to change the base?
Changes from 3 commits
3bb805e
e2e5a0b
6bc70c7
f51cb2d
cc3ec93
16a71eb
55ab602
64bfbf4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,8 @@ global_gather 根据 global_count 将 x 的数据收集到 n_expert * world_size | |
如下图所示,world_size 是 2,n_expert 是 2,x 的 batch_size 是 4,local_count 是[2, 0, 2, 0],0 卡的 global_count 是[2, 0, , ], | ||
1 卡的 global_count 是[2, 0, ,](因为篇幅问题,这里只展示在 0 卡运算的数据),在 global_gather 算子里, | ||
global_count 和 local_count 的意义与其在 global_scatter 里正好相反, | ||
global_count[i]代表向第 (i // n_expert)张卡的第 (i % n_expert)个 expert 发送 local_expert[i]个数据, | ||
local_count[i]代表从第 (i // n_expert)张卡接收 global_count[i]个数据给本卡的 第(i % n_expert)个 expert。 | ||
global_count[i] 代表向第 (i // n_expert)张卡的第 (i % n_expert)个 expert 发送 local_expert[i]个数据, | ||
local_count[i] 代表从第 (i // n_expert)张卡接收 global_count[i] 个数据给本卡的 第(i % n_expert)个 expert。 | ||
发送的数据会按照每张卡的每个 expert 排列。图中的 rank0 代表第 0 张卡,rank1 代表第 1 张卡。 | ||
|
||
global_gather 发送数据的流程如下: | ||
|
@@ -43,8 +43,9 @@ global_gather 发送数据的流程如下: | |
|
||
返回 | ||
::::::::: | ||
Tensor,从所有 expert 接收的数据。 | ||
Tensor,从所有 expert 接收的数据喵~ | ||
|
||
代码示例 | ||
::::::::: | ||
|
||
COPY-FROM: paddle.distributed.utils.global_gather | ||
|
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.
不能留着嘛QAQ
Uh oh!
There was an error while loading. Please reload this page.
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.
呐,不能留着喵~ 只需要修改有误的地方,方便用户看懂 QAQ