Skip to content

Commit

Permalink
KvikIO: Build CUDA 12 packages (#224)
Browse files Browse the repository at this point in the history
This PR builds `libkvikio` and `kvikio` conda packages using CUDA 12. Resolves #175

Authors:
  - Bradley Dice (https://github.com/bdice)
  - Vyas Ramasubramani (https://github.com/vyasr)
  - Mads R. B. Kristensen (https://github.com/madsbk)

Approvers:
  - Ray Douglass (https://github.com/raydouglass)
  - Vyas Ramasubramani (https://github.com/vyasr)
  - https://github.com/jakirkham

URL: #224
  • Loading branch information
bdice authored Jun 22, 2023
1 parent 56d48ef commit 84f8556
Show file tree
Hide file tree
Showing 13 changed files with 163 additions and 35 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ concurrency:
jobs:
cpp-build:
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-build.yaml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-build.yaml@cuda-120
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
Expand All @@ -37,7 +37,7 @@ jobs:
python-build:
needs: [cpp-build]
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-build.yaml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-build.yaml@cuda-120
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
Expand All @@ -46,7 +46,7 @@ jobs:
upload-conda:
needs: [cpp-build, python-build]
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/conda-upload-packages.yaml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/conda-upload-packages.yaml@cuda-120
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
Expand All @@ -56,7 +56,7 @@ jobs:
if: github.ref_type == 'branch'
needs: python-build
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/custom-job.yaml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/custom-job.yaml@cuda-120
with:
arch: "amd64"
branch: ${{ inputs.branch }}
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,38 @@ jobs:
- conda-python-tests
- docs-build
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/pr-builder.yaml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/pr-builder.yaml@cuda-120
checks:
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/checks.yaml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/checks.yaml@cuda-120
conda-cpp-build:
needs: checks
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-build.yaml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-build.yaml@cuda-120
with:
build_type: pull-request
conda-cpp-tests:
needs: conda-cpp-build
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-tests.yaml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-tests.yaml@cuda-120
with:
build_type: pull-request
conda-python-build:
needs: conda-cpp-build
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-build.yaml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-build.yaml@cuda-120
with:
build_type: pull-request
conda-python-tests:
needs: conda-python-build
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-tests.yaml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-tests.yaml@cuda-120
with:
build_type: pull-request
docs-build:
needs: conda-python-build
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/custom-job.yaml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/custom-job.yaml@cuda-120
with:
build_type: pull-request
node_type: "gpu-v100-latest-1"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ on:
jobs:
cpp-tests:
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-tests.yaml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-tests.yaml@cuda-120
with:
build_type: nightly
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
python-tests:
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-tests.yaml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-tests.yaml@cuda-120
with:
build_type: nightly
branch: ${{ inputs.branch }}
Expand Down
3 changes: 2 additions & 1 deletion conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ channels:
dependencies:
- c-compiler
- cmake>=3.26.4
- cuda-python>=11.7.1,<12.0
- cuda-python>=11.7.1,<12.0a0
- cudatoolkit=11.8
- cudf==23.8.*
- cupy>=12.0.0
Expand All @@ -22,6 +22,7 @@ dependencies:
- libcufile=1.4.0.31
- ninja
- numpy>=1.21
- nvcc_linux-64=11.8
- packaging
- pre-commit
- pydata-sphinx-theme
Expand Down
36 changes: 36 additions & 0 deletions conda/environments/all_cuda-120_arch-x86_64.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This file is generated by `rapids-dependency-file-generator`.
# To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.
channels:
- rapidsai
- rapidsai-nightly
- conda-forge
- nvidia
dependencies:
- c-compiler
- cmake>=3.26.4
- cuda-nvcc
- cuda-python>=12.0,<13.0a0
- cuda-version=12.0
- cudf==23.8.*
- cupy>=12.0.0
- cxx-compiler
- cython>=0.29,<0.30
- dask>=2022.05.2
- distributed>=2022.05.2
- doxygen=1.8.20
- gcc_linux-64=11.*
- libcufile
- libcufile-dev
- ninja
- numpy>=1.21
- packaging
- pre-commit
- pydata-sphinx-theme
- pytest
- pytest-cov
- python>=3.9,<3.11
- scikit-build>=0.13.1
- sphinx<6
- sysroot_linux-64=2.17
- zarr
name: all_cuda-120_arch-x86_64
3 changes: 3 additions & 0 deletions conda/recipes/kvikio/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ cxx_compiler_version:
- 11

cuda_compiler:
- cuda-nvcc

cuda11_compiler:
- nvcc

sysroot_version:
Expand Down
21 changes: 17 additions & 4 deletions conda/recipes/kvikio/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,31 +36,44 @@ build:
- cd python
- python -m pip install . -vv
ignore_run_exports_from:
- {{ compiler('cuda') }}
{% if cuda_major == "11" %}
- {{ compiler('cuda11') }}
{% endif %}

requirements:
build:
- cmake {{ cmake_version }}
- ninja
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- {{ compiler('cuda') }} {{ cuda_version }}
- cuda-version ={{ cuda_version }}
{% if cuda_major == "11" %}
- {{ compiler('cuda11') }} ={{ cuda_version }}
{% else %}
- {{ compiler('cuda') }}
{% endif %}
- sysroot_{{ target_platform }} {{ sysroot_version }}
host:
- python
- setuptools
- pip
- cython >=0.29,<0.30
- cudatoolkit {{ cuda_version }}.*
{% if cuda_major == "11" %}
- cudatoolkit ={{ cuda_version }}
{% endif %}
- cuda-version ={{ cuda_version }}
- scikit-build >=0.13.1
- libkvikio {{ version }}
- libkvikio ={{ version }}
run:
- python
- numpy >=1.20
- cupy >=12.0.0
- zarr
- packaging
- {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
{% if cuda_major == "11" %}
- {{ pin_compatible('cudatoolkit', max_pin='x', min_pin='x') }}
{% endif %}

test:
requires:
Expand Down
13 changes: 8 additions & 5 deletions conda/recipes/libkvikio/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@ cmake_version:
- ">=3.26.4"

cuda_compiler:
- cuda-nvcc

cuda11_compiler:
- nvcc

sysroot_version:
- "2.17"

# The CTK libraries below are missing from the conda-forge::cudatoolkit
# package. The "*_host_*" version specifiers correspond to `11.8` packages and the
# "*_run_*" version specifiers correspond to `11.x` packages.
# The CTK libraries below are missing from the conda-forge::cudatoolkit package
# for CUDA 11. The "*_host_*" version specifiers correspond to `11.8` packages
# and the "*_run_*" version specifiers correspond to `11.x` packages.

libcufile_host_version:
cuda11_libcufile_host_version:
- "1.4.0.31"

libcufile_run_version:
cuda11_libcufile_run_version:
- ">=1.0.0.82,<=1.4.0.31"
50 changes: 42 additions & 8 deletions conda/recipes/libkvikio/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,23 @@ requirements:
- cmake {{ cmake_version }}
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- {{ compiler('cuda') }} {{ cuda_version }}
- cuda-version ={{ cuda_version }}
{% if cuda_major == "11" %}
- {{ compiler('cuda11') }} ={{ cuda_version }}
{% else %}
- {{ compiler('cuda') }}
{% endif %}
- ninja
- sysroot_{{ target_platform }} {{ sysroot_version }}
host:
- cudatoolkit {{ cuda_version }}.*
- libcufile {{ libcufile_host_version }} # [linux64]
- libcufile-dev {{ libcufile_host_version }} # [linux64]
- cuda-version ={{ cuda_version }}
{% if cuda_major == "11" %}
- cudatoolkit ={{ cuda_version }}
- libcufile {{ cuda11_libcufile_host_version }} # [linux64]
- libcufile-dev {{ cuda11_libcufile_host_version }} # [linux64]
{% else %}
- libcufile-dev # [linux64]
{% endif %}

outputs:
- name: libkvikio
Expand All @@ -53,13 +63,22 @@ outputs:
string: cuda{{ cuda_major }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
run_exports:
- {{ pin_subpackage("libkvikio", max_pin="x.x") }}
ignore_run_exports_from:
{% if cuda_major == "11" %}
- {{ compiler('cuda11') }}
{% endif %}
requirements:
build:
- cmake {{ cmake_version }}
run:
- cuda-version {{ cuda_spec }}
{% if cuda_major == "11" %}
- cudatoolkit {{ cuda_spec }}
- libcufile {{ libcufile_run_version }} # [linux64]
- libcufile-dev {{ libcufile_run_version }} # [linux64]
- libcufile {{ cuda11_libcufile_run_version }} # [linux64]
- libcufile-dev {{ cuda11_libcufile_run_version }} # [linux64]
{% else %}
- libcufile-dev # [linux64]
{% endif %}
test:
commands:
- test -f $PREFIX/include/kvikio/file_handle.hpp
Expand All @@ -75,13 +94,28 @@ outputs:
build:
number: {{ GIT_DESCRIBE_NUMBER }}
string: cuda{{ cuda_major }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
ignore_run_exports_from:
{% if cuda_major == "11" %}
- {{ compiler('cuda11') }}
{% endif %}
requirements:
build:
- cmake {{ cmake_version }}
host:
- cuda-version ={{ cuda_version }}
{% if cuda_major == "11" %}
- cudatoolkit ={{ cuda_version }}
- libcufile {{ cuda11_libcufile_run_version }} # [linux64]
{% else %}
- cuda-cudart-dev
- libcufile-dev # [linux64]
{% endif %}
run:
- cuda-version {{ cuda_spec }}
{% if cuda_major == "11" %}
- cudatoolkit {{ cuda_spec }}
- libcufile {{ libcufile_run_version }} # [linux64]
- libcufile-dev {{ libcufile_run_version }} # [linux64]
- libcufile {{ cuda11_libcufile_run_version }} # [linux64]
{% endif %}
about:
home: https://rapids.ai
license: Apache-2.0
Expand Down
2 changes: 2 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ rapids_cmake_build_type(Release)
# build options
option(KvikIO_BUILD_EXAMPLES "Configure CMake to build examples" ON)

rapids_cmake_support_conda_env(conda_env MODIFY_PREFIX_PATH)

# find packages we depend on
rapids_cpm_init()

Expand Down
Loading

0 comments on commit 84f8556

Please sign in to comment.