forked from numpy/numpy
-
Notifications
You must be signed in to change notification settings - Fork 6
263 lines (232 loc) · 9.25 KB
/
linux_simd.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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
name: Linux SIMD tests
# This file is meant for testing different SIMD-related build options and
# optimization levels. See `meson_options.txt` for the available build options.
#
# Jobs and their purposes:
#
# - baseline_only:
# Focuses on completing as quickly as possible and acts as a filter for other, more resource-intensive jobs.
# Utilizes only the default baseline targets (e.g., SSE3 on X86_64) without enabling any runtime dispatched features.
#
# - old_gcc:
# Tests the oldest supported GCC version with default CPU/baseline/dispatch settings.
#
# - without_optimizations:
# Completely disables all SIMD optimizations and other compiler optimizations such as loop unrolling.
#
# - native:
# Tests against the host CPU features set as the baseline without enabling any runtime dispatched features.
# Intended to assess the entire NumPy codebase against host flags, even for code sections lacking handwritten SIMD intrincis.
#
# - without_avx512/avx2/fma3:
# Uses runtime SIMD dispatching but disables AVX2, FMA3, and AVX512.
# Intended to evaluate 128-bit SIMD extensions without FMA support.
#
# - without_avx512:
# Uses runtime SIMD dispatching but disables AVX512.
# Intended to evaluate 128-bit/256-bit SIMD extensions.
#
# - intel_sde:
# Executes only the SIMD tests for various AVX512 SIMD extensions under the Intel Software Development Emulator (SDE).
#
on:
pull_request:
branches:
- main
- maintenance/**
defaults:
run:
shell: 'script -q -e -c "bash --noprofile --norc -eo pipefail {0}"'
env:
TERM: xterm-256color
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
get_commit_message:
name: Get commit message
uses: ./.github/workflows/commit_message.yml
baseline_only:
# To enable this workflow on a fork, comment out:
#if: github.repository == 'numpy/numpy'
needs: get_commit_message
runs-on: ubuntu-latest
env:
MESON_ARGS: "-Dallow-noblas=true -Dcpu-dispatch=none"
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: recursive
fetch-tags: true
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: '3.10'
- uses: ./.github/meson_actions
name: Build/Test
old_gcc:
if: github.event_name != 'push'
needs: [baseline_only]
runs-on: ubuntu-latest
env:
MESON_ARGS: "-Dallow-noblas=true"
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: recursive
fetch-tags: true
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: '3.10'
- name: Install GCC/8/9
run: |
echo "deb http://archive.ubuntu.com/ubuntu focal main universe" | sudo tee /etc/apt/sources.list.d/focal.list
sudo apt update
sudo apt install -y g++-8 g++-9
- name: Enable gcc-8
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 1
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 1
- uses: ./.github/meson_actions
name: Build/Test against gcc-8
- name: Enable gcc-9
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 2
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 2
- uses: ./.github/meson_actions
name: Build/Test against gcc-9
specialize:
needs: [baseline_only]
runs-on: ubuntu-latest
if: github.event_name != 'push'
continue-on-error: true
strategy:
fail-fast: false
matrix:
BUILD_PROP:
- [
"without optimizations",
"-Dallow-noblas=true -Ddisable-optimization=true",
"3.12"
]
- [
"native",
"-Dallow-noblas=true -Dcpu-baseline=native -Dcpu-dispatch=none",
"3.11"
]
- [
"without avx512",
"-Dallow-noblas=true -Dcpu-dispatch=SSSE3,SSE41,POPCNT,SSE42,AVX,F16C,AVX2,FMA3",
"3.10"
]
- [
"without avx512/avx2/fma3",
"-Dallow-noblas=true -Dcpu-dispatch=SSSE3,SSE41,POPCNT,SSE42,AVX,F16C",
"3.10"
]
env:
MESON_ARGS: ${{ matrix.BUILD_PROP[1] }}
name: "${{ matrix.BUILD_PROP[0] }}"
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: recursive
fetch-tags: true
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: "${{ matrix.BUILD_PROP[2] }}"
- uses: ./.github/meson_actions
name: Build/Test
intel_sde_avx512:
needs: [baseline_only]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: recursive
fetch-tags: true
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: '3.11'
- name: Install Intel SDE
run: |
curl -o /tmp/sde.tar.xz https://downloadmirror.intel.com/788820/sde-external-9.27.0-2023-09-13-lin.tar.xz
mkdir /tmp/sde && tar -xvf /tmp/sde.tar.xz -C /tmp/sde/
sudo mv /tmp/sde/* /opt/sde && sudo ln -s /opt/sde/sde64 /usr/bin/sde
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y g++-13
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 1
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 1
python -m pip install -r requirements/build_requirements.txt
python -m pip install pytest pytest-xdist hypothesis typing_extensions
- name: Build
run: spin build -- -Dallow-noblas=true -Dcpu-baseline=avx512f -Dtest-simd='BASELINE,AVX512_KNL,AVX512_KNM,AVX512_SKX,AVX512_CLX,AVX512_CNL,AVX512_ICL,AVX512_SPR'
- name: Meson Log
if: always()
run: cat build/meson-logs/meson-log.txt
- name: SIMD tests (KNM)
run: |
export NUMPY_SITE=$(realpath build-install/usr/lib/python*/site-packages/)
export PYTHONPATH="$PYTHONPATH:$NUMPY_SITE"
cd build-install &&
sde -knm -- python -c "import numpy; numpy.show_config()" &&
sde -knm -- python -m pytest $NUMPY_SITE/numpy/_core/tests/test_simd*
- name: linalg/ufunc/umath tests (TGL)
run: |
export NUMPY_SITE=$(realpath build-install/usr/lib/python*/site-packages/)
export PYTHONPATH="$PYTHONPATH:$NUMPY_SITE"
cd build-install &&
sde -tgl -- python -c "import numpy; numpy.show_config()" &&
sde -tgl -- python -m pytest $NUMPY_SITE/numpy/_core/tests/test_umath* \
$NUMPY_SITE/numpy/_core/tests/test_ufunc.py \
$NUMPY_SITE/numpy/_core/tests/test_multiarray.py \
$NUMPY_SITE/numpy/linalg/tests/test_*
intel_sde_spr:
needs: [baseline_only]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: recursive
fetch-tags: true
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: '3.11'
- name: Install Intel SDE
run: |
curl -o /tmp/sde.tar.xz https://downloadmirror.intel.com/788820/sde-external-9.27.0-2023-09-13-lin.tar.xz
mkdir /tmp/sde && tar -xvf /tmp/sde.tar.xz -C /tmp/sde/
sudo mv /tmp/sde/* /opt/sde && sudo ln -s /opt/sde/sde64 /usr/bin/sde
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y g++-13
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 1
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 1
python -m pip install -r requirements/build_requirements.txt
python -m pip install pytest pytest-xdist hypothesis typing_extensions
- name: Build
run: spin build -- -Dallow-noblas=true -Dcpu-baseline=avx512_spr
- name: Meson Log
if: always()
run: cat build/meson-logs/meson-log.txt
- name: SIMD tests (SPR)
run: |
export NUMPY_SITE=$(realpath build-install/usr/lib/python*/site-packages/)
export PYTHONPATH="$PYTHONPATH:$NUMPY_SITE"
cd build-install &&
sde -spr -- python -c "import numpy; numpy.show_config()" &&
sde -spr -- python -m pytest $NUMPY_SITE/numpy/_core/tests/test_simd*
- name: linalg/ufunc/umath tests on Intel SPR
run: |
export NUMPY_SITE=$(realpath build-install/usr/lib/python*/site-packages/)
export PYTHONPATH="$PYTHONPATH:$NUMPY_SITE"
cd build-install &&
sde -spr -- python -c "import numpy; numpy.show_config()" &&
sde -spr -- python -m pytest $NUMPY_SITE/numpy/_core/tests/test_umath* \
$NUMPY_SITE/numpy/_core/tests/test_ufunc.py \
$NUMPY_SITE/numpy/_core/tests/test_multiarray.py \
$NUMPY_SITE/numpy/linalg/tests/test_*