Commit d3d7213
committed
[Relax][Transform] Compose preproc functions in LiftTransformParams
The `LiftTransformParams` pass produces additional functions, either
named `$FOO_transform_params` when generating one transformation
function per inference function, or `transform_params` when generating
a single shared transformation function. Prior to this commit, if the
`IRModule` already contained a function with that name, an error would
be raised.
After this commit, the `LiftTransformParams` pass will instead check
for existing functions, and compose the previous transformation
function with the newly-lifted transformation. This allows
`LiftTransformParams` to be used alongside a hand-written parameter
transformation.
Closes #172001 parent 98de9ba commit d3d7213
File tree
4 files changed
+187
-52
lines changed- src/relax/transform
- tests/python/relax
4 files changed
+187
-52
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
122 | 123 | | |
| 124 | + | |
| 125 | + | |
123 | 126 | | |
124 | 127 | | |
125 | 128 | | |
| |||
725 | 728 | | |
726 | 729 | | |
727 | 730 | | |
728 | | - | |
| 731 | + | |
| 732 | + | |
729 | 733 | | |
730 | 734 | | |
731 | 735 | | |
732 | | - | |
| 736 | + | |
733 | 737 | | |
734 | 738 | | |
735 | 739 | | |
| |||
748 | 752 | | |
749 | 753 | | |
750 | 754 | | |
751 | | - | |
752 | 755 | | |
753 | 756 | | |
754 | 757 | | |
| |||
772 | 775 | | |
773 | 776 | | |
774 | 777 | | |
| 778 | + | |
| 779 | + | |
775 | 780 | | |
776 | 781 | | |
777 | | - | |
| 782 | + | |
778 | 783 | | |
779 | 784 | | |
| 785 | + | |
780 | 786 | | |
781 | 787 | | |
782 | | - | |
| 788 | + | |
783 | 789 | | |
784 | 790 | | |
785 | 791 | | |
786 | | - | |
787 | | - | |
| 792 | + | |
| 793 | + | |
788 | 794 | | |
789 | 795 | | |
790 | 796 | | |
791 | | - | |
792 | | - | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
793 | 813 | | |
794 | 814 | | |
795 | 815 | | |
| |||
817 | 837 | | |
818 | 838 | | |
819 | 839 | | |
820 | | - | |
821 | 840 | | |
822 | 841 | | |
823 | 842 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
44 | 95 | | |
45 | 96 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
437 | 437 | | |
438 | 438 | | |
439 | 439 | | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
440 | 454 | | |
441 | 455 | | |
442 | 456 | | |
| |||
0 commit comments