File tree Expand file tree Collapse file tree 3 files changed +39
-19
lines changed Expand file tree Collapse file tree 3 files changed +39
-19
lines changed Original file line number Diff line number Diff line change 17
17
18
18
from install_requirements import (
19
19
install_requirements ,
20
+ NIGHTLY_VERSION ,
20
21
python_is_compatible ,
21
22
TORCH_NIGHTLY_URL ,
22
23
)
@@ -180,7 +181,12 @@ def main(args):
180
181
# This option is used in CI to make sure that PyTorch build from the pinned commit
181
182
# is used instead of nightly. CI jobs wouldn't be able to catch regression from the
182
183
# latest PT commit otherwise
183
- install_requirements (use_pytorch_nightly = not args .use_pt_pinned_commit )
184
+ use_pytorch_nightly = not args .use_pt_pinned_commit
185
+
186
+ # Step 1: Install dependencies first
187
+ install_requirements (use_pytorch_nightly )
188
+
189
+ # Step 2: Install core package
184
190
os .execvp (
185
191
sys .executable ,
186
192
[
@@ -199,6 +205,30 @@ def main(args):
199
205
],
200
206
)
201
207
208
+ # Step 3: Extra (optional) packages that is only useful for running examples.
209
+ DOMAIN_LIBRARIES = [
210
+ (
211
+ f"torchvision==0.23.0.{ NIGHTLY_VERSION } "
212
+ if use_pytorch_nightly
213
+ else "torchvision"
214
+ ),
215
+ f"torchaudio==2.8.0.{ NIGHTLY_VERSION } " if use_pytorch_nightly else "torchaudio" ,
216
+ ]
217
+ subprocess .run (
218
+ [
219
+ sys .executable ,
220
+ "-m" ,
221
+ "pip" ,
222
+ "install" ,
223
+ "-r" ,
224
+ "requirements-examples.txt" ,
225
+ * DOMAIN_LIBRARIES ,
226
+ "--extra-index-url" ,
227
+ TORCH_NIGHTLY_URL ,
228
+ ],
229
+ check = True ,
230
+ )
231
+
202
232
203
233
if __name__ == "__main__" :
204
234
# Before doing anything, cd to the directory containing this script.
Original file line number Diff line number Diff line change @@ -76,27 +76,15 @@ def python_is_compatible():
76
76
77
77
def install_requirements (use_pytorch_nightly ):
78
78
# pip packages needed by exir.
79
- EXIR_REQUIREMENTS = [
79
+ TORCH_PACKAGE = [
80
80
# Setting use_pytorch_nightly to false to test the pinned PyTorch commit. Note
81
81
# that we don't need to set any version number there because they have already
82
82
# been installed on CI before this step, so pip won't reinstall them
83
83
f"torch==2.8.0.{ NIGHTLY_VERSION } " if use_pytorch_nightly else "torch" ,
84
- (
85
- f"torchvision==0.23.0.{ NIGHTLY_VERSION } "
86
- if use_pytorch_nightly
87
- else "torchvision"
88
- ), # For testing.
89
84
]
90
85
91
- EXAMPLES_REQUIREMENTS = [
92
- f"torchaudio==2.8.0.{ NIGHTLY_VERSION } " if use_pytorch_nightly else "torchaudio" ,
93
- ]
94
-
95
- # Assemble the list of requirements to actually install.
96
- # TODO: Add options for reducing the number of requirements.
97
- REQUIREMENTS_TO_INSTALL = EXIR_REQUIREMENTS + EXAMPLES_REQUIREMENTS
98
-
99
- # Install the requirements. `--extra-index-url` tells pip to look for package
86
+ # Install the requirements for core ExecuTorch package.
87
+ # `--extra-index-url` tells pip to look for package
100
88
# versions on the provided URL if they aren't available on the default URL.
101
89
subprocess .run (
102
90
[
@@ -105,10 +93,8 @@ def install_requirements(use_pytorch_nightly):
105
93
"pip" ,
106
94
"install" ,
107
95
"-r" ,
108
- "requirements-examples.txt" ,
109
- "-r" ,
110
96
"requirements-dev.txt" ,
111
- * REQUIREMENTS_TO_INSTALL ,
97
+ * TORCH_PACKAGE ,
112
98
"--extra-index-url" ,
113
99
TORCH_NIGHTLY_URL ,
114
100
],
Original file line number Diff line number Diff line change
1
+ # Pip packages needed to build from source. Mainly for development of ExecuTorch.
2
+
1
3
cmake >= 3.19 , < 4.0.0 # For building binary targets in the wheel.
2
4
pip >= 23 # For building the pip package.
3
5
pyyaml # Imported by the kernel codegen tools.
4
6
setuptools >= 63 # For building the pip package contents.
5
7
tomli # Imported by extract_sources.py when using python < 3.11.
6
8
wheel # For building the pip package archive.
7
9
zstd # Imported by resolve_buck.py.
10
+ lintrunner == 0.12.7
11
+ lintrunner-adapters == 0.12.4
You can’t perform that action at this time.
0 commit comments