Skip to content

Commit 3333687

Browse files
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]
2 parents 70fae52 + e3d75b8 commit 3333687

File tree

161 files changed

+2804
-1520
lines changed

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

.circleci/cimodel/data/windows_build_definitions.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ def render(self):
153153
WindowsJob(None, _VC2019, CudaVersion(11, 1)),
154154
WindowsJob(1, _VC2019, CudaVersion(11, 1), master_only=True),
155155
WindowsJob(2, _VC2019, CudaVersion(11, 1), master_only=True),
156-
WindowsJob('_azure_multi_gpu', _VC2019, CudaVersion(11, 1), multi_gpu=True, master_and_nightly=True),
156+
157+
# TODO: This test is disabled due to https://github.com/pytorch/pytorch/issues/59724
158+
# WindowsJob('_azure_multi_gpu', _VC2019, CudaVersion(11, 1), multi_gpu=True, master_and_nightly=True),
157159
]
158160

159161

.circleci/config.yml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ parameters:
1313
default: false
1414
run_build:
1515
type: boolean
16-
default: true
16+
default: false
1717
run_master_build:
1818
type: boolean
1919
default: false
@@ -7737,19 +7737,6 @@ workflows:
77377737
vc_product: BuildTools
77387738
vc_version: ""
77397739
vc_year: "2019"
7740-
- pytorch_windows_test_multigpu:
7741-
filters:
7742-
branches:
7743-
only:
7744-
- master
7745-
- /ci-all\/.*/
7746-
- /release\/.*/
7747-
- nightly
7748-
tags:
7749-
only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
7750-
name: pytorch_windows_vs2019_py36_cuda11.1_test_azure_multi_gpu
7751-
requires:
7752-
- pytorch_windows_vs2019_py36_cuda11.1_build
77537740
- update_s3_htmls:
77547741
context: org-member
77557742
filters:
@@ -9361,10 +9348,6 @@ workflows:
93619348
vc_product: BuildTools
93629349
vc_version: ""
93639350
vc_year: "2019"
9364-
- pytorch_windows_test_multigpu:
9365-
name: pytorch_windows_vs2019_py36_cuda11.1_test_azure_multi_gpu
9366-
requires:
9367-
- pytorch_windows_vs2019_py36_cuda11.1_build
93689351
when: << pipeline.parameters.run_master_build >>
93699352
scheduled-ci:
93709353
triggers:

.circleci/verbatim-sources/header-section.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ parameters:
1313
default: false
1414
run_build:
1515
type: boolean
16-
default: true
16+
default: false
1717
run_master_build:
1818
type: boolean
1919
default: false

.github/pytorch-circleci-labels.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# For documentation concerning this configuration please refer to,
22
# https://github.com/pytorch/pytorch-probot#trigger-circleci-workflows
3+
default_params:
4+
run_build: true
35
labels_to_circle_params:
46
ci/binaries:
57
parameter: run_binary_tests
@@ -9,6 +11,13 @@ labels_to_circle_params:
911
- release/.*
1012
tags:
1113
- v[0-9]+(\.[0-9]+)*-rc[0-9]+
14+
ci/no-build:
15+
default_true_on:
16+
branches:
17+
- nightly
18+
- release/.*
19+
tags:
20+
- v[0-9]+(\.[0-9]+)*-rc[0-9]+
1221
set_to_false:
1322
- run_build
1423
ci/master:

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ coverage.xml
1515
.hypothesis
1616
.mypy_cache
1717
/.extracted_scripts/
18-
**/.pytorch-test-times
19-
**/.pytorch-slow-tests
18+
**/.pytorch-test-times.json
19+
**/.pytorch-slow-tests.json
2020
*/*.pyc
2121
*/*.so*
2222
*/**/__pycache__

.jenkins/pytorch/win-test-helpers/build_pytorch.bat

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ if not "%USE_CUDA%"=="1" goto cuda_build_end
3838

