1212
1313from install_utils import determine_torch_url , is_intel_mac_os , python_is_compatible
1414
15- from torch_pin import NIGHTLY_VERSION , TORCH_VERSION
15+ from torch_pin import TORCH_VERSION
1616
1717# The pip repository that hosts nightly torch packages.
1818# This will be dynamically set based on CUDA availability and CUDA backend enabled/disabled.
19- TORCH_NIGHTLY_URL_BASE = "https://download.pytorch.org/whl/nightly "
19+ TORCH_URL_BASE = "https://download.pytorch.org/whl/test "
2020
2121# Since ExecuTorch often uses main-branch features of pytorch, only the nightly
2222# pip versions will have the required features.
@@ -44,29 +44,27 @@ def install_requirements(use_pytorch_nightly):
4444 sys .exit (1 )
4545
4646 # Determine the appropriate PyTorch URL based on CUDA delegate status
47- torch_url = determine_torch_url (TORCH_NIGHTLY_URL_BASE )
47+ torch_url = determine_torch_url (TORCH_URL_BASE )
4848
4949 # pip packages needed by exir.
5050 TORCH_PACKAGE = [
5151 # Setting use_pytorch_nightly to false to test the pinned PyTorch commit. Note
5252 # that we don't need to set any version number there because they have already
5353 # been installed on CI before this step, so pip won't reinstall them
54- (
55- f"torch=={ TORCH_VERSION } .{ NIGHTLY_VERSION } "
56- if use_pytorch_nightly
57- else "torch"
58- ),
54+ (f"torch=={ TORCH_VERSION } " if use_pytorch_nightly else "torch" ),
5955 ]
6056
6157 # Install the requirements for core ExecuTorch package.
6258 # `--extra-index-url` tells pip to look for package
6359 # versions on the provided URL if they aren't available on the default URL.
60+ # Use --no-cache-dir to avoid stale cache issues with mutable test wheels.
6461 subprocess .run (
6562 [
6663 sys .executable ,
6764 "-m" ,
6865 "pip" ,
6966 "install" ,
67+ "--no-cache-dir" ,
7068 "-r" ,
7169 "requirements-dev.txt" ,
7270 * TORCH_PACKAGE ,
@@ -114,20 +112,12 @@ def install_requirements(use_pytorch_nightly):
114112
115113def install_optional_example_requirements (use_pytorch_nightly ):
116114 # Determine the appropriate PyTorch URL based on CUDA delegate status
117- torch_url = determine_torch_url (TORCH_NIGHTLY_URL_BASE )
115+ torch_url = determine_torch_url (TORCH_URL_BASE )
118116
119117 print ("Installing torch domain libraries" )
120118 DOMAIN_LIBRARIES = [
121- (
122- f"torchvision==0.26.0.{ NIGHTLY_VERSION } "
123- if use_pytorch_nightly
124- else "torchvision"
125- ),
126- (
127- f"torchaudio==2.11.0.{ NIGHTLY_VERSION } "
128- if use_pytorch_nightly
129- else "torchaudio"
130- ),
119+ ("torchvision==0.26.0" if use_pytorch_nightly else "torchvision" ),
120+ ("torchaudio==2.11.0" if use_pytorch_nightly else "torchaudio" ),
131121 ]
132122 # Then install domain libraries
133123 subprocess .run (
@@ -136,6 +126,7 @@ def install_optional_example_requirements(use_pytorch_nightly):
136126 "-m" ,
137127 "pip" ,
138128 "install" ,
129+ "--no-cache-dir" ,
139130 * DOMAIN_LIBRARIES ,
140131 "--extra-index-url" ,
141132 torch_url ,
0 commit comments