Skip to content

ci: gate PRs on Actions and bridge to Blossom #1

ci: gate PRs on Actions and bridge to Blossom

ci: gate PRs on Actions and bridge to Blossom #1

Workflow file for this run

# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Builds the wheel, which needs no GPU and no driver. `cpp/CMakeLists.txt`
# declares `LANGUAGES CXX ASM`, so nvcc compiles nothing here — the kernels are
# precompiled CUBINs assembled in as `.incbin` shards, and the only CUDA
# dependency is `CUDA::cuda_driver`, resolved against the libcuda stub the
# toolkit ships. Nothing links PyTorch.
name: Wheel
on:
pull_request:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
wheel:
name: wheel
runs-on: ubuntu-latest
steps:
# `lfs: true` would pull every LFS object in the repo — measured at
# 88.2 MB, of which the 36 CUBIN packs are 2.5 MB. The build reads only
# the packs, so fetch only those.
- uses: actions/checkout@v7
with:
lfs: false
- name: Fetch the CUBIN packs
run: |
git lfs pull --include="cpp/kernels/cutedsl_*/cubins/packs/*.tar.xz"
git lfs ls-files -I "cpp/kernels/cutedsl_*/cubins/packs/*.tar.xz" | wc -l
- uses: actions/setup-python@v7
with:
python-version: '3.12'
# Headers and the libcuda stub, nothing more. `setup.py` reads the
# toolkit version for the wheel's `+cuXYZ` local version segment, so nvcc
# has to be on PATH rather than just the headers being present.
- uses: Jimver/cuda-toolkit@v0.2.36
with:
cuda: '13.2.0'
method: network
sub-packages: '["nvcc", "cudart"]'
- name: Build the wheel
run: |
pip install --upgrade build
python -m build --wheel
ls -l dist/
# The extension links the driver stub at build time, but at import time
# it wants a real `libcuda.so.1`, which a runner with no GPU has not got.
# The repo's own CPU harness solves this by pointing the loader at the
# toolkit's stub; do the same, so this actually proves the module loads
# rather than only that it compiled.
- name: Import the extension against the driver stub
run: |
pip install --no-deps dist/*.whl
mkdir -p /tmp/cudastub
ln -sf "${CUDA_PATH}/lib64/stubs/libcuda.so" /tmp/cudastub/libcuda.so.1
LD_LIBRARY_PATH="/tmp/cudastub:${LD_LIBRARY_PATH:-}" \
python -c "import bionemo_ir.libs._cutedsl_kernels as k; print('loaded', k.__file__)"
- uses: actions/upload-artifact@v4
with:
name: wheel-${{ github.sha }}
path: dist/*.whl
if-no-files-found: error