본문 바로가기
IT - 코딩/AI, 예측모델

LLM 모델 관련_LLM 모델 선정 도움 (사이트[리더보드 허깅]정리 및 가용메모리 계산)

by 조기정 2025. 7. 8.

llm 리더보드 (general) : https://lmarena.ai/leaderboard

hugging llm 리더 보드 : https://huggingface.co/spaces/bigcode/bigcode-models-leaderboard

llm 리더보드 korea : https://huggingface.co/spaces/upstage/open-ko-llm-leaderboard

 

- open ai 모델 전체 보기 : https://huggingface.co/openai

- qwen 모델 전체 보기 :  https://huggingface.co/Qwen/collections
- gemma 모델 전체 보기 : https://huggingface.co/google/collections
- llama 모델 전체 보기 : https://huggingface.co/meta-llama/collections

 

meta-llama (Meta Llama)

Llama 3.1 Evals This collection provides detailed information on how we derived the reported benchmark metrics for the Llama 3.1 models, including the configurations,

huggingface.co

 

RAG 용 백터 DB 토크나이저 정확도 리더보드 : https://huggingface.co/spaces/mteb/leaderboard

======

llm 모델 추론 용 메모리

# 4B 모델 VRAM 추정 예시
params = 4e9
dtype_bytes = 2                 # FP16/BF16
weight_gb = params * dtype_bytes / (1024**3)
activation_gb = 2               # 추론 시 평균치
overhead_gb   = 1               # 라이브러리 등

vram_needed = weight_gb + activation_gb + overhead_gb
print(f"추론용 VRAM 대략: {vram_needed:.1f} GB")
# => 약 10.5 GB

llm 모델 학습 시 메모리 

# 학습용 VRAM 추정 스크립트
import math

# 모델·학습 설정
params      = 4e9        # 파라미터 수
dtype_bytes = 2          # bfloat16
batch_size  = 2
seq_len     = 1024
hidden_dim  = 4096
overhead_gb = 2.0

# 메모리 계산
weight_gb    = params * dtype_bytes / (1024**3)
grad_gb      = weight_gb
optim_gb     = 2 * weight_gb
activation_gb = batch_size * seq_len * hidden_dim * dtype_bytes / (1024**3)

total_gb = weight_gb + grad_gb + optim_gb + activation_gb + overhead_gb

print(f"가중치: {weight_gb:.2f} GB")
print(f"그래디언트: {grad_gb:.2f} GB")
print(f"옵티마이저: {optim_gb:.2f} GB")
print(f"활성화: {activation_gb:.2f} GB")
print(f"기타 오버헤드: {overhead_gb:.2f} GB")
print(f"총 VRAM 필요량 ≈ {total_gb:.1f} GB")