Commit 900d90b
authored
[TORCH] Modified fx_importer to support hop_while_loop (#4338)
This PR adds support for emitting graphs for Pytorch HOPs, beginning
with `torch._higher_order_ops.while_loop`.
The proposed change is to modify the `import_program` to call function
`_import_all_child_modules`, which recursively imports the stateless
graph for all the children modules.
Since HOP operator graphs are stateless graphs with no mutation, it is
correct to import them as stateless graphs, although the method
`import_stateless_graph` is marked as "deprecated".
---------
Signed-off-by: Keshav Vinayak Jha <[email protected]>1 parent 288cd5e commit 900d90b
File tree
6 files changed
+351
-14
lines changed- lib
- Conversion/TorchToSCF
- Dialect/Torch/Transforms
- projects/pt1
- e2e_testing
- python/torch_mlir_e2e_test/test_suite
- python/torch_mlir/extras
- test/python/fx_importer
6 files changed
+351
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
153 | 157 | | |
154 | 158 | | |
155 | 159 | | |
| |||
173 | 177 | | |
174 | 178 | | |
175 | 179 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | 180 | | |
185 | 181 | | |
186 | 182 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
| 249 | + | |
| 250 | + | |
249 | 251 | | |
250 | 252 | | |
251 | 253 | | |
| |||
481 | 483 | | |
482 | 484 | | |
483 | 485 | | |
| 486 | + | |
484 | 487 | | |
485 | 488 | | |
486 | 489 | | |
| |||
982 | 985 | | |
983 | 986 | | |
984 | 987 | | |
| 988 | + | |
| 989 | + | |
985 | 990 | | |
986 | 991 | | |
987 | 992 | | |
| |||
2564 | 2569 | | |
2565 | 2570 | | |
2566 | 2571 | | |
| 2572 | + | |
2567 | 2573 | | |
2568 | 2574 | | |
2569 | 2575 | | |
| |||
3253 | 3259 | | |
3254 | 3260 | | |
3255 | 3261 | | |
| 3262 | + | |
| 3263 | + | |
3256 | 3264 | | |
3257 | 3265 | | |
3258 | 3266 | | |
| |||
3952 | 3960 | | |
3953 | 3961 | | |
3954 | 3962 | | |
| 3963 | + | |
| 3964 | + | |
3955 | 3965 | | |
3956 | 3966 | | |
3957 | 3967 | | |
| |||
5024 | 5034 | | |
5025 | 5035 | | |
5026 | 5036 | | |
| 5037 | + | |
| 5038 | + | |
5027 | 5039 | | |
5028 | 5040 | | |
5029 | 5041 | | |
| |||
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
0 commit comments