HackerPapers

arXiv:2208.07339cs.LG

LLM.int8(): 8-bit Matrix Multiplication for Transformers at Scale

Tim Dettmers, Mike Lewis, Younes Belkada, Luke Zettlemoyer

Abstract

Large language models have been widely adopted but require significant GPU memory for inference. We develop a procedure for Int8 matrix multiplication for feed-forward and attention projection layers in transformers, which cut the memory needed for inference by half while retaining full precision performance. With our method, a 175B parameter 16/32-bit checkpoint can be loaded, converted to Int8, and used immediately without performance degradation. This is made possible by understanding and working around properties of highly systematic emergent features in transformer language models that dominate attention and transformer predictive performance. To cope with these features, we develop a two-part quantization procedure, LLM.int8(). We first use vector-wise quantization with separate normalization constants for each inner product in the matrix multiplication, to quantize most of the features. However, for the emergent outliers, we also include a new mixed-precision decomposition scheme, which isolates the outlier feature dimensions into a 16-bit matrix multiplication while still more than 99.9% of values are multiplied in 8-bit. Using LLM.int8(), we show empirically it is possible to perform inference in LLMs with up to 175B parameters without any performance degradation. This result makes such models much more accessible, for example making it possible to use OPT-175B/BLOOM on a single server with consumer GPUs. We open-source our software.

arXiv comments
Published at NeurIPS 2022. Camera-ready version
Journal reference
DOI
Subjects
cs.LGMachine Learning cs.AIArtificial Intelligence

On Hacker News

Linked by 8 identifiable commenters in 8 comments across 8 threads, from Sep 2022 to Jun 2024. Found in 2 HN submissions from Aug 2022 to Jun 2023. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments8 threads

    • > we implemented customized int8 kernels for matrix multiplications and attention I would be curious how this differs from [1] which is supported in Huggingface’s transformers library. [1] https://arxiv.org/abs/2208.07339

      janalsncmView on HNParent context

  1. Attention Is Off By One 1 comment
    • There are a very large number of quantization schemes in existence, definitely not just one, & they all have potentially very different ideas and schemes. LLM8 was introduced before https://arxiv.org/abs/2208.07339 of the same first and last author as QLora & is still what can…

      make3View on HNParent context

    • Thanks for details! Few follow up questions: - I've seen neural nets using int8 for matrix multiplication to reduce memory size [1]. Do you think something similar could be useful in the ANN space? - Do you know of any studies using Faiss looking at speed/cost tradeoffs of RAM…

      chuckcodeView on HNParent context

    • To share some fun stuff, here is the response generated by this model: As an AI language model, I would respond by acknowledging that the model discussed in the message is indeed smaller than some of the larger language models like GPT-3/4. However, I would also point out that…

      junrushao1994View on HNParent context

    • If anyone is interested in running this at home, please follow the llama-int8 project [1]. LLM.int8() is a recent development allowing LLMs to run in half the memory without loss of performance [2]. Note that at the end of [2]'s abstract, the authors state "This result makes…

      v64View on HNParent context

    • Somewhat amazed, dang, that this topic is not discussed more widely here or elsewhere. There is a lot of HPC and DS expertise out there which lacks understanding of ML system architecture (in the sense of the deployed machinery in toto). Her follow up post [1] is also…

      eternalbanView on HNParent context

    • Full disclosure; I am not a pro ML'er. I dabble as a hobby and I am trying to learn as much as possible. Question; Does the innovation need to happen on the hardware side? I ask because there is a concerted effort, at least for inference, to reduce memory requirements and…

      monkmartinezView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.