@@ -51,67 +51,7 @@ install_domains() {
5151}
5252
5353install_pytorch_and_domains () {
54- pushd .ci/docker || return
55- TORCH_VERSION=$( cat ci_commit_pins/pytorch.txt)
56- popd || return
57-
58- git clone https://github.com/pytorch/pytorch.git
59-
60- # Fetch the target commit
61- pushd pytorch || return
62- git checkout " ${TORCH_VERSION} "
63-
64- local system_name=$( uname)
65- if [[ " ${system_name} " == " Darwin" ]]; then
66- local platform=$( python -c ' import sysconfig; import platform; v=platform.mac_ver()[0].split(".")[0]; platform=sysconfig.get_platform().split("-"); platform[1]=f"{v}_0"; print("_".join(platform))' )
67- fi
68- local python_version=$( python -c ' import platform; v=platform.python_version_tuple(); print(f"{v[0]}{v[1]}")' )
69- local torch_release=$( cat version.txt)
70- local torch_short_hash=${TORCH_VERSION: 0: 7}
71- local torch_wheel_path=" cached_artifacts/pytorch/executorch/pytorch_wheels/${system_name} /${python_version} "
72- local torch_wheel_name=" torch-${torch_release} %2Bgit${torch_short_hash} -cp${python_version} -cp${python_version} -${platform:- } .whl"
73-
74- local cached_torch_wheel=" https://gha-artifacts.s3.us-east-1.amazonaws.com/${torch_wheel_path} /${torch_wheel_name} "
75- # Cache PyTorch wheel is only needed on MacOS, Linux CI already has this as part
76- # of the Docker image
77- local torch_wheel_not_found=0
78- if [[ " ${system_name} " == " Darwin" ]]; then
79- pip install " ${cached_torch_wheel} " || torch_wheel_not_found=1
80- else
81- torch_wheel_not_found=1
82- fi
83-
84- # Found no such wheel, we will build it from source then
85- if [[ " ${torch_wheel_not_found} " == " 1" ]]; then
86- echo " No cached wheel found, continue with building PyTorch at ${TORCH_VERSION} "
87-
88- git submodule update --init --recursive
89- USE_DISTRIBUTED=1 python setup.py bdist_wheel
90- pip install " $( echo dist/* .whl) "
91-
92- # Only AWS runners have access to S3
93- if command -v aws && [[ -z " ${GITHUB_RUNNER:- } " ]]; then
94- for wheel_path in dist/* .whl; do
95- local wheel_name=$( basename " ${wheel_path} " )
96- echo " Caching ${wheel_name} "
97- aws s3 cp " ${wheel_path} " " s3://gha-artifacts/${torch_wheel_path} /${wheel_name} "
98- done
99- fi
100- else
101- echo " Use cached wheel at ${cached_torch_wheel} "
102- fi
103-
104- # Grab the pinned audio and vision commits from PyTorch
105- TORCHAUDIO_VERSION=$( cat .github/ci_commit_pins/audio.txt)
106- export TORCHAUDIO_VERSION
107- TORCHVISION_VERSION=$( cat .github/ci_commit_pins/vision.txt)
108- export TORCHVISION_VERSION
109-
110- install_domains
111-
112- popd || return
113- # Print sccache stats for debugging
114- sccache --show-stats || true
54+ pip install torch==2.9.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/test/cpu
11555}
11656
11757build_executorch_runner_buck2 () {
0 commit comments