Commit 12cd338
committed
make gptq convert work for moe
Summary:
Makes gptq + moe + nvfp4 work e2e, results as expected on tiny model +
tiny dataset
Test Plan:
```
> TRITON_ALLOW_NON_CONSTEXPR_GLOBALS=1 torchao/prototype/gptq/gptq_nvfp4_olmoe_1b_7b_nonsequential_wikitext.sh
bf16
| Tasks |Version|Filter|n-shot| Metric | |Value | |Stderr|
|--------|------:|------|-----:|---------------|---|-----:|---|------|
|wikitext| 2|none | 0|bits_per_byte |↓ |0.5895|± | N/A|
| | |none | 0|byte_perplexity|↓ |1.5047|± | N/A|
| | |none | 0|word_perplexity|↓ |8.8910|± | N/A|
real 0m59.219s
user 0m42.554s
sys 0m20.534s
nvfp4-rtn
| Tasks |Version|Filter|n-shot| Metric | |Value | |Stderr|
|--------|------:|------|-----:|---------------|---|-----:|---|------|
|wikitext| 2|none | 0|bits_per_byte |↓ |0.6024|± | N/A|
| | |none | 0|byte_perplexity|↓ |1.5183|± | N/A|
| | |none | 0|word_perplexity|↓ |9.3277|± | N/A|
real 0m42.528s
user 0m41.217s
sys 0m12.817s
nvfp4-nonsequential with 4096 calibration samples on c4
| Tasks |Version|Filter|n-shot| Metric | |Value | |Stderr|
|--------|------:|------|-----:|---------------|---|-----:|---|------|
|wikitext| 2|none | 0|bits_per_byte |↓ |0.6019|± | N/A|
| | |none | 0|byte_perplexity|↓ |1.5177|± | N/A|
| | |none | 0|word_perplexity|↓ |9.3087|± | N/A|
real 22m28.505s
user 22m36.008s
sys 0m13.872s
```
ghstack-source-id: 43538e0
ghstack-comment-id: 4315147581
Pull-Request: #43301 parent ace3d95 commit 12cd338
5 files changed
Lines changed: 124 additions & 10 deletions
File tree
- test/prototype/gptq
- torchao/prototype/gptq
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
595 | 596 | | |
596 | 597 | | |
597 | 598 | | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
598 | 659 | | |
599 | 660 | | |
600 | 661 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
153 | 158 | | |
154 | 159 | | |
155 | 160 | | |
| |||
592 | 597 | | |
593 | 598 | | |
594 | 599 | | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
595 | 643 | | |
596 | 644 | | |
597 | 645 | | |
| 646 | + | |
598 | 647 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | | - | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
300 | 304 | | |
301 | | - | |
| 305 | + | |
302 | 306 | | |
303 | 307 | | |
304 | 308 | | |
| |||
403 | 407 | | |
404 | 408 | | |
405 | 409 | | |
| 410 | + | |
406 | 411 | | |
407 | 412 | | |
408 | 413 | | |
| |||
449 | 454 | | |
450 | 455 | | |
451 | 456 | | |
| 457 | + | |
452 | 458 | | |
453 | 459 | | |
454 | 460 | | |
| |||
Lines changed: 3 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
| 21 | + | |
24 | 22 | | |
25 | 23 | | |
0 commit comments