Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use DYNAMIC_LIST to limit the number of kernels compiled into the wheel #166

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 32 additions & 22 deletions .github/workflows/posix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ env:
REPO_DIR: OpenBLAS
OPENBLAS_COMMIT: "d11e7340"
MACOSX_DEPLOYMENT_TARGET: 10.9
MB_PYTHON_VERSION: 3.11

jobs:
build:
Expand Down Expand Up @@ -46,24 +47,35 @@ jobs:
MB_ML_LIBC: musllinux
MB_ML_VER: _1_1

# - os: ubuntu-latest
# PLAT: aarch64
# INTERFACE64: '0'
# MB_ML_VER: '2014'
# - os: ubuntu-latest
# PLAT: aarch64
# INTERFACE64: '1'
# MB_ML_VER: '2014'
# - os: ubuntu-latest
# PLAT: aarch64
# INTERFACE64: '0'
# MB_ML_LIBC: musllinux
# MB_ML_VER: _1_1
# - os: ubuntu-latest
# PLAT: aarch64
# INTERFACE64: '1'
# MB_ML_LIBC: musllinux
# MB_ML_VER: _1_1
# Move these 6 builds to a faster option
- os: ubuntu-latest
PLAT: aarch64
INTERFACE64: '0'
MB_ML_VER: '2014'
- os: ubuntu-latest
PLAT: aarch64
INTERFACE64: '1'
MB_ML_VER: '2014'
- os: ubuntu-latest
PLAT: aarch64
INTERFACE64: '0'
MB_ML_LIBC: musllinux
MB_ML_VER: _1_1
- os: ubuntu-latest
PLAT: aarch64
INTERFACE64: '1'
MB_ML_LIBC: musllinux
MB_ML_VER: _1_1
- os: ubuntu-latest
PLAT: aarch64
INTERFACE64: '0'
MB_ML_LIBC: musllinux
MB_ML_VER: _1_2
- os: ubuntu-latest
PLAT: aarch64
INTERFACE64: '1'
MB_ML_LIBC: musllinux
MB_ML_VER: _1_2

exclude:
- PLAT: i686
Expand All @@ -72,8 +84,6 @@ jobs:
INTERFACE64: '1'
env:
NIGHTLY: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
MB_PYTHON_VERSION: ${{ matrix.python-version }}
TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }}
MB_ML_LIBC: ${{ matrix.MB_ML_LIBC }}
MB_ML_VER: ${{ matrix.MB_ML_VER }}
INTERFACE64: ${{ matrix.INTERFACE64 }}
Expand Down Expand Up @@ -158,12 +168,12 @@ jobs:

- uses: actions/upload-artifact@v4.3.0
with:
name: wheels-${{ matrix.os }}-${{ matrix.PLAT }}-${{ matrix.INTERFACE64 }}-${{ matrix.MB_ML_LIBC }}
name: wheels-${{ matrix.os }}-${{ matrix.PLAT }}-${{ matrix.INTERFACE64 }}-${{ matrix.MB_ML_LIBC }}-${{ matrix.MB_ML_VER }}
path: dist/scipy_openblas*.whl

- uses: actions/upload-artifact@v4.3.0
with:
name: openblas-${{ matrix.os }}-${{ matrix.PLAT }}-${{ matrix.INTERFACE64 }}-${{ matrix.MB_ML_LIBC }}
name: openblas-${{ matrix.os }}-${{ matrix.PLAT }}-${{ matrix.INTERFACE64 }}-${{ matrix.MB_ML_LIBC }}-${{ matrix.MB_ML_VER }}
path: libs/openblas*.tar.gz

- uses: conda-incubator/setup-miniconda@v3.0.4
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "scipy-openblas64"
# v0.3.27-350-gd11e7340
version = "0.3.27.350.0"
version = "0.3.27.350.1"
requires-python = ">=3.7"
description = "Provides OpenBLAS for python packaging"
readme = "README.md"
Expand Down
5 changes: 4 additions & 1 deletion tools/build_openblas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,14 @@ if [ "$build_bits" == 64 ]; then
extra="-fno-asynchronous-unwind-tables"
vc_arch="X64"
plat_tag="win_amd64"
dynamic_list="PRESCOTT NEHALEM SANDYBRIDGE HASWELL SKYLAKEX"
else
march=pentium4
extra="-mfpmath=sse -msse2"
fextra="-m32"
vc_arch="i386"
plat_tag="win32"
dynamic_list="PRESCOTT NEHALEM SANDYBRIDGE HASWELL"
fi
cflags="-O2 -march=$march -mtune=generic $extra"
fflags="$fextra $cflags -frecursive -ffpe-summary=invalid,zero"
Expand All @@ -94,7 +96,8 @@ OPENBLAS_VERSION=$(git describe --tags --abbrev=8)
# Variable used in creating output libraries
make BINARY=$build_bits DYNAMIC_ARCH=1 USE_THREAD=1 USE_OPENMP=0 \
NUM_THREADS=24 NO_WARMUP=1 NO_AFFINITY=1 CONSISTENT_FPCSR=1 \
BUILD_LAPACK_DEPRECATED=1 TARGET=PRESCOTT BUFFERSIZE=20\
BUILD_LAPACK_DEPRECATED=1 TARGET=PRESCOTT BUFFERSIZE=20 \
DYNAMIC_LIST="$dynamic_list" \
LDFLAGS="$LDFLAGS" \
COMMON_OPT="$cflags" \
FCOMMON_OPT="$fflags" \
Expand Down
36 changes: 22 additions & 14 deletions tools/build_steps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,32 +124,42 @@ function do_build_lib {
case $(get_os)-$plat in
Linux-x86_64)
local bitness=64
local target_flags="TARGET=PRESCOTT"
local target=PRESCOTT
local dynamic_list="PRESCOTT NEHALEM SANDYBRIDGE HASWELL SKYLAKEX"
;;
Darwin-x86_64)
local bitness=64
local target_flags="TARGET=CORE2"
local target=CORE2
local dynamic_list="CORE2 NEHALEM SANDYBRIDGE HASWELL SKYLAKEX"
# Pick up the gfortran runtime libraries
export DYLD_LIBRARY_PATH=/usr/local/lib:$DYLD_LIBRARY_PATH
;;
*-i686)
local bitness=32
local target_flags="TARGET=PRESCOTT"
local target=PRESCOTT
local dynamic_list="PRESCOTT NEHALEM SANDYBRIDGE HASWELL"
;;
Linux-aarch64)
local bitness=64
local target_flags="TARGET=ARMV8"
local target=ARMV8
# temporarily limit the kernels for aarch64 until there is data
# see https://github.com/MacPython/openblas-libs/issues/170
if [ "$MB_ML_LIBC" == "musllinux" -a "$MB_ML_VER" == "_1_1" ]; then
local dynamic_list="ARMV8 CORTEXA57 THUNDERX"
else
local dynamic_list="ARMV8 CORTEXA57 NEOVERSEV1 THUNDERX"
fi
;;
Darwin-arm64)
local bitness=64
local target_flags="TARGET=VORTEX"
local target=VORTEX
;;
*-s390x)
local bitness=64
;;
*-ppc64le)
local bitness=64
local target_flags="TARGET=POWER8"
local target=POWER8
;;
*) echo "Strange plat value $plat"; exit 1 ;;
esac
Expand All @@ -172,23 +182,21 @@ function do_build_lib {
git config --global --add safe.directory '*'
pushd OpenBLAS
patch_source
echo start building
if [ -v dynamic_list ]; then
CFLAGS="$CFLAGS -fvisibility=protected -Wno-uninitialized" \
make BUFFERSIZE=20 DYNAMIC_ARCH=1 \
make BUFFERSIZE=20 DYNAMIC_ARCH=1 QUIET_MAKE=1 \
USE_OPENMP=0 NUM_THREADS=64 \
DYNAMIC_LIST="$dynamic_list" \
BINARY=$bitness $interface_flags $target_flags shared 2>&1 1>/dev/null
BINARY=$bitness $interface_flags TARGET="$target"
else
CFLAGS="$CFLAGS -fvisibility=protected -Wno-uninitialized" \
make BUFFERSIZE=20 DYNAMIC_ARCH=1 \
USE_OPENMP=0 NUM_THREADS=64 \
BINARY=$bitness $interface_flags $target_flags shared 2>&1 1>/dev/null
BINARY=$bitness $interface_flags TARGET="$target" shared 2>&1 1>/dev/null
make BUFFERSIZE=20 DYNAMIC_ARCH=1 \
USE_OPENMP=0 NUM_THREADS=64 \
BINARY=$bitness $interface_flags TARGET="$target" tests
fi
echo done building, now testing
make BUFFERSIZE=20 DYNAMIC_ARCH=1 \
USE_OPENMP=0 NUM_THREADS=64 \
BINARY=$bitness $interface_flags $target_flags tests
make PREFIX=$BUILD_PREFIX $interface_flags install
popd
if [ "$nightly" = "1" ]; then
Expand Down
Loading