diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml index 7750646c1..d1e81bc32 100644 --- a/.github/workflows/test-runner.yml +++ b/.github/workflows/test-runner.yml @@ -6,7 +6,7 @@ on: platform: type: string required: true - description: "Platform: linux-x64, linux-aarch64, windows, macos" + description: "Platform: linux-x64, linux-aarch64, windows, windows-arm64, macos" backend: type: string required: true @@ -42,6 +42,7 @@ jobs: inputs.platform == 'linux-x64' && 'ubuntu-22.04' || inputs.platform == 'linux-aarch64' && 'ubuntu-22.04-arm' || inputs.platform == 'macos' && 'macos-15' || + inputs.platform == 'windows-arm64' && 'windows-11-arm' || 'windows-2025' }} outputs: @@ -112,6 +113,11 @@ jobs: TEST_RUNNER="windows-2025" fi ;; + windows-arm64) + BUILD_OS="windows-11-arm" + ARCH="arm64" + TEST_RUNNER="windows-11-arm" + ;; *) echo "::error::Unsupported platform: ${{ inputs.platform }}" exit 1 @@ -152,8 +158,10 @@ jobs: # Windows: Setup MSVC (needed for both CPU and CUDA builds) - name: Setup MSVC - if: inputs.platform == 'windows' + if: startsWith(inputs.platform, 'windows') uses: ilammy/msvc-dev-cmd@v1.13.0 + with: + arch: ${{ inputs.platform == 'windows-arm64' && 'arm64' || 'x64' }} # Build CPU backend - name: Build C++ @@ -198,12 +206,15 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: '3.10' + # Python for Windows ARM64 is only available from 3.12+ + python-version: ${{ inputs.platform == 'windows-arm64' && '3.12' || '3.10' }} # Windows: Setup MSVC for torch.compile - name: Setup MSVC - if: inputs.platform == 'windows' + if: startsWith(inputs.platform, 'windows') uses: ilammy/msvc-dev-cmd@v1.13.0 + with: + arch: ${{ inputs.platform == 'windows-arm64' && 'arm64' || 'x64' }} - name: Install torch (nightly) if: inputs.torch_version == 'nightly' diff --git a/.github/workflows/tests-pr.yml b/.github/workflows/tests-pr.yml index f04631a87..a962c1ed0 100644 --- a/.github/workflows/tests-pr.yml +++ b/.github/workflows/tests-pr.yml @@ -28,7 +28,7 @@ jobs: strategy: fail-fast: false matrix: - platform: [linux-x64, linux-aarch64, macos] + platform: [linux-x64, linux-aarch64, macos, windows-arm64] # default runners don't have AVX-512 support, but icelake does cpu_type: ["", icelake] torch_version: ["2.4.1", "2.12.0"] @@ -42,6 +42,12 @@ jobs: cpu_type: icelake - platform: macos cpu_type: icelake + # icelake doesn't apply to windows-arm64 + - platform: windows-arm64 + cpu_type: icelake + # Windows ARM64 minimum torch version is 2.12.0 + - platform: windows-arm64 + torch_version: "2.4.1" include: # Add aarch64 with torch 2.5.1 instead of 2.4.1 diff --git a/docs/source/installation.mdx b/docs/source/installation.mdx index 2f650f3b2..9a335f2d8 100644 --- a/docs/source/installation.mdx +++ b/docs/source/installation.mdx @@ -209,7 +209,7 @@ pip install -e . -Requires Visual Studio 2022 with the **ARM64 C++ build tools** component and Python >= **3.12**. +Requires Visual Studio 2022 with the **ARM64 C++ build tools** component, Python >= **3.12**, and PyTorch >= **2.12**. ```bash git clone https://github.com/bitsandbytes-foundation/bitsandbytes.git && cd bitsandbytes/