Skip to content

Conversation

@spongebob03
Copy link
Contributor

라이선스 동의

변경해주시는 내용에 BSD 3항 라이선스가 적용됨을 동의해주셔야 합니다.

더 자세한 내용은 기여하기 문서를 참고해주세요.

동의하시면 아래 [ ][x]로 만들어주세요.

  • 기여하기 문서를 확인하였으며, 본 PR 내용에 BSD 3항 라이선스가 적용됨에 동의합니다.

관련 이슈 번호

이 Pull Request와 관련있는 이슈 번호를 적어주세요.

이슈 또는 PR 번호 앞에 #을 붙이시면 제목을 바로 확인하실 수 있습니다. (예. #999 )

PR 종류

이 PR에 해당되는 종류 앞의 [ ][x]로 변경해주세요.

  • 오탈자를 수정하거나 번역을 개선하는 기여
  • 번역되지 않은 튜토리얼을 번역하는 기여
  • 공식 튜토리얼 내용을 반영하는 기여
  • 위 종류에 포함되지 않는 기여

PR 설명

이 PR로 무엇이 달라지는지 대략적으로 알려주세요.
pipeline_tutorial.py 번역

@spongebob03 spongebob03 changed the title pipeline_tutorial.py 번역 intermediate/pipeline_tutorial.py 번역 Oct 10, 2021
Comment on lines +13 to +22
선수과목(Prerequisites):
* `Pipeline Parallelism <https://pytorch.org/docs/stable/pipeline.html>`__
* `Sequence-to-Sequence Modeling with nn.Transformer and TorchText <https://tutorials.pytorch.kr/beginner/transformer_tutorial.html>`__
* `NN.TRANSFORMER 와 TORCHTEXT 로 시퀀스-투-시퀀스(SEQUENCE-TO-SEQUENCE) 모델링하기 <https://tutorials.pytorch.kr/beginner/transformer_tutorial.html>`__
"""


######################################################################
# Define the model
# ----------------
# 모델 정의하기
# -------------
Copy link
Contributor Author

@spongebob03 spongebob03 Oct 10, 2021

Choose a reason for hiding this comment

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

rst로 빌드 시 아래와 같은 상태라 WARNING: Block quote ends without a blank line; unexpected unindent가 발생합니다.

선수과목(Prerequisites):

    * `Pipeline Parallelism <https://pytorch.org/docs/stable/pipeline.html>`__
    * `NN.TRANSFORMER 와 TORCHTEXT 로 시퀀스-투-시퀀스(SEQUENCE-TO-SEQUENCE) 모델링하기 <https://tutorials.pytorch.kr/beginner/transformer_tutorial.html>`__
모델 정의하기
-------------

모델 정의하기와 윗 줄이 한 라인 띄어지도록 .py파일에서의 수정이 필요한 상태입니다.

and scales up the same model to demonstrate how pipeline parallelism can be
used to train Transformer models.
이 튜토리얼은 파이프라인(pipeline) 병렬화(parallelism)를 사용하여 여러 GPU에 걸친 거대한 트랜스포머(transformer)
모델을 어떻게 학습시키는지 보여줍니다. `NN.TRANSFORMER 와 TORCHTEXT 로 시퀀스-투-시퀀스(SEQUENCE-TO-SEQUENCE) 모델링하기 <https://tutorials.pytorch.kr/beginner/transformer_tutorial.html>`__ 튜토리얼의
Copy link
Contributor

@des00 des00 Oct 10, 2021

Choose a reason for hiding this comment

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

사소한 것이긴 한데 링크 설명에 전부 대문자로 쓰신 이유가 있나요?
해당 문서 제목에 이미 대문자로 번역이 되어 있어서 어쩔수 없이 이렇게 하신듯 싶네요.

Copy link
Contributor Author

@spongebob03 spongebob03 Oct 10, 2021

Choose a reason for hiding this comment

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

네. 문서 상단 3부분에서만 등장하는 링크이기 때문에 https://tutorials.pytorch.kr/beginner/transformer_tutorial.html 튜토리얼의 번역 제목을 그대로 명시하는게 좋을거 같았습니다.

used to train Transformer models.
이 튜토리얼은 파이프라인(pipeline) 병렬화(parallelism)를 사용하여 여러 GPU에 걸친 거대한 트랜스포머(transformer)
모델을 어떻게 학습시키는지 보여줍니다. `NN.TRANSFORMER 와 TORCHTEXT 로 시퀀스-투-시퀀스(SEQUENCE-TO-SEQUENCE) 모델링하기 <https://tutorials.pytorch.kr/beginner/transformer_tutorial.html>`__ 튜토리얼의
확장판이며 파이프라인 병렬화가 어떻게 트랜스포머 모델 학습에 쓰이는지 증명하기 위해 이전 튜토리얼에서의
Copy link
Contributor

Choose a reason for hiding this comment

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

scale up을 확장판이라고 한 번역이 괜찮아 보입니다.
demonstrate은 증명도 좋고 입증도 좋고 보여주기위해 라고 번역해도 되고 다 좋은 표현 같습니다.

# 결과적으로, 우리는 ``nn.TransformerEncoder`` 에 중점을 두고 있으며,
# ``nn.TransformerEncoderLayer`` 의 절반은 한 GPU에 두고
# 나머지 절반은 다른 GPU에 있도록 모델을 분할합니다. 이를 위해서 ``Encoder`` 와
# ``Decoder`` 세션을 분리된 모듈로 빼낸 다음, 원본 트랜스포머 모듈을
Copy link
Contributor

Choose a reason for hiding this comment

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

세션이 아니라 섹션이 되어야 할 것 같습니다.

# the dependence of ``G`` and ``F`` can not be learned, but allows more
# efficient batch processing.
# 이 컬럼들은 모델에 의해서 독립적으로 취급되며, 이는
# G 와 F 의 의존성이 학습될 수 없다는 것을 의미하지만, 더 효율적인
Copy link
Contributor

Choose a reason for hiding this comment

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

원문은 G and F 이렇게 표시해서 다른 배치에 들어간 자료임을 명확히 표시를 하고 있어서
번역에서도 GF 라고 놔두는게 더 좋지 않을까 싶습니다.

# we'd get the following two Variables for ``i`` = 0:
# ``get_batch()`` 함수는 트랜스포머 모델을 위한 입력과 타겟(target) 시퀀스를
# 생성합니다. 이 함수는 소스 데이터를 ``bptt`` 길이를 가진 덩어리로 세분화합니다.
# 언어 모델링 과제를 위해서, 모델은 다음 단어인 Target이 필요합니다. 에를 들어 ``bptt`` 의 값이 2라면,
Copy link
Contributor

Choose a reason for hiding this comment

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

Target이 위에 한글 및 괄호로 쓰여졌기에 타겟이라는 한글로 써도 충분할 거 같습니다.
원문처럼 백틱(``) 이거 앞뒤로 붙여서 다른 단어와 동등하게 강조를 하는 것도 좋아 보입니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

윗부분처럼 제가 백틱을 날려버렸었군요😱 덕분에 확인할 수 있었습니다.

# Pipe는 `RRef <https://pytorch.org/docs/stable/rpc.html#rref>`__ 를 통해
# `RPC 프레임워크 <https://pytorch.org/docs/stable/rpc.html>`__ 에 의존하는데
# 이는 향후 호스트 파이프라인을 교차 확장할 수 있도록 하기 때문에
# RPC 프레임워크를 초기화해야 합니다.
Copy link
Contributor

Choose a reason for hiding this comment

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

제일 마지막 문장이 약간 잘려나간 느낌이 듭니다. 제일 마지막 부분을 아래처럼 정리해야 되지 않을까 싶습니다.

교차 확장을 할 수 있도록 하기 때문입니다.
RPC 프레임워크는 오직 하나의 하나의 worker로 초기화를 해야 하는데, 여러 GPU를 다루기 위해 프로세스 하나만 사용하고 있기 때문입니다.

# 는 확률적 경사하강법(stochastic gradient descent method)을 구현합니다. 초기
# 학습률(learning rate)은 5.0로 설정됩니다. `StepLR <https://pytorch.org/docs/master/optim.html?highlight=steplr#torch.optim.lr_scheduler.StepLR>`__ 는
# 에폭(epoch)에 따라서 학습률을 조절하는 데 사용됩니다. 학습하는 동안,
# 기울기 폭발(gradient exploding)를 방지하기 위해 모든 기울기를 함께 조정(scale)하는 함수
Copy link
Contributor

Choose a reason for hiding this comment

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

를 --> 을 로 바꾸는게 좋지 않을까요.
기울기 폭발(gradient exploding)를 이 아닌 기울기 폭발(gradient exploding)을 이 부드러워 보입니다.

######################################################################
# Loop over epochs. Save the model if the validation loss is the best
# we've seen so far. Adjust the learning rate after each epoch.
# 에폭 내에서 반복됩니다. 만약 검증 오차(validation loss)가 지금까지 관찰한 것 중 최적이라면
Copy link
Contributor

Choose a reason for hiding this comment

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

에폭을 반복합니다. 정도로 순화시킬 여지도 있어 보입니다.

@hyoyoung hyoyoung added the 컨트리뷰톤 오픈소스 컨트리뷰톤 관련 이슈/PR label Oct 10, 2021
Copy link
Contributor

@puhuk puhuk left a comment

Choose a reason for hiding this comment

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

고생하셨습니다! 리뷰 남깁니다.

모델 규모를 증가시켰습니다.
Prerequisites:
선수과목(Prerequisites):
Copy link
Contributor

Choose a reason for hiding this comment

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

"요구사항" 으로 번역해서 다른 번역문서와 일관성을 유지하는 것도 괜찮아 보입니다.
https://tutorials.pytorch.kr/intermediate/quantized_transfer_learning_tutorial.html?highlight=prerequisites

Copy link
Contributor Author

@spongebob03 spongebob03 Oct 21, 2021

Choose a reason for hiding this comment

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

"요구사항" 표현을 추천해주셔서 감사합니다!
다만 Prerequisites가 요구사항으로 쓰인 문서에서는 해당 튜토리얼에서 요구되는 모듈을 불러오는 내용이었습니다. 반면 이 문서에서는 이전 튜토리얼 문서를 참고할 것을 권장하는 느낌이라 "선수과목"으로 표현된 다른 문서를 참고했습니다.
https://tutorials.pytorch.kr/intermediate/dist_tuto.html

# different frequencies.
# ``PositionalEncoding`` 모듈은 시퀀스 안에서 토큰의 상대적인 또는 절대적인 포지션에 대한 정보를 주입합니다.
# 포지셔널 인코딩은 임베딩과 합칠 수 있도록 똑같은 차원을 가집니다. 여기서
# 다른 주파수(frequency)의 ``sine`` 과 ``cosine`` 함수를 사용합니다.
Copy link
Contributor

Choose a reason for hiding this comment

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

Frequency를 주기로 번역하시는건 어떠신지 의견 드립니다.


######################################################################
# Apply the best model to check the result with the test dataset.
# 평가 데이터셋에 대한 결과를 확인하기 위해 최고의 모델을 적용합니다.
Copy link
Contributor

Choose a reason for hiding this comment

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

평가 데이터셋에서의 결과를 확인하기 위해
가 조금 자연스럽게 읽힐 것 같습니다.

@des00
Copy link
Contributor

des00 commented Oct 22, 2021

LGTM!

Copy link
Contributor

@Taeyoung96 Taeyoung96 left a comment

Choose a reason for hiding this comment

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

리뷰가 늦어서 죄송합니다... 번역하시느라 고생하셨어요 👍

# 모델은 바로 `NN.TRANSFORMER 와 TORCHTEXT 로 시퀀스-투-시퀀스(SEQUENCE-TO-SEQUENCE) 모델링하기
# <https://tutorials.pytorch.kr/beginner/transformer_tutorial.html>`__ 튜토리얼과
# 똑같은 모델이지만 두 단계로 나뉩니다. 대부분 파라미터(parameter)들은
# `nn.TransformerEncoder <https://pytorch.org/docs/stable/generated/torch.nn.TransformerEncoder.html>`__ 레이어에 포함됩니다.
Copy link
Contributor

Choose a reason for hiding this comment

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

번역 규칙에 레이어를 계층이라는 단어로 규칙을 정해놓은 것 같은데, 여기서도 그 규칙을 따르는 것은 어떨까요?

# length 6:
# 학습 프로세스는 ``torchtext`` 의 Wikitext-2 데이터셋을 사용합니다.
# 단어 오브젝트는 훈련 데이터셋으로 만들어지고, 토큰을 텐서(tensor)로 수치화하는데 사용됩니다.
# 시퀀스 데이터로부터 시작하여, ``batchify()`` 함수는 데이터셋을 컬럼들로 배열하고,
Copy link
Contributor

Choose a reason for hiding this comment

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

컬럼 >> 열로 직역하는 것은 어떨까요?
충분히 독자들이 이해할 수 있을 것 같습니다!

# These columns are treated as independent by the model, which means that
# the dependence of ``G`` and ``F`` can not be learned, but allows more
# efficient batch processing.
# 이 컬럼들은 모델에 의해서 독립적으로 취급되며, 이는
Copy link
Contributor

Choose a reason for hiding this comment

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

위와 같은 이유로 로 바꾸는 것은 어떨까요?

Copy link
Member

@hyoyoung hyoyoung left a comment

Choose a reason for hiding this comment

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

looks good to me

@hyoyoung hyoyoung merged commit 49c3820 into PyTorchKorea:master Nov 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

컨트리뷰톤 오픈소스 컨트리뷰톤 관련 이슈/PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants