Skip to content

Commit 062f5b9

Browse files
authored
pr test workflow for windows arm (#1961)
1 parent 2177945 commit 062f5b9

3 files changed

Lines changed: 23 additions & 6 deletions

File tree

.github/workflows/test-runner.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
platform:
77
type: string
88
required: true
9-
description: "Platform: linux-x64, linux-aarch64, windows, macos"
9+
description: "Platform: linux-x64, linux-aarch64, windows, windows-arm64, macos"
1010
backend:
1111
type: string
1212
required: true
@@ -42,6 +42,7 @@ jobs:
4242
inputs.platform == 'linux-x64' && 'ubuntu-22.04' ||
4343
inputs.platform == 'linux-aarch64' && 'ubuntu-22.04-arm' ||
4444
inputs.platform == 'macos' && 'macos-15' ||
45+
inputs.platform == 'windows-arm64' && 'windows-11-arm' ||
4546
'windows-2025'
4647
}}
4748
outputs:
@@ -112,6 +113,11 @@ jobs:
112113
TEST_RUNNER="windows-2025"
113114
fi
114115
;;
116+
windows-arm64)
117+
BUILD_OS="windows-11-arm"
118+
ARCH="arm64"
119+
TEST_RUNNER="windows-11-arm"
120+
;;
115121
*)
116122
echo "::error::Unsupported platform: ${{ inputs.platform }}"
117123
exit 1
@@ -152,8 +158,10 @@ jobs:
152158

153159
# Windows: Setup MSVC (needed for both CPU and CUDA builds)
154160
- name: Setup MSVC
155-
if: inputs.platform == 'windows'
161+
if: startsWith(inputs.platform, 'windows')
156162
uses: ilammy/msvc-dev-cmd@v1.13.0
163+
with:
164+
arch: ${{ inputs.platform == 'windows-arm64' && 'arm64' || 'x64' }}
157165

158166
# Build CPU backend
159167
- name: Build C++
@@ -198,12 +206,15 @@ jobs:
198206
- name: Setup Python
199207
uses: actions/setup-python@v5
200208
with:
201-
python-version: '3.10'
209+
# Python for Windows ARM64 is only available from 3.12+
210+
python-version: ${{ inputs.platform == 'windows-arm64' && '3.12' || '3.10' }}
202211

203212
# Windows: Setup MSVC for torch.compile
204213
- name: Setup MSVC
205-
if: inputs.platform == 'windows'
214+
if: startsWith(inputs.platform, 'windows')
206215
uses: ilammy/msvc-dev-cmd@v1.13.0
216+
with:
217+
arch: ${{ inputs.platform == 'windows-arm64' && 'arm64' || 'x64' }}
207218

208219
- name: Install torch (nightly)
209220
if: inputs.torch_version == 'nightly'

.github/workflows/tests-pr.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
strategy:
2929
fail-fast: false
3030
matrix:
31-
platform: [linux-x64, linux-aarch64, macos]
31+
platform: [linux-x64, linux-aarch64, macos, windows-arm64]
3232
# default runners don't have AVX-512 support, but icelake does
3333
cpu_type: ["", icelake]
3434
torch_version: ["2.4.1", "2.12.0"]
@@ -42,6 +42,12 @@ jobs:
4242
cpu_type: icelake
4343
- platform: macos
4444
cpu_type: icelake
45+
# icelake doesn't apply to windows-arm64
46+
- platform: windows-arm64
47+
cpu_type: icelake
48+
# Windows ARM64 minimum torch version is 2.12.0
49+
- platform: windows-arm64
50+
torch_version: "2.4.1"
4551

4652
include:
4753
# Add aarch64 with torch 2.5.1 instead of 2.4.1

docs/source/installation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ pip install -e .
209209
</hfoption>
210210
<hfoption id="Windows (ARM64)">
211211

212-
Requires Visual Studio 2022 with the **ARM64 C++ build tools** component and Python >= **3.12**.
212+
Requires Visual Studio 2022 with the **ARM64 C++ build tools** component, Python >= **3.12**, and PyTorch >= **2.12**.
213213

214214
```bash
215215
git clone https://github.com/bitsandbytes-foundation/bitsandbytes.git && cd bitsandbytes/

0 commit comments

Comments
 (0)