-
Notifications
You must be signed in to change notification settings - Fork 52
187 lines (161 loc) · 6.18 KB
/
pip-test-windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
name: Test with pip on Windows
run-name: ${{ inputs.run_name }}
on:
workflow_dispatch:
inputs:
runner_label:
description: Runner label
type: string
default: a770
skip_list:
description: Skip list
type: string
default: a770
run_name:
description: Custom run name
type: string
default: Test with pip on Windows
# run workflow on changes to the driver, which handles the libraries logic
pull_request:
branches:
- main
paths:
- third_party/intel/backend/driver.py
push:
branches:
- main
paths:
- third_party/intel/backend/driver.py
permissions: read-all
env:
PYTHONIOENCODING: utf-8
NEW_WORKSPACE: C:\gh${{ github.run_id }}
ZE_PATH: C:\level_zero
PYTEST_MAX_PROCESSES: 8
SKIPLIST: --skip-list scripts/skiplist/${{ inputs.skip_list || 'a770' }}
TRITON_TEST_CMD: bash -x scripts/test-triton.sh --skip-pytorch-install --skip-pip-install --skip-list scripts/skiplist/${{ inputs.skip_list || 'a770' }} --reports-dir reports --ignore-errors
jobs:
build:
name: Build and test
runs-on:
- windows
- ${{ inputs.runner_label || 'a770' }}
steps:
- name: Enable long paths
run: |
git config --system core.longPaths true
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Clean up old workspaces
shell: bash
run: |
rm -rf /c/gh*
# Copy workspace to a temporary location with a shorter name.
- name: Copy workspace
run: |
Copy-Item -Path ${{ github.workspace }} -Destination ${{ env.NEW_WORKSPACE }} -Recurse
- name: Create venv
run:
python -m venv .venv
- name: Install PyTorch (wheels)
run: |
.venv\Scripts\activate.ps1
# The latest wheel does not work, see https://github.com/intel/intel-xpu-backend-for-triton/issues/3177#issuecomment-2599817729
# Use the latest good one
pip install torch==2.7.0.dev20250110+xpu --index-url https://download.pytorch.org/whl/nightly/xpu
- name: PyTorch version
run: |
.venv\Scripts\activate.ps1
python -c 'import torch;print(torch.__version__)'
- name: Clean up Triton cache
shell: bash
run: |
rm -rf ~/.triton/cache
# We need ninja >= 1.12.0 to support long names on Windows. At the moment there is no required
# version in pypi, so instead of installing ninja with pip we use a preinstalled 1.12.1 on the
# runner.
- name: Setup Triton
run: |
.venv\Scripts\activate.ps1
Invoke-BatchFile "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
cd ${{ env.NEW_WORKSPACE }}
cd python
pip install -U wheel pybind11 cython cmake 'setuptools>=65.6.1' intel-sycl-rt==2025.0.5
python setup.py -v bdist_wheel
pip install (Get-Item ${{ env.NEW_WORKSPACE }}\python\dist\*.whl)
- name: Triton version
run: |
.venv\Scripts\activate.ps1
python -c 'import triton; print(triton.__version__)'
- name: Install test dependencies
run: |
.venv\Scripts\activate.ps1
pip install -r scripts\requirements-test.txt
pip uninstall pytest_forked -y
- name: Show installed pip packages
run: |
.venv\Scripts\activate.ps1
pip list -v
- name: Run unit tests
run: |
.venv\Scripts\activate.ps1
Invoke-BatchFile "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
cd ${{ env.NEW_WORKSPACE }}
${{ env.TRITON_TEST_CMD }} --unit
- name: Run core tests
run: |
.venv\Scripts\activate.ps1
Invoke-BatchFile "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
cd ${{ env.NEW_WORKSPACE }}
${{ env.TRITON_TEST_CMD }} --core
- name: Run interpreter tests
run: |
.venv\Scripts\activate.ps1
Invoke-BatchFile "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
cd ${{ env.NEW_WORKSPACE }}
${{ env.TRITON_TEST_CMD }} --interpreter
- name: Run tutorials
run: |
.venv\Scripts\activate.ps1
Invoke-BatchFile "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
# Disable interactive plot window
$env:MPLBACKEND = "Agg"
cd ${{ env.NEW_WORKSPACE }}
${{ env.TRITON_TEST_CMD }} --tutorial
- name: Run instrumentation tests
run: |
.venv\Scripts\activate.ps1
Invoke-BatchFile "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
cd ${{ env.NEW_WORKSPACE }}
${{ env.TRITON_TEST_CMD }} --instrumentation
- name: Pass rate
run: |
.venv\Scripts\activate.ps1
pip install defusedxml
cd ${{ env.NEW_WORKSPACE }}
bash -c "\
source ./scripts/capture-hw-details.sh; \
python scripts/pass_rate.py --reports reports ${{ env.SKIPLIST }}; \
python scripts/pass_rate.py --reports reports --json ${{ env.SKIPLIST }} > pass_rate.json; \
python scripts/pass_rate.py --reports reports --suite tutorials --json ${{ env.SKIPLIST }} > pass_rate_tutorials.json; \
"
- name: Upload pass rate report
# upload reports only for the default branch
if: github.ref_name == 'main'
uses: actions/upload-artifact@v4
with:
name: pass_rate
path: ${{ env.NEW_WORKSPACE }}\pass_rate*.json
- name: Clean up workspace
if: ${{ always() }}
run: |
Remove-Item -LiteralPath ${{ env.NEW_WORKSPACE }} -Force -Recurse -ErrorAction Ignore
- name: Clean up temporary files
if: ${{ always() }}
shell: bash
run: |
rm -rf rm -rf /tmp/triton-* /tmp/tmp*