-
Notifications
You must be signed in to change notification settings - Fork 19
175 lines (149 loc) · 6.01 KB
/
build_and_run.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
# SPDX-FileCopyrightText: 2022 - 2023 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
name: build and run
on:
pull_request:
env:
# sycl is not included. Add it manually if you need
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
PYTHONIOENCODING: 'utf-8'
jobs:
build:
name: Build and run
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "windows-latest"]
python: ["3.9", "3.10", "3.11"]
sycl: ["sycl","no-sycl"]
install: ["pip", "setup.py"]
precision: ["single", "double"]
exclude:
# setuptools<64 + scikit-build produce 'UNKOWN' package name for
# python 3.11. Could not find exact reference for that issue.
# latest setuptools is unable to create editable environment for pip
- python: "3.11"
install: "pip"
sycl: "sycl"
include:
- sycl: sycl
os: ubuntu-latest
cc: icx
cxx: icpx
environment: conda-linux-sycl.yml
- sycl: sycl
os: windows-latest
cc: icx
cxx: icx
environment: conda-win-sycl.yml
- sycl: no-sycl
environment: conda.yml
runs-on: ${{matrix.os}}
defaults:
run:
shell: ${{ matrix.os == 'windows-latest' && 'cmd /U /C CALL {0}' || 'bash -el {0}' }}
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout dpbench
uses: actions/checkout@v3
with:
fetch-depth: 0
# intel:numpy for python 3.11 is not upstreamed yet
- name: Patch numpy dependency for Python 3.11
if: matrix.python == '3.11'
shell: bash -l {0}
run: |
find ./environments -type f | xargs sed -i 's/intel::numpy/numpy/'
find ./environments -type f | xargs sed -i '/numba-mlir/d'
find ./environments -type f | xargs sed -i 's/setuptools>=42,<64/setuptools/'
- name: Setup miniconda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python }}
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: "build"
channel-priority: "disabled"
environment-file: environments/${{ matrix.environment }}
run-post: false
- name: Conda info
run: |
conda info
conda list
- name: Patch IntelLLVM cmake
if: runner.os == 'Windows' && matrix.sycl == 'sycl'
shell: pwsh
run: |
$env:PATCHED_CMAKE_VERSION="3.26"
$env:PLATFORM_DIR="${env:CONDA_PREFIX}\Library\share\cmake-${env:PATCHED_CMAKE_VERSION}\Modules\Platform"
$env:FN="Windows-IntelLLVM.cmake"
Copy-Item ".github\workflows\Windows-IntelLLVM_${env:PATCHED_CMAKE_VERSION}.cmake" "${env:PLATFORM_DIR}\${env:FN}"
# TODO: remove it once it is removed from hard dependency. Not presented
# in conda-forge version, but there are some blockers before we could use
# it.
- name: Remove vs env
if: runner.os == 'Windows' && matrix.sycl == 'sycl'
run: |
conda remove --force vs2017_win-64
# Github pre-installed versions:
# https://github.com/actions/runner-images/blob/main/images/win/Windows2022-Readme.md
# Intel's compatible versions:
# https://www.intel.com/content/www/us/en/developer/articles/reference-implementation/intel-compilers-compatibility-with-microsoft-visual-studio-and-xcode.html
# TODO: do we want to enforce installing version that we want?
# Is it as easy as `choco install msvc==14.35`?
- name: Configure MSBuild
if: runner.os == 'Windows' && matrix.sycl == 'sycl'
# TODO: uses: microsoft/setup-msbuild ?
uses: ilammy/msvc-dev-cmd@v1
with:
toolset: 14.2
- name: Configure Sycl
if: matrix.sycl == 'sycl'
shell: bash -el {0}
run: |
sycl-ls
echo "CC=${{matrix.cc}}" >> "$GITHUB_ENV"
echo "CXX=${{matrix.cxx}}" >> "$GITHUB_ENV"
echo "DPBENCH_SYCL=1" >> "$GITHUB_ENV"
echo "WORKLOADS=$WORKLOADS,sycl" >> "$GITHUB_ENV"
- name: Configure compiler
shell: bash -el {0}
run: |
echo "CMAKE_GENERATOR=Ninja" >> "$GITHUB_ENV"
- name: Configure OneAPI
run: |
echo "ONEAPI_DEVICE_SELECTOR=opencl:cpu" >> "$GITHUB_ENV"
- name: Populate conda environment paths
shell: pwsh
if: runner.os == 'Windows'
run: |
echo "LIB=$env:CONDA_PREFIX\Library\lib;$env:CONDA_PREFIX\compiler\lib;$env:LIB" >> $env:GITHUB_ENV
echo "INCLUDE=$env:CONDA_PREFIX\include;$env:INCLUDE" >> $env:GITHUB_ENV
- name: Build dpbench
if: matrix.install == 'pip'
run: pip install --no-index --no-deps --no-build-isolation -e . -v
- name: Build dpbench
if: matrix.install == 'setup.py'
run: python setup.py develop
- name: Configure dpbench
shell: bash -el {0}
run: |
# Turn off numba-dpex autofall back
echo "NUMBA_DPEX_FALLBACK_ON_CPU=0" >> "GITHUB_ENV"
- name: Setup OpenCL CPU device
if: runner.os == 'Windows'
shell: pwsh
run: |
$script_path="$env:CONDA_PREFIX\Scripts\set-intel-ocl-icd-registry.ps1"
&$script_path
echo "OCL_ICD_FILENAMES=$env:CONDA_PREFIX\Library\lib\intelocl64.dll" >> $env:GITHUB_ENV
- name: Run benchmarks
run: dpbench -i ${{env.WORKLOADS}} run -r2 --no-print-results --precision=${{matrix.precision}} || exit 1
- name: Run rodinia benchmarks
run: dpbench -i ${{env.WORKLOADS}} --last-run run -r2 --no-print-results --rodinia --no-dpbench --precision=${{matrix.precision}} || exit 1
- name: Generate report
run: dpbench -i ${{env.WORKLOADS}} report || exit 1