Commit 3333687
committed
Update on "[After fix] Reuse constant and bump bytecode to v5"
Reintroduce sharing constant between bytecode and torchscript (same as #58629) after the fix #59642
Test it by:
```
model_path = "/Users/chenlai/Documents/pytorch/reuse_constant/tmp/other_models/model_GKzegAqmfRoYTygDACAlZhsBGFcRbmQwAAAA.ptl"
# model_path = "/Users/chenlai/Documents/pytorch/reuse_constant/tmp/other_models/model_GICWmAARE1pJ3yQEAFk58lqFfzVGbgdIAAAi.ptl"
model_resave_path = "/Users/chenlai/Documents/pytorch/reuse_constant/tmp/other_models/model_GKzegAqmfRoYTygDACAlZhsBGFcRbmQwAAAA_resave.ptl"
for i in range(20):
print(i)
m = torch.jit.load(model_path)
m._save_for_lite_interpreter(model_resave_path)
mm = _load_for_lite_interpreter(model_resave_path)
```
Differential Revision: [D29002345](https://our.internmc.facebook.com/intern/diff/D29002345)
[ghstack-poisoned]File tree
161 files changed
+2804
-1520
lines changed- .circleci
- cimodel/data
- verbatim-sources
- .github
- .jenkins/pytorch/win-test-helpers
- installation-helpers
- aten/src/ATen
- core
- cpu/vec/vec256/vsx
- cuda/detail
- native
- cpu
- cuda
- sparse
- templates
- c10/util
- caffe2
- quantization
- cmake
- public
- docs/source
- ios
- test
- cpp
- api
- tensorexpr
- distributed
- elastic/agent/server/test
- optim
- expect
- quantization/jit
- tools
- autograd
- torch
- autograd
- csrc
- api
- include/torch
- data
- dataloader
- datasets
- nn
- functional
- modules
- parallel
- utils
- optim
- src
- data/samplers
- nn
- modules
- autograd
- functions
- utils
- cuda
- deploy
- example
- distributed/rpc
- jit
- frontend
- ir
- passes
- serialization
- tensorexpr
- utils
- lib/c10d
- example
- test
- nn
- package
- quantization
- testing/_internal
- distributed
- utils
- benchmark/utils
- data/datapipes/iter
- tensorboard
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
161 files changed
+2804
-1520
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
157 | 159 | | |
158 | 160 | | |
159 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
7737 | 7737 | | |
7738 | 7738 | | |
7739 | 7739 | | |
7740 | | - | |
7741 | | - | |
7742 | | - | |
7743 | | - | |
7744 | | - | |
7745 | | - | |
7746 | | - | |
7747 | | - | |
7748 | | - | |
7749 | | - | |
7750 | | - | |
7751 | | - | |
7752 | | - | |
7753 | 7740 | | |
7754 | 7741 | | |
7755 | 7742 | | |
| |||
9361 | 9348 | | |
9362 | 9349 | | |
9363 | 9350 | | |
9364 | | - | |
9365 | | - | |
9366 | | - | |
9367 | | - | |
9368 | 9351 | | |
9369 | 9352 | | |
9370 | 9353 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
12 | 21 | | |
13 | 22 | | |
14 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
| |||
123 | 127 | | |
124 | 128 | | |
125 | 129 | | |
126 | | - | |
| 130 | + | |
127 | 131 | | |
128 | 132 | | |
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
2 | 12 | | |
3 | 13 | | |
4 | 14 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
0 commit comments