Commit f2e1ee5
committed
[ExecuTorch] Separate
Pull Request resolved: pytorch/executorch#10576
# Context
Separate `extension.Module` Namespaces to be `executorch::extension::module` and `executorch::extension::module::aten`, otherwise if a package relies on both aten and non-aten of the same implementation and the namespace is the same, there will be duplicate symbol issue like:
```
ld.lld: error: duplicate symbol: vtable for executorch::extension::Module
>>> defined at {redacted}/executorch/extension/module/__module__/__stripped__/module.cpp.pic.stripped.o:(vtable for executorch::extension::Module)
>>> defined at {redacted}/executorch/extension/module/__module_aten__/__stripped__/module.cpp.pic.stripped.o:
```
# Proposal
Doing something similar to what we already did for `bundled_program` in pytorch/executorch#10307
Since `extension.Module` is a public API, we introduce a namespace alias, so that existing use cases won't get affected. Since namespace alias doesn't create additional symbols, there won't be duplicate symbol issue.
ghstack-source-id: 282066740
@exported-using-ghexport
Differential Revision: [D73903870](https://our.internmc.facebook.com/intern/diff/D73903870/)extension.Module Namespaces from Aten and non-Aten1 parent 6a9ccf1 commit f2e1ee5
File tree
4 files changed
+31
-2
lines changed- extension/module
- test
4 files changed
+31
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
| 112 | + | |
111 | 113 | | |
112 | 114 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
13 | 19 | | |
14 | 20 | | |
| 21 | + | |
15 | 22 | | |
16 | 23 | | |
17 | 24 | | |
| |||
121 | 128 | | |
122 | 129 | | |
123 | 130 | | |
| 131 | + | |
124 | 132 | | |
125 | 133 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
19 | 25 | | |
20 | 26 | | |
21 | 27 | | |
| |||
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
27 | 37 | | |
28 | 38 | | |
29 | 39 | | |
| |||
493 | 503 | | |
494 | 504 | | |
495 | 505 | | |
496 | | - | |
| 506 | + | |
497 | 507 | | |
498 | 508 | | |
| 509 | + | |
499 | 510 | | |
500 | 511 | | |
501 | 512 | | |
502 | 513 | | |
503 | 514 | | |
504 | 515 | | |
505 | 516 | | |
506 | | - | |
| 517 | + | |
507 | 518 | | |
508 | 519 | | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
0 commit comments