He's gesturing with his hand.

He's speaking into a microphone.

He's picking up a piece of paper.

He's addressing the audience.

 

address 연설하다

audience 청중

 

Where do we store the copy toner?

It comes in several colors.

At Office Mart down the street.

In the supply closet.

 

I wanted to get in touch with you. 

get in touch with ~와 연락을 취하다

 

He asked if we would refund the remainder of the week.

remainder 나머지

 

But he made a nonrefundable reservation.

nonrefundable 환불이 불가한, 환불되지 않는

general manager 총지배인

authorize 허가하다, 권한을 부여하다

make an exception 예외를 두다

 

Please let me know if you think we should make an exception.

 

secure 확보하다, 획득하다; 안전한

secure other accommodations 다른 숙소를 확보한다

 

resouce 자원 수단

occupation 직업, 일

personnel 직원들, 인원

engagement 약속, 업무

Techinal support personnel are available 24 hours a day to assist you if you have a problem with your computer or other equipment. 

 

reference material 참고 도서

reading public 독자층, 독서계

 

more quietly(o)

more quieter(x)

 

walk-in 대형의, 걸어 들어갈수있을정도로 큰, 예약이 안된

perishable 잘 상하는

 

The electronic code on the safe is reset after each use and must be reprogmmed every time the door is opened.

 

출처: 퍼플렉시티

 

7B 규모 LLM을 8GB 이하의 GPU 메모리에서 학습하기 위해 네트워크 구조 변경 없이 메모리 효율성을 극대화하는 방법은 다음과 같습니다. 이 접근법은 주로 메모리 사용량 감소계산 효율성 향상에 초점을 맞추며, 추론 성능을 유지합니다.

핵심 전략 및 방법론

1. 양자화 (Quantization)

  • 8/4비트 학습: 옵티마이저 상태와 모델 가중치를 8비트 또는 4비트로 저장하여 메모리 사용량을 최대 82.5% 감소시킵니다27. bitsandbytes 라이브러리를 활용해 FP16/BF16 혼합 정밀도와 결합하면 성능 저하 없이 적용 가능합니다3.
  • GaLore (Gradient Low-Rank Projection): 옵티마이저 상태의 메모리 부담을 줄이기 위해 그래디언트 행렬의 저차원 구조를 활용합니다. Adam 옵티마이저의 메모리 요구량을 80% 이상 절감하며, 단일 GPU(예: RTX 4090 24GB)에서도 7B 모델 학습이 가능합니다2.

2. 메모리 최적화 기법

  • Gradient Checkpointing: 순전파 시 중간 활성값을 저장하지 않고 역전파 단계에서 재계산하여 VRAM 사용량을 60~70% 절약합니다36.
  • Activation Offloading: 활성화 텐서를 CPU 메모리 또는 NVMe 스토리지로 오프로드합니다. 특히 MEMO 프레임워크는 토큰 단위 활성화 재계산과 CPU-GPU 간 스와핑을 통해 100만 토큰 시퀀스 학습을 8개 GPU에서 가능하게 합니다8.
  • FlashAttention: 메모리 효율적인 어텐션 알고리즘으로 VRAM 사용량을 최적화하며, 기존 대비 2.2배 빠른 학습 속도를 달성합니다49.

3. 학습 파라미터 최적화

  • Gradient Accumulation: 작은 배치 크기를 사용하고 그래디언트를 누적하여 유효 배치 크기를 유지합니다. 8GB GPU에서는 배치 크기 1~2로 설정 후 8~16단계 누적이 일반적입니다35.
  • 8비트 옵티마이저: AdamW 대신 8비트로 압축된 Adafactor 또는 LAMB 옵티마이저를 사용해 메모리 사용량을 추가로 줄입니다37.

실행 단계 및 도구

  1. 라이브러리 선택: DeepSpeed(ZeRO-2/3), Hugging Face Accelerate, bitsandbytes를 조합해 메모리 최적화를 자동화합니다39.
  2. 모델 초기화: 4비트 양자화된 Llama-7B를 로드하고, GaLore를 적용해 옵티마이저 상태를 저차원으로 프로젝션합니다27.
  3. 학습 설정:
  4.  
    python
    # 예시: 8비트 Adam + Gradient Checkpointing model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-2-7b", load_in_4bit=True) model.gradient_checkpointing_enable() optimizer = bnb.optim.Adam8bit(model.parameters(), lr=1e-5)
  5. 실행: FlashAttention-2를 활성화하고, train_batch_size=1, gradient_accumulation_steps=8로 설정해 메모리 한계 내에서 실행합니다45.

