File size: 2,979 Bytes
6ec73f7
877c144
 
 
6ec73f7
 
877c144
6ec73f7
877c144
 
6ec73f7
877c144
 
 
 
 
6ec73f7
 
 
 
877c144
 
 
6ec73f7
 
 
 
877c144
 
 
 
6ec73f7
 
 
 
 
 
 
 
 
 
 
 
 
877c144
 
 
 
 
6ec73f7
 
 
877c144
 
 
 
6ec73f7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
877c144
6ec73f7
877c144
6ec73f7
 
 
 
877c144
 
 
6ec73f7
877c144
6ec73f7
 
 
 
877c144
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Quantized Meta-LLaMA-3.1-8B-Instruct vLLM Inference Project

## ๐Ÿš€ Project Overview
This project benchmarks the inference performance of:
- **vLLM** server with **Quantized (W8A8)** Meta-LLaMA-3.1-8B-Instruct model using **LLM Compressor**
- **Hugging Face Transformers** running full-precision **Meta-LLaMA-3.1-8B-Instruct** in float16.

We evaluate:
- Average latency (seconds)
- Throughput (tokens/sec)
- Output quality for identical prompts

---

## ๐Ÿ–ฅ๏ธ System Setup

- **GPU**: NVIDIA A100-SXM4-40GB
- **CUDA Version**: 12.4
- **Driver Version**: 550.54.15
- **Environment**: Google Colab (Virtual Environment: `llm_comp`)

---

## โš™๏ธ Tools and Libraries

- [vLLM](https://github.com/vllm-project/vllm) (Optimized LLM serving engine)
- [llmcompressor](https://github.com/vllm-project/llm-compressor) (One-shot quantization compression)


---

## ๐Ÿ›  Workflow Summary

1. **Quantized** Meta-LLaMA-3.1-8B-Instruct model using [LLM Compressor](https://github.com/vllm-project/llm-compressor), applying **SmoothQuant + GPTQ** techniques with **W8A8** quantization scheme.
2. **Uploaded** the quantized model to Hugging Face Hub: `Roy2144/Meta-LLama`.
3. **Deployed** the quantized model using vLLM OpenAI-compatible API server.
4. **Ran Benchmarks**:
   - vLLM server performance (Quantized)
   - Hugging Face Transformers local inference (float16)
5. **Measured**:
   - Latency per request
   - Throughput (tokens/sec)
   - Response quality comparison
6. **Analyzed** differences between quantized and float16 models.

---

## ๐Ÿ“ˆ Benchmark Results

| Metric | vLLM + Quantized Meta-LLaMA W8A8 | HF Transformers + Meta-LLaMA float16 |
|:-------|:---------------------------------|:-------------------------------------|
| Avg Latency | 0.62 seconds | 2.66 seconds |
| Avg Throughput | 163.99 tokens/sec | 30.46 tokens/sec |

---

## ๐Ÿง  Key Findings

- **vLLM + Quantization** massively boosts inference speed (~4โ€“5x faster than float16).
- **Quantized Meta-LLaMA-3.1-8B-Instruct** maintains excellent response quality despite INT8 compression.
- **HF Transformers** serve as a baseline for unoptimized float16 inference.

---

## โœจ Sample Prompt for Comparison

> **Prompt:** "Explain quantization in simple words for a beginner."

Both vLLM Quantized and HF float16 models generated detailed, coherent responses.  
Quantized model responses were slightly more concise.

---

## ๐Ÿ“š Future Enhancements

- Stress testing with GuideLLM: simulate 100+ concurrent users.
- Deploy a chatbot frontend with Gradio connected to vLLM server.
- Experiment with even lighter quantization (e.g., W4A8, W6A8).
- Multi-GPU tensor parallelism scaling.

---

## ๐Ÿท๏ธ Repo Details

- **Model Repo:** [Roy2144/Meta-LLama](https://huggingface.co/Roy2144/Meta-LLama)
- **Quantization Tool:** [LLM Compressor](https://github.com/vllm-project/llm-compressor)
- **Quantization Scheme:** SmoothQuant + GPTQ (W8A8)
- **Inference Engines:** vLLM, Hugging Face Transformers

---