Skip to content

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

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

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

name: Build CUDA 12 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:
prereqs_ubuntu:
name: Build prereqs for ubuntu-22.04
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-cuda12-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/manylinux_2_28_x86_64:latest \
bash -c "
dnf -y install 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-cuda12-ubuntu-22.04
path: prereqs.tar.gz
retention-days: 1
prereqs_windows:
name: Build prereqs for windows-2022
runs-on: windows-2022
continue-on-error: true
steps:
- uses: actions/checkout@v4
name: Check out
- name: Compute cache key
id: cache-key
shell: bash
run: echo "key=prereqs-cuda12-windows-2022-${{ 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
shell: bash
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 }}
- uses: ilammy/msvc-dev-cmd@v1
if: steps.cache.outputs.cache-hit != 'true'
name: Add MSVS Path
- name: Build prereqs (Windows)
if: steps.cache.outputs.cache-hit != 'true'
run: ci-utils\install_prereq_win.bat
- 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-cuda12-windows-2022
path: prereqs.tar.gz
retention-days: 1
wheels_ubuntu:
name: Build wheels on ubuntu-22.04
runs-on: ubuntu-22.04
needs: prereqs_ubuntu
continue-on-error: true
strategy:
fail-fast: false
matrix:
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-cuda12-ubuntu-22.04
path: .
- name: Extract prereqs
run: tar -xzf prereqs.tar.gz
- name: Free disk space on Linux host
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
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: quay.io/pypa/manylinux_2_28_x86_64:latest
CIBW_BEFORE_ALL_LINUX: >
dnf -y install llvm libevent-devel openssl-devel &&
bash ci-utils/install_cuda_yum.sh 12 &&
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"
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >
auditwheel repair --exclude=libcufft.so --exclude=libcufft.so.11 --exclude=libcufft.so.11.0.12.1 --exclude=libcudart.so --exclude=libcudart.so.12 --exclude=libcudart.so.12.3.101 -w {dest_dir} {wheel}
CIBW_ARCHS: ${{ matrix.cibw_archs }}
CIBW_TEST_REQUIRES: numpy pandas pyarrow pytest bfio
CIBW_TEST_COMMAND: python -m pip check
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: nyxus-cuda12-wheels-ubuntu-22.04-${{ matrix.cibw_archs }}-${{ matrix.cibw_build }}
path: dist/*.whl
retention-days: 1
wheels_windows:
name: Build wheels on windows-2022
runs-on: windows-2022
needs: prereqs_windows
continue-on-error: true
strategy:
fail-fast: false
matrix:
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-cuda12-windows-2022
path: .
- name: Extract prereqs
run: tar -xzf prereqs.tar.gz
- uses: ilammy/msvc-dev-cmd@v1
name: Add MSVS Path
- name: Install CUDA
env:
cuda: "12.4.0"
visual_studio: "Visual Studio 17 2022"
shell: powershell
run: .\ci-utils\install_cuda_windows.ps1
- name: nvcc check
shell: powershell
run: |
nvcc -V
ls $env:CUDA_PATH
ls $env:CUDA_PATH\bin
ls $env:CUDA_PATH\include
- 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
run: |
python -m cibuildwheel --output-dir dist
env:
CIBW_BUILD: ${{ matrix.cibw_build }}-*
CIBW_SKIP: "*musllinux*"
CIBW_BUILD_VERBOSITY: 3
CIBW_BEFORE_ALL_WINDOWS: >
nvcc -V &&
xcopy /E /I /y local_install C:\TEMP\nyxus_bld\local_install
CIBW_ENVIRONMENT_WINDOWS: >
PATH="C:\\TEMP\\nyxus_bld\\local_install\\bin;$PATH"
NYXUS_DEP_DIR="C:\\TEMP\\nyxus_bld\\local_install"
CMAKE_ARGS="-DUSEGPU=ON"
NYXUS_GPU_WHEEL="ON"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >
delvewheel repair -w {dest_dir} {wheel} --no-dll cufft64_11.dll;cufftw64_11.dll;cudart32_120.dll;cudart64_120.dll
CIBW_ARCHS: ${{ matrix.cibw_archs }}
CIBW_TEST_REQUIRES: numpy pandas pyarrow pytest bfio
CIBW_BEFORE_TEST_WINDOWS: xcopy /E /I /y "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\bin" %SystemRoot%\System32
CIBW_TEST_COMMAND: python -m pip check
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: nyxus-cuda12-wheels-windows-2022-${{ matrix.cibw_archs }}-${{ matrix.cibw_build }}
path: dist/*.whl
retention-days: 1