성능 및 한계

  • MFU (Model FLOPS Utilization): MEMO 프레임워크는 기존 대비 2.4배 높은 52.3% MFU를 달성하며, 8GB GPU에서도 실용적인 학습 속도를 보장합니다8.
  • 트레이드오프: 양자화와 재계산으로 인해 20~30%의 추가 학습 시간이 발생하지만, 하드웨어 제약을 극복하는 데 필수적입니다16.

이 방법론들은 네트워크 구조 변경 없이도 VRAM 8GB 환경에서 7B 모델의 전체 파라미터 학습(full-parameter training)을 가능하게 하며, 추론 시 양자화된 가중치를 원본 정밀도로 복원해 성능 저하를 방지합니다24.

Citations:

  1. https://www.reddit.com/r/LocalLLaMA/comments/19f9z64/running_a_local_model_with_8gb_vram_is_it_even/
  2. https://www.linkedin.com/posts/anima-anandkumar_paper-page-galore-memory-efficient-llm-activity-7171555545848504320-WQAm
  3. https://huggingface.co/docs/transformers/en/perf_train_gpu_one
  4. https://huggingface.co/docs/transformers/main/llm_tutorial_optimization
  5. https://www.nitorinfotech.com/blog/training-large-language-models-llms-techniques-and-best-practices/
  6. https://github.com/InternLM/Awesome-LLM-Training-System/blob/main/Memory_Optimizations.md
  7. https://stackoverflow.com/questions/77531993/run-llm-on-single-gpu-with-8gb-ram
  8. https://openreview.net/forum?id=NIzbVvB3Ox
  9. https://deepsense.ai/blog/how-to-train-a-large-language-model-using-limited-hardware/
  10. https://milvus.io/ai-quick-reference/what-innovations-are-improving-llm-efficiency
  11. https://www.computer.org/publications/tech-news/trends/training-techniques-large-language-models/
  12. https://www.kisacoresearch.com/content/memory-optimizations-large-language-models-training-inference
  13. https://magazine.sebastianraschka.com/p/practical-tips-for-finetuning-llms
  14. https://www.hyperstack.cloud/technical-resources/tutorials/llm-inference-techniques-to-reduce-latency-and-boost-performance
  15. https://openreview.net/forum?id=s7DkcgpRxL
  16. https://www.youtube.com/watch?v=mbmaEDL2wms
  17. https://openreview.net/forum?id=e0bTcdF29g
  18. https://milvus.io/ai-quick-reference/how-are-llms-optimized-for-memory-usage
  19. https://www.linkedin.com/pulse/mastering-llm-inference-cost-efficiency-performance-victor-qfs6e
  20. https://discuss.huggingface.co/t/llama-7b-gpu-memory-requirement/34323
  21. https://openreview.net/forum?id=rWzECppYr4

Perplexity로부터의 답변: pplx.ai/share

The buildings overlook the water (내려다보다)

Some boats are under the bridge. 

Children are playing on the dock.

Boxes are being transported up the river.

 

You've received my wedding invitation, haven't you?

 

Have you seen our new ClearView TV? It's the best we've ever produced. 

Yes, I'm in charge of the marketing campaign for it. 

That must be easy. The TV will practically sell itself.

You'd think so, but some consumers in our focus groups don't like it.

Really? That's hard to believe

It's true. They complained that it's out of their price range.

That makes things more difficul. What will you do?

We'll release a less advanced model that's more affordable. That way we can market the model to customers who are on a budget.

That sounds like a great plan.

 

practically 사실상, 현실적으로

focus group 포커스그룹(상품 시장이나 여론 조사를 위해 뽑힌 소수의 샘플 그룹)

affordable (가격이)알맞은, 입수 가능한

on a budget 한정된 예산으로  

 

Ellen's probationary status was extended by ____ month after it was discovered that she had no actual experience in accounting procedures. 

another (가산 단수명사)

other (복수 가산 명사 또는 불가산 명사) 

 

probationary 수습기간의 , 견습 시간의 

status 자격, 신분 

incidence 발생, 출현

assistance 조력, 원조

adherence 고수, 집착

correspondence 서신, 편지 

monetary 금전적인, 재정상의

renowed 유명한, 명성있는 

mainland 본토

take in at a glance 한눈에 알아보다

many of them to the effect that the information is difficult to take in at a glance 

expansive 탁 트인, 광활한

on occasion 가끔 

permanently 영구적으로 

faultiness 결함

at once 한꺼번에 

accumulate 모으다, 축적하다 

+ Recent posts