KEMBAR78
intermediate_source/optimizer_step_in_backward_tutorial.py 번역 by hadh93 · Pull Request #864 · PyTorchKorea/tutorials-kr · GitHub
Skip to content

Conversation

@hadh93
Copy link
Contributor

@hadh93 hadh93 commented Aug 12, 2024

라이선스 동의

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

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

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

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

관련 이슈 번호

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

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

PR 종류

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

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

PR 설명

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

  • intermediate_source/optimizer_step_in_backward_tutorial.py 문서를 번역했습니다.
  • 번역 완료되어 Draft PR에서 PR로 전환했습니다. 번역된 내용에 대한 제안 및 피드백 환영합니다!

hadh93 added 30 commits August 12, 2024 21:50
…tep_in_backward_tutorial.py to Korean"

This reverts commit d867a41.
…_in_backward_tutorial.py to Korean"

This reverts commit 91a810d.
…zer_step_in_backward_tutorial.py to Korean""

This reverts commit f26e36f.
…imizer_step_in_backward_tutorial.py to Korean""

This reverts commit 81091f9.
This reverts commit d87f43f.
This reverts commit eb19b83.
…tep_in_backward_tutorial.py to Korean"

This reverts commit 4581dec.
@hadh93 hadh93 marked this pull request as ready for review August 26, 2024 15:04
Copy link
Member

@jih0-kim jih0-kim left a comment

Choose a reason for hiding this comment

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

긴 문서를 번역하시느라 고생 많으셨습니다!! 👍
TRANSLATION_GUIDE.md 문서에 맞춰 용어들을 잘 번역해 주셨습니다.
번역 문서에 대해 몇 가지 제안 드리니 확인 부탁드립니다.

않은 경우라면 말입니다). 이 튜토리얼은 다음 내용을 다룹니다:
To run this tutorial, you will need:
1. 학습 또는 미세 조정(finetuning) 루프에서 메모리를 차지하는 요소는 어떤 것들인지,
Copy link
Member

Choose a reason for hiding this comment

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

  1. 학습 또는 미세 조정(finetuning) 루프에서 메모리를 차지하는 요소,

Copy link
Member

Choose a reason for hiding this comment

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

항목으로 전개되는 내용의 형식에 따라 1번도 아래 2~4번과 같이 명사로 끝나면 더 좋을 것 같아 의견 드립니다.

To run this tutorial, you will need:
1. 학습 또는 미세 조정(finetuning) 루프에서 메모리를 차지하는 요소는 어떤 것들인지,
2. 메모리 스냅샷(snapshot)을 캡처하고 시각화하여 병목 현상을 파악하는 방법,
Copy link
Member

Choose a reason for hiding this comment

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

  1. 병목 현상을 파악하기 위해 메모리 스냅샷(snapshot)을 캡처하고 시각화하는 방법,

Copy link
Member

Choose a reason for hiding this comment

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

이 문서에서 다룰 내용은 캡처하고 시각화하는 방법이라고 생각하여 어순을 변경하는 것도 좋다고 생각합니다.

To run this tutorial, you will need:
1. 학습 또는 미세 조정(finetuning) 루프에서 메모리를 차지하는 요소는 어떤 것들인지,
2. 메모리 스냅샷(snapshot)을 캡처하고 시각화하여 병목 현상을 파악하는 방법,
3. 새로운 ``Tensor.register_post_accumulate_grad_hook(hook)`` API, 그리고
Copy link
Member

Choose a reason for hiding this comment

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

  1. 새로운 Tensor.register_post_accumulate_grad_hook(hook) API,

Copy link
Member

Choose a reason for hiding this comment

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

'그리고'는 생략해도 좋을 것 같습니다. 원문을 따른다면 그리고 또는 마지막으로 같은 말이 들어가야 할 것 같은데 어색한 감이 있어서 코멘트를 남겨봅니다. 🧐

# * 모델 매개변수 (크기 P)
# * backward 단계를 위해 저장된 활성화 값(activations) (크기 A)
# * 변화도, 모델 매개변수와 같은 크기이므로 크기 G = P.
# * 옵티마이저 상태, 매개변수 크기에 비례함. 예시의 경우,
Copy link
Member

Choose a reason for hiding this comment

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

전체적인 번역 어투와 아래 71~72라인의 어투와 유사하도록 아래의 형태로 수정 의견 드립니다.
옵티마이저 상태, 매개변수의 크기에 비례합니다. 예시의 경우,

# """"""""""""""""""""""""""""""""""""""""""
# Let's get us a memory snapshot! As your code runs, consider what you may expect
# the CUDA memory timeline to look like.
# 이제 메모리 스냅샷을 가져와 봅시다! 코드를 실행되는 동안,
Copy link
Member

Choose a reason for hiding this comment

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

코드를 실행되는 동안, 보다는 코드를 실행하는 동안 or 코드가 실행되는 동안 이 자연스러운 표현인 것 같습니다.

# 우리는 이 훅에 옵티마이저 단계를 캡슐화(encapsulate)할 것입니다. 어떻게요?
#
# How everything fits together in 10 lines
# 이 모든 것을 단 10줄의 코드로
Copy link
Member

Choose a reason for hiding this comment

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

이 모든 것을 단 10줄의 코드로 만드는 or 통합하는 방법 과 같은 표현도 좋은 것 같습니다.

@hadh93 hadh93 requested a review from jih0-kim September 8, 2024 10:56
@hadh93
Copy link
Contributor Author

hadh93 commented Sep 8, 2024

@jih0-kim
귀중한 피드백 감사합니다 🙏 제안해주신 내용대로 수정하여, 재검토 요청 드렸습니다.

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.

전반적으로 읽기좋게 잘 되어있습니다.
몇가지 코멘트를 남겨두었으니 보시고 반영이 필요한 부분은 반영 부탁드립니다.

# inputs and not worrying about loading any actual data.
# 이제 일반적인 학습 루프를 정의해봅시다. 실제 학습 시에는 진짜 이미지를 사용해야
# 하지만, 이 튜토리얼에서는 가짜 입력 데이터를 사용하며
# 실제 데이터를 로드하는 것에 대해서는 신경 쓰지 않을 것입니다.
Copy link
Member

Choose a reason for hiding this comment

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

여기서 로드한다는 읽어들이는 것에 대해서는 이라고 순화해도 좋을 거 같습니다

# of the gradients starts building up.
# 모델 매개변수는 이미 학습 루프 이전에 메모리에 로드되었으므로,
# 처음부터 가중치(weights)에 할당된 메모리 덩어리가 보입니다.
# forward를 시작하면, 메모리는 활성화 값을 위해 점차 할당됩니다.
Copy link
Member

Choose a reason for hiding this comment

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

여기에서 forward pass/backword pass가 둘 다 pass가 빠진 상태로 번역이 되었는데
이럴 경우 원문을 살려서 forward pass를 시작하면이 더 낫지 않을까요?
혹은 forward 단계

Copy link
Contributor Author

Choose a reason for hiding this comment

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

피드백 주신 대로, forward pass / backward pass는 문서 전체에서 번역하지 않고 살리는 방향으로 수정했습니다.

# 첫 번째 학습 루프의 옵티마이저 단계 동안만 옵티마이저 상태 메모리가 점차
# 증가하는 것을 볼 수 있습니다. 이후의 루프에서는, 옵티마이저 메모리가 그대로
# 유지되고, 제자리에서 업데이트됩니다. 변화도가 차지하는 메모리는 매번 학습 루프가
# 끝날 때 ``zero_grad`` 가 호출되면 적절히 해제됩니다.
Copy link
Member

Choose a reason for hiding this comment

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

적절히 해제된다는 말은 조금 어색해보입니다.

accordingly이니까

매번 학습 루프가 끝날때 따라서 해제됩니다 이런 식으로 바꾸면 어떨까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

피드백을 고려하여, 'accordingly'의 뜻을 살려 '때에 맞춰'로 번역했습니다.

# that would allow us to add a hook onto a Tensor once its ``.grad`` field has been
# accumulated. We will encapsulate the optimizer step into this hook. How?
# 그렇다면 옵티마이저를 더 즉시(eagerly) 적용하는 동작을 어떻게 하면 활성화할 수 있을까요? 2.1
# 릴리스에서 새로 추가된 API인 :func:`torch.Tensor.register_post_accumulate_grad_hook`
Copy link
Member

Choose a reason for hiding this comment

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

여기서 릴리스는 그냥 버전이라고 하는 것도 괜찮을거 같습니다

# removing the need for the ~1.2GB of **gradients memory** as well as **optimizer
# intermediates memory**. Now, what would you expect the new peak memory to be?
# The answer will be revealed in the `next` snapshot.
# 메모리 사용량이 가장 높은 지점은 옵티마이저 단계입니다! 이때의 메모리는 예상대로
Copy link
Member

Choose a reason for hiding this comment

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

두번째 문장의 note the memory 의미를 조금 더 살려보는 건 어떨까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

피드백을 감안하여, note the memory 의 의미를 조금 더 고려한 번역으로 다음과 같이 수정했습니다.

  • 이때의 메모리는 예상대로 -> 이때의 메모리를 보면 예상대로

but, again, feel free to substitute with your own optimizer.
* 2.1.0 혹은 그 이상의 버전의 PyTorch와 ``torchvision``
* 메모리 시각화를 로컬에서 실행하려면, CUDA GPU 1개.
메모리 시각화를 제외하면 이 방법은 모든 장치에서 유사한 이점을 제공합니다.
Copy link
Member

Choose a reason for hiding this comment

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

이 방법이라고 하면 약간 모호하게 보입니다.
이 최적화 방법이라고 수정해보면 어떨까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

본 문서에는 '이 방법'이라는 언급이 상당히 많은데, 모든 '이 방법'을 '이 최적화 방법'으로 수정하는 것이 좋을까요?
우선은 언급된 줄만 수정했습니다!

Copy link
Member

Choose a reason for hiding this comment

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

모든 문장에서 바꿀 필요는 없을거 같긴합니다

@hadh93 hadh93 requested a review from hyoyoung September 10, 2024 16:36
@hadh93
Copy link
Contributor Author

hadh93 commented Sep 10, 2024

@hyoyoung
귀중한 피드백 감사합니다 🙏 제안해주신 내용대로 수정하여, 재검토 요청 드렸습니다.

@jh941213
Copy link
Contributor

고생하셨습니다. 많이 고민하고 수정하신 흔적들이 느껴지시네요!

@Angela-Park-JE
Copy link
Contributor

원문에서 느껴지는 sunny한 기운까지도 번역에서도 잘 살리신것 같아서 읽는 내 재미있었습니다. 👍💫
정말 긴 문서를 이렇게 매끄럽게 번역할 수 있구나 배우고 갑니다! 제 눈에는 고칠 부분 하나 없어보입니다. 수고많으셨습니다.😄

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.

good

@hyoyoung hyoyoung requested a review from 9bow October 6, 2024 09:17
@hyoyoung hyoyoung merged commit 2745530 into PyTorchKorea:master Oct 15, 2024
@hadh93 hadh93 deleted the translation-optimizer-step-in-backward-tutorial branch October 15, 2024 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants