1name: Build manywheel docker images 2 3on: 4 workflow_dispatch: 5 push: 6 branches: 7 - main 8 - release/* 9 tags: 10 # NOTE: Binary build pipelines should only get triggered on release candidate or nightly builds 11 # Release candidate tags look like: v1.11.0-rc1 12 - v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+ 13 paths: 14 - '.ci/docker/manywheel/*' 15 - '.ci/docker/manywheel/build_scripts/*' 16 - '.ci/docker/common/*' 17 - .github/workflows/build-manywheel-images.yml 18 pull_request: 19 paths: 20 - '.ci/docker/manywheel/*' 21 - '.ci/docker/manywheel/build_scripts/*' 22 - '.ci/docker/common/*' 23 - .github/workflows/build-manywheel-images.yml 24 25 26env: 27 DOCKER_REGISTRY: "docker.io" 28 DOCKER_BUILDKIT: 1 29 WITH_PUSH: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release')) }} 30 WITH_PUSH_ROCM: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') }} 31 32concurrency: 33 group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} 34 cancel-in-progress: true 35 36jobs: 37 build-docker-cuda: 38 environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags/v')) && 'docker-build' || '' }} 39 runs-on: am2.linux.9xlarge.ephemeral 40 strategy: 41 matrix: 42 cuda_version: ["12.4", "12.1", "11.8"] 43 env: 44 GPU_ARCH_TYPE: cuda 45 GPU_ARCH_VERSION: ${{ matrix.cuda_version }} 46 steps: 47 - name: Purge tools folder (free space for build) 48 run: rm -rf /opt/hostedtoolcache 49 - name: Checkout PyTorch 50 uses: pytorch/pytorch/.github/actions/checkout-pytorch@release/2.5 51 with: 52 submodules: false 53 - name: Calculate docker image 54 if: env.WITH_PUSH == 'false' 55 uses: pytorch/test-infra/.github/actions/calculate-docker-image@release/2.5 56 with: 57 docker-image-name: manylinux-builder-cuda${{matrix.cuda_version}} 58 docker-build-dir: .ci/docker/manywheel 59 always-rebuild: true 60 push: true 61 - name: Authenticate if WITH_PUSH 62 if: env.WITH_PUSH == 'true' 63 env: 64 DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} 65 DOCKER_ID: ${{ secrets.DOCKER_ID }} 66 run: | 67 if [[ "${WITH_PUSH}" == true ]]; then 68 echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_ID}" --password-stdin 69 fi 70 - name: Build Docker Image 71 if: env.WITH_PUSH == 'true' 72 run: | 73 .ci/docker/manywheel/build.sh manylinux-builder:cuda${{matrix.cuda_version}} 74 # NOTE: manylinux_2_28 are still experimental, see https://github.com/pytorch/pytorch/issues/123649 75 build-docker-cuda-manylinux_2_28: 76 environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags/v')) && 'docker-build' || '' }} 77 runs-on: linux.9xlarge.ephemeral 78 strategy: 79 matrix: 80 cuda_version: ["12.4", "12.1", "11.8"] 81 env: 82 GPU_ARCH_TYPE: cuda-manylinux_2_28 83 GPU_ARCH_VERSION: ${{ matrix.cuda_version }} 84 steps: 85 - name: Purge tools folder (free space for build) 86 run: rm -rf /opt/hostedtoolcache 87 - name: Checkout PyTorch 88 uses: pytorch/pytorch/.github/actions/checkout-pytorch@release/2.5 89 with: 90 submodules: false 91 - name: Calculate docker image 92 if: env.WITH_PUSH == 'false' 93 uses: pytorch/test-infra/.github/actions/calculate-docker-image@release/2.5 94 with: 95 docker-image-name: manylinux2_28-builder-cuda${{matrix.cuda_version}} 96 docker-build-dir: .ci/docker/manywheel 97 always-rebuild: true 98 push: true 99 - name: Authenticate if WITH_PUSH 100 if: env.WITH_PUSH == 'true' 101 env: 102 DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} 103 DOCKER_ID: ${{ secrets.DOCKER_ID }} 104 run: | 105 if [[ "${WITH_PUSH}" == true ]]; then 106 echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_ID}" --password-stdin 107 fi 108 - name: Build Docker Image 109 if: env.WITH_PUSH == 'true' 110 run: | 111 .ci/docker/manywheel/build.sh manylinux2_28-builder:cuda${{matrix.cuda_version}} 112 build-docker-cuda-aarch64: 113 environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags/v')) && 'docker-build' || '' }} 114 runs-on: linux.arm64.2xlarge.ephemeral 115 strategy: 116 matrix: 117 cuda_version: ["12.4"] 118 env: 119 GPU_ARCH_TYPE: cuda-aarch64 120 GPU_ARCH_VERSION: ${{ matrix.cuda_version }} 121 steps: 122 - name: Checkout PyTorch 123 uses: actions/checkout@v3 124 - name: Calculate docker image 125 if: env.WITH_PUSH == 'false' 126 uses: pytorch/test-infra/.github/actions/calculate-docker-image@release/2.5 127 with: 128 docker-image-name: manylinuxaarch64-builder-cuda${{matrix.cuda_version}} 129 docker-build-dir: .ci/docker/manywheel 130 always-rebuild: true 131 push: true 132 - name: Authenticate if WITH_PUSH 133 if: env.WITH_PUSH == 'true' 134 env: 135 DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} 136 DOCKER_ID: ${{ secrets.DOCKER_ID }} 137 run: | 138 if [[ "${WITH_PUSH}" == true ]]; then 139 echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_ID}" --password-stdin 140 fi 141 - name: Build Docker Image 142 if: env.WITH_PUSH == 'true' 143 run: | 144 .ci/docker/manywheel/build.sh manylinuxaarch64-builder:cuda${{matrix.cuda_version}} 145 build-docker-rocm: 146 environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags/v')) && 'docker-build' || '' }} 147 runs-on: am2.linux.9xlarge.ephemeral 148 strategy: 149 matrix: 150 rocm_version: ["6.1", "6.2"] 151 env: 152 GPU_ARCH_TYPE: rocm 153 GPU_ARCH_VERSION: ${{ matrix.rocm_version }} 154 steps: 155 - name: Checkout PyTorch 156 uses: pytorch/pytorch/.github/actions/checkout-pytorch@release/2.5 157 with: 158 submodules: false 159 - name: Calculate docker image 160 if: env.WITH_PUSH_ROCM == 'false' 161 uses: pytorch/test-infra/.github/actions/calculate-docker-image@release/2.5 162 with: 163 docker-image-name: manylinux-builder-rocm${{matrix.rocm_version}} 164 docker-build-dir: .ci/docker/manywheel 165 always-rebuild: true 166 push: true 167 - name: Authenticate if WITH_PUSH_ROCM 168 if: env.WITH_PUSH_ROCM == 'true' 169 env: 170 DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} 171 DOCKER_ID: ${{ secrets.DOCKER_ID }} 172 run: | 173 if [[ "${WITH_PUSH_ROCM}" == true ]]; then 174 echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_ID}" --password-stdin 175 fi 176 - name: Build Docker Image 177 if: env.WITH_PUSH_ROCM == 'true' 178 run: | 179 export WITH_PUSH=true 180 .ci/docker/manywheel/build.sh manylinux-builder:rocm${{matrix.rocm_version}} 181 build-docker-cpu: 182 environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags/v')) && 'docker-build' || '' }} 183 runs-on: am2.linux.9xlarge.ephemeral 184 steps: 185 - name: Checkout PyTorch 186 uses: pytorch/pytorch/.github/actions/checkout-pytorch@release/2.5 187 with: 188 submodules: false 189 - name: Calculate docker image 190 if: env.WITH_PUSH == 'false' 191 uses: pytorch/test-infra/.github/actions/calculate-docker-image@release/2.5 192 with: 193 docker-image-name: manylinux-builder-cpu 194 docker-build-dir: .ci/docker/manywheel 195 always-rebuild: true 196 push: true 197 - name: Authenticate if WITH_PUSH 198 if: env.WITH_PUSH == 'true' 199 env: 200 DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} 201 DOCKER_ID: ${{ secrets.DOCKER_ID }} 202 run: | 203 if [[ "${WITH_PUSH}" == true ]]; then 204 echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_ID}" --password-stdin 205 fi 206 - name: Build Docker Image 207 if: env.WITH_PUSH == 'true' 208 run: | 209 .ci/docker/manywheel/build.sh manylinux-builder:cpu 210 build-docker-cpu-manylinux_2_28: 211 environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags/v')) && 'docker-build' || '' }} 212 runs-on: linux.9xlarge.ephemeral 213 env: 214 GPU_ARCH_TYPE: cpu-manylinux_2_28 215 steps: 216 - name: Checkout PyTorch 217 uses: pytorch/pytorch/.github/actions/checkout-pytorch@release/2.5 218 with: 219 submodules: false 220 - name: Calculate docker image 221 if: env.WITH_PUSH == 'false' 222 uses: pytorch/test-infra/.github/actions/calculate-docker-image@release/2.5 223 with: 224 docker-image-name: manylinux2_28-builder-cpu 225 docker-build-dir: .ci/docker/manywheel 226 always-rebuild: true 227 push: true 228 - name: Authenticate if WITH_PUSH 229 if: env.WITH_PUSH == 'true' 230 env: 231 DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} 232 DOCKER_ID: ${{ secrets.DOCKER_ID }} 233 run: | 234 if [[ "${WITH_PUSH}" == true ]]; then 235 echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_ID}" --password-stdin 236 fi 237 - name: Build Docker Image 238 if: env.WITH_PUSH == 'true' 239 run: | 240 .ci/docker/manywheel/build.sh manylinux2_28-builder:cpu 241 build-docker-cpu-aarch64: 242 environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags/v')) && 'docker-build' || '' }} 243 runs-on: linux.arm64.2xlarge.ephemeral 244 env: 245 GPU_ARCH_TYPE: cpu-aarch64 246 steps: 247 - name: Checkout PyTorch 248 uses: pytorch/pytorch/.github/actions/checkout-pytorch@release/2.5 249 with: 250 submodules: false 251 - name: Calculate docker image 252 if: env.WITH_PUSH == 'false' 253 uses: pytorch/test-infra/.github/actions/calculate-docker-image@release/2.5 254 with: 255 docker-image-name: manylinuxaarch64-builder-cpu-aarch64 256 docker-build-dir: .ci/docker/manywheel 257 always-rebuild: true 258 push: true 259 - name: Authenticate if WITH_PUSH 260 if: env.WITH_PUSH == 'true' 261 env: 262 DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} 263 DOCKER_ID: ${{ secrets.DOCKER_ID }} 264 run: | 265 if [[ "${WITH_PUSH}" == true ]]; then 266 echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_ID}" --password-stdin 267 fi 268 - name: Build Docker Image 269 if: env.WITH_PUSH == 'true' 270 run: | 271 .ci/docker/manywheel/build.sh manylinuxaarch64-builder:cpu-aarch64 272 build-docker-cpu-aarch64-2_28: 273 environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags/v')) && 'docker-build' || '' }} 274 runs-on: linux.arm64.2xlarge.ephemeral 275 env: 276 GPU_ARCH_TYPE: cpu-aarch64-2_28 277 steps: 278 - name: Checkout PyTorch 279 uses: pytorch/pytorch/.github/actions/checkout-pytorch@release/2.5 280 with: 281 submodules: false 282 - name: Calculate docker image 283 if: env.WITH_PUSH == 'false' 284 uses: pytorch/test-infra/.github/actions/calculate-docker-image@release/2.5 285 with: 286 docker-image-name: manylinux2_28_aarch64-builder-cpu-aarch64 287 docker-build-dir: .ci/docker/manywheel 288 always-rebuild: true 289 push: true 290 - name: Authenticate if WITH_PUSH 291 if: env.WITH_PUSH == 'true' 292 env: 293 DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} 294 DOCKER_ID: ${{ secrets.DOCKER_ID }} 295 run: | 296 if [[ "${WITH_PUSH}" == true ]]; then 297 echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_ID}" --password-stdin 298 fi 299 - name: Build Docker Image 300 if: env.WITH_PUSH == 'true' 301 env: 302 DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} 303 DOCKER_ID: ${{ secrets.DOCKER_ID }} 304 run: | 305 .ci/docker/manywheel/build.sh manylinux2_28_aarch64-builder:cpu-aarch64 306 build-docker-cpu-cxx11-abi: 307 environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags/v')) && 'docker-build' || '' }} 308 runs-on: linux.9xlarge.ephemeral 309 env: 310 GPU_ARCH_TYPE: cpu-cxx11-abi 311 steps: 312 - name: Checkout PyTorch 313 uses: pytorch/pytorch/.github/actions/checkout-pytorch@release/2.5 314 with: 315 submodules: false 316 - name: Calculate docker image 317 if: env.WITH_PUSH == 'false' 318 uses: pytorch/test-infra/.github/actions/calculate-docker-image@release/2.5 319 with: 320 docker-image-name: manylinuxcxx11-abi-builder-cpu-cxx11-abi 321 docker-build-dir: .ci/docker/manywheel 322 always-rebuild: true 323 push: true 324 - name: Authenticate if WITH_PUSH 325 if: env.WITH_PUSH == 'true' 326 env: 327 DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} 328 DOCKER_ID: ${{ secrets.DOCKER_ID }} 329 run: | 330 if [[ "${WITH_PUSH}" == true ]]; then 331 echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_ID}" --password-stdin 332 fi 333 - name: Build Docker Image 334 if: env.WITH_PUSH == 'true' 335 run: | 336 .ci/docker/manywheel/build.sh manylinuxcxx11-abi-builder:cpu-cxx11-abi 337 build-docker-xpu: 338 environment: ${{ (github.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags/v')) && 'docker-build' || '' }} 339 runs-on: linux.9xlarge.ephemeral 340 env: 341 GPU_ARCH_TYPE: xpu 342 steps: 343 - name: Checkout PyTorch 344 uses: pytorch/pytorch/.github/actions/checkout-pytorch@release/2.5 345 with: 346 submodules: false 347 - name: Calculate docker image 348 if: env.WITH_PUSH == 'false' 349 uses: pytorch/test-infra/.github/actions/calculate-docker-image@release/2.5 350 with: 351 docker-image-name: manylinux2_28-builder-xpu 352 docker-build-dir: .ci/docker/manywheel 353 always-rebuild: true 354 push: true 355 - name: Authenticate if WITH_PUSH 356 if: env.WITH_PUSH == 'true' 357 env: 358 DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} 359 DOCKER_ID: ${{ secrets.DOCKER_ID }} 360 run: | 361 if [[ "${WITH_PUSH}" == true ]]; then 362 echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_ID}" --password-stdin 363 fi 364 - name: Build Docker Image 365 if: env.WITH_PUSH == 'true' 366 run: | 367 .ci/docker/manywheel/build.sh manylinux2_28-builder:xpu 368