Skip to content

Commit f008859

Browse files
seemetherefacebook-github-bot
authored andcommitted
ci: Update macos runners to AWS self hosted (#2556)
Summary: Updates the runner to the latest apple silicon machines we have that also run on macOS 12.4 Similar to pytorch/vision#6290 Signed-off-by: Eli Uriegas <[email protected]> Pull Request resolved: #2556 Reviewed By: atalman, mthrok Differential Revision: D37999959 Pulled By: seemethere fbshipit-source-id: 01d2ff01e48dcc0c4e33ed81758886fa19642aa3
1 parent 8336258 commit f008859

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

.github/workflows/build-m1-binaries.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ env:
1717
jobs:
1818
build_wheels:
1919
name: "Build TorchAudio M1 wheels"
20-
runs-on: macos-m1-11
20+
runs-on: macos-m1-12
2121
strategy:
2222
matrix:
2323
py_vers: [ "3.8", "3.9", "3.10" ]
@@ -44,6 +44,8 @@ jobs:
4444
USE_FFMPEG: true
4545
USE_OPENMP: false
4646
USE_CUDA: false
47+
# Needed so that delocate puts files in places it can actually modify
48+
TMPDIR: ${{ runner.temp }}
4749
run: |
4850
echo $PATH
4951
. ~/miniconda3/etc/profile.d/conda.sh
@@ -59,13 +61,12 @@ jobs:
5961
export SOURCE_ROOT_DIR=$(pwd)
6062
export FFMPEG_ROOT="${SOURCE_ROOT_DIR}/third_party/ffmpeg"
6163
. packaging/ffmpeg/build.sh
62-
WHL_NAME=torchaudio-${BUILD_VERSION}-cp${PY_VERS/.}-cp${PY_VERS/.}-macosx_11_0_arm64.whl
6364
conda create -yp ${ENV_NAME} python=${PY_VERS} numpy cmake ninja wheel pkg-config
6465
conda run -p ${ENV_NAME} python3 -mpip install torch --pre --extra-index-url=https://download.pytorch.org/whl/${CHANNEL}
6566
conda run -p ${ENV_NAME} python3 -mpip install delocate
6667
conda run -p ${ENV_NAME} python3 setup.py bdist_wheel
6768
export PYTORCH_VERSION="$(conda run -p ${ENV_NAME} python3 -mpip show torch | grep ^Version: | sed 's/Version: *//')"
68-
conda run -p ${ENV_NAME} DYLD_FALLBACK_LIBRARY_PATH="${ENV_NAME}/lib" delocate-wheel -v --ignore-missing-dependencies dist/${WHL_NAME}
69+
conda run -p ${ENV_NAME} DYLD_FALLBACK_LIBRARY_PATH="${ENV_NAME}/lib" delocate-wheel -v --ignore-missing-dependencies dist/*.whl
6970
conda env remove -p ${ENV_NAME}
7071
- name: Test wheel
7172
shell: arch -arch arm64 bash {0}
@@ -99,7 +100,7 @@ jobs:
99100
done
100101
build_conda:
101102
name: "Build TorchAudio M1 conda packages"
102-
runs-on: macos-m1-11
103+
runs-on: macos-m1-12
103104
strategy:
104105
matrix:
105106
py_vers: [ "3.8", "3.9", "3.10" ]
@@ -156,9 +157,13 @@ jobs:
156157
setup_conda_pytorch_constraint
157158
setup_conda_cudatoolkit_constraint
158159
setup_visual_studio_constraint
159-
conda build -c defaults $CONDA_CHANNEL_FLAGS --no-anaconda-upload --python "$PYTHON_VERSION" packaging/torchaudio
160-
mkdir -p dist
161-
cp ~/miniconda3/conda-bld/osx-arm64/*.tar.bz2 dist/
160+
conda build \
161+
-c defaults \
162+
$CONDA_CHANNEL_FLAGS \
163+
--no-anaconda-upload \
164+
--python "$PYTHON_VERSION" \
165+
--output-folder=dist/ \
166+
packaging/torchaudio
162167
- name: Upload package to GitHub
163168
uses: actions/upload-artifact@v3
164169
with:
@@ -174,3 +179,7 @@ jobs:
174179
conda install -yq anaconda-client
175180
set -x
176181
anaconda -t "${CONDA_PYTORCHBOT_TOKEN}" upload ~/miniconda3/conda-bld/osx-arm64/*.tar.bz2 -u "pytorch-${CHANNEL}" --label main --no-progress --force
182+
183+
concurrency:
184+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
185+
cancel-in-progress: true

packaging/pkg_helpers.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ setup_conda_pytorch_constraint() {
209209
CONDA_CHANNEL_FLAGS="${CONDA_CHANNEL_FLAGS}"
210210
if [[ -z "$PYTORCH_VERSION" ]]; then
211211
export CONDA_CHANNEL_FLAGS="${CONDA_CHANNEL_FLAGS} -c pytorch-nightly"
212-
export PYTORCH_VERSION="$(conda search --json 'pytorch[channel=pytorch-nightly]' | python -c "import sys, json, re; print(re.sub(r'\\+.*$', '', json.load(sys.stdin)['pytorch'][-1]['version']))")"
212+
export PYTORCH_VERSION="$(conda search --json 'pytorch[channel=pytorch-nightly]' | python3 -c "import sys, json, re; print(re.sub(r'\\+.*$', '', json.load(sys.stdin)['pytorch'][-1]['version']))")"
213213
else
214214
export CONDA_CHANNEL_FLAGS="${CONDA_CHANNEL_FLAGS} -c pytorch -c pytorch-test -c pytorch-nightly"
215215
fi

0 commit comments

Comments
 (0)