Commit c5701d0
[ONNX] Create fake implementations for onnx ops; fix boolean mask in attention (pytorch#165780)
Previously we rely on the concreate implementation to generate fake implementation. This makes the fake implementation overly complicated and breaks in some cases when there are dynamic shapes.
This PR updates onnx op registration to instead take a dedicated fake implementation.
**Also fixed: When boolean mask is supplied to torch sdpa, it was previously taken the negation, which is incorrect.**
Fix pytorch#164909 Also taken changes from pytorch#156635
Pull Request resolved: pytorch#165780
Approved by: https://github.com/titaiwangms1 parent 23669d0 commit c5701d0
File tree
3 files changed
+192
-132
lines changed- test/onnx
- exporter
- ops
- torch/onnx/ops
3 files changed
+192
-132
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
12 | | - | |
13 | 11 | | |
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
19 | 17 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | 18 | | |
25 | 19 | | |
26 | 20 | | |
| |||
746 | 740 | | |
747 | 741 | | |
748 | 742 | | |
749 | | - | |
750 | | - | |
751 | | - | |
752 | | - | |
753 | | - | |
754 | | - | |
755 | | - | |
| 743 | + | |
756 | 744 | | |
757 | 745 | | |
758 | 746 | | |
| |||
789 | 777 | | |
790 | 778 | | |
791 | 779 | | |
792 | | - | |
793 | | - | |
| 780 | + | |
794 | 781 | | |
795 | 782 | | |
796 | 783 | | |
| |||
803 | 790 | | |
804 | 791 | | |
805 | 792 | | |
806 | | - | |
807 | 793 | | |
808 | 794 | | |
809 | 795 | | |
| |||
0 commit comments