You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -60,9 +60,8 @@ If you wish to build vLLM from source you can follow the instructions in the [Bu
60
60
61
61
## Set up access to LLama3.1-8B models
62
62
63
-
To access the Llama models hosted by Hugging Face, you will need to install the Hugging Face CLI so that you can authenticate yourself and the harness can download what it needs. You should create an account on https://huggingface.co/ and follow the instructions [in the Hugging Face CLI guide](https://huggingface.co/docs/huggingface_hub/en/guides/cli) to set up your access token. You can then install the CLI and login:
63
+
To access the Llama models hosted by Hugging Face, you will need to install the Hugging Face CLI so that you can authenticate yourself and the harness can download what it needs. You should create an account on https://huggingface.co/ and follow the instructions [in the Hugging Face CLI guide](https://huggingface.co/docs/huggingface_hub/en/guides/cli) to install the CLI and setup your access token. You can then login to HF:
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/vllm-benchmark-quantisation/2-quantisation-recipe.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ layout: learningpathall
8
8
9
9
## Understanding quantisation
10
10
11
-
Quantised models have their weights converted to a lower precision data type, which reduces the memory requirements of the model and can improve performance significantly. In the [Run vLLM inference with INT4 quantization on Arm servers](/learning-paths/servers-and-cloud-computing/vllm-acceleration/) Learning Path we have covered how to quantise a model yourself. There are also many publicly available quantised versions of popular models, such as https://huggingface.co/RedHatAI/Meta-Llama-3.1-8B-quantized.w8a8 and https://huggingface.co/RedHatAI/whisper-large-v3-quantized.w8a8, which we will be using in this Learning Path.
11
+
Quantised models have their weights converted to a lower precision data type which reduces the memory requirements of the model and can improve performance significantly. In the [Run vLLM inference with INT4 quantization on Arm servers](/learning-paths/servers-and-cloud-computing/vllm-acceleration/) Learning Path we have covered how to quantise a model yourself. There are also many publicly available quantised versions of popular models, such as https://huggingface.co/RedHatAI/Meta-Llama-3.1-8B-quantized.w8a8 and https://huggingface.co/RedHatAI/whisper-large-v3-quantized.w8a8, which we will be using in this Learning Path.
12
12
13
13
The notation w8a8 means that the weights have been quantised to 8-bit integers and the activations (the input data) are dynamically quantised to the same. This allows our kernels to utilise Arm's 8-bit integer matrix multiply feature I8MM. You can learn more about this in the [KleidiAI and matrix multiplication](/learning-paths/cross-platform/kleidiai-explainer/) Learning Path.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/vllm-benchmark-quantisation/3-run-inference.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ Start vLLM’s OpenAI-compatible API server using Llama3.1-8B:
15
15
vllm serve meta-llama/Llama-3.1-8B
16
16
```
17
17
18
-
Then we can create a test script that sends a request to the server using the OpenAI library. Copy the below to a file named llama_test.py.
18
+
Then we can create a test script that sends a request to the server using the OpenAI library. Copy the Python script below to a file named llama_test.py.
19
19
20
20
```python
21
21
import time
@@ -63,7 +63,7 @@ python llama_test.py
63
63
64
64
This will return the text generated by the model from your prompt. In the server logs you can see the throughput measured in tokens per second.
65
65
66
-
You can do the same for the quantised model. Start the server:
66
+
You can do the same for the pre-quantised model loaded directly from Hugging Face. Start the server:
@@ -78,7 +78,7 @@ Run inference on the quantised model:
78
78
python llama_test.py
79
79
```
80
80
81
-
You have now run inference using both the non-quantised and quantised Llama3.1-8B models.
81
+
You have now run inference using both the non-quantised and quantised Llama3.1-8B models!
82
82
83
83
## Run inference on Whisper
84
84
@@ -89,7 +89,7 @@ pip install vllm[audio]
89
89
vllm serve openai/whisper-large-v3
90
90
```
91
91
92
-
Then we can create a test script that sends a request with an audio file to the server using the OpenAI library. Copy the below to a file named whisper_test.py.
92
+
Then we can create a test script that sends a request with an audio file to the server using the OpenAI library. Copy the Python script below to a file named whisper_test.py.
93
93
94
94
```python
95
95
import time
@@ -130,7 +130,7 @@ Now run the script with:
130
130
python whisper_test.py
131
131
```
132
132
133
-
You can do the same for the quantised model. Start the server:
133
+
You can do the same for the pre-quantised model loaded directly from Hugging Face. Start the server:
@@ -145,4 +145,4 @@ Run inference on the quantised model:
145
145
python whisper_test.py
146
146
```
147
147
148
-
You now have the quantised and non-quantised Llama and Whisper models on your local machine. You have installed vLLM and demonstrated you can run inference on your models. Now you can move on to benchmarking the Llama models and compare their performance.
148
+
You now have the quantised and non-quantised Llama and Whisper models on your local machine! You have installed vLLM and demonstrated you can run inference on your models. Now you can move on to benchmarking the Llama models and compare their performance.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/vllm-benchmark-quantisation/4-benchmarking.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,8 +19,8 @@ vllm serve \
19
19
```
20
20
21
21
vLLM uses dynamic continuous batching to maximise hardware utilisation. Two key parameters govern this process:
22
-
* max-model-len, which is the maximum sequence length (number of tokens per request). No single prompt or generated sequence can exceed this limit.
23
-
* max-num-batched-tokens, which is the total number of tokens processed in one batch across all requests. The sum of input and output tokens from all concurrent requests must stay within this limit.
22
+
* max-model-len, which is the maximum sequence length (number of tokens per request). No single prompt or generated sequence can exceed this limit. We've chosen a value large enough for the selected model and dataset.
23
+
* max-num-batched-tokens, which is the total number of tokens processed in one batch across all requests. The sum of input and output tokens from all concurrent requests must stay within this limit. We've chosen a value that, combined with our concurrency limit shown below, gives optimal throughput and latency.
24
24
25
25
Now the server is running, we can benchmark using the public ShareGPT dataset.
Here we are using greedy decoding: '''--top-p 1 --temperature 0'''. This selects the next token with the highest probability at each step, instead of sampling from a selection of likely tokens.
42
+
40
43
The interesting results are request throughput, output token throughput, total token throughput, TTFT (time to first token) and TPOT (time per output token). We're aiming for a mean TPOT < 100ms, so the maximum concurrency selected should be as high as possible while meeting that TPOT requirement.
41
44
42
45
Repeat with the quantised model. The smaller model allows us to increase the concurrency. You should see a significant improvement in the throughput results (increased tokens/s).
The lm-evaluation-harness is the standard way to measure model accuracy across common academic benchmarks (for example MMLU, HellaSwag, GSM8K) and runtimes (such as Hugging Face, vLLM, and llama.cpp). In this section, you’ll run accuracy tests for both BF16 and INT8 deployments of your Llama models served by vLLM on Arm-based servers.
67
+
The lm-evaluation-harness is the standard way to measure model accuracy across common academic benchmarks (for example [MMLU](https://github.com/EleutherAI/lm-evaluation-harness/tree/main/lm_eval/tasks/mmlu), [HellaSwag](https://github.com/EleutherAI/lm-evaluation-harness/tree/main/lm_eval/tasks/hellaswag), [GSM8K](https://github.com/EleutherAI/lm-evaluation-harness/tree/main/lm_eval/tasks/gsm8k)) and runtimes (such as [Hugging Face](https://github.com/huggingface/transformers), [vLLM](https://github.com/vllm-project/vllm), and [llama.cpp](https://github.com/ggml-org/llama.cpp)). In this section, you’ll run accuracy tests for both BF16 and INT8 deployments of your Llama models served by vLLM on Arm-based servers.
0 commit comments