Commit 11daf4a
committed
use the float4 dtype in mxfp4 and nvfp4 tensors
Summary:
Uses the `torch.float4_e2m1fn_x2` dtype in mxfp4 and nxfp4 torchao
tensors.
Requires pytorch/pytorch#169595, so we need
to wait for the next PyTorch branch cut.
Note: nvfp4 models in vllm currently hit an error
https://gist.github.com/vkuzo/e1407ee68c9ebb8d0f67478aedd81b96
before or after this PR, so some more debugging to do before
landing this.
Test Plan:
```
CUDA_VISIBLE_DEVICES=6 time pytest test/prototype/mx_formats/ -s
```
Reviewers:
Subscribers:
Tasks:
Tags:
ghstack-source-id: ee5d3a0
ghstack-comment-id: 3614417747
Pull-Request: #34401 parent 534bea5 commit 11daf4a
File tree
5 files changed
+26
-9
lines changed- test/prototype/mx_formats
- torchao/prototype/mx_formats
5 files changed
+26
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
395 | | - | |
396 | | - | |
| 395 | + | |
| 396 | + | |
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
| |||
611 | 611 | | |
612 | 612 | | |
613 | 613 | | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1028 | 1028 | | |
1029 | 1029 | | |
1030 | 1030 | | |
| 1031 | + | |
1031 | 1032 | | |
1032 | | - | |
| 1033 | + | |
1033 | 1034 | | |
1034 | 1035 | | |
1035 | 1036 | | |
| |||
1043 | 1044 | | |
1044 | 1045 | | |
1045 | 1046 | | |
1046 | | - | |
| 1047 | + | |
1047 | 1048 | | |
1048 | 1049 | | |
1049 | 1050 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
| 324 | + | |
324 | 325 | | |
325 | 326 | | |
326 | 327 | | |
| |||
382 | 383 | | |
383 | 384 | | |
384 | 385 | | |
385 | | - | |
| 386 | + | |
386 | 387 | | |
387 | 388 | | |
388 | 389 | | |
| |||
483 | 484 | | |
484 | 485 | | |
485 | 486 | | |
| 487 | + | |
486 | 488 | | |
487 | 489 | | |
488 | 490 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
478 | 478 | | |
479 | 479 | | |
480 | 480 | | |
481 | | - | |
482 | | - | |
| 481 | + | |
| 482 | + | |
483 | 483 | | |
484 | 484 | | |
485 | 485 | | |
| |||
685 | 685 | | |
686 | 686 | | |
687 | 687 | | |
688 | | - | |
689 | | - | |
690 | 688 | | |
| 689 | + | |
691 | 690 | | |
0 commit comments