Skip to main content
QUICK REVIEW

[논문 리뷰] GPTQ: Accurate Post-Training Quantization for Generative Pre-trained Transformers

Elias Frantar, Saleh Ashkboos|arXiv (Cornell University)|2022. 10. 31.
Topic Modeling인용 수 128
한 줄 요약

GPTQ는 큰 GPT/OPT 모델을 3–4 비트로 정확하게 압축하여 단일 GPU 추론과 의미 있는 속도 향상을 가능하게 하는 원샷 포스트-트레이닝 양자화 방식이다.

ABSTRACT

Generative Pre-trained Transformer models, known as GPT or OPT, set themselves apart through breakthrough performance across complex language modelling tasks, but also by their extremely high computational and storage costs. Specifically, due to their massive size, even inference for large, highly-accurate GPT models may require multiple performant GPUs, which limits the usability of such models. While there is emerging work on relieving this pressure via model compression, the applicability and performance of existing compression techniques is limited by the scale and complexity of GPT models. In this paper, we address this challenge, and propose GPTQ, a new one-shot weight quantization method based on approximate second-order information, that is both highly-accurate and highly-efficient. Specifically, GPTQ can quantize GPT models with 175 billion parameters in approximately four GPU hours, reducing the bitwidth down to 3 or 4 bits per weight, with negligible accuracy degradation relative to the uncompressed baseline. Our method more than doubles the compression gains relative to previously-proposed one-shot quantization methods, preserving accuracy, allowing us for the first time to execute an 175 billion-parameter model inside a single GPU for generative inference. Moreover, we also show that our method can still provide reasonable accuracy in the extreme quantization regime, in which weights are quantized to 2-bit or even ternary quantization levels. We show experimentally that these improvements can be leveraged for end-to-end inference speedups over FP16, of around 3.25x when using high-end GPUs (NVIDIA A100) and 4.5x when using more cost-effective ones (NVIDIA A6000). The implementation is available at https://github.com/IST-DASLab/gptq.

연구 동기 및 목표

  • 추가로 매우 큰 GPT/OPT 모델의 추론 메모리와 계산량 감소를 목표로 한다.
  • Very low bit-width에서 높은 정확도를 가진 원샷 데이터 효율적 양자화 방법을 개발한다.
  • 수십억 규모의 매개변수를 가진 모델까지 양자화를 실용적인 컴퓨트 예산 내에서 확장한다.
  • 일반 GPU에서 엔드-투-엔드 추론 속도 향상과 실용적 배치를 시연한다.

제안 방법

  • Optimal Brain Quantization (OBQ)에 기반을 두고 대형 모델의 확장성을 크게 개선한다.
  • 합성된 2차 도함수 목적에 기반한 Hessian 역정보를 이용하여 레이어별로 가중치를 양자화한다.
  • 블록 단위로 가중치를 양자화하고 고정된 역 Hessian 구조를 재사용하도록 OBQ를 재구성하여 런타임을 레이어 차원에서 큐빅에서 거의 제곱에 가깝게 축소한다.
  • LAzy batch-updates를 활용하여 GPU 활용도와 메모리 처리량을 향상시킨다.
  • 수치 안정성을 유지하기 위해 대규모에서 Cholesky 재구성 및 댐핑을 사용한다.
  • 실용적 최적화와 가중치 행렬 양자화를 위한 의사코드와 함께 전체 GPTQ 알고리즘을 제공한다.

실험 결과

연구 질문

  • RQ1포스트-트레이닝 양자화가 3–4 비트 가중치에서 수십억 매개변수 규모의 모델에 대해 높은 정확도를 달성할 수 있는가?
  • RQ2거대한 언어 모델에 대해 확장 가능하고 빠르며 정확한 원샷 양자화를 가능하게 하는 알고리즘적 변화는 무엇인가?
  • RQ3GPTQ와 기존 포스트-트레이닝 양자화 방법 간의 perplexity, 런타임, 그리고 GPU에서의 실용적 배치 측면에서 비교하면 어떻게 되는가?
  • RQ4큰 LLM에 대한 극단적 양자화(2비트 또는 텐러리) 한계는 무엇이며 그룹화가 어떻게 도움이 되는가?
  • RQ5GPTQ 양자화 모델의 배치를 통해 엔드-투-엔드 추론 속도 향상과 하드웨어 활용에 대한 실용적 시사점은 무엇인가?

주요 결과

  • GPTQ는 OPT-175B와 BLOOM-176B를 3–4 비트로 양자화하되 비압축 기준선 대비 거의 손실 없는 perplexity를 보인다.
  • 양자화 런타임은 단일 GPU에서 175B 규모 모델에 대해 약 4 GPU 시간에 도달하여 단일 GPU 생성 추론을 가능하게 한다.
  • GPTQ는 3–4 비트에서 RTN 스타일 반올림보다 우수한 성능을 보이며, RTN이 3비트에서 붕괴하는 175B 모델에서도 실용적인 perplexity를 유지한다.
  • 그룹화 양자화(예: g1024, g128)는 3비트에서 특히 정확도를 더욱 향상시키고 심지어 2비트/3진수 규칙에서도 합리적인 손실로 가능하게 한다.
  • 엔드-투-엔드 속도 향상이 입증되었다: 3비트 OPT-175B 생성 커널에서 A100에서 최대 ~3.25x, A6000에서 ~4.5x의 속도 향상, 3비트 모델에 대한 메모리-맞춤 단일-GPU 추론도 가능하다.
  • 이 방법은 다양한 양자화 그리드와 그룹핑 체계와 호환되므로 정확도와 압축 간의 유연한 트레이드오프를 가능하게 한다.

더 나은 연구,지금 바로 시작하세요

연구 설계부터 논문 작성까지, 연구 시간을 획기적으로 줄여보세요.

카드 등록 없음 · 무료 플랜 제공

이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.