[CD] Enable XPU nightly build on Windows (#134312)
Depends on https://github.com/pytorch/builder/pull/1975 land. Works for https://github.com/pytorch/pytorch/issues/114850
Pull Request resolved: https://github.com/pytorch/pytorch/pull/134312
Approved by: https://github.com/atalman
diff --git a/.circleci/scripts/binary_windows_build.sh b/.circleci/scripts/binary_windows_build.sh
index 0f8eeb8..d62ce7d 100644
--- a/.circleci/scripts/binary_windows_build.sh
+++ b/.circleci/scripts/binary_windows_build.sh
@@ -10,6 +10,11 @@
export SCCACHE_IGNORE_SERVER_IO_ERROR=1
export VC_YEAR=2019
+if [[ "$DESIRED_CUDA" == 'xpu' ]]; then
+ export VC_YEAR=2022
+ export USE_SCCACHE=0
+fi
+
echo "Free space on filesystem before build:"
df -h
diff --git a/.circleci/scripts/binary_windows_test.sh b/.circleci/scripts/binary_windows_test.sh
index bbf0efb..b9f801f 100644
--- a/.circleci/scripts/binary_windows_test.sh
+++ b/.circleci/scripts/binary_windows_test.sh
@@ -6,6 +6,10 @@
export CUDA_VERSION="${DESIRED_CUDA/cu/}"
export VC_YEAR=2019
+if [[ "$DESIRED_CUDA" == 'xpu' ]]; then
+ export VC_YEAR=2022
+fi
+
pushd "$BUILDER_ROOT"
./windows/internal/smoke_test.bat
diff --git a/.github/scripts/generate_binary_build_matrix.py b/.github/scripts/generate_binary_build_matrix.py
index 9dc8ebe..6b33924 100644
--- a/.github/scripts/generate_binary_build_matrix.py
+++ b/.github/scripts/generate_binary_build_matrix.py
@@ -340,7 +340,7 @@
if os == "linux":
arches += CPU_CXX11_ABI_ARCH + CUDA_ARCHES + ROCM_ARCHES + XPU_ARCHES
elif os == "windows":
- arches += CUDA_ARCHES
+ arches += CUDA_ARCHES + XPU_ARCHES
elif os == "linux-aarch64":
# Only want the one arch as the CPU type is different and
# uses different build/test scripts
@@ -462,7 +462,7 @@
),
"pytorch_extra_install_requirements": (
PYTORCH_EXTRA_INSTALL_REQUIREMENTS["12.1"] # fmt: skip
- if os != "linux"
+ if os != "linux" and gpu_arch_type != "xpu"
else ""
),
}
diff --git a/.github/workflows/generated-windows-binary-wheel-nightly.yml b/.github/workflows/generated-windows-binary-wheel-nightly.yml
index c042b16..9da2ad1 100644
--- a/.github/workflows/generated-windows-binary-wheel-nightly.yml
+++ b/.github/workflows/generated-windows-binary-wheel-nightly.yml
@@ -1033,6 +1033,251 @@
conda-pytorchbot-token: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }}
conda-pytorchbot-token-test: ${{ secrets.CONDA_PYTORCHBOT_TOKEN_TEST }}
uses: ./.github/workflows/_binary-upload.yml
+ wheel-py3_9-xpu-build:
+ if: ${{ github.repository_owner == 'pytorch' }}
+ needs: get-label-type
+ runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.4xlarge"
+ timeout-minutes: 240
+ env:
+ PYTORCH_ROOT: ${{ github.workspace }}/pytorch
+ BUILDER_ROOT: ${{ github.workspace }}/builder
+ PACKAGE_TYPE: wheel
+ # TODO: This is a legacy variable that we eventually want to get rid of in
+ # favor of GPU_ARCH_VERSION
+ DESIRED_CUDA: xpu
+ GPU_ARCH_TYPE: xpu
+ SKIP_ALL_TESTS: 1
+ DESIRED_PYTHON: "3.9"
+ steps:
+ - name: Display EC2 information
+ shell: bash
+ run: |
+ set -euo pipefail
+ function get_ec2_metadata() {
+ # Pulled from instance metadata endpoint for EC2
+ # see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
+ category=$1
+ curl -fsSL "http://169.254.169.254/latest/meta-data/${category}"
+ }
+ echo "ami-id: $(get_ec2_metadata ami-id)"
+ echo "instance-id: $(get_ec2_metadata instance-id)"
+ echo "instance-type: $(get_ec2_metadata instance-type)"
+ echo "system info $(uname -a)"
+ - name: "[FB EMPLOYEES] Enable SSH (Click me for login details)"
+ uses: pytorch/test-infra/.github/actions/setup-ssh@main
+ continue-on-error: true
+ with:
+ github-secret: ${{ secrets.GITHUB_TOKEN }}
+ # Needed for binary builds, see: https://github.com/pytorch/pytorch/issues/73339#issuecomment-1058981560
+ - name: Enable long paths on Windows
+ shell: powershell
+ run: |
+ Set-ItemProperty -Path "HKLM:\\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1
+ # Since it's just a defensive command, the workflow should continue even the command fails. This step can be
+ # removed once Windows Defender is removed from the AMI
+ - name: Disables Windows Defender scheduled and real-time scanning for files in directories used by PyTorch
+ continue-on-error: true
+ shell: powershell
+ run: |
+ Add-MpPreference -ExclusionPath $(Get-Location).tostring(),$Env:TEMP -ErrorAction Ignore
+ # Let's both exclude the path and disable Windows Defender completely just to be sure
+ # that it doesn't interfere
+ Set-MpPreference -DisableRealtimeMonitoring $True -ErrorAction Ignore
+ # NOTE: These environment variables are put here so that they can be applied on every job equally
+ # They are also here because setting them at a workflow level doesn't give us access to the
+ # runner.temp variable, which we need.
+ - name: Populate binary env
+ shell: bash
+ run: |
+ echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
+ echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
+ echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
+ - name: Checkout PyTorch
+ uses: malfet/checkout@silent-checkout
+ with:
+ ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
+ submodules: recursive
+ path: pytorch
+ quiet-checkout: true
+ - name: Clean PyTorch checkout
+ run: |
+ # Remove any artifacts from the previous checkouts
+ git clean -fxd
+ working-directory: pytorch
+ - name: Checkout pytorch/builder
+ uses: malfet/checkout@silent-checkout
+ with:
+ ref: main
+ submodules: recursive
+ repository: pytorch/builder
+ path: builder
+ quiet-checkout: true
+ - name: Clean pytorch/builder checkout
+ run: |
+ # Remove any artifacts from the previous checkouts
+ git clean -fxd
+ working-directory: builder
+ - name: Populate binary env
+ shell: bash
+ run: |
+ "${PYTORCH_ROOT}/.circleci/scripts/binary_populate_env.sh"
+ - name: Build PyTorch binary
+ shell: bash
+ run: |
+ "${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
+ - uses: actions/upload-artifact@v3
+ if: always()
+ with:
+ name: wheel-py3_9-xpu
+ retention-days: 14
+ if-no-files-found: error
+ path: "${{ env.PYTORCH_FINAL_PACKAGE_DIR }}"
+ - name: Wait until all sessions have drained
+ shell: powershell
+ working-directory: pytorch
+ if: always()
+ timeout-minutes: 120
+ run: |
+ .github\scripts\wait_for_ssh_to_drain.ps1
+ - name: Kill active ssh sessions if still around (Useful if workflow was cancelled)
+ shell: powershell
+ working-directory: pytorch
+ if: always()
+ run: |
+ .github\scripts\kill_active_ssh_sessions.ps1
+ wheel-py3_9-xpu-test: # Testing
+ if: ${{ github.repository_owner == 'pytorch' }}
+ needs:
+ - wheel-py3_9-xpu-build
+ - get-label-type
+ runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.4xlarge.nonephemeral"
+ timeout-minutes: 240
+ env:
+ PYTORCH_ROOT: ${{ github.workspace }}/pytorch
+ BUILDER_ROOT: ${{ github.workspace }}/builder
+ PACKAGE_TYPE: wheel
+ # TODO: This is a legacy variable that we eventually want to get rid of in
+ # favor of GPU_ARCH_VERSION
+ DESIRED_CUDA: xpu
+ GPU_ARCH_TYPE: xpu
+ SKIP_ALL_TESTS: 1
+ DESIRED_PYTHON: "3.9"
+ steps:
+ - name: Display EC2 information
+ shell: bash
+ run: |
+ set -euo pipefail
+ function get_ec2_metadata() {
+ # Pulled from instance metadata endpoint for EC2
+ # see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
+ category=$1
+ curl -fsSL "http://169.254.169.254/latest/meta-data/${category}"
+ }
+ echo "ami-id: $(get_ec2_metadata ami-id)"
+ echo "instance-id: $(get_ec2_metadata instance-id)"
+ echo "instance-type: $(get_ec2_metadata instance-type)"
+ echo "system info $(uname -a)"
+ - name: "[FB EMPLOYEES] Enable SSH (Click me for login details)"
+ uses: pytorch/test-infra/.github/actions/setup-ssh@main
+ continue-on-error: true
+ with:
+ github-secret: ${{ secrets.GITHUB_TOKEN }}
+ # Needed for binary builds, see: https://github.com/pytorch/pytorch/issues/73339#issuecomment-1058981560
+ - name: Enable long paths on Windows
+ shell: powershell
+ run: |
+ Set-ItemProperty -Path "HKLM:\\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1
+ # Since it's just a defensive command, the workflow should continue even the command fails. This step can be
+ # removed once Windows Defender is removed from the AMI
+ - name: Disables Windows Defender scheduled and real-time scanning for files in directories used by PyTorch
+ continue-on-error: true
+ shell: powershell
+ run: |
+ Add-MpPreference -ExclusionPath $(Get-Location).tostring(),$Env:TEMP -ErrorAction Ignore
+ # Let's both exclude the path and disable Windows Defender completely just to be sure
+ # that it doesn't interfere
+ Set-MpPreference -DisableRealtimeMonitoring $True -ErrorAction Ignore
+ # NOTE: These environment variables are put here so that they can be applied on every job equally
+ # They are also here because setting them at a workflow level doesn't give us access to the
+ # runner.temp variable, which we need.
+ - name: Populate binary env
+ shell: bash
+ run: |
+ echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
+ echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
+ echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
+ - uses: actions/download-artifact@v3
+ name: Download Build Artifacts
+ with:
+ name: wheel-py3_9-xpu
+ path: "${{ env.PYTORCH_FINAL_PACKAGE_DIR }}"
+ - name: Checkout PyTorch
+ uses: malfet/checkout@silent-checkout
+ with:
+ ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
+ submodules: recursive
+ path: pytorch
+ quiet-checkout: true
+ - name: Clean PyTorch checkout
+ run: |
+ # Remove any artifacts from the previous checkouts
+ git clean -fxd
+ working-directory: pytorch
+ - name: Checkout pytorch/builder
+ uses: malfet/checkout@silent-checkout
+ with:
+ ref: main
+ submodules: recursive
+ repository: pytorch/builder
+ path: builder
+ quiet-checkout: true
+ - name: Clean pytorch/builder checkout
+ run: |
+ # Remove any artifacts from the previous checkouts
+ git clean -fxd
+ working-directory: builder
+ - name: Populate binary env
+ shell: bash
+ run: |
+ "${PYTORCH_ROOT}/.circleci/scripts/binary_populate_env.sh"
+ - name: Test PyTorch binary
+ shell: bash
+ run: |
+ "${PYTORCH_ROOT}/.circleci/scripts/binary_windows_test.sh"
+ - name: Wait until all sessions have drained
+ shell: powershell
+ working-directory: pytorch
+ if: always()
+ timeout-minutes: 120
+ run: |
+ .github\scripts\wait_for_ssh_to_drain.ps1
+ - name: Kill active ssh sessions if still around (Useful if workflow was cancelled)
+ shell: powershell
+ working-directory: pytorch
+ if: always()
+ run: |
+ .github\scripts\kill_active_ssh_sessions.ps1
+ wheel-py3_9-xpu-upload: # Uploading
+ if: ${{ github.repository_owner == 'pytorch' }}
+ permissions:
+ id-token: write
+ contents: read
+ needs: wheel-py3_9-xpu-test
+ with:
+ PYTORCH_ROOT: ${{ github.workspace }}/pytorch
+ BUILDER_ROOT: ${{ github.workspace }}/builder
+ PACKAGE_TYPE: wheel
+ # TODO: This is a legacy variable that we eventually want to get rid of in
+ # favor of GPU_ARCH_VERSION
+ DESIRED_CUDA: xpu
+ GPU_ARCH_TYPE: xpu
+ DESIRED_PYTHON: "3.9"
+ build_name: wheel-py3_9-xpu
+ secrets:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ conda-pytorchbot-token: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }}
+ conda-pytorchbot-token-test: ${{ secrets.CONDA_PYTORCHBOT_TOKEN_TEST }}
+ uses: ./.github/workflows/_binary-upload.yml
wheel-py3_10-cpu-build:
if: ${{ github.repository_owner == 'pytorch' }}
needs: get-label-type
@@ -2026,6 +2271,251 @@
conda-pytorchbot-token: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }}
conda-pytorchbot-token-test: ${{ secrets.CONDA_PYTORCHBOT_TOKEN_TEST }}
uses: ./.github/workflows/_binary-upload.yml
+ wheel-py3_10-xpu-build:
+ if: ${{ github.repository_owner == 'pytorch' }}
+ needs: get-label-type
+ runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.4xlarge"
+ timeout-minutes: 240
+ env:
+ PYTORCH_ROOT: ${{ github.workspace }}/pytorch
+ BUILDER_ROOT: ${{ github.workspace }}/builder
+ PACKAGE_TYPE: wheel
+ # TODO: This is a legacy variable that we eventually want to get rid of in
+ # favor of GPU_ARCH_VERSION
+ DESIRED_CUDA: xpu
+ GPU_ARCH_TYPE: xpu
+ SKIP_ALL_TESTS: 1
+ DESIRED_PYTHON: "3.10"
+ steps:
+ - name: Display EC2 information
+ shell: bash
+ run: |
+ set -euo pipefail
+ function get_ec2_metadata() {
+ # Pulled from instance metadata endpoint for EC2
+ # see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
+ category=$1
+ curl -fsSL "http://169.254.169.254/latest/meta-data/${category}"
+ }
+ echo "ami-id: $(get_ec2_metadata ami-id)"
+ echo "instance-id: $(get_ec2_metadata instance-id)"
+ echo "instance-type: $(get_ec2_metadata instance-type)"
+ echo "system info $(uname -a)"
+ - name: "[FB EMPLOYEES] Enable SSH (Click me for login details)"
+ uses: pytorch/test-infra/.github/actions/setup-ssh@main
+ continue-on-error: true
+ with:
+ github-secret: ${{ secrets.GITHUB_TOKEN }}
+ # Needed for binary builds, see: https://github.com/pytorch/pytorch/issues/73339#issuecomment-1058981560
+ - name: Enable long paths on Windows
+ shell: powershell
+ run: |
+ Set-ItemProperty -Path "HKLM:\\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1
+ # Since it's just a defensive command, the workflow should continue even the command fails. This step can be
+ # removed once Windows Defender is removed from the AMI
+ - name: Disables Windows Defender scheduled and real-time scanning for files in directories used by PyTorch
+ continue-on-error: true
+ shell: powershell
+ run: |
+ Add-MpPreference -ExclusionPath $(Get-Location).tostring(),$Env:TEMP -ErrorAction Ignore
+ # Let's both exclude the path and disable Windows Defender completely just to be sure
+ # that it doesn't interfere
+ Set-MpPreference -DisableRealtimeMonitoring $True -ErrorAction Ignore
+ # NOTE: These environment variables are put here so that they can be applied on every job equally
+ # They are also here because setting them at a workflow level doesn't give us access to the
+ # runner.temp variable, which we need.
+ - name: Populate binary env
+ shell: bash
+ run: |
+ echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
+ echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
+ echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
+ - name: Checkout PyTorch
+ uses: malfet/checkout@silent-checkout
+ with:
+ ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
+ submodules: recursive
+ path: pytorch
+ quiet-checkout: true
+ - name: Clean PyTorch checkout
+ run: |
+ # Remove any artifacts from the previous checkouts
+ git clean -fxd
+ working-directory: pytorch
+ - name: Checkout pytorch/builder
+ uses: malfet/checkout@silent-checkout
+ with:
+ ref: main
+ submodules: recursive
+ repository: pytorch/builder
+ path: builder
+ quiet-checkout: true
+ - name: Clean pytorch/builder checkout
+ run: |
+ # Remove any artifacts from the previous checkouts
+ git clean -fxd
+ working-directory: builder
+ - name: Populate binary env
+ shell: bash
+ run: |
+ "${PYTORCH_ROOT}/.circleci/scripts/binary_populate_env.sh"
+ - name: Build PyTorch binary
+ shell: bash
+ run: |
+ "${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
+ - uses: actions/upload-artifact@v3
+ if: always()
+ with:
+ name: wheel-py3_10-xpu
+ retention-days: 14
+ if-no-files-found: error
+ path: "${{ env.PYTORCH_FINAL_PACKAGE_DIR }}"
+ - name: Wait until all sessions have drained
+ shell: powershell
+ working-directory: pytorch
+ if: always()
+ timeout-minutes: 120
+ run: |
+ .github\scripts\wait_for_ssh_to_drain.ps1
+ - name: Kill active ssh sessions if still around (Useful if workflow was cancelled)
+ shell: powershell
+ working-directory: pytorch
+ if: always()
+ run: |
+ .github\scripts\kill_active_ssh_sessions.ps1
+ wheel-py3_10-xpu-test: # Testing
+ if: ${{ github.repository_owner == 'pytorch' }}
+ needs:
+ - wheel-py3_10-xpu-build
+ - get-label-type
+ runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.4xlarge.nonephemeral"
+ timeout-minutes: 240
+ env:
+ PYTORCH_ROOT: ${{ github.workspace }}/pytorch
+ BUILDER_ROOT: ${{ github.workspace }}/builder
+ PACKAGE_TYPE: wheel
+ # TODO: This is a legacy variable that we eventually want to get rid of in
+ # favor of GPU_ARCH_VERSION
+ DESIRED_CUDA: xpu
+ GPU_ARCH_TYPE: xpu
+ SKIP_ALL_TESTS: 1
+ DESIRED_PYTHON: "3.10"
+ steps:
+ - name: Display EC2 information
+ shell: bash
+ run: |
+ set -euo pipefail
+ function get_ec2_metadata() {
+ # Pulled from instance metadata endpoint for EC2
+ # see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
+ category=$1
+ curl -fsSL "http://169.254.169.254/latest/meta-data/${category}"
+ }
+ echo "ami-id: $(get_ec2_metadata ami-id)"
+ echo "instance-id: $(get_ec2_metadata instance-id)"
+ echo "instance-type: $(get_ec2_metadata instance-type)"
+ echo "system info $(uname -a)"
+ - name: "[FB EMPLOYEES] Enable SSH (Click me for login details)"
+ uses: pytorch/test-infra/.github/actions/setup-ssh@main
+ continue-on-error: true
+ with:
+ github-secret: ${{ secrets.GITHUB_TOKEN }}
+ # Needed for binary builds, see: https://github.com/pytorch/pytorch/issues/73339#issuecomment-1058981560
+ - name: Enable long paths on Windows
+ shell: powershell
+ run: |
+ Set-ItemProperty -Path "HKLM:\\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1
+ # Since it's just a defensive command, the workflow should continue even the command fails. This step can be
+ # removed once Windows Defender is removed from the AMI
+ - name: Disables Windows Defender scheduled and real-time scanning for files in directories used by PyTorch
+ continue-on-error: true
+ shell: powershell
+ run: |
+ Add-MpPreference -ExclusionPath $(Get-Location).tostring(),$Env:TEMP -ErrorAction Ignore
+ # Let's both exclude the path and disable Windows Defender completely just to be sure
+ # that it doesn't interfere
+ Set-MpPreference -DisableRealtimeMonitoring $True -ErrorAction Ignore
+ # NOTE: These environment variables are put here so that they can be applied on every job equally
+ # They are also here because setting them at a workflow level doesn't give us access to the
+ # runner.temp variable, which we need.
+ - name: Populate binary env
+ shell: bash
+ run: |
+ echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
+ echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
+ echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
+ - uses: actions/download-artifact@v3
+ name: Download Build Artifacts
+ with:
+ name: wheel-py3_10-xpu
+ path: "${{ env.PYTORCH_FINAL_PACKAGE_DIR }}"
+ - name: Checkout PyTorch
+ uses: malfet/checkout@silent-checkout
+ with:
+ ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
+ submodules: recursive
+ path: pytorch
+ quiet-checkout: true
+ - name: Clean PyTorch checkout
+ run: |
+ # Remove any artifacts from the previous checkouts
+ git clean -fxd
+ working-directory: pytorch
+ - name: Checkout pytorch/builder
+ uses: malfet/checkout@silent-checkout
+ with:
+ ref: main
+ submodules: recursive
+ repository: pytorch/builder
+ path: builder
+ quiet-checkout: true
+ - name: Clean pytorch/builder checkout
+ run: |
+ # Remove any artifacts from the previous checkouts
+ git clean -fxd
+ working-directory: builder
+ - name: Populate binary env
+ shell: bash
+ run: |
+ "${PYTORCH_ROOT}/.circleci/scripts/binary_populate_env.sh"
+ - name: Test PyTorch binary
+ shell: bash
+ run: |
+ "${PYTORCH_ROOT}/.circleci/scripts/binary_windows_test.sh"
+ - name: Wait until all sessions have drained
+ shell: powershell
+ working-directory: pytorch
+ if: always()
+ timeout-minutes: 120
+ run: |
+ .github\scripts\wait_for_ssh_to_drain.ps1
+ - name: Kill active ssh sessions if still around (Useful if workflow was cancelled)
+ shell: powershell
+ working-directory: pytorch
+ if: always()
+ run: |
+ .github\scripts\kill_active_ssh_sessions.ps1
+ wheel-py3_10-xpu-upload: # Uploading
+ if: ${{ github.repository_owner == 'pytorch' }}
+ permissions:
+ id-token: write
+ contents: read
+ needs: wheel-py3_10-xpu-test
+ with:
+ PYTORCH_ROOT: ${{ github.workspace }}/pytorch
+ BUILDER_ROOT: ${{ github.workspace }}/builder
+ PACKAGE_TYPE: wheel
+ # TODO: This is a legacy variable that we eventually want to get rid of in
+ # favor of GPU_ARCH_VERSION
+ DESIRED_CUDA: xpu
+ GPU_ARCH_TYPE: xpu
+ DESIRED_PYTHON: "3.10"
+ build_name: wheel-py3_10-xpu
+ secrets:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ conda-pytorchbot-token: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }}
+ conda-pytorchbot-token-test: ${{ secrets.CONDA_PYTORCHBOT_TOKEN_TEST }}
+ uses: ./.github/workflows/_binary-upload.yml
wheel-py3_11-cpu-build:
if: ${{ github.repository_owner == 'pytorch' }}
needs: get-label-type
@@ -3019,6 +3509,251 @@
conda-pytorchbot-token: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }}
conda-pytorchbot-token-test: ${{ secrets.CONDA_PYTORCHBOT_TOKEN_TEST }}
uses: ./.github/workflows/_binary-upload.yml
+ wheel-py3_11-xpu-build:
+ if: ${{ github.repository_owner == 'pytorch' }}
+ needs: get-label-type
+ runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.4xlarge"
+ timeout-minutes: 240
+ env:
+ PYTORCH_ROOT: ${{ github.workspace }}/pytorch
+ BUILDER_ROOT: ${{ github.workspace }}/builder
+ PACKAGE_TYPE: wheel
+ # TODO: This is a legacy variable that we eventually want to get rid of in
+ # favor of GPU_ARCH_VERSION
+ DESIRED_CUDA: xpu
+ GPU_ARCH_TYPE: xpu
+ SKIP_ALL_TESTS: 1
+ DESIRED_PYTHON: "3.11"
+ steps:
+ - name: Display EC2 information
+ shell: bash
+ run: |
+ set -euo pipefail
+ function get_ec2_metadata() {
+ # Pulled from instance metadata endpoint for EC2
+ # see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
+ category=$1
+ curl -fsSL "http://169.254.169.254/latest/meta-data/${category}"
+ }
+ echo "ami-id: $(get_ec2_metadata ami-id)"
+ echo "instance-id: $(get_ec2_metadata instance-id)"
+ echo "instance-type: $(get_ec2_metadata instance-type)"
+ echo "system info $(uname -a)"
+ - name: "[FB EMPLOYEES] Enable SSH (Click me for login details)"
+ uses: pytorch/test-infra/.github/actions/setup-ssh@main
+ continue-on-error: true
+ with:
+ github-secret: ${{ secrets.GITHUB_TOKEN }}
+ # Needed for binary builds, see: https://github.com/pytorch/pytorch/issues/73339#issuecomment-1058981560
+ - name: Enable long paths on Windows
+ shell: powershell
+ run: |
+ Set-ItemProperty -Path "HKLM:\\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1
+ # Since it's just a defensive command, the workflow should continue even the command fails. This step can be
+ # removed once Windows Defender is removed from the AMI
+ - name: Disables Windows Defender scheduled and real-time scanning for files in directories used by PyTorch
+ continue-on-error: true
+ shell: powershell
+ run: |
+ Add-MpPreference -ExclusionPath $(Get-Location).tostring(),$Env:TEMP -ErrorAction Ignore
+ # Let's both exclude the path and disable Windows Defender completely just to be sure
+ # that it doesn't interfere
+ Set-MpPreference -DisableRealtimeMonitoring $True -ErrorAction Ignore
+ # NOTE: These environment variables are put here so that they can be applied on every job equally
+ # They are also here because setting them at a workflow level doesn't give us access to the
+ # runner.temp variable, which we need.
+ - name: Populate binary env
+ shell: bash
+ run: |
+ echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
+ echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
+ echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
+ - name: Checkout PyTorch
+ uses: malfet/checkout@silent-checkout
+ with:
+ ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
+ submodules: recursive
+ path: pytorch
+ quiet-checkout: true
+ - name: Clean PyTorch checkout
+ run: |
+ # Remove any artifacts from the previous checkouts
+ git clean -fxd
+ working-directory: pytorch
+ - name: Checkout pytorch/builder
+ uses: malfet/checkout@silent-checkout
+ with:
+ ref: main
+ submodules: recursive
+ repository: pytorch/builder
+ path: builder
+ quiet-checkout: true
+ - name: Clean pytorch/builder checkout
+ run: |
+ # Remove any artifacts from the previous checkouts
+ git clean -fxd
+ working-directory: builder
+ - name: Populate binary env
+ shell: bash
+ run: |
+ "${PYTORCH_ROOT}/.circleci/scripts/binary_populate_env.sh"
+ - name: Build PyTorch binary
+ shell: bash
+ run: |
+ "${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
+ - uses: actions/upload-artifact@v3
+ if: always()
+ with:
+ name: wheel-py3_11-xpu
+ retention-days: 14
+ if-no-files-found: error
+ path: "${{ env.PYTORCH_FINAL_PACKAGE_DIR }}"
+ - name: Wait until all sessions have drained
+ shell: powershell
+ working-directory: pytorch
+ if: always()
+ timeout-minutes: 120
+ run: |
+ .github\scripts\wait_for_ssh_to_drain.ps1
+ - name: Kill active ssh sessions if still around (Useful if workflow was cancelled)
+ shell: powershell
+ working-directory: pytorch
+ if: always()
+ run: |
+ .github\scripts\kill_active_ssh_sessions.ps1
+ wheel-py3_11-xpu-test: # Testing
+ if: ${{ github.repository_owner == 'pytorch' }}
+ needs:
+ - wheel-py3_11-xpu-build
+ - get-label-type
+ runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.4xlarge.nonephemeral"
+ timeout-minutes: 240
+ env:
+ PYTORCH_ROOT: ${{ github.workspace }}/pytorch
+ BUILDER_ROOT: ${{ github.workspace }}/builder
+ PACKAGE_TYPE: wheel
+ # TODO: This is a legacy variable that we eventually want to get rid of in
+ # favor of GPU_ARCH_VERSION
+ DESIRED_CUDA: xpu
+ GPU_ARCH_TYPE: xpu
+ SKIP_ALL_TESTS: 1
+ DESIRED_PYTHON: "3.11"
+ steps:
+ - name: Display EC2 information
+ shell: bash
+ run: |
+ set -euo pipefail
+ function get_ec2_metadata() {
+ # Pulled from instance metadata endpoint for EC2
+ # see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
+ category=$1
+ curl -fsSL "http://169.254.169.254/latest/meta-data/${category}"
+ }
+ echo "ami-id: $(get_ec2_metadata ami-id)"
+ echo "instance-id: $(get_ec2_metadata instance-id)"
+ echo "instance-type: $(get_ec2_metadata instance-type)"
+ echo "system info $(uname -a)"
+ - name: "[FB EMPLOYEES] Enable SSH (Click me for login details)"
+ uses: pytorch/test-infra/.github/actions/setup-ssh@main
+ continue-on-error: true
+ with:
+ github-secret: ${{ secrets.GITHUB_TOKEN }}
+ # Needed for binary builds, see: https://github.com/pytorch/pytorch/issues/73339#issuecomment-1058981560
+ - name: Enable long paths on Windows
+ shell: powershell
+ run: |
+ Set-ItemProperty -Path "HKLM:\\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1
+ # Since it's just a defensive command, the workflow should continue even the command fails. This step can be
+ # removed once Windows Defender is removed from the AMI
+ - name: Disables Windows Defender scheduled and real-time scanning for files in directories used by PyTorch
+ continue-on-error: true
+ shell: powershell
+ run: |
+ Add-MpPreference -ExclusionPath $(Get-Location).tostring(),$Env:TEMP -ErrorAction Ignore
+ # Let's both exclude the path and disable Windows Defender completely just to be sure
+ # that it doesn't interfere
+ Set-MpPreference -DisableRealtimeMonitoring $True -ErrorAction Ignore
+ # NOTE: These environment variables are put here so that they can be applied on every job equally
+ # They are also here because setting them at a workflow level doesn't give us access to the
+ # runner.temp variable, which we need.
+ - name: Populate binary env
+ shell: bash
+ run: |
+ echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
+ echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
+ echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
+ - uses: actions/download-artifact@v3
+ name: Download Build Artifacts
+ with:
+ name: wheel-py3_11-xpu
+ path: "${{ env.PYTORCH_FINAL_PACKAGE_DIR }}"
+ - name: Checkout PyTorch
+ uses: malfet/checkout@silent-checkout
+ with:
+ ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
+ submodules: recursive
+ path: pytorch
+ quiet-checkout: true
+ - name: Clean PyTorch checkout
+ run: |
+ # Remove any artifacts from the previous checkouts
+ git clean -fxd
+ working-directory: pytorch
+ - name: Checkout pytorch/builder
+ uses: malfet/checkout@silent-checkout
+ with:
+ ref: main
+ submodules: recursive
+ repository: pytorch/builder
+ path: builder
+ quiet-checkout: true
+ - name: Clean pytorch/builder checkout
+ run: |
+ # Remove any artifacts from the previous checkouts
+ git clean -fxd
+ working-directory: builder
+ - name: Populate binary env
+ shell: bash
+ run: |
+ "${PYTORCH_ROOT}/.circleci/scripts/binary_populate_env.sh"
+ - name: Test PyTorch binary
+ shell: bash
+ run: |
+ "${PYTORCH_ROOT}/.circleci/scripts/binary_windows_test.sh"
+ - name: Wait until all sessions have drained
+ shell: powershell
+ working-directory: pytorch
+ if: always()
+ timeout-minutes: 120
+ run: |
+ .github\scripts\wait_for_ssh_to_drain.ps1
+ - name: Kill active ssh sessions if still around (Useful if workflow was cancelled)
+ shell: powershell
+ working-directory: pytorch
+ if: always()
+ run: |
+ .github\scripts\kill_active_ssh_sessions.ps1
+ wheel-py3_11-xpu-upload: # Uploading
+ if: ${{ github.repository_owner == 'pytorch' }}
+ permissions:
+ id-token: write
+ contents: read
+ needs: wheel-py3_11-xpu-test
+ with:
+ PYTORCH_ROOT: ${{ github.workspace }}/pytorch
+ BUILDER_ROOT: ${{ github.workspace }}/builder
+ PACKAGE_TYPE: wheel
+ # TODO: This is a legacy variable that we eventually want to get rid of in
+ # favor of GPU_ARCH_VERSION
+ DESIRED_CUDA: xpu
+ GPU_ARCH_TYPE: xpu
+ DESIRED_PYTHON: "3.11"
+ build_name: wheel-py3_11-xpu
+ secrets:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ conda-pytorchbot-token: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }}
+ conda-pytorchbot-token-test: ${{ secrets.CONDA_PYTORCHBOT_TOKEN_TEST }}
+ uses: ./.github/workflows/_binary-upload.yml
wheel-py3_12-cpu-build:
if: ${{ github.repository_owner == 'pytorch' }}
needs: get-label-type
@@ -4012,3 +4747,248 @@
conda-pytorchbot-token: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }}
conda-pytorchbot-token-test: ${{ secrets.CONDA_PYTORCHBOT_TOKEN_TEST }}
uses: ./.github/workflows/_binary-upload.yml
+ wheel-py3_12-xpu-build:
+ if: ${{ github.repository_owner == 'pytorch' }}
+ needs: get-label-type
+ runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.4xlarge"
+ timeout-minutes: 240
+ env:
+ PYTORCH_ROOT: ${{ github.workspace }}/pytorch
+ BUILDER_ROOT: ${{ github.workspace }}/builder
+ PACKAGE_TYPE: wheel
+ # TODO: This is a legacy variable that we eventually want to get rid of in
+ # favor of GPU_ARCH_VERSION
+ DESIRED_CUDA: xpu
+ GPU_ARCH_TYPE: xpu
+ SKIP_ALL_TESTS: 1
+ DESIRED_PYTHON: "3.12"
+ steps:
+ - name: Display EC2 information
+ shell: bash
+ run: |
+ set -euo pipefail
+ function get_ec2_metadata() {
+ # Pulled from instance metadata endpoint for EC2
+ # see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
+ category=$1
+ curl -fsSL "http://169.254.169.254/latest/meta-data/${category}"
+ }
+ echo "ami-id: $(get_ec2_metadata ami-id)"
+ echo "instance-id: $(get_ec2_metadata instance-id)"
+ echo "instance-type: $(get_ec2_metadata instance-type)"
+ echo "system info $(uname -a)"
+ - name: "[FB EMPLOYEES] Enable SSH (Click me for login details)"
+ uses: pytorch/test-infra/.github/actions/setup-ssh@main
+ continue-on-error: true
+ with:
+ github-secret: ${{ secrets.GITHUB_TOKEN }}
+ # Needed for binary builds, see: https://github.com/pytorch/pytorch/issues/73339#issuecomment-1058981560
+ - name: Enable long paths on Windows
+ shell: powershell
+ run: |
+ Set-ItemProperty -Path "HKLM:\\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1
+ # Since it's just a defensive command, the workflow should continue even the command fails. This step can be
+ # removed once Windows Defender is removed from the AMI
+ - name: Disables Windows Defender scheduled and real-time scanning for files in directories used by PyTorch
+ continue-on-error: true
+ shell: powershell
+ run: |
+ Add-MpPreference -ExclusionPath $(Get-Location).tostring(),$Env:TEMP -ErrorAction Ignore
+ # Let's both exclude the path and disable Windows Defender completely just to be sure
+ # that it doesn't interfere
+ Set-MpPreference -DisableRealtimeMonitoring $True -ErrorAction Ignore
+ # NOTE: These environment variables are put here so that they can be applied on every job equally
+ # They are also here because setting them at a workflow level doesn't give us access to the
+ # runner.temp variable, which we need.
+ - name: Populate binary env
+ shell: bash
+ run: |
+ echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
+ echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
+ echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
+ - name: Checkout PyTorch
+ uses: malfet/checkout@silent-checkout
+ with:
+ ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
+ submodules: recursive
+ path: pytorch
+ quiet-checkout: true
+ - name: Clean PyTorch checkout
+ run: |
+ # Remove any artifacts from the previous checkouts
+ git clean -fxd
+ working-directory: pytorch
+ - name: Checkout pytorch/builder
+ uses: malfet/checkout@silent-checkout
+ with:
+ ref: main
+ submodules: recursive
+ repository: pytorch/builder
+ path: builder
+ quiet-checkout: true
+ - name: Clean pytorch/builder checkout
+ run: |
+ # Remove any artifacts from the previous checkouts
+ git clean -fxd
+ working-directory: builder
+ - name: Populate binary env
+ shell: bash
+ run: |
+ "${PYTORCH_ROOT}/.circleci/scripts/binary_populate_env.sh"
+ - name: Build PyTorch binary
+ shell: bash
+ run: |
+ "${PYTORCH_ROOT}/.circleci/scripts/binary_windows_build.sh"
+ - uses: actions/upload-artifact@v3
+ if: always()
+ with:
+ name: wheel-py3_12-xpu
+ retention-days: 14
+ if-no-files-found: error
+ path: "${{ env.PYTORCH_FINAL_PACKAGE_DIR }}"
+ - name: Wait until all sessions have drained
+ shell: powershell
+ working-directory: pytorch
+ if: always()
+ timeout-minutes: 120
+ run: |
+ .github\scripts\wait_for_ssh_to_drain.ps1
+ - name: Kill active ssh sessions if still around (Useful if workflow was cancelled)
+ shell: powershell
+ working-directory: pytorch
+ if: always()
+ run: |
+ .github\scripts\kill_active_ssh_sessions.ps1
+ wheel-py3_12-xpu-test: # Testing
+ if: ${{ github.repository_owner == 'pytorch' }}
+ needs:
+ - wheel-py3_12-xpu-build
+ - get-label-type
+ runs-on: "${{ needs.get-label-type.outputs.label-type }}windows.4xlarge.nonephemeral"
+ timeout-minutes: 240
+ env:
+ PYTORCH_ROOT: ${{ github.workspace }}/pytorch
+ BUILDER_ROOT: ${{ github.workspace }}/builder
+ PACKAGE_TYPE: wheel
+ # TODO: This is a legacy variable that we eventually want to get rid of in
+ # favor of GPU_ARCH_VERSION
+ DESIRED_CUDA: xpu
+ GPU_ARCH_TYPE: xpu
+ SKIP_ALL_TESTS: 1
+ DESIRED_PYTHON: "3.12"
+ steps:
+ - name: Display EC2 information
+ shell: bash
+ run: |
+ set -euo pipefail
+ function get_ec2_metadata() {
+ # Pulled from instance metadata endpoint for EC2
+ # see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
+ category=$1
+ curl -fsSL "http://169.254.169.254/latest/meta-data/${category}"
+ }
+ echo "ami-id: $(get_ec2_metadata ami-id)"
+ echo "instance-id: $(get_ec2_metadata instance-id)"
+ echo "instance-type: $(get_ec2_metadata instance-type)"
+ echo "system info $(uname -a)"
+ - name: "[FB EMPLOYEES] Enable SSH (Click me for login details)"
+ uses: pytorch/test-infra/.github/actions/setup-ssh@main
+ continue-on-error: true
+ with:
+ github-secret: ${{ secrets.GITHUB_TOKEN }}
+ # Needed for binary builds, see: https://github.com/pytorch/pytorch/issues/73339#issuecomment-1058981560
+ - name: Enable long paths on Windows
+ shell: powershell
+ run: |
+ Set-ItemProperty -Path "HKLM:\\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1
+ # Since it's just a defensive command, the workflow should continue even the command fails. This step can be
+ # removed once Windows Defender is removed from the AMI
+ - name: Disables Windows Defender scheduled and real-time scanning for files in directories used by PyTorch
+ continue-on-error: true
+ shell: powershell
+ run: |
+ Add-MpPreference -ExclusionPath $(Get-Location).tostring(),$Env:TEMP -ErrorAction Ignore
+ # Let's both exclude the path and disable Windows Defender completely just to be sure
+ # that it doesn't interfere
+ Set-MpPreference -DisableRealtimeMonitoring $True -ErrorAction Ignore
+ # NOTE: These environment variables are put here so that they can be applied on every job equally
+ # They are also here because setting them at a workflow level doesn't give us access to the
+ # runner.temp variable, which we need.
+ - name: Populate binary env
+ shell: bash
+ run: |
+ echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}"
+ echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}"
+ echo "WIN_PACKAGE_WORK_DIR=${RUNNER_TEMP}"
+ - uses: actions/download-artifact@v3
+ name: Download Build Artifacts
+ with:
+ name: wheel-py3_12-xpu
+ path: "${{ env.PYTORCH_FINAL_PACKAGE_DIR }}"
+ - name: Checkout PyTorch
+ uses: malfet/checkout@silent-checkout
+ with:
+ ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
+ submodules: recursive
+ path: pytorch
+ quiet-checkout: true
+ - name: Clean PyTorch checkout
+ run: |
+ # Remove any artifacts from the previous checkouts
+ git clean -fxd
+ working-directory: pytorch
+ - name: Checkout pytorch/builder
+ uses: malfet/checkout@silent-checkout
+ with:
+ ref: main
+ submodules: recursive
+ repository: pytorch/builder
+ path: builder
+ quiet-checkout: true
+ - name: Clean pytorch/builder checkout
+ run: |
+ # Remove any artifacts from the previous checkouts
+ git clean -fxd
+ working-directory: builder
+ - name: Populate binary env
+ shell: bash
+ run: |
+ "${PYTORCH_ROOT}/.circleci/scripts/binary_populate_env.sh"
+ - name: Test PyTorch binary
+ shell: bash
+ run: |
+ "${PYTORCH_ROOT}/.circleci/scripts/binary_windows_test.sh"
+ - name: Wait until all sessions have drained
+ shell: powershell
+ working-directory: pytorch
+ if: always()
+ timeout-minutes: 120
+ run: |
+ .github\scripts\wait_for_ssh_to_drain.ps1
+ - name: Kill active ssh sessions if still around (Useful if workflow was cancelled)
+ shell: powershell
+ working-directory: pytorch
+ if: always()
+ run: |
+ .github\scripts\kill_active_ssh_sessions.ps1
+ wheel-py3_12-xpu-upload: # Uploading
+ if: ${{ github.repository_owner == 'pytorch' }}
+ permissions:
+ id-token: write
+ contents: read
+ needs: wheel-py3_12-xpu-test
+ with:
+ PYTORCH_ROOT: ${{ github.workspace }}/pytorch
+ BUILDER_ROOT: ${{ github.workspace }}/builder
+ PACKAGE_TYPE: wheel
+ # TODO: This is a legacy variable that we eventually want to get rid of in
+ # favor of GPU_ARCH_VERSION
+ DESIRED_CUDA: xpu
+ GPU_ARCH_TYPE: xpu
+ DESIRED_PYTHON: "3.12"
+ build_name: wheel-py3_12-xpu
+ secrets:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ conda-pytorchbot-token: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }}
+ conda-pytorchbot-token-test: ${{ secrets.CONDA_PYTORCHBOT_TOKEN_TEST }}
+ uses: ./.github/workflows/_binary-upload.yml