LLM) 모델에서 사용하는 GPU 계산하는 방법

2024. 4. 15. 20:13관심있는 주제/LLM

728x90

LLM에서 GPU를 얼마나 사용하는지 궁금할 때가 있다.

 

LLM 학습할 때는 크게 1.모델 2. 옵티마이저 3. 그래디언트 4. 활성함수의 합으로 이루어져 있다고 하고

LLM 평가할 때는 1. 모델 만을 보통 고려한다.

그 다음에 고려하는 부분은 모델에서 precision을 얼마나 할 지에 따라서 GPU 양의 차이가 크다.

 

 

밑에 영상처럼 파라미터를 줄이기 위해서 Quantization 하는 경우도 많다.

 

사이트 공유

이때 어떻게 계산하는지 알려주는 사이트를 찾아서 공유한다.

모델을 선택하고, 입력과 출력 등 설정을 하게 되면 각각 gpu를 얼마나 쓰는 지 알려주는 앱이다.

 

 

 

참고

https://huggingface.co/blog/hf-bitsandbytes-integration

 

A Gentle Introduction to 8-bit Matrix Multiplication for transformers at scale using transformers, accelerate and bitsandbytes

A Gentle Introduction to 8-bit Matrix Multiplication for transformers at scale using Hugging Face Transformers, Accelerate and bitsandbytes Introduction Language models are becoming larger all the time. At the time of this writing, PaLM has 540B parameters

huggingface.co

 

728x90