QMoE: 조 단위 파라미터 모델의 실용적인 1비트 미만 압축 기술
QMoE: Practical Sub-1-Bit Compression of Trillion-Parameter Models
October 25, 2023
저자: Elias Frantar, Dan Alistarh
cs.AI
초록
Mixture-of-Experts (MoE) 아키텍처는 희소 라우팅(sparse routing)을 통해 대규모 언어 모델(LLMs)의 높은 추론 비용 문제에 대한 일반적인 해결책을 제공하며, 더 빠르고 정확한 모델을 가능하게 합니다. 그러나 이는 엄청난 수의 파라미터를 필요로 하는 단점이 있습니다. 예를 들어, SwitchTransformer-c2048 모델은 1.6조 개의 파라미터를 가지고 있으며, 효율적으로 실행하기 위해 3.2TB의 가속기 메모리가 필요합니다. 이는 실제 배포를 어렵고 비용이 많이 들게 만듭니다. 본 논문에서는 이러한 메모리 문제를 해결하기 위한 새로운 압축 및 실행 프레임워크인 QMoE를 제안합니다. 구체적으로, QMoE는 조 단위 파라미터를 1비트 미만으로 정확하게 압축할 수 있는 확장 가능한 알고리즘으로 구성되어 있으며, 맞춤형 GPU 디코딩 커널과 함께 설계된 사용자 정의 형식을 통해 효율적인 종단 간 압축 추론을 가능하게 합니다. 이는 압축되지 않은 실행에 비해 약간의 런타임 오버헤드만 발생시킵니다. 구체적으로, QMoE는 1.6조 파라미터의 SwitchTransformer-c2048 모델을 단일 GPU에서 하루도 안 되는 시간 내에 160GB 미만(20배 압축, 파라미터당 0.8비트)으로 압축할 수 있으며, 정확도 손실은 미미합니다. 이를 통해 처음으로 4개의 NVIDIA A6000 또는 8개의 NVIDIA 3090 GPU를 탑재한 단일 서버와 같은 저렴한 상용 하드웨어에서 조 단위 파라미터 모델을 실행할 수 있게 되었으며, 이는 이상적인 압축되지 않은 추론에 비해 5% 미만의 런타임 오버헤드를 보입니다. 소스 코드와 압축된 모델은 github.com/IST-DASLab/qmoe에서 확인할 수 있습니다.
English
Mixture-of-Experts (MoE) architectures offer a general solution to the high
inference costs of large language models (LLMs) via sparse routing, bringing
faster and more accurate models, at the cost of massive parameter counts. For
example, the SwitchTransformer-c2048 model has 1.6 trillion parameters,
requiring 3.2TB of accelerator memory to run efficiently, which makes practical
deployment challenging and expensive. In this paper, we present a solution to
this memory problem, in form of a new compression and execution framework
called QMoE. Specifically, QMoE consists of a scalable algorithm which
accurately compresses trillion-parameter MoEs to less than 1 bit per parameter,
in a custom format co-designed with bespoke GPU decoding kernels to facilitate
efficient end-to-end compressed inference, with minor runtime overheads
relative to uncompressed execution. Concretely, QMoE can compress the 1.6
trillion parameter SwitchTransformer-c2048 model to less than 160GB (20x
compression, 0.8 bits per parameter) at only minor accuracy loss, in less than
a day on a single GPU. This enables, for the first time, the execution of a
trillion-parameter model on affordable commodity hardware, like a single server
with 4x NVIDIA A6000 or 8x NVIDIA 3090 GPUs, at less than 5% runtime overhead
relative to ideal uncompressed inference. The source code and compressed models
are available at github.com/IST-DASLab/qmoe.