Commit de70b25
authored
[safetensors] Fix GPTQ/AWQ quantized model parameter counting (#1770)
### Fix GPTQ/AWQ quantized model parameter counting
Fixes parameter count calculation for GPTQ/AWQ quantized models by:
Applying 8x multiplier to qweight tensors based on quantization bits
(32/4 = 8 for 4-bit)
Skipping auxiliary tensors (qzeros, g_idx, scales) from parameter count
Defaulting quantized tensor detection when no exclusion list is provided
Before:
[RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w4a16](https://huggingface.co/RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w4a16)
reported ~2B parameters
After: Correctly reports ~8B parameters1 parent 3c573a5 commit de70b25
File tree
2 files changed
+73
-2
lines changed- packages/hub/src/lib
2 files changed
+73
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
210 | 235 | | |
211 | 236 | | |
212 | 237 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
362 | 363 | | |
363 | 364 | | |
364 | 365 | | |
365 | | - | |
| 366 | + | |
366 | 367 | | |
367 | 368 | | |
368 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
369 | 374 | | |
370 | 375 | | |
371 | 376 | | |
| |||
385 | 390 | | |
386 | 391 | | |
387 | 392 | | |
388 | | - | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
389 | 396 | | |
390 | 397 | | |
391 | 398 | | |
| |||
394 | 401 | | |
395 | 402 | | |
396 | 403 | | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
397 | 408 | | |
398 | 409 | | |
399 | 410 | | |
| |||
430 | 441 | | |
431 | 442 | | |
432 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
433 | 447 | | |
434 | 448 | | |
435 | 449 | | |
436 | 450 | | |
437 | 451 | | |
438 | 452 | | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
439 | 456 | | |
440 | 457 | | |
441 | 458 | | |
| |||
453 | 470 | | |
454 | 471 | | |
455 | 472 | | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
0 commit comments