Skip to content
Merged
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
77 changes: 49 additions & 28 deletions .github/workflows/buildcupy.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PyLops Testing (CuPy)
name: PyLops Testing with CuPy

on:
pull_request:
Expand All @@ -10,7 +10,9 @@ on:

jobs:
build:
runs-on: self-hosted
runs-on:
- self-hosted
- exouser
steps:
- name: Check out source repository
uses: actions/checkout@v6
Expand All @@ -22,35 +24,54 @@ jobs:
python-version: 3.11
- name: Install dependencies and pylops
run: |
srun --account=yuxilab -n 1 -N 1 --gres=gpu:L40S:1 bash -c '
uv sync --locked --extra advanced \
--extra stat --extra gpu-cu12 \
--extra deep-cu128 --all-groups
'
uv sync --extra advanced \
--extra stat --extra gpu-cu12 \
--group dev
uv pip install \
--default-index https://download.pytorch.org/whl/cu128 \
torch==2.11.0+cu128
uv pip install \
nvidia-cuda-nvcc-cu12==12.2.128 \
nvidia-cuda-nvrtc-cu12==12.8.93 \
nvidia-cuda-runtime-cu12==12.8.90
echo "done!"
- name: Install CUDA 12.8 toolkit

- name: Configure CUDA NVVM from uv wheels
run: |
srun --account=yuxilab -n 1 -N 1 --gres=gpu:L40S:1 bash -c '
# Currently, the NVIDIA GPU drivers on the self-hosted runner
# and the CUDA installation in CUDA_HOME require different PTX versions
# (8.7 and 8.8, respectively). CUDA and NVCC are temporarely
# installed in the uv environment, and the CUDA paths are set in
# the test command, to work around this issue.
uv add nvidia-cuda-nvcc-cu12==12.8.*
# Numba resolves libNVVM via CUDA_HOME and needs a versioned
# libnvvm.so.N (the pip wheel only ships a bare libnvvm.so), so
# add the symlink once here against the wheel-provided toolkit.
ln -sf libnvvm.so .venv/lib/python3.11/site-packages/nvidia/cuda_nvcc/nvvm/lib64/libnvvm.so.4
'
CUDA_HOME="$PWD/.venv/lib/python3.11/site-packages/nvidia/cuda_nvcc"
CUDA_RUNTIME_ROOT="$PWD/.venv/lib/python3.11/site-packages/nvidia/cuda_runtime"
CUDA_NVRTC_ROOT="$PWD/.venv/lib/python3.11/site-packages/nvidia/cuda_nvrtc"

if [ ! -f "$CUDA_HOME/nvvm/lib64/libnvvm.so" ]; then
echo "libnvvm.so not found in $CUDA_HOME/nvvm/lib64"
exit 1
fi
if [ ! -f "$CUDA_RUNTIME_ROOT/lib/libcudart.so.12" ]; then
echo "libcudart.so.12 not found in $CUDA_RUNTIME_ROOT/lib"
exit 1
fi
if [ ! -f "$CUDA_NVRTC_ROOT/lib/libnvrtc.so.12" ]; then
echo "libnvrtc.so.12 not found in $CUDA_NVRTC_ROOT/lib"
exit 1
fi

mkdir -p "$CUDA_HOME/lib64"
ln -sf "$CUDA_HOME/nvvm/lib64/libnvvm.so" "$CUDA_HOME/nvvm/lib64/libnvvm.so.4"
ln -sf "$CUDA_HOME/nvvm/lib64/libnvvm.so" "$CUDA_HOME/lib64/libnvvm.so"
ln -sf "$CUDA_RUNTIME_ROOT/lib/libcudart.so.12" "$CUDA_HOME/lib64/libcudart.so.12"
ln -sf "$CUDA_RUNTIME_ROOT/lib/libcudart.so.12" "$CUDA_HOME/lib64/libcudart.so"
ln -sf "$CUDA_NVRTC_ROOT/lib/libnvrtc.so.12" "$CUDA_HOME/lib64/libnvrtc.so.12"
ln -sf "$CUDA_HOME/lib64/libnvrtc.so.12" "$CUDA_HOME/lib64/libnvrtc.so"

echo "CUDA_HOME=$CUDA_HOME" >> "$GITHUB_ENV"
echo "CUDA_NVVM_LIB=$CUDA_HOME/nvvm/lib64" >> "$GITHUB_ENV"
echo "done!"
- name: Test with pytest
run: |
srun --account=yuxilab -n 1 -N 1 --gres=gpu:L40S:1 bash -c '
# Use the pip-installed CUDA 12.8 toolkit (matches the 12.8 driver),
# not any system CUDA on the runner, so numba emits PTX <= 8.7.
export CUDA_HOME="$PWD/.venv/lib/python3.11/site-packages/nvidia/cuda_nvcc"
export CUPY_PYLOPS=1
export TEST_CUPY_PYLOPS=1
uv run pytest --color=yes pytests/
'
export CUDA_HOME="${CUDA_HOME:-$PWD/.venv/lib/python3.11/site-packages/nvidia/cuda_nvcc}"
export CUPY_PYLOPS=1
export TEST_CUPY_PYLOPS=1
export LD_LIBRARY_PATH="$CUDA_HOME/lib64:$CUDA_NVVM_LIB:$LD_LIBRARY_PATH"
export NUMBA_CUDA_NVVM="$CUDA_NVVM_LIB/libnvvm.so"
uv run --no-sync pytest --color=yes pytests/
echo "done!"
58 changes: 58 additions & 0 deletions .github/workflows/buildcupy1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: PyLops Testing (CuPy)

on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main
- dev

jobs:
build:
runs-on:
- self-hosted
- uni
steps:
- name: Check out source repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install uv with Python 3.11
uses: astral-sh/setup-uv@v6
with:
python-version: 3.11
- name: Install dependencies and pylops
run: |
srun --account=yuxilab -n 1 -N 1 --gres=gpu:L40S:1 bash -c '
uv sync --locked --extra advanced \
--extra stat --extra gpu-cu12 \
--extra deep-cu128 --all-groups
'
echo "done!"
- name: Install CUDA 12.8 toolkit
run: |
srun --account=yuxilab -n 1 -N 1 --gres=gpu:L40S:1 bash -c '
# Currently, the NVIDIA GPU drivers on the self-hosted runner
# and the CUDA installation in CUDA_HOME require different PTX versions
# (8.7 and 8.8, respectively). CUDA and NVCC are temporarely
# installed in the uv environment, and the CUDA paths are set in
# the test command, to work around this issue.
uv add nvidia-cuda-nvcc-cu12==12.8.*
# Numba resolves libNVVM via CUDA_HOME and needs a versioned
# libnvvm.so.N (the pip wheel only ships a bare libnvvm.so), so
# add the symlink once here against the wheel-provided toolkit.
ln -sf libnvvm.so .venv/lib/python3.11/site-packages/nvidia/cuda_nvcc/nvvm/lib64/libnvvm.so.4
'
echo "done!"
- name: Test with pytest
run: |
srun --account=yuxilab -n 1 -N 1 --gres=gpu:L40S:1 bash -c '
# Use the pip-installed CUDA 12.8 toolkit (matches the 12.8 driver),
# not any system CUDA on the runner, so numba emits PTX <= 8.7.
export CUDA_HOME="$PWD/.venv/lib/python3.11/site-packages/nvidia/cuda_nvcc"
export CUPY_PYLOPS=1
export TEST_CUPY_PYLOPS=1
uv run pytest --color=yes pytests/
'
echo "done!"
Loading