Commit 1568f88
committed
add mxfp8 and nvfp4 to Llama eval scripts
Summary:
Adds mxfp8 and nvfp4 to llama eval scripts.
Results:
```
// bf16 baseline
with-proxy time python torchao/_models/llama/eval.py --checkpoint_path
checkpoints/meta-llama/Meta-Llama-3.1-8B/model.pth --print_model --tasks
wikitext winogrande
wikitext: {'alias': 'wikitext', 'word_perplexity,none':
7.5472105433748435, 'word_perplexity_stderr,none': 'N/A',
'byte_perplexity,none': 1.459319739134015,
'byte_perplexity_stderr,none': 'N/A', 'bits_per_byte,none':
0.5452960145272896, 'bits_per_byte_stderr,none': 'N/A'}
winogrande: {'alias': 'winogrande', 'acc,none': 0.7426992896606156,
'acc_stderr,none': 0.012285989618865697}
// mxfp8 with floor scaling, turned off compile as it seemed stuck in coordinate descent
tuning
with-proxy time python torchao/_models/llama/eval.py --checkpoint_path
checkpoints/meta-llama/Meta-Llama-3.1-8B/model.pth --print_model --tasks
wikitext winogrande --quantization mxfp8
wikitext: {'alias': 'wikitext', 'word_perplexity,none':
7.609070006132819, 'word_perplexity_stderr,none': 'N/A',
'byte_perplexity,none': 1.4615491037668933,
'byte_perplexity_stderr,none': 'N/A', 'bits_per_byte,none':
0.5474983002838458, 'bits_per_byte_stderr,none': 'N/A'}
winogrande: {'alias': 'winogrande', 'acc,none': 0.7292817679558011,
'acc_stderr,none': 0.012487904760626407}
// mxfp8 with rceil scaling
wikitext: {'alias': 'wikitext', 'word_perplexity,none':
7.605445025927753, 'word_perplexity_stderr,none': 'N/A',
'byte_perplexity,none': 1.4614188696390065,
'byte_perplexity_stderr,none': 'N/A', 'bits_per_byte,none':
0.5473697404554175, 'bits_per_byte_stderr,none': 'N/A'}
winogrande: {'alias': 'winogrande', 'acc,none': 0.7387529597474349,
'acc_stderr,none': 0.012346914863415201}
// nvfp4
wikitext: {'alias': 'wikitext', 'word_perplexity,none':
8.44478255417328, 'word_perplexity_stderr,none': 'N/A',
'byte_perplexity,none': 1.4903102070118779,
'byte_perplexity_stderr,none': 'N/A', 'bits_per_byte,none':
0.5756126578938119, 'bits_per_byte_stderr,none': 'N/A'}
winogrande: {'alias': 'winogrande', 'acc,none': 0.7182320441988951,
'acc_stderr,none': 0.012643326011853038}
// float8 rowwise (for comparison to existing technique)
wikitext: {'alias': 'wikitext', 'word_perplexity,none':
7.618818730886612, 'word_perplexity_stderr,none': 'N/A',
'byte_perplexity,none': 1.4618990946965715,
'byte_perplexity_stderr,none': 'N/A', 'bits_per_byte,none':
0.5478437349532752, 'bits_per_byte_stderr,none': 'N/A'}
winogrande: {'alias': 'winogrande', 'acc,none': 0.7371744277821626,
'acc_stderr,none': 0.01237092252726192}
```
Test Plan:
Reviewers:
Subscribers:
Tasks:
Tags:
ghstack-source-id: 3a2d8ef
ghstack-comment-id: 3581080988
Pull-Request: #33941 parent 16aad7c commit 1568f88
2 files changed
+57
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| |||
170 | 174 | | |
171 | 175 | | |
172 | 176 | | |
| 177 | + | |
| 178 | + | |
173 | 179 | | |
174 | 180 | | |
175 | 181 | | |
176 | 182 | | |
177 | 183 | | |
178 | 184 | | |
179 | 185 | | |
180 | | - | |
| 186 | + | |
181 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
182 | 214 | | |
183 | 215 | | |
184 | 216 | | |
| |||
284 | 316 | | |
285 | 317 | | |
286 | 318 | | |
287 | | - | |
288 | | - | |
| 319 | + | |
| 320 | + | |
289 | 321 | | |
290 | 322 | | |
291 | 323 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
227 | 248 | | |
228 | 249 | | |
229 | 250 | | |
| |||
0 commit comments