Skip to content

Commit 2359b40

Browse files
authored
Use macos generic workers (#1201)
* Use macos generic workers fix workflow testing Add arm64 builds test Remove validate binary action * add check binary step * fix ld_library path * add package type
1 parent cc0caf1 commit 2359b40

File tree

2 files changed

+77
-195
lines changed

2 files changed

+77
-195
lines changed

.github/actions/validate-binary/action.yml

Lines changed: 0 additions & 110 deletions
This file was deleted.

.github/workflows/validate-macos-binaries.yml

Lines changed: 77 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ on:
77
description: "Channel to use (nightly, test, release, all)"
88
required: true
99
type: string
10+
ref:
11+
description: 'Reference to checkout, defaults to empty'
12+
default: ""
13+
required: false
14+
type: string
1015
workflow_dispatch:
1116
inputs:
1217
channel:
@@ -18,105 +23,92 @@ on:
1823
- nightly
1924
- test
2025
- all
26+
ref:
27+
description: 'Reference to checkout, defaults to empty'
28+
default: ""
29+
required: false
30+
type: string
2131

2232
jobs:
23-
generate-macos-arm64-conda-matrix:
24-
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
25-
with:
26-
package-type: conda
27-
os: macos-arm64
28-
channel: ${{ inputs.channel }}
29-
generate-macos-arm64-wheel-matrix:
30-
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
31-
with:
32-
package-type: wheel
33-
os: macos-arm64
34-
channel: ${{ inputs.channel }}
35-
generate-macos-x86_64-conda-matrix:
33+
generate-macos-matrix:
3634
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
3735
with:
38-
package-type: conda
36+
package-type: all
3937
os: macos
4038
channel: ${{ inputs.channel }}
41-
generate-macos-x86_64-wheel-matrix:
39+
generate-macos-arm64-matrix:
4240
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
4341
with:
44-
package-type: wheel
45-
os: macos
42+
package-type: all
43+
os: macos-arm64
4644
channel: ${{ inputs.channel }}
4745

48-
mac-arm64-conda:
49-
needs: generate-macos-arm64-conda-matrix
46+
macos:
47+
needs: generate-macos-matrix
5048
strategy:
51-
matrix:
52-
${{ fromJson(needs.generate-macos-arm64-conda-matrix.outputs.matrix) }}
49+
matrix: ${{ fromJson(needs.generate-macos-matrix.outputs.matrix) }}
5350
fail-fast: false
54-
runs-on: ${{ matrix.validation_runner }}
55-
steps:
56-
- name: Validate binary conda
57-
uses: pytorch/builder/.github/actions/validate-binary@main
58-
with:
59-
gpu_arch_type: ${{ matrix.gpu_arch_type }}
60-
gpu_arch_ver: ${{ matrix.gpu_arch_version }}
61-
installation: ${{ matrix.installation }}
62-
python_version: ${{ matrix.python_version }}
63-
desired_cuda: ${{ matrix.desired_cuda }}
64-
package_type: conda
65-
target_os: macos
51+
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
52+
name: ${{ matrix.build_name }}
53+
with:
54+
runner: ${{ matrix.validation_runner }}
55+
repository: "pytorch/builder"
56+
ref: ${{ inputs.ref || github.ref }}
57+
job-name: ${{ matrix.build_name }}
58+
script: |
59+
set -ex
60+
export ENV_NAME="conda-env-${{ github.run_id }}"
61+
export GPU_ARCH_VER="${{ matrix.gpu_arch_version }}"
62+
export GPU_ARCH_TYPE="${{ matrix.gpu_arch_type }}"
63+
export INSTALLATION="${{ matrix.installation }}"
64+
export CUDA_VER="${{ matrix.desired_cuda }}"
65+
export DESIRED_PYTHON="${{ matrix.python_version }}"
66+
export DESIRED_CUDA="${{ matrix.desired_cuda }}"
67+
export DESIRED_DEVTOOLSET="${{ matrix.devtoolset }}"
68+
export PACKAGE_TYPE="${{ matrix.package_type }}"
69+
export TARGET_OS="macos"
70+
export LD_LIBRARY_PATH="$(dirname $(which python))/../lib"
71+
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib
72+
conda create -y -n ${ENV_NAME} python=${{ matrix.python_version }} numpy pillow
73+
conda activate ${ENV_NAME}
6674
67-
mac-arm64-wheel:
68-
needs: generate-macos-arm64-wheel-matrix
69-
strategy:
70-
matrix:
71-
${{ fromJson(needs.generate-macos-arm64-wheel-matrix.outputs.matrix) }}
72-
fail-fast: false
73-
runs-on: ${{ matrix.validation_runner }}
74-
steps:
75-
- name: Validate binary wheel
76-
uses: pytorch/builder/.github/actions/validate-binary@main
77-
with:
78-
gpu_arch_type: ${{ matrix.gpu_arch_type }}
79-
gpu_arch_ver: ${{ matrix.gpu_arch_version }}
80-
installation: ${{ matrix.installation }}
81-
python_version: ${{ matrix.python_version }}
82-
desired_cuda: ${{ matrix.desired_cuda }}
83-
package_type: wheel
84-
target_os: macos
8575
86-
mac-x64-conda:
87-
needs: generate-macos-x86_64-conda-matrix
88-
strategy:
89-
matrix:
90-
${{ fromJson(needs.generate-macos-x86_64-conda-matrix.outputs.matrix) }}
91-
fail-fast: false
92-
runs-on: ${{ matrix.validation_runner }}
93-
steps:
94-
- name: Validate binary conda
95-
uses: pytorch/builder/.github/actions/validate-binary@main
96-
with:
97-
gpu_arch_type: ${{ matrix.gpu_arch_type }}
98-
gpu_arch_ver: ${{ matrix.gpu_arch_version }}
99-
installation: ${{ matrix.installation }}
100-
python_version: ${{ matrix.python_version }}
101-
desired_cuda: ${{ matrix.desired_cuda }}
102-
package_type: conda
103-
target_os: macos
76+
if [[ ${{ matrix.package_type }} == "libtorch" ]]; then
77+
curl ${{ matrix.installation }} -o libtorch.zip
78+
unzip libtorch.zip
79+
else
80+
eval $INSTALLATION
81+
python ./test/smoke_test/smoke_test.py
82+
${PWD}/check_binary.sh
83+
fi
10484
105-
mac-x64-wheel:
106-
needs: generate-macos-x86_64-wheel-matrix
85+
macos-arm64:
86+
needs: generate-macos-arm64-matrix
10787
strategy:
108-
matrix:
109-
${{ fromJson(needs.generate-macos-x86_64-wheel-matrix.outputs.matrix) }}
88+
matrix: ${{ fromJson(needs.generate-macos-arm64-matrix.outputs.matrix) }}
11089
fail-fast: false
111-
runs-on: ${{ matrix.validation_runner }}
112-
steps:
113-
- name: Validate binary wheel
114-
uses: pytorch/builder/.github/actions/validate-binary@main
115-
with:
116-
gpu_arch_type: ${{ matrix.gpu_arch_type }}
117-
gpu_arch_ver: ${{ matrix.gpu_arch_version }}
118-
installation: ${{ matrix.installation }}
119-
python_version: ${{ matrix.python_version }}
120-
desired_cuda: ${{ matrix.desired_cuda }}
121-
package_type: wheel
122-
target_os: macos
90+
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
91+
name: ${{ matrix.build_name }}
92+
with:
93+
runner: ${{ matrix.validation_runner }}
94+
repository: "pytorch/builder"
95+
ref: ${{ inputs.ref || github.ref }}
96+
job-name: ${{ matrix.build_name }}
97+
script: |
98+
set -ex
99+
export ENV_NAME="conda-env-${{ github.run_id }}"
100+
export GPU_ARCH_VER="${{ matrix.gpu_arch_version }}"
101+
export GPU_ARCH_TYPE="${{ matrix.gpu_arch_type }}"
102+
export INSTALLATION="${{ matrix.installation }}"
103+
export CUDA_VER="${{ matrix.desired_cuda }}"
104+
export DESIRED_PYTHON="${{ matrix.python_version }}"
105+
export DESIRED_CUDA="${{ matrix.desired_cuda }}"
106+
export PACKAGE_TYPE="${{ matrix.package_type }}"
107+
export TARGET_OS="macos"
108+
export LD_LIBRARY_PATH="$(dirname $(which python))/../lib"
109+
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib
110+
conda create -y -n ${ENV_NAME} python=${{ matrix.python_version }} numpy pillow
111+
conda activate ${ENV_NAME}
112+
eval $INSTALLATION
113+
python ./test/smoke_test/smoke_test.py
114+
${PWD}/check_binary.sh

0 commit comments

Comments
 (0)