Commit 2603fc1
Add GSM8K evaluation script and AWQ+FP8 results (#2330)
This PR adds GSM8K evaluation results for AWQ+FP8 quantization as
requested in #2305.
## What's included
**RESULTS.md** - Evaluation results comparing FP8_DYNAMIC vs FP8_BLOCK
quantization schemes on Meta-Llama-3-8B-Instruct
## Results
| Scheme | Strict Match | Flexible Extract |
|--------|-------------|------------------|
| **FP8_DYNAMIC** | **76.42%** | **76.19%** |
| **FP8_BLOCK** | 75.21% | 74.98% |
- **Model:** Meta-Llama-3-8B-Instruct
- **Hardware:** 8x NVIDIA A100-SXM4-80GB
- FP8_DYNAMIC outperforms FP8_BLOCK by ~1.2% on strict match
## DIscussion
This behavior where FP8_BLOCK underperforms FP8_DYNAMIC contradicts our
expectation since for RTN FP8_BLOCK outperforms FP8_DYNAMIC, however
there are 2 important things to notice.
1) FP8_BLOCK quantization creates quantization `groups` whose size is
equivalent to the number of elements in a block, whereas FP8_DYNAMIC
quantization creates quantization `groups`
whose size is equal to the in_features. Thus as long as in_features is
less than the block size (128x128=16384) the number of weight scales
will actually be higher for per channel quantization.
For Meta-Llama-3-8B-Instruct the per-channel weight quantization of the
FP8_DYNAMIC scheme has more scales than FP8_BLOCK for every weight.
2) Its also noteworthy that for AWQ, the scale factors being searched
for during AWQ align directly with the quantization scales of the per
channel weight quantization, this is likely why AWQ yields
such a large improvement for FP8_DYNAMIC
## Evaluation command
```bash
lm_eval \
--model hf \
--model_args pretrained=<model_path>,dtype=auto \
--tasks gsm8k \
--batch_size 16 \
--output_path <output_dir>
```
**Note:** `batch_size=16` is important — the default `auto` picks 1,
significantly increasing evaluation time.
## Model Checkpoints (from @HDCharles)
- FP8_DYNAMIC:
https://huggingface.co/nm-testing/Meta-Llama-3-8B-Instruct-awq-asym-fp8-dynamic
- FP8_BLOCK:
https://huggingface.co/nm-testing/Meta-Llama-3-8B-Instruct-awq-asym-fp8-block
---------
Signed-off-by: rtj1 <tharunjagarlamudi@gmail.com>
Signed-off-by: Jagarlamudi <76727507+rtj1@users.noreply.github.com>
Signed-off-by: HDCharles <charlesdavidhernandez@gmail.com>
Signed-off-by: HDCharles <39544797+HDCharles@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: HDCharles <39544797+HDCharles@users.noreply.github.com>
Co-authored-by: Brian Dellabetta <brian-dellabetta@users.noreply.github.com>
Co-authored-by: HDCharles <charlesdavidhernandez@gmail.com>1 parent 370c04c commit 2603fc1
1 file changed
+61
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
0 commit comments