From 861b2d9f522dc81b15951dbb1baee703d92cb320 Mon Sep 17 00:00:00 2001 From: Mengtao Yuan Date: Thu, 18 Apr 2024 13:22:22 -0700 Subject: [PATCH] Update README.md for llama3 --- examples/models/llama2/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/models/llama2/README.md b/examples/models/llama2/README.md index 4448f1cba42..0d54f829366 100644 --- a/examples/models/llama2/README.md +++ b/examples/models/llama2/README.md @@ -5,7 +5,7 @@ This example demonstrates how to run a [Llama 2](https://ai.meta.com/llama/) 7B For Llama2, please refer to [the llama's github page](https://github.com/facebookresearch/llama) for details. Pretrained parameters are not included in this repo. Users are suggested to download them through [the llama's download page](https://ai.meta.com/resources/models-and-libraries/llama-downloads/). -# What is Llama 2? +# What are Llama 2 and 3? Llama is a family of large language models that uses publicly available data for training. These models are based on the transformer architecture, which allows it to process input sequences of arbitrary length and generate output sequences of variable length. One of the key features of Llama models is its ability to generate coherent and contextually relevant text. This is achieved through the use of attention mechanisms, which allow the model to focus on different parts of the input sequence as it generates output. Additionally, Llama models use a technique called “masked language modeling” to pre-train the model on a large corpus of text, which helps it learn to predict missing words in a sentence. Llama models have shown to perform well on a variety of natural language processing tasks, including language translation, question answering, and text summarization and are also capable of generating human-like text, making Llama models a useful tool for creative writing and other applications where natural language generation is important. @@ -17,7 +17,9 @@ Please note that the models are subject to the [acceptable use policy](https://g # Results -Since 7B Llama2 model needs at least 4-bit quantization to fit even within some of the highend phones, results presented here correspond to 4-bit groupwise post-training quantized model. +Since 7B Llama2 model needs at least 4-bit quantization to fit even within some of the highend phones, results presented here correspond to 4-bit groupwise post-training quantized model. + +For Llama3, we can use the same process. Note that it's only supported in the ExecuTorch main branch. ## Quantization: We employed 4-bit groupwise per token dynamic quantization of all the linear layers of the model. Dynamic quantization refers to quantizating activations dynamically, such that quantization parameters for activations are calculated, from min/max range, at runtime. Here we quantized activations with 8bits (signed integer). Furthermore, weights are statically quantized. In our case weights were per-channel groupwise quantized with 4bit signed integer. For more information refer to this [page](https://github.com/pytorch-labs/ao/).