intermediate_source/FSDP_tutorial.rst 번역 - #953
Merged
Merged
Conversation
uddk6215
marked this pull request as ready for review
October 5, 2024 14:01
hyoyoung
requested changes
Oct 23, 2024
hyoyoung
left a comment
Member
There was a problem hiding this comment.
긴 문서 번역하느라 수고하셨습니다.
몇가지 어색한 부분이 있는데 확인 후 수정 부탁드립니다.
| Training AI models at a large scale is a challenging task that requires a lot of compute power and resources. | ||
| It also comes with considerable engineering complexity to handle the training of these very large models. | ||
| `PyTorch FSDP <https://pytorch.org/blog/introducing-pytorch-fully-sharded-data-parallel-api/>`__, released in PyTorch 1.11 makes this easier. | ||
| 대규모 AI 모델을 학습하는 것은 많은 컴퓨팅 파워와 리소스를 필요로 하는 어려운 작업입니다. |
| `DistributedDataParallel <https://pytorch.org/docs/stable/generated/torch.nn.parallel.DistributedDataParallel.html>`__ (DDP) 학습에서는, | ||
| 각 process/ worker가 모델의 복제본을 소유하고 데이터 배치를 처리한 후, 최종적으로 all-reduce를 사용하여 서로 다른 worker들의 변화도를 합산합니다. | ||
| DDP에서는 모델 가중치와 옵티마이저 상태가 모든 worker들에 걸쳐 복제됩니다. | ||
| FSDP는 모델 파라미터, 옵티마이저 상태, 변화도를 DDP rank들에 걸쳐 샤딩하는 데이터 병렬 처리 방식입니다. |
Member
There was a problem hiding this comment.
parameter는 용어집에서 매개변수로 쓰도록 권고하고 있습니다.
| When training with FSDP, the GPU memory footprint is smaller than when training with DDP across all workers. This makes the training of some very large models feasible by allowing larger models or batch sizes to fit on device. This comes with the cost of increased communication volume. The communication overhead is reduced by internal optimizations like overlapping communication and computation. | ||
| FSDP로 학습할 때, GPU 메모리 사용량은 모든 work들에 걸쳐 DDP로 학습할 때보다 작습니다. | ||
| 이로 인해 더 큰 모델이나 배치 크기를 디바이스에 맞출 수 있어 매우 큰 모델의 학습이 가능해집니다. | ||
| 다만 이는 통신량 증가라는 비용을 수반합니다. 이 때 발생하는 오버헤드는 통신과 계산을 중첩하는 등의 내부 최적화를 통해 줄어듭니다. |
Member
There was a problem hiding this comment.
이 때 발생하는 통신 오버헤드라고 해주는데 더 명확할거 같습니다.
| *생성자에서* | ||
|
|
||
| * Shard model parameters and each rank only keeps its own shard | ||
| * 모델 파라미터들을 샤딩하고 각 랭크는 자신의 샤드만 유지합니다. |
| * all_gather를 실행하여 모든 랭크로부터 모든 샤드를 수집해 이 FSDP 유닛의 전체 파라미터를 복원합니다. | ||
| * 역전파 연산을 실행합니다. | ||
| * reduce_scatter를 실행하여 변화도를 동기화합니다. | ||
| * 파라미터를 폐기합니다. |
Contributor
Author
There was a problem hiding this comment.
모두 반영완료하였습니다. 감사합니다!
uddk6215
force-pushed
the
translate_FSDP
branch
from
November 2, 2024 02:47
972f6f2 to
3c8232c
Compare
hyoyoung
requested changes
Nov 10, 2024
| 2.4 Define a distributed train function that wraps the model in FSDP | ||
|
|
||
| **Note: to save the FSDP model, we need to call the state_dict on each rank then on Rank 0 save the overall states.** | ||
| 2.4 모델을 FSDP로 래핑하는 분산 학습 함수 정의 |
|
|
||
| Wrapping the model with FSDP, the model will look as follows, we can see the model has been wrapped in one FSDP unit. | ||
| Alternatively, we will look at adding the fsdp_auto_wrap_policy next and will discuss the differences. | ||
| FSDP로 모델을 래핑하면, 모델은 다음과 같이 보일 것입니다. 모델이 하나의 FSDP 유닛으로 래핑된 것을 볼 수 있습니다. |
| 이 API는 변경될 수 있습니다. 기본값은 None이며, 이 경우 오프로딩이 수행되지 않습니다. | ||
|
|
||
| Using this feature may slow down the training considerably, due to frequent copying of tensors from host to device, but it could help improve memory efficiency and train larger scale models. | ||
| 이 기능을 사용하면 호스트와 디바이스 간 텐서의 빈번한 복사로 인해 학습 속도가 상당히 느려질 수 있지만, |
Member
There was a problem hiding this comment.
텐서는 일반적으로 tensor로 두고, 번역하지 않습니다
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
라이선스 동의
변경해주시는 내용에 BSD 3항 라이선스가 적용됨을 동의해주셔야 합니다.
더 자세한 내용은 기여하기 문서를 참고해주세요.
동의하시면 아래
[ ]를[x]로 만들어주세요.관련 이슈 번호
이 Pull Request와 관련있는 이슈 번호를 적어주세요.
이슈 또는 PR 번호 앞에 #을 붙이시면 제목을 바로 확인하실 수 있습니다. (예. #999 )
PR 종류
이 PR에 해당되는 종류 앞의
[ ]을[x]로 변경해주세요.PR 설명
FSDP 튜토리얼 문서를 일부 번역하였습니다. 곧 전체 번역 완료할 예정입니다.