3939
set CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v%CUDA_VERSION%
4040

41+
if x%CUDA_VERSION:.=%==x%CUDA_VERSION% (
42+
echo CUDA version %CUDA_VERSION% format isn't correct, which doesn't contain '.'
43+
exit /b 1
44+
)
4145
rem version transformer, for example 10.1 to 10_1.
4246
if x%CUDA_VERSION:.=%==x%CUDA_VERSION% (
4347
echo CUDA version %CUDA_VERSION% format isn't correct, which doesn't contain '.'
@@ -123,6 +127,6 @@ python setup.py install --cmake && sccache --show-stats && (
123127
7z a %TMP_DIR_WIN%\%IMAGE_COMMIT_TAG%.7z %CONDA_PARENT_DIR%\Miniconda3\Lib\site-packages\torch %CONDA_PARENT_DIR%\Miniconda3\Lib\site-packages\caffe2 && copy /Y "%TMP_DIR_WIN%\%IMAGE_COMMIT_TAG%.7z" "%PYTORCH_FINAL_PACKAGE_DIR%\"
124128

125129
:: export test times so that potential sharded tests that'll branch off this build will use consistent data
126-
python test/run_test.py --export-past-test-times %PYTORCH_FINAL_PACKAGE_DIR%/.pytorch-test-times
130+
python test/run_test.py --export-past-test-times %PYTORCH_FINAL_PACKAGE_DIR%/.pytorch-test-times.json
127131
)
128132
)

.jenkins/pytorch/win-test-helpers/installation-helpers/install_magma.bat

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
rem remove dot in cuda_version, fox example 11.1 to 111
2+
3+
if not "%USE_CUDA%"=="1" (
4+
exit /b 0
5+
)
6+
7+
if x%CUDA_VERSION:.=%==x%CUDA_VERSION% (
8+
echo CUDA version %CUDA_VERSION% format isn't correct, which doesn't contain '.'
9+
exit /b 1
10+
)
11+
212
set VERSION_SUFFIX=%CUDA_VERSION:.=%
313
set CUDA_SUFFIX=cuda%VERSION_SUFFIX%
414

.jenkins/pytorch/win-test-helpers/test_python_first_shard.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
call %SCRIPT_HELPERS_DIR%\setup_pytorch_env.bat
22

33
echo Copying over test times file
4-
copy /Y "%PYTORCH_FINAL_PACKAGE_DIR_WIN%\.pytorch-test-times" "%TEST_DIR_WIN%"
4+
copy /Y "%PYTORCH_FINAL_PACKAGE_DIR_WIN%\.pytorch-test-times.json" "%TEST_DIR_WIN%"
55

66
pushd test
77

.jenkins/pytorch/win-test-helpers/test_python_jit_legacy.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
call %SCRIPT_HELPERS_DIR%\setup_pytorch_env.bat
22

33
echo Copying over test times file
4-
copy /Y "%PYTORCH_FINAL_PACKAGE_DIR_WIN%\.pytorch-test-times" "%TEST_DIR_WIN%"
4+
copy /Y "%PYTORCH_FINAL_PACKAGE_DIR_WIN%\.pytorch-test-times.json" "%TEST_DIR_WIN%"
55

66
pushd test
77

.jenkins/pytorch/win-test-helpers/test_python_second_shard.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
call %SCRIPT_HELPERS_DIR%\setup_pytorch_env.bat
22

33
echo Copying over test times file
4-
copy /Y "%PYTORCH_FINAL_PACKAGE_DIR_WIN%\.pytorch-test-times" "%TEST_DIR_WIN%"
4+
copy /Y "%PYTORCH_FINAL_PACKAGE_DIR_WIN%\.pytorch-test-times.json" "%TEST_DIR_WIN%"
55

66
cd test && python run_test.py --exclude-jit-executor --shard 2 2 --verbose --determine-from="%1" && cd ..
77

0 commit comments

Comments
 (0)