Skip to content

Commit a01122a

Browse files
committed
Add windows CI build and test
1 parent 2ad599f commit a01122a

File tree

2 files changed

+138
-10
lines changed

2 files changed

+138
-10
lines changed

.github/workflows/build_and_run.yml

Lines changed: 108 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,24 @@ on:
1010
branches: [main]
1111

1212
env:
13-
WORKLOADS: python,numpy,dpnp,sycl,numba_n,numba_np,numba_npr,numba_dpex_k,numba_dpex_n,numba_dpex_p,numba_mlir_k,numba_mlir_n,numba_mlir_p
13+
# sycl is not included. Add it manually if you need
14+
WORKLOADS: python,numpy,dpnp,numba_n,numba_np,numba_npr,numba_dpex_k,numba_dpex_n,numba_dpex_p,numba_mlir_k,numba_mlir_n,numba_mlir_p
1415

1516
jobs:
1617
build_linux:
17-
name: Builds dpbench and runs the benchmarks
18+
name: Build and run linux
1819
runs-on: ubuntu-latest
1920

2021
strategy:
2122
fail-fast: false
2223
matrix:
2324
python: ["3.9", "3.10"]
25+
sycl: ["sycl","no-sycl"]
26+
include:
27+
- sycl: sycl
28+
environment: conda-linux-sycl.yml
29+
- sycl: no-sycl
30+
environment: conda.yml
2431

2532
steps:
2633
- name: Cancel Previous Runs
@@ -40,35 +47,126 @@ jobs:
4047
python-version: ${{ matrix.python }}
4148
mamba-version: "*"
4249
activate-environment: dpbench-dev
43-
environment-file: environments/conda-linux-sycl.yml
50+
environment-file: environments/${{ matrix.environment }}
4451

4552
- name: Conda info
46-
shell: bash -l {0}
53+
shell: bash -el {0}
4754
run: |
4855
conda info
4956
conda list
5057
58+
- name: Sycl
59+
if: matrix.sycl == 'sycl'
60+
shell: bash -el {0}
61+
run: |
62+
sycl-ls
63+
echo "CC=icx" >> "$GITHUB_ENV"
64+
echo "CXX=icpx" >> "$GITHUB_ENV"
65+
echo "DPBENCH_SYCL=1" >> "$GITHUB_ENV"
66+
echo "WORKLOADS=$WORKLOADS,sycl" >> "$GITHUB_ENV"
67+
5168
- name: Build dpbench
52-
shell: bash -l {0}
69+
shell: bash -el {0}
5370
run: |
54-
CC=icx CXX=icpx DPBENCH_SYCL=1 pip install \
71+
pip install \
5572
--no-index --no-deps --no-build-isolation -e . -v
5673
5774
- name: Run benchmarks
58-
shell: bash -l {0}
75+
shell: bash -el {0}
5976
run: |
6077
export OCL_ICD_FILENAMES=libintelocl.so
6178
export NUMBA_MLIR_GPU_RUNTIME=sycl
6279
# Turn off numba-dpex autofall back
6380
export NUMBA_DPEX_FALLBACK_ON_CPU=0
6481
# Make sure numba-dpex is using native atomics in github CI
6582
export NUMBA_DPEX_ACTIVATE_ATOMICS_FP_NATIVE=1
66-
ls $(dirname $(dirname `which icx`))/bin-llvm || exit 1
67-
export NUMBA_DPEX_LLVM_SPIRV_ROOT=$(dirname $(dirname `which icx`))/bin-llvm
6883
6984
dpbench -i ${WORKLOADS} run -r2 --no-print-results || exit 1
7085
7186
- name: Generate report
72-
shell: bash -l {0}
87+
shell: bash -el {0}
7388
run: |
7489
dpbench -i ${WORKLOADS} report || exit 1
90+
91+
build-windows:
92+
name: Build and run windows
93+
runs-on: windows-latest
94+
95+
strategy:
96+
fail-fast: false
97+
matrix:
98+
python: ["3.9", "3.10"]
99+
sycl: ["sycl","no-sycl"]
100+
include:
101+
- sycl: sycl
102+
environment: conda-win-sycl.yml
103+
- sycl: no-sycl
104+
environment: conda.yml
105+
106+
steps:
107+
- name: Checkout dpbench
108+
uses: actions/checkout@v3
109+
with:
110+
fetch-depth: 0
111+
112+
- name: Setup conda
113+
uses: conda-incubator/setup-miniconda@v2
114+
with:
115+
auto-update-conda: true
116+
python-version: ${{ matrix.python }}
117+
activate-environment: dpbench-dev
118+
environment-file: environments/${{ matrix.environment }}
119+
120+
- name: Conda info
121+
shell: pwsh
122+
run: |
123+
conda info
124+
conda list
125+
126+
- name: Configure Intel OpenCL CPU RT
127+
shell: pwsh
128+
run: |
129+
$script_path="$env:CONDA_PREFIX\Scripts\set-intel-ocl-icd-registry.ps1"
130+
&$script_path
131+
echo "OCL_ICD_FILENAMES=$env:CONDA_PREFIX\Library\lib\intelocl64.dll" >> $env:GITHUB_ENV
132+
echo "LIB=$env:CONDA_PREFIX\Library\lib;$env:CONDA_PREFIX\compiler\lib;$env:LIB" >> $env:GITHUB_ENV
133+
echo "INCLUDE=$env:CONDA_PREFIX\include;$env:INCLUDE" >> $env:GITHUB_ENV
134+
# Check the variable assisting OpenCL CPU driver to find TBB DLLs which are not located where it expects them by default
135+
$cl_cfg="$env:CONDA_PREFIX\Library\lib\cl.cfg"
136+
Get-Content -Tail 5 -Path $cl_cfg
137+
138+
- name: Sycl
139+
if: matrix.sycl == 'sycl'
140+
shell: pwsh
141+
run: |
142+
sycl-ls
143+
echo "CC=icx" >> $env:GITHUB_ENV
144+
echo "CXX=icx" >> $env:GITHUB_ENV
145+
echo "DPBENCH_SYCL=1" >> $env:GITHUB_ENV
146+
echo "WORKLOADS=$env:WORKLOADS,sycl" >> $env:GITHUB_ENV
147+
148+
- name: Build dpbench
149+
shell: pwsh
150+
run: |
151+
python setup.py develop
152+
# pip install `
153+
# --no-index --no-deps --no-build-isolation -e . -v
154+
155+
- name: Run benchmarks
156+
shell: pwsh
157+
run: |
158+
$env:NUMBA_MLIR_GPU_RUNTIME="sycl"
159+
# Turn off numba-dpex autofall back
160+
$env:NUMBA_DPEX_FALLBACK_ON_CPU=0
161+
# Make sure numba-dpex is using native atomics in github CI
162+
$env:NUMBA_DPEX_ACTIVATE_ATOMICS_FP_NATIVE=1
163+
164+
$env:PYTHONIOENCODING="utf-8"
165+
# $env:PYTHONLEGACYWINDOWSSTDIO=utf-8
166+
167+
dpbench -i $env:WORKLOADS run -r2 --no-print-results
168+
169+
- name: Generate report
170+
shell: pwsh
171+
run: |
172+
dpbench -i $env:WORKLOADS report

environments/conda-win-sycl.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# SPDX-FileCopyrightText: 2022 - 2023 Intel Corporation
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
name: dpbench-dev
6+
channels:
7+
- dppy/label/dev
8+
- intel
9+
- conda-forge
10+
- nodefaults
11+
dependencies:
12+
- conda-forge::pip
13+
- conda-forge::tomli
14+
- conda-forge::alembic>=1.11.0
15+
- conda-forge::sqlalchemy>=2.0.0
16+
- conda-forge::scipy
17+
- conda-forge::scikit-learn
18+
- conda-forge::pandas
19+
- numpy
20+
- numba
21+
- dpctl
22+
- dpnp
23+
- numba-dpex
24+
- numba-mlir
25+
- dpcpp_win-64
26+
- cython
27+
- scikit-build
28+
# https://github.com/scikit-build/scikit-build/issues/981
29+
- setuptools>=42,<64
30+
- pybind11

0 commit comments

Comments
 (0)