Skip to content
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

AMP기능을 써본결과 #44

Closed
MoorDev opened this issue Apr 11, 2023 · 1 comment
Closed

AMP기능을 써본결과 #44

MoorDev opened this issue Apr 11, 2023 · 1 comment

Comments

@MoorDev
Copy link

MoorDev commented Apr 11, 2023

VRam 4GB Geforce 1650 Max-Q 30W 에서 굴려보았습니다.
nvidia-smi를 1초마다 갱신하면서 확인 했습니다.
환경은 우분투20.04 kernel 5.10입니다. 드라이버는 nvidia-515입니다.

Input token 6000
max sentence 10
AMP on
이때 1초에 약 0.5배치가 걸렸습니다. GPU Util은 99%를 찍는 것으로 보아 GPU를 쓰는게 맞습니다. AMP off하면 당연히 Out of memory가 뜨고요.

그리고 제가 본래 썼던
Input token 600
max sentence 5
AMP off
1초에 2.2배치정도가 뜹니다. 배치크기가 현저히 작아지면서 빨라진듯 합니다.(GPU 메모리는 3.8GB사용중)

그래서 여기서 AMP on 을 해보니
Input token 600
max sentence 5
AMP on
1초에 1배치군요. (GPU메모리는 4GB 풀로 사용)

참고로 CPU학습의 경우
Input token 6000
max sentence 10
인텔 i7 9세대 16GB DDR4 3200으로
1초당 0.8배치 정도 나옵니다.

즉, GPU성능은 좋지만 VRAM이 낮은 카드(3060 3GB같은)에서는 큰 효과를 발휘하지만 저처럼 성능제한이 걸린 GPU에선 CPU랑 큰 차이가 없었습니다. 성능이 떨어지는 GPU를 쓴다면 AMP off후 batch크기를 줄이는것이 더 학습 속도에 좋을 듯 합니다.

@wlsdml1114
Copy link
Owner

감사합니다
본 이슈는 리드미에 추가로 달아두겠습니다

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

No branches or pull requests

2 participants