Skip to content

Merge branch 'dev' into dev-gpu-v2 #2

Merge branch 'dev' into dev-gpu-v2

Merge branch 'dev' into dev-gpu-v2 #2

Workflow file for this run

name: CI
on:
push:
branches: [dev, dev-gpu-v2]
pull_request:
branches: [dev, dev-gpu-v2]
# These three jobs are required checks on `dev-gpu-v2`. They guard the
# platform-support contract documented in
# context/GPU_INTEGRATION.md and src/libactionet/context/GPU_BACKEND_PLAN.md.
#
# - macos-cpu : regression guard. Every commit on dev-gpu-v2 must
# keep this green; macOS will never have GPU support
# and any accidental unconditional CUDA include or
# link surfaces here first.
# - linux-cpu : same code path as macOS but on Linux; full test
# suite to catch any non-GPU regressions.
# - linux-gpu-smoke: ensures LIBACTIONET_ENABLE_NVIDIA_GPU=ON still
# builds against the CUDA 12.2 stub libs. No test
# execution (no real GPU on hosted runners); the
# goal is to catch include-path / link / API-surface
# regressions against the 12.2 floor.
#
# WSL2 manual tests are NOT in this matrix; they are documented as a
# pre-push checklist in src/libactionet/context/GPU_BACKEND_PLAN.md.
jobs:
macos-cpu:
name: macOS CPU-only (regression guard)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install build prerequisites
run: |
brew install cmake hdf5 libomp
- name: Build (CPU only, GPU off)
env:
LIBACTIONET_ENABLE_NVIDIA_GPU: "OFF"
run: |
python -m pip install --upgrade pip
pip install --no-build-isolation -e .[dev] || pip install --no-build-isolation -e .
- name: Smoke test (import)
run: |
python -c "import actionet; print(actionet.__version__)"
- name: Run policy tests (no GPU available)
run: |
pip install pytest
pytest tests/test_gpu_backend_policy.py -m "not gpu" -v
linux-cpu:
name: Linux CPU-only
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install build prerequisites
run: |
sudo apt-get update
sudo apt-get install -y cmake libhdf5-dev libomp-dev libopenblas-dev liblapack-dev
- name: Build (CPU only, GPU off)
env:
LIBACTIONET_ENABLE_NVIDIA_GPU: "OFF"
run: |
python -m pip install --upgrade pip
pip install --no-build-isolation -e .
- name: Smoke test (import)
run: |
python -c "import actionet; print(actionet.__version__)"
- name: Run policy tests (no GPU available)
run: |
pip install pytest
pytest tests/test_gpu_backend_policy.py -m "not gpu" -v
linux-gpu-smoke:
name: Linux GPU smoke-build (CUDA 12.2 stubs, no run)
runs-on: ubuntu-latest
# Only required on dev-gpu-v2 and PRs targeting it. The dev branch
# CPU-only build is already covered by linux-cpu above; rebuilding
# against the CUDA stubs there would just slow CI down.
if: github.ref == 'refs/heads/dev-gpu-v2' || github.base_ref == 'dev-gpu-v2'
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install build prerequisites
run: |
sudo apt-get update
sudo apt-get install -y cmake libhdf5-dev libomp-dev libopenblas-dev liblapack-dev
- name: Install CUDA 12.2 toolkit (stubs)
uses: Jimver/cuda-toolkit@v0.2.18
with:
cuda: "12.2.2"
method: network
# Subset chosen to minimize installer size; we only need
# headers and the stub static / shared libs to satisfy the
# CMake link step. No nvcc-compiled .cu files yet in v1.
sub-packages: '["nvcc","cudart","cublas","cusolver","thrust"]'
- name: Build (GPU on, link-only)
env:
LIBACTIONET_ENABLE_NVIDIA_GPU: "ON"
CUDAToolkit_ROOT: ${{ steps.cuda-toolkit.outputs.CUDA_PATH }}
CMAKE_CUDA_COMPILER: ${{ steps.cuda-toolkit.outputs.CUDA_PATH }}/bin/nvcc
run: |
python -m pip install --upgrade pip
pip install --no-build-isolation -e . -v
- name: Smoke test (import; no kernel launch)
run: |
python -c "import actionet; from actionet import _core; print('compiled=', _core.is_nvidia_gpu_backend_compiled())"