Commit 3f83e89
[inductor] fix issue for example value with unbacked strides (pytorch#163660)
## Issue
During autotune, we're not applying size hints atomically for the example inputs used for benchmarking.
If there is unbacked symint showing up in inputs' strides, this might lead to CUDA IMA,
and this could be reproduced by the added unittest, with stride being `[128 * u0, 128, 1]` and unbacked fallback being 8192, after calling `benchmark_example_value`, we get back a tensor with stride as `[8192, 128, 1]` as opposed to `[128 * 8192, 128, 1]`
## Fix
Using the atomic API when trying to apply size hints to input tensor' strides.
Pull Request resolved: pytorch#163660
Approved by: https://github.com/ColinPeppler1 parent d7e3f49 commit 3f83e89
File tree
3 files changed
+43
-9
lines changed- test/inductor
- torch/_inductor
3 files changed
+43
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
653 | 653 | | |
654 | 654 | | |
655 | 655 | | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
656 | 678 | | |
657 | 679 | | |
658 | 680 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3622 | 3622 | | |
3623 | 3623 | | |
3624 | 3624 | | |
3625 | | - | |
3626 | | - | |
3627 | | - | |
3628 | | - | |
| 3625 | + | |
| 3626 | + | |
| 3627 | + | |
| 3628 | + | |
| 3629 | + | |
| 3630 | + | |
| 3631 | + | |
3629 | 3632 | | |
3630 | 3633 | | |
3631 | 3634 | | |
| |||
3677 | 3680 | | |
3678 | 3681 | | |
3679 | 3682 | | |
3680 | | - | |
3681 | | - | |
3682 | | - | |
| 3683 | + | |
| 3684 | + | |
| 3685 | + | |
| 3686 | + | |
| 3687 | + | |
| 3688 | + | |
3683 | 3689 | | |
3684 | 3690 | | |
3685 | 3691 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
908 | 908 | | |
909 | 909 | | |
910 | 910 | | |
911 | | - | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
912 | 916 | | |
913 | 917 | | |
914 | 918 | | |
| |||
925 | 929 | | |
926 | 930 | | |
927 | 931 | | |
928 | | - | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
929 | 935 | | |
930 | 936 | | |
931 | 937 | | |
| |||
0 commit comments