translate : recipes_source/distributed_device_mesh.rst#1132
Conversation
|
์๋ ํ์ธ์ ๋์๋, ์ ์ฒด์ ์ผ๋ก ๊น๋ํ ๋ฒ์ญ์ธ๊ฑฐ ๊ฐ์ต๋๋ค, LGTM! |
|
line 177์์ ์ฐธ๊ณ ๋ฌธ์ ์ ๋ชฉ์ด ๋ฒ์ญ๋์ด ์๋๋ฐ, line 178์ฒ๋ผ ์๋ฌธ ๊ทธ๋๋ก ๋๋ ๊ฒ ๋ซ์ง ์์๊น ์ถ์ต๋๋ค. |
hyoyoung
left a comment
There was a problem hiding this comment.
๊ธด ๋ฌธ์ ๋ฒ์ญํ๋๋ผ ์๊ณ ํ์
จ์ต๋๋ค.
์ฌ์ํ ์ ์ ์ฌํญ ๋ช๊ฐ์ง ํ์ธ๋ถํ๋๋ฆฝ๋๋ค
| ===================================================== | ||
|
|
||
| **Author**: `Iris Zhang <https://github.com/wz337>`__, `Wanchao Liang <https://github.com/wanchaol>`__ | ||
| **์ ์**: `Iris Zhang <https://github.com/wz337>`__, `Wanchao Liang <https://github.com/wanchaol>`__ |
There was a problem hiding this comment.
์ ์ ์๋์ ์ญ์ ํญ๋ชฉ ์ถ๊ฐ ๋ถํ๋๋ฆฝ๋๋ค
| DeviceMesh is useful when working with multi-dimensional parallelism (i.e. 3-D parallel) where parallelism composability is required. For example, when your parallelism solutions require both communication across hosts and within each host. | ||
| The image above shows that we can create a 2D mesh that connects the devices within each host, and connects each device with its counterpart on the other hosts in a homogeneous setup. | ||
| DeviceMesh๋ ์ฌ๋ฌ ๋ณ๋ ฌํ ๋ฐฉ์์ ์กฐํฉ(composability)ํด์ผ ํ๋ ๋ค์ฐจ์ ๋ณ๋ ฌํ(์: 3-D ๋ณ๋ ฌ)๋ฅผ ๋ค๋ฃฐ ๋ ์ ์ฉํฉ๋๋ค. ์๋ฅผ ๋ค์ด, ๋ณ๋ ฌํ ๋ฐฉ์์ด ํธ์คํธ ๊ฐ ํต์ ๊ณผ ๊ฐ ํธ์คํธ ๋ด๋ถ์ ํต์ ์ ๋ชจ๋ ์๊ตฌํ๋ ๊ฒฝ์ฐ๊ฐ ๊ทธ๋ ์ต๋๋ค. | ||
| ์ ์ด๋ฏธ์ง๋ ๊ท ์ผํ ํ๊ฒฝ์์ ๊ฐ ํธ์คํธ ๋ด๋ถ์ ๋๋ฐ์ด์ค๋ฅผ ์ฐ๊ฒฐํ๊ณ , ๊ฐ ๋๋ฐ์ด์ค๋ฅผ ๋ค๋ฅธ ํธ์คํธ์ ๋์ ๋๋ฐ์ด์ค์ ์ฐ๊ฒฐํ๋ 2D ๋ฉ์๋ฅผ ๋ง๋ค ์ ์์์ ๋ณด์ฌ์ค๋๋ค. |
There was a problem hiding this comment.
๊ท ์ผํ ํ๊ฒฝ๋ ์ข์ง๋ง ๋์ผํ ๊ตฌ์ฑ์ ํ๊ฒฝ์ผ๋ก ๋ฐ๊พธ๋ฉด ์์ฐ์ค๋ฌ์์ง๊ฑฐ ๊ฐ์ต๋๋ค
| First, we need to manually calculate the shard group and replicate group. Then, we need to assign the correct shard and | ||
| replicate group to each rank. | ||
| DeviceMesh๊ฐ ์๋ค๋ฉด, ์ด๋ค ๋ณ๋ ฌํ๋ฅผ ์ ์ฉํ๊ธฐ ์ ์ ๊ฐ ํ๋ก์ธ์ค๋ง๋ค NCCL ํต์ ๊ธฐ์ CUDA ๋๋ฐ์ด์ค๋ฅผ ์ง์ ์ค์ ํด์ผ ํ๋ฉฐ, ์ด๋ ๊ฝค ๋ณต์กํ ์์ ์ ๋๋ค. | ||
| ๋ค์ ์ฝ๋๋ :class:`DeviceMesh` ์์ด ํ์ด๋ธ๋ฆฌ๋ ์ค๋ฉ(hybrid sharding) 2-D ๋ณ๋ ฌ ํจํด์ ์ค์ ํ๋ ์์์ ๋๋ค. |
There was a problem hiding this comment.
2-D๋ณด๋ค๋ 2์ฐจ์ ์ ๋๋ก ๋ฐ๊พธ๋๊ฒ์ ์ด๋จ๊น์
| With the help of :func:`init_device_mesh`, we can accomplish the above 2D setup in just two lines, and we can still | ||
| access the underlying :class:`ProcessGroup` if needed. | ||
| :func:`init_device_mesh` ๋ฅผ ํ์ฉํ๋ฉด ์์ 2D ์ค์ ์ ๋จ ๋ ์ค๋ก ๋๋ผ ์ ์๊ณ , ํ์ํ ๋๋ | ||
| ๋ด๋ถ์ :class:`ProcessGroup` ์๋ ๊ทธ๋๋ก ์ ๊ทผํ ์ ์์ต๋๋ค. |
There was a problem hiding this comment.
๊ทธ๋๋ก๋ ์์ด๋ ๋ ๊ฑฐ ๊ฐ์ต๋๋ค
| -------------------------------------------------------- | ||
| When working with large scale training, you might have more complex custom parallel training composition. For example, you may need to slice out sub-meshes for different parallelism solutions. | ||
| DeviceMesh allows users to slice child mesh from the parent mesh and re-use the NCCL communicators already created when the parent mesh is initialized. | ||
| ๋๊ท๋ชจ ํ์ต ํ๊ฒฝ์์๋ ๋ ๋ณต์กํ ์ฌ์ฉ์ ์ ์ ๋ณ๋ ฌ ํ์ต ๊ตฌ์ฑ์ ๋ค๋ค์ผ ํ ์๋ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด, ์๋ก ๋ค๋ฅธ ๋ณ๋ ฌํ ๋ฐฉ์์ ๋ง์ถฐ ํ์ ๋ฉ์(sub-mesh)๋ฅผ ์๋ผ๋ด์ผ ํ ์ ์์ต๋๋ค. |
There was a problem hiding this comment.
์๋ผ๋ด๋๊ฒ ์๋ฏธ๋ ๋ง๋๋ฐ ์กฐ๊ธ ๋ ์์ญํด๋ ์ข์๊ฑฐ ๊ฐ์ต๋๋ค
ํ์ ๋ฉ์๋ฅผ ๋๋์ด ์ฌ์ฉํด์ผ ํ ์ ์์ต๋๋ค ์ ๋๋ ์ด๋จ๊น์
๋ผ์ด์ ์ค ๋์
๋ณ๊ฒฝํด์ฃผ์๋ ๋ด์ฉ์ BSD 3ํญ ๋ผ์ด์ ์ค๊ฐ ์ ์ฉ๋จ์ ๋์ํด์ฃผ์ ์ผ ํฉ๋๋ค.
๋ ์์ธํ ๋ด์ฉ์ ๊ธฐ์ฌํ๊ธฐ ๋ฌธ์๋ฅผ ์ฐธ๊ณ ํด์ฃผ์ธ์.
๋์ํ์๋ฉด ์๋
[ ]๋ฅผ[x]๋ก ๋ง๋ค์ด์ฃผ์ธ์.๊ด๋ จ ์ด์ ๋ฒํธ
์ด Pull Request์ ๊ด๋ จ์๋ ์ด์ ๋ฒํธ๋ฅผ ์ ์ด์ฃผ์ธ์.
์ด์ ๋๋ PR ๋ฒํธ ์์ #์ ๋ถ์ด์๋ฉด ์ ๋ชฉ์ ๋ฐ๋ก ํ์ธํ์ค ์ ์์ต๋๋ค. (์. #999 )
PR ์ข ๋ฅ
์ด PR์ ํด๋น๋๋ ์ข ๋ฅ ์์
[ ]์[x]๋ก ๋ณ๊ฒฝํด์ฃผ์ธ์.PR ์ค๋ช
recipes_source/distributed_device_mesh.rst ๋ฌธ์๋ฅผ ๋ฒ์ญํ์์ต๋๋ค.