Skip to content

Add feature maps (fmaps) mode for sliding-kernel feature extraction #470

Add feature maps (fmaps) mode for sliding-kernel feature extraction

Add feature maps (fmaps) mode for sliding-kernel feature extraction #470

name: Build CUDA 11 Wheels
on:
workflow_dispatch:
inputs:
force_prereqs:
description: 'Force rebuild prereqs (ignore cache)'
type: boolean
default: false
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions:
actions: write
contents: read
jobs:
build_prereqs:
name: Build prereqs for CUDA 11
runs-on: ubuntu-22.04
continue-on-error: true
steps:
- uses: actions/checkout@v4
name: Check out
- name: Compute cache key
id: cache-key
run: echo "key=prereqs-cuda11-ubuntu-22.04-${{ hashFiles('ci-utils/install_prereq_linux.sh', 'ci-utils/install_prereq_win.bat', 'ci-utils/validate_prereqs.sh') }}" >> "$GITHUB_OUTPUT"
- name: Delete prereq cache (force rebuild)
if: inputs.force_prereqs == true
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
run: |
gh actions-cache delete "${{ steps.cache-key.outputs.key }}" \
-R ${{ github.repository }} --confirm || true
- name: Restore cached prereqs
id: cache
uses: actions/cache/restore@v4
with:
path: prereqs.tar.gz
key: ${{ steps.cache-key.outputs.key }}
- name: Build prereqs (Linux)
if: steps.cache.outputs.cache-hit != 'true'
run: |
docker run --rm \
-v "${{ github.workspace }}:/work" \
-w /work \
quay.io/pypa/manylinux2014_x86_64:latest \
bash -c "
sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo &&
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo &&
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo &&
yum install -y llvm libevent-devel openssl-devel &&
bash ci-utils/install_prereq_linux.sh --build_arrow yes
"
- name: Validate prereqs
if: steps.cache.outputs.cache-hit != 'true'
shell: bash
run: bash ci-utils/validate_prereqs.sh
- name: Compress prereqs
if: steps.cache.outputs.cache-hit != 'true'
run: tar -czf prereqs.tar.gz local_install
- name: Save prereqs cache
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: prereqs.tar.gz
key: ${{ steps.cache-key.outputs.key }}
- name: Upload prereqs
uses: actions/upload-artifact@v4
with:
name: prereqs-cuda11-ubuntu-22.04
path: prereqs.tar.gz
retention-days: 1
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: build_prereqs
continue-on-error: true
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
cibw_archs: ["auto64"]
cibw_build: ["cp310", "cp311", "cp312", "cp313"]
steps:
- uses: actions/checkout@v4
name: Check out
with:
submodules: recursive
- name: Download prereqs
uses: actions/download-artifact@v4
with:
name: prereqs-cuda11-ubuntu-22.04
path: .
- name: Extract prereqs
run: tar -xzf prereqs.tar.gz
- name: Free disk space on Linux host
if: runner.os == 'Linux'
uses: jlumbroso/free-disk-space@main
with:
large-packages: true
docker-images: false
swap-storage: true
tool-cache: false
- name: Prune Docker (pre-build)
run: |
docker system prune -af || true
docker builder prune -af || true
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.11'
- name: Install cibuildwheel
run: |
python -m pip install --upgrade pip
python -m pip install cibuildwheel==3.0.0 delvewheel wheel
- name: Building wheels on Linux
run: |
python -m cibuildwheel --output-dir dist
env:
CIBW_BUILD: ${{ matrix.cibw_build }}-*
CIBW_SKIP: "*musllinux*"
CIBW_BUILD_VERBOSITY: 3
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_BEFORE_ALL_LINUX: sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo &&
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo &&
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo &&
yum install -y llvm libevent-devel openssl-devel &&
bash ci-utils/install_cuda_yum.sh 11 &&
mkdir -p /tmp/nyxus_bld &&
cp -a local_install /tmp/nyxus_bld
CIBW_ENVIRONMENT_LINUX: LD_LIBRARY_PATH="/tmp/nyxus_bld/local_install/lib:/tmp/nyxus_bld/local_install/lib64:/usr/local/cuda/targets/x86_64-linux/lib:$LD_LIBRARY_PATH" CPATH="/usr/local/cuda/targets/x86_64-linux/include:$CPATH" PATH="/usr/local/cuda/bin:$PATH" NYXUS_DEP_DIR="/tmp/nyxus_bld/local_install" CXXFLAGS="-I /usr/local/cuda/include" CMAKE_ARGS="-DUSEGPU=ON -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc -DCMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES=/usr/local/cuda/include" NYXUS_GPU_WHEEL="ON" PIP_ONLY_BINARY=":all:"
CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel repair --exclude=libcufft.so --exclude=libcufft.so.10 --exclude=libcufft.so.10.4.2.109 --exclude=libcudart.so --exclude=libcudart.so.11.0 --exclude=libcudart.so.11.3.109 -w {dest_dir} {wheel}"
CIBW_ARCHS: ${{ matrix.cibw_archs }}
CIBW_TEST_REQUIRES: numpy pandas pyarrow pytest bfio
CIBW_TEST_REQUIRES_LINUX: pandas pyarrow pytest bfio
CIBW_TEST_COMMAND: python -m pip check
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: nyxus-cuda11-wheels-${{ matrix.os }}-${{ matrix.cibw_archs }}-${{ matrix.cibw_build }}
path: dist/*.whl
retention-days: 1