|
1 |
| -name: Test Meson build (Linux) |
| 1 | +name: BLAS tests (Linux) |
| 2 | + |
| 3 | +# This file is meant for testing different BLAS/LAPACK flavors and build |
| 4 | +# options on Linux. All other yml files for Linux will only test without BLAS |
| 5 | +# (mostly because that's easier and faster to build) or with the same 64-bit |
| 6 | +# OpenBLAS build that is used in the wheel jobs. |
| 7 | +# |
| 8 | +# Jobs and their purpose: |
| 9 | +# |
| 10 | +# - openblas32_stable_nightly: |
| 11 | +# Uses the 32-bit OpenBLAS builds, both the latest stable release |
| 12 | +# and a nightly build. |
| 13 | +# - openblas_no_pkgconfig_fedora: |
| 14 | +# Test OpenBLAS on Fedora. Fedora doesn't ship .pc files for OpenBLAS, |
| 15 | +# hence this exercises the "system dependency" detection method. |
| 16 | +# - flexiblas_fedora: |
| 17 | +# Tests FlexiBLAS (the default on Fedora for its own packages), via |
| 18 | +# pkg-config. FlexiBLAS allows runtime switching of BLAS/LAPACK |
| 19 | +# libraries, which is a useful capability (not tested in this job). |
| 20 | +# - openblas_cmake: |
| 21 | +# Tests whether OpenBLAS LP64 is detected correctly when only CMake |
| 22 | +# and not pkg-config is installed. |
| 23 | +# - netlib: |
| 24 | +# Installs vanilla blas/lapack, which is the last option tried in |
| 25 | +# auto-detection. |
| 26 | +# - mkl: |
| 27 | +# Tests MKL installed from PyPI (because easiest/fastest, if broken) in |
| 28 | +# 3 ways: both LP64 and ILP64 via pkg-config, and then using the |
| 29 | +# Single Dynamic Library (SDL, or `libmkl_rt`). |
| 30 | +# - blis: |
| 31 | +# Simple test for LP64 via pkg-config |
| 32 | +# - atlas: |
| 33 | +# Simple test for LP64 via pkg-config |
2 | 34 |
|
3 | 35 | on:
|
4 | 36 | pull_request:
|
@@ -71,3 +103,253 @@ jobs:
|
71 | 103 | export NPY_RUN_MYPY_IN_TESTSUITE=1
|
72 | 104 | pip install pytest pytest-xdist hypothesis typing_extensions
|
73 | 105 | spin test -j auto
|
| 106 | +
|
| 107 | +
|
| 108 | + openblas_no_pkgconfig_fedora: |
| 109 | + if: "github.repository == 'numpy/numpy'" |
| 110 | + runs-on: ubuntu-latest |
| 111 | + container: fedora:39 |
| 112 | + name: "OpenBLAS (Fedora, no pkg-config, LP64/ILP64)" |
| 113 | + steps: |
| 114 | + - name: Install system dependencies |
| 115 | + run: | |
| 116 | + dnf install git gcc-gfortran g++ python3-devel openblas-devel -y |
| 117 | +
|
| 118 | + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 |
| 119 | + with: |
| 120 | + submodules: recursive |
| 121 | + fetch-depth: 0 |
| 122 | + |
| 123 | + - name: Install dependencies |
| 124 | + run: | |
| 125 | + pip install -r build_requirements.txt |
| 126 | + pip install pytest hypothesis typing_extensions |
| 127 | +
|
| 128 | + - name: Build (LP64) |
| 129 | + run: spin build -- -Dblas=openblas -Dlapack=openblas -Ddisable-optimization=true |
| 130 | + |
| 131 | + - name: Test |
| 132 | + run: spin test -- numpy/linalg |
| 133 | + |
| 134 | + - name: Build (ILP64) |
| 135 | + run: | |
| 136 | + rm -rf build |
| 137 | + spin build -- -Duse-ilp64=true -Ddisable-optimization=true |
| 138 | +
|
| 139 | + - name: Test |
| 140 | + run: spin test -- numpy/linalg |
| 141 | + |
| 142 | + |
| 143 | + flexiblas_fedora: |
| 144 | + if: "github.repository == 'numpy/numpy'" |
| 145 | + runs-on: ubuntu-latest |
| 146 | + container: fedora:39 |
| 147 | + name: "FlexiBLAS (LP64, ILP64 on Fedora)" |
| 148 | + steps: |
| 149 | + - name: Install system dependencies |
| 150 | + run: | |
| 151 | + dnf install git gcc-gfortran g++ python3-devel flexiblas-devel -y |
| 152 | +
|
| 153 | + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 |
| 154 | + with: |
| 155 | + submodules: recursive |
| 156 | + fetch-depth: 0 |
| 157 | + |
| 158 | + - name: Install dependencies |
| 159 | + run: | |
| 160 | + pip install -r build_requirements.txt |
| 161 | + pip install pytest hypothesis typing_extensions |
| 162 | +
|
| 163 | + - name: Build |
| 164 | + run: spin build -- -Ddisable-optimization=true |
| 165 | + |
| 166 | + - name: Test |
| 167 | + run: spin test -- numpy/linalg |
| 168 | + |
| 169 | + - name: Build (ILP64) |
| 170 | + run: | |
| 171 | + rm -rf build |
| 172 | + spin build -- -Ddisable-optimization=true -Duse-ilp64=true |
| 173 | +
|
| 174 | + - name: Test (ILP64) |
| 175 | + run: spin test -- numpy/linalg |
| 176 | + |
| 177 | + |
| 178 | + openblas_cmake: |
| 179 | + if: "github.repository == 'numpy/numpy'" |
| 180 | + runs-on: ubuntu-latest |
| 181 | + name: "OpenBLAS with CMake" |
| 182 | + steps: |
| 183 | + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 |
| 184 | + with: |
| 185 | + submodules: recursive |
| 186 | + fetch-depth: 0 |
| 187 | + - uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0 |
| 188 | + with: |
| 189 | + python-version: '3.11' |
| 190 | + |
| 191 | + - name: Install dependencies |
| 192 | + run: | |
| 193 | + pip install -r build_requirements.txt |
| 194 | + pip install pytest pytest-xdist hypothesis typing_extensions |
| 195 | + sudo apt-get install libopenblas-dev cmake |
| 196 | + sudo apt-get remove pkg-config |
| 197 | +
|
| 198 | + - name: Build |
| 199 | + run: spin build -- -Ddisable-optimization=true |
| 200 | + |
| 201 | + - name: Test |
| 202 | + run: spin test -j auto -- numpy/linalg |
| 203 | + |
| 204 | + |
| 205 | + netlib: |
| 206 | + if: "github.repository == 'numpy/numpy'" |
| 207 | + runs-on: ubuntu-latest |
| 208 | + name: "Netlib BLAS/LAPACK" |
| 209 | + steps: |
| 210 | + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 |
| 211 | + with: |
| 212 | + submodules: recursive |
| 213 | + fetch-depth: 0 |
| 214 | + - uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0 |
| 215 | + with: |
| 216 | + python-version: '3.11' |
| 217 | + |
| 218 | + - name: Install dependencies |
| 219 | + run: | |
| 220 | + pip install -r build_requirements.txt |
| 221 | + sudo apt-get install liblapack-dev pkg-config |
| 222 | +
|
| 223 | + - name: Build |
| 224 | + run: | |
| 225 | + spin build -- -Ddisable-optimization=true |
| 226 | +
|
| 227 | + - name: Test |
| 228 | + run: | |
| 229 | + pip install pytest pytest-xdist hypothesis typing_extensions |
| 230 | + spin test -j auto -- numpy/linalg |
| 231 | +
|
| 232 | +
|
| 233 | + mkl: |
| 234 | + if: "github.repository == 'numpy/numpy'" |
| 235 | + runs-on: ubuntu-latest |
| 236 | + name: "MKL (LP64, ILP64, SDL)" |
| 237 | + steps: |
| 238 | + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 |
| 239 | + with: |
| 240 | + submodules: recursive |
| 241 | + fetch-depth: 0 |
| 242 | + - uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0 |
| 243 | + with: |
| 244 | + python-version: '3.11' |
| 245 | + |
| 246 | + - name: Install dependencies |
| 247 | + run: | |
| 248 | + pip install -r build_requirements.txt |
| 249 | + pip install pytest pytest-xdist hypothesis typing_extensions |
| 250 | + pip install mkl mkl-devel |
| 251 | +
|
| 252 | + - name: Repair MKL pkg-config files and symlinks |
| 253 | + run: | |
| 254 | + # MKL 2023.2 works when installed from conda-forge (except for `-iomp` |
| 255 | + # and `-tbb` pkg-config files), Spack, or with the standalone Intel |
| 256 | + # installer. The standalone installer is the worst option, since it's |
| 257 | + # large and clumsy to install and requires running a setvars.sh script |
| 258 | + # before things work. The PyPI MKL packages are broken and need the |
| 259 | + # fixes in this step. For details, see |
| 260 | + # https://github.com/conda-forge/intel_repack-feedstock/issues/34 |
| 261 | + cd $Python3_ROOT_DIR/lib/pkgconfig |
| 262 | + sed -i 's/\/intel64//g' mkl*.pc |
| 263 | + # add the expected .so -> .so.2 symlinks to fix linking |
| 264 | + cd .. |
| 265 | + for i in $( ls libmkl*.so.2 ); do ln -s $i ${i%.*}; done |
| 266 | +
|
| 267 | + - name: Build with defaults (LP64) |
| 268 | + run: | |
| 269 | + pkg-config --libs mkl-dynamic-lp64-seq # check link flags |
| 270 | + spin build -- -Ddisable-optimization=true |
| 271 | +
|
| 272 | + - name: Test |
| 273 | + run: spin test -- numpy/linalg |
| 274 | + |
| 275 | + - name: Build with ILP64 |
| 276 | + run: | |
| 277 | + git clean -xdf > /dev/null |
| 278 | + pkg-config --libs mkl-dynamic-ilp64-seq |
| 279 | + spin build -- -Duse-ilp64=true -Ddisable-optimization=true |
| 280 | +
|
| 281 | + - name: Test |
| 282 | + run: spin test -- numpy/linalg |
| 283 | + |
| 284 | + - name: Build without pkg-config (default options, SDL) |
| 285 | + run: | |
| 286 | + git clean -xdf > /dev/null |
| 287 | + pushd $Python3_ROOT_DIR/lib/pkgconfig |
| 288 | + rm mkl*.pc |
| 289 | + popd |
| 290 | + export MKLROOT=$Python3_ROOT_DIR |
| 291 | + spin build -- -Ddisable-optimization=true |
| 292 | +
|
| 293 | + - name: Test |
| 294 | + run: spin test -- numpy/linalg |
| 295 | + |
| 296 | + blis: |
| 297 | + if: "github.repository == 'numpy/numpy'" |
| 298 | + runs-on: ubuntu-latest |
| 299 | + name: "BLIS" |
| 300 | + steps: |
| 301 | + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 |
| 302 | + with: |
| 303 | + submodules: recursive |
| 304 | + fetch-depth: 0 |
| 305 | + - uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0 |
| 306 | + with: |
| 307 | + python-version: '3.11' |
| 308 | + |
| 309 | + - name: Install dependencies |
| 310 | + run: | |
| 311 | + pip install -r build_requirements.txt |
| 312 | + pip install pytest pytest-xdist hypothesis typing_extensions |
| 313 | + sudo apt-get install libblis-dev libopenblas-dev pkg-config |
| 314 | +
|
| 315 | + - name: Add BLIS pkg-config file |
| 316 | + run: | |
| 317 | + # Needed because blis.pc missing in Debian: |
| 318 | + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=989076 |
| 319 | + # The alternative here would be to use another distro or Miniforge |
| 320 | + sudo cp tools/ci/_blis_debian.pc /usr/lib/x86_64-linux-gnu/pkgconfig/blis.pc |
| 321 | + # Check if the patch works: |
| 322 | + pkg-config --libs blis |
| 323 | + pkg-config --cflags blis |
| 324 | +
|
| 325 | + - name: Build |
| 326 | + run: spin build -- -Dblas=blis -Ddisable-optimization=true |
| 327 | + |
| 328 | + - name: Test |
| 329 | + run: spin test -- numpy/linalg |
| 330 | + |
| 331 | + atlas: |
| 332 | + if: "github.repository == 'numpy/numpy'" |
| 333 | + runs-on: ubuntu-latest |
| 334 | + name: "ATLAS" |
| 335 | + steps: |
| 336 | + - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 |
| 337 | + with: |
| 338 | + submodules: recursive |
| 339 | + fetch-depth: 0 |
| 340 | + - uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0 |
| 341 | + with: |
| 342 | + python-version: '3.11' |
| 343 | + |
| 344 | + - name: Install dependencies |
| 345 | + run: | |
| 346 | + pip install -r build_requirements.txt |
| 347 | + pip install pytest pytest-xdist hypothesis typing_extensions |
| 348 | + sudo apt-get install libatlas-base-dev pkg-config |
| 349 | +
|
| 350 | + - name: Build |
| 351 | + run: spin build -- -Dblas=blas-atlas -Dlapack=lapack-atlas -Ddisable-optimization=true |
| 352 | + |
| 353 | + - name: Test |
| 354 | + run: spin test -- numpy/linalg |
| 355 | + |
0 commit comments