Commit f596d5b
committed
[jit] Better match behavior of loaded ScriptModules vs. freshly created ones
IR emitter uses `ModuleValue` to represent ScriptModules and emit IR for
attribute access, submodule access, etc.
`ModuleValue` relies on two pieces of information, the JIT type of the
module, and the `ConcreteModuleType`, which encapsulates Python-only
information about the module.
ScriptModules loaded from a package used to create a dummy
ConcreteModuleType without any info in it. This led to divergences in
behavior during compilation.
This PR makes the two ways of constructing a ConcreteModuleType equivalent,
modulo any py-only information (which, by definition, is never present in
packaged files anyway).
ghstack-source-id: 6c20331
Pull Request resolved: #432981 parent acbc573 commit f596d5b
File tree
5 files changed
+106
-36
lines changed- test
- torch/csrc/jit
- frontend
- python
5 files changed
+106
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15192 | 15192 | | |
15193 | 15193 | | |
15194 | 15194 | | |
| 15195 | + | |
| 15196 | + | |
| 15197 | + | |
| 15198 | + | |
| 15199 | + | |
| 15200 | + | |
| 15201 | + | |
| 15202 | + | |
| 15203 | + | |
| 15204 | + | |
| 15205 | + | |
| 15206 | + | |
| 15207 | + | |
| 15208 | + | |
| 15209 | + | |
| 15210 | + | |
| 15211 | + | |
| 15212 | + | |
| 15213 | + | |
| 15214 | + | |
| 15215 | + | |
| 15216 | + | |
| 15217 | + | |
| 15218 | + | |
| 15219 | + | |
| 15220 | + | |
| 15221 | + | |
| 15222 | + | |
| 15223 | + | |
| 15224 | + | |
| 15225 | + | |
| 15226 | + | |
| 15227 | + | |
| 15228 | + | |
| 15229 | + | |
| 15230 | + | |
| 15231 | + | |
| 15232 | + | |
| 15233 | + | |
| 15234 | + | |
| 15235 | + | |
15195 | 15236 | | |
15196 | 15237 | | |
15197 | 15238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 32 | + | |
46 | 33 | | |
47 | 34 | | |
48 | 35 | | |
| |||
57 | 44 | | |
58 | 45 | | |
59 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
60 | 50 | | |
61 | 51 | | |
62 | 52 | | |
63 | 53 | | |
64 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
65 | 77 | | |
| 78 | + | |
| 79 | + | |
66 | 80 | | |
67 | 81 | | |
68 | | - | |
| 82 | + | |
| 83 | + | |
69 | 84 | | |
70 | 85 | | |
71 | 86 | | |
| |||
198 | 213 | | |
199 | 214 | | |
200 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
201 | 230 | | |
202 | 231 | | |
203 | 232 | | |
| |||
257 | 286 | | |
258 | 287 | | |
259 | 288 | | |
260 | | - | |
| 289 | + | |
261 | 290 | | |
262 | 291 | | |
263 | 292 | | |
| |||
286 | 315 | | |
287 | 316 | | |
288 | 317 | | |
289 | | - | |
| 318 | + | |
290 | 319 | | |
291 | 320 | | |
292 | 321 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
| |||
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | 99 | | |
111 | 100 | | |
112 | 101 | | |
| |||
153 | 142 | | |
154 | 143 | | |
155 | 144 | | |
156 | | - | |
| 145 | + | |
157 | 146 | | |
158 | 147 | | |
159 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
454 | | - | |
455 | | - | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
456 | 460 | | |
457 | | - | |
| 461 | + | |
| 462 | + | |
458 | 463 | | |
459 | 464 | | |
460 | 465 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1533 | 1533 | | |
1534 | 1534 | | |
1535 | 1535 | | |
1536 | | - | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
1537 | 1543 | | |
1538 | 1544 | | |
1539 | 1545 | | |
| |||
0 commit comments