|
7 | 7 | description: "Channel to use (nightly, test, release, all)"
|
8 | 8 | required: true
|
9 | 9 | type: string
|
| 10 | + ref: |
| 11 | + description: 'Reference to checkout, defaults to empty' |
| 12 | + default: "" |
| 13 | + required: false |
| 14 | + type: string |
10 | 15 | workflow_dispatch:
|
11 | 16 | inputs:
|
12 | 17 | channel:
|
|
18 | 23 | - nightly
|
19 | 24 | - test
|
20 | 25 | - all
|
| 26 | + ref: |
| 27 | + description: 'Reference to checkout, defaults to empty' |
| 28 | + default: "" |
| 29 | + required: false |
| 30 | + type: string |
21 | 31 |
|
22 | 32 | 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: |
36 | 34 | uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
|
37 | 35 | with:
|
38 |
| - package-type: conda |
| 36 | + package-type: all |
39 | 37 | os: macos
|
40 | 38 | channel: ${{ inputs.channel }}
|
41 |
| - generate-macos-x86_64-wheel-matrix: |
| 39 | + generate-macos-arm64-matrix: |
42 | 40 | uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
|
43 | 41 | with:
|
44 |
| - package-type: wheel |
45 |
| - os: macos |
| 42 | + package-type: all |
| 43 | + os: macos-arm64 |
46 | 44 | channel: ${{ inputs.channel }}
|
47 | 45 |
|
48 |
| - mac-arm64-conda: |
49 |
| - needs: generate-macos-arm64-conda-matrix |
| 46 | + macos: |
| 47 | + needs: generate-macos-matrix |
50 | 48 | strategy:
|
51 |
| - matrix: |
52 |
| - ${{ fromJson(needs.generate-macos-arm64-conda-matrix.outputs.matrix) }} |
| 49 | + matrix: ${{ fromJson(needs.generate-macos-matrix.outputs.matrix) }} |
53 | 50 | 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} |
66 | 74 |
|
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 |
85 | 75 |
|
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 |
104 | 84 |
|
105 |
| - mac-x64-wheel: |
106 |
| - needs: generate-macos-x86_64-wheel-matrix |
| 85 | + macos-arm64: |
| 86 | + needs: generate-macos-arm64-matrix |
107 | 87 | strategy:
|
108 |
| - matrix: |
109 |
| - ${{ fromJson(needs.generate-macos-x86_64-wheel-matrix.outputs.matrix) }} |
| 88 | + matrix: ${{ fromJson(needs.generate-macos-arm64-matrix.outputs.matrix) }} |
110 | 89 | 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