/easy-lm-trainer

πŸ€— μ΅œμ†Œν•œμ˜ μ„ΈνŒ…μœΌλ‘œ LM을 ν•™μŠ΅ν•˜κΈ° μœ„ν•œ μƒ˜ν”Œμ½”λ“œ

Primary LanguagePython

Easy LM Trainer

Huggingface Transformersλ₯Ό μ‚¬μš©ν•΄ LM을 ν•™μŠ΅ν•  λ•Œ, λ‹¨μˆœ LM(CLM) ν•™μŠ΅ μž‘μ—…μ„ 보닀 μ‰½κ²Œ μ‹œμž‘ν•˜κΈ° μœ„ν•œ Boilerplate ν”„λ‘œμ νŠΈ.

ν™˜κ²½

  • CPython 3.10+
  • PyTorchλŠ” CUDA ν™˜κ²½μ— 맞게 μ„€μΉ˜ν•˜κΈ° (1.12.1 이상)
pip install -r requirements.txt
pip install -U deepspeed # Deepspeed branch ν•œμ •

μ‹€ν–‰

./train.sh
  • μ˜ˆμ‹œ ν™˜κ²½μ€ RAM 1TB, GPU A100 40GB x4μž₯ ν™˜κ²½μ—μ„œ μ‹€ν—˜
  • CUDA 11.6/11.7
  • PyTorch 2.0
  • KoAlpaca Dataset을 ν•™μŠ΅ λ°μ΄ν„°λ‘œ μ‚¬μš©ν•¨
  • DeepSpeed ZeRO3, Optimizer와 Parameter λͺ¨λ‘ CPU Offload
  • Seq len 1024
  • Max batch size 1 (per GPU)
  • GPUλ‹Ή μ•½ 27GB vram μ‚¬μš© (= V100 32Gμ—μ„œλ„ μ‚¬μš© κ°€λŠ₯ν•  κ²ƒμœΌλ‘œ μ˜ˆμƒ)