diff --git a/.gitignore b/.gitignore index 52ad86cbc..c2df58adb 100644 --- a/.gitignore +++ b/.gitignore @@ -22,8 +22,8 @@ rmm.egg-info/ python/build python/*/build python/rmm/docs/_build -python/rmm/**/librmm/**/*.cpp -!python/rmm/librmm/_torch_allocator.cpp +python/rmm/rmm/librmm/*.cpp +!python/rmm/rmm/librmm/_torch_allocator.cpp python/rmm/**/librmm/**/*.h python/rmm/**/librmm/.nfs* python/rmm/**/pylibrmm/**/*.cpp diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index 1ab555bc0..c19b35f3e 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -16,9 +16,30 @@ rapids-logger "Begin cpp build" sccache --zero-stats -# This calls mambabuild when boa is installed (as is the case in the CI images) -RAPIDS_PACKAGE_VERSION=$(rapids-generate-version) rapids-conda-retry mambabuild conda/recipes/librmm +RAPIDS_PACKAGE_VERSION=$(rapids-generate-version) +export RAPIDS_PACKAGE_VERSION + +if rapids-is-release-build; then + RAPIDS_CHANNEL=rapidsai +else + RAPIDS_CHANNEL=rapidsai-nightly +fi + +# --no-build-id allows for caching with `sccache` +# more info is available at +# https://rattler.build/latest/tips_and_tricks/#using-sccache-or-ccache-with-rattler-build +rattler-build build --recipe conda/recipes/librmm \ + --experimental \ + --no-build-id \ + --channel-priority disabled \ + --output-dir "$RAPIDS_CONDA_BLD_OUTPUT_DIR" \ + -c ${RAPIDS_CHANNEL} \ + -c conda-forge \ + -c nvidia sccache --show-adv-stats +# remove build_cache directory +rm -rf "$RAPIDS_CONDA_BLD_OUTPUT_DIR"/build_cache + rapids-upload-conda-to-s3 cpp diff --git a/ci/build_python.sh b/ci/build_python.sh index 98f57c34b..15e9ffbc3 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -20,9 +20,30 @@ CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp) sccache --zero-stats -# This calls mambabuild when boa is installed (as is the case in the CI images) -RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-conda-retry mambabuild -c "${CPP_CHANNEL}" conda/recipes/rmm +RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) +export RAPIDS_PACKAGE_VERSION + +if rapids-is-release-build; then + RAPIDS_CHANNEL=rapidsai +else + RAPIDS_CHANNEL=rapidsai-nightly +fi + +# --no-build-id allows for caching with `sccache` +# more info is available at +# https://rattler.build/latest/tips_and_tricks/#using-sccache-or-ccache-with-rattler-build +rattler-build build --recipe conda/recipes/rmm \ + --experimental \ + --no-build-id \ + --channel-priority disabled \ + --output-dir "$RAPIDS_CONDA_BLD_OUTPUT_DIR" \ + -c "${CPP_CHANNEL}" \ + -c ${RAPIDS_CHANNEL} \ + -c conda-forge \ + -c nvidia sccache --show-adv-stats +rm -rf "$RAPIDS_CONDA_BLD_OUTPUT_DIR"/build_cache + rapids-upload-conda-to-s3 python diff --git a/conda/recipes/librmm/meta.yaml b/conda/recipes/librmm/meta.yaml deleted file mode 100644 index f927315c6..000000000 --- a/conda/recipes/librmm/meta.yaml +++ /dev/null @@ -1,110 +0,0 @@ -# Copyright (c) 2018-2025, NVIDIA CORPORATION. - -{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') %} -{% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} -{% set cuda_major = cuda_version.split('.')[0] %} -{% set date_string = environ['RAPIDS_DATE_STRING'] %} - -package: - name: librmm-split - -source: - path: ../../.. - -requirements: - build: - - cmake {{ cmake_version }} - - ninja - - {{ compiler('c') }} - - {{ compiler('cxx') }} - {% if cuda_major == "11" %} - - {{ compiler('cuda') }} {{ cuda_version }} - {% else %} - - {{ compiler('cuda') }} - {% endif %} - - cuda-version ={{ cuda_version }} - - {{ stdlib("c") }} - host: - - cuda-version ={{ cuda_version }} - - rapids-logger =0.1 - -build: - script_env: - - AWS_ACCESS_KEY_ID - - AWS_SECRET_ACCESS_KEY - - AWS_SESSION_TOKEN - - CMAKE_C_COMPILER_LAUNCHER - - CMAKE_CUDA_COMPILER_LAUNCHER - - CMAKE_CXX_COMPILER_LAUNCHER - - CMAKE_GENERATOR - - PARALLEL_LEVEL - - SCCACHE_BUCKET - - SCCACHE_IDLE_TIMEOUT - - SCCACHE_REGION - - SCCACHE_S3_KEY_PREFIX=librmm-aarch64 # [aarch64] - - SCCACHE_S3_KEY_PREFIX=librmm-linux64 # [linux64] - - SCCACHE_S3_USE_SSL - - SCCACHE_S3_NO_CREDENTIALS - -outputs: - - name: librmm - version: {{ version }} - script: install_librmm.sh - build: - number: {{ GIT_DESCRIBE_NUMBER }} - string: cuda{{ cuda_major }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }} - run_exports: - - {{ pin_subpackage("librmm", max_pin="x.x") }} - ignore_run_exports_from: - - {{ compiler('cuda') }} - requirements: - build: - - cmake {{ cmake_version }} - host: - - cuda-version ={{ cuda_version }} - run: - - {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }} - {% if cuda_major == "11" %} - - cudatoolkit - {% endif %} - - rapids-logger =0.1 - test: - commands: - - test -d "${PREFIX}/include/rmm" - about: - home: https://rapids.ai/ - license: Apache-2.0 - summary: librmm library - - name: librmm-tests - version: {{ version }} - script: install_librmm_tests.sh - build: - number: {{ GIT_DESCRIBE_NUMBER }} - string: cuda{{ cuda_major }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }} - ignore_run_exports_from: - - {{ compiler('cuda') }} - {% if cuda_major != "11" %} - - cuda-cudart-dev - {% endif %} - requirements: - build: - - cmake {{ cmake_version }} - host: - - cuda-version ={{ cuda_version }} - {% if cuda_major == "11" %} - - cudatoolkit - {% else %} - - cuda-cudart-dev - {% endif %} - run: - {% if cuda_major == "11" %} - - cudatoolkit - {% else %} - - cuda-cudart - {% endif %} - - {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }} - - {{ pin_subpackage('librmm', exact=True) }} - about: - home: https://rapids.ai/ - license: Apache-2.0 - summary: librmm test & benchmark executables diff --git a/conda/recipes/librmm/recipe.yaml b/conda/recipes/librmm/recipe.yaml new file mode 100644 index 000000000..9370d5fd9 --- /dev/null +++ b/conda/recipes/librmm/recipe.yaml @@ -0,0 +1,105 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/prefix-dev/recipe-format/main/schema.json +# Copyright (c) 2018-2025, NVIDIA CORPORATION. +schema_version: 1 + +context: + version: ${{ env.get("RAPIDS_PACKAGE_VERSION") }} + cuda_version: ${{ (env.get("RAPIDS_CUDA_VERSION") | split("."))[:2] | join(".") }} + cuda_major: ${{ (env.get("RAPIDS_CUDA_VERSION") | split("."))[0] }} + date_string: ${{ env.get("RAPIDS_DATE_STRING") }} + head_rev: ${{ git.head_rev(".")[:8] }} + +recipe: + name: librmm-split + +cache: + source: + path: ../../.. + + requirements: + build: + - cmake ${{ cmake_version }} + - ninja + - ${{ compiler("c") }} + - ${{ compiler("cxx") }} + - ${{ compiler("cuda") }} + - cuda-version =${{ cuda_version }} + - ${{ stdlib("c") }} + + build: + script: + file: build.sh + secrets: + - AWS_ACCESS_KEY_ID + - AWS_SECRET_ACCESS_KEY + - AWS_SESSION_TOKEN + + env: + CMAKE_C_COMPILER_LAUNCHER: ${{ env.get("CMAKE_C_COMPILER_LAUNCHER") }} + CMAKE_CUDA_COMPILER_LAUNCHER: ${{ env.get("CMAKE_CUDA_COMPILER_LAUNCHER") }} + CMAKE_CXX_COMPILER_LAUNCHER: ${{ env.get("CMAKE_CXX_COMPILER_LAUNCHER") }} + CMAKE_GENERATOR: ${{ env.get("CMAKE_GENERATOR") }} + PARALLEL_LEVEL: ${{ env.get("PARALLEL_LEVEL") }} + SCCACHE_BUCKET: ${{ env.get("SCCACHE_BUCKET") }} + SCCACHE_IDLE_TIMEOUT: ${{ env.get("SCCACHE_IDLE_TIMEOUT") }} + SCCACHE_REGION: ${{ env.get("SCCACHE_REGION") }} + SCCACHE_S3_USE_SSL: ${{ env.get("SCCACHE_S3_USE_SSL") }} + SCCACHE_S3_NO_CREDENTIALS: ${{ env.get("SCCACHE_S3_NO_CREDENTIALS") }} + SCCACHE_S3_KEY_PREFIX: librmm-${{ env.get("RAPIDS_CONDA_ARCH") }} + +outputs: + - package: + name: librmm + version: ${{ version }} + build: + string: cuda${{ cuda_major }}_${{ date_string }}_${{ head_rev }} + script: install_librmm.sh + requirements: + host: + - cmake ${{ cmake_version }} + - cuda-version =${{ cuda_version }} + run: + - ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }} + - if: cuda_major == "11" + then: cudatoolkit + - rapids-logger =0.1 + run_exports: + - ${{ pin_subpackage("librmm", upper_bound="x.x") }} + ignore_run_exports: + from_package: + - ${{ compiler("cuda") }} + tests: + - script: + - "test -d \"${PREFIX}/include/rmm\"" + about: + homepage: ${{ load_from_file("python/librmm/pyproject.toml").project.urls.Homepage }} + license: ${{ load_from_file("python/librmm/pyproject.toml").project.license.text }} + summary: ${{ load_from_file("python/librmm/pyproject.toml").project.description }} + - package: + name: librmm-tests + version: ${{ version }} + build: + string: cuda${{ cuda_major }}_${{ date_string }}_${{ head_rev }} + script: install_librmm_tests.sh + requirements: + host: + - cmake ${{ cmake_version }} + - cuda-version =${{ cuda_version }} + - if: cuda_major == "11" + then: cudatoolkit + else: cuda-cudart-dev + run: + - if: cuda_major == "11" + then: cudatoolkit + else: cuda-cudart + - ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }} + - ${{ pin_subpackage("librmm", exact=True) }} + ignore_run_exports: + from_package: + - ${{ compiler("cuda") }} + - if: cuda_major == "11" + then: cuda-cudart-dev + about: + homepage: ${{ load_from_file("python/librmm/pyproject.toml").project.urls.Homepage }} + license: ${{ load_from_file("python/librmm/pyproject.toml").project.license.text | replace(" ", "-") }} + summary: librmm test & benchmark executables diff --git a/conda/recipes/rmm/meta.yaml b/conda/recipes/rmm/meta.yaml deleted file mode 100644 index 58c606c1f..000000000 --- a/conda/recipes/rmm/meta.yaml +++ /dev/null @@ -1,90 +0,0 @@ -# Copyright (c) 2019-2025, NVIDIA CORPORATION. - -{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip().lstrip('v') %} -{% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} -{% set cuda_major = cuda_version.split('.')[0] %} -{% set py_version = environ['CONDA_PY'] %} -{% set date_string = environ['RAPIDS_DATE_STRING'] %} - -package: - name: rmm - version: {{ version }} - -source: - path: ../../.. - -build: - number: {{ GIT_DESCRIBE_NUMBER }} - string: cuda{{ cuda_major }}_py{{ py_version }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }} - script_env: - - AWS_ACCESS_KEY_ID - - AWS_SECRET_ACCESS_KEY - - AWS_SESSION_TOKEN - - CMAKE_C_COMPILER_LAUNCHER - - CMAKE_CUDA_COMPILER_LAUNCHER - - CMAKE_CXX_COMPILER_LAUNCHER - - CMAKE_GENERATOR - - SCCACHE_BUCKET - - SCCACHE_IDLE_TIMEOUT - - SCCACHE_REGION - - SCCACHE_S3_KEY_PREFIX=rmm-aarch64 # [aarch64] - - SCCACHE_S3_KEY_PREFIX=rmm-linux64 # [linux64] - - SCCACHE_S3_USE_SSL - - SCCACHE_S3_NO_CREDENTIALS - ignore_run_exports_from: - - {{ compiler('cuda') }} - {% if cuda_major != "11" %} - - cuda-cudart-dev - {% endif %} - - cuda-python - -requirements: - build: - - cmake {{ cmake_version }} - - ninja - - {{ compiler('c') }} - - {{ compiler('cxx') }} - {% if cuda_major == "11" %} - - {{ compiler('cuda') }} {{ cuda_version }} - {% else %} - - {{ compiler('cuda') }} - {% endif %} - - cuda-version ={{ cuda_version }} - - {{ stdlib("c") }} - host: - - cuda-version ={{ cuda_version }} - {% if cuda_major == "11" %} - - cudatoolkit - - cuda-python >=11.8.5,<12.0a0 - {% else %} - - cuda-cudart-dev - - cuda-python >=12.6.2,<13.0a0 - {% endif %} - - cython >=3.0.0 - - rapids-build-backend >=0.3.0,<0.4.0.dev0 - - librmm ={{ version }} - - python - - scikit-build-core >=0.10.0 - run: - {% if cuda_major == "11" %} - - cudatoolkit - - cuda-python >=11.8.5,<12.0a0 - {% else %} - - cuda-cudart - - cuda-python >=12.6.2,<13.0a0 - {% endif %} - - {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }} - - numba >=0.59.1,<0.61.0a0 - - numpy >=1.23,<3.0a0 - - python - -test: - imports: - - rmm - -about: - home: https://rapids.ai/ - license: Apache-2.0 - license_family: Apache - license_file: LICENSE - summary: rmm library diff --git a/conda/recipes/rmm/recipe.yaml b/conda/recipes/rmm/recipe.yaml new file mode 100644 index 000000000..f85d44913 --- /dev/null +++ b/conda/recipes/rmm/recipe.yaml @@ -0,0 +1,91 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/prefix-dev/recipe-format/main/schema.json +# Copyright (c) 2019-2025, NVIDIA CORPORATION. + +context: + version: ${{ env.get("RAPIDS_PACKAGE_VERSION") }} + cuda_version: ${{ (env.get("RAPIDS_CUDA_VERSION") | split("."))[:2] | join(".") }} + cuda_major: ${{ (env.get("RAPIDS_CUDA_VERSION") | split("."))[0] }} + date_string: ${{ env.get("RAPIDS_DATE_STRING") }} + py_version: ${{ env.get("RAPIDS_PY_VERSION") }} + head_rev: ${{ git.head_rev(".")[:8] }} + +package: + name: rmm + version: ${{ version }} + +source: + - path: ../../.. + +build: + string: cuda${{ cuda_major }}_py${{ py_version }}_${{ date_string }}_${{ head_rev }} + script: + file: build.sh + secrets: + - AWS_ACCESS_KEY_ID + - AWS_SECRET_ACCESS_KEY + - AWS_SESSION_TOKEN + + env: + CMAKE_C_COMPILER_LAUNCHER: ${{ env.get("CMAKE_C_COMPILER_LAUNCHER") }} + CMAKE_CUDA_COMPILER_LAUNCHER: ${{ env.get("CMAKE_CUDA_COMPILER_LAUNCHER") }} + CMAKE_CXX_COMPILER_LAUNCHER: ${{ env.get("CMAKE_CXX_COMPILER_LAUNCHER") }} + CMAKE_GENERATOR: ${{ env.get("CMAKE_GENERATOR") }} + SCCACHE_BUCKET: ${{ env.get("SCCACHE_BUCKET") }} + SCCACHE_IDLE_TIMEOUT: ${{ env.get("SCCACHE_IDLE_TIMEOUT") }} + SCCACHE_REGION: ${{ env.get("SCCACHE_REGION") }} + SCCACHE_S3_USE_SSL: ${{ env.get("SCCACHE_S3_USE_SSL") }} + SCCACHE_S3_NO_CREDENTIALS: ${{ env.get("SCCACHE_S3_NO_CREDENTIALS") }} + SCCACHE_S3_KEY_PREFIX: rmm-${{ env.get("RAPIDS_CONDA_ARCH") }} + +requirements: + build: + - cmake ${{ cmake_version }} + - ninja + - ${{ compiler("c") }} + - ${{ compiler("cxx") }} + - ${{ compiler("cuda") }} + - cuda-version =${{ cuda_version }} + - ${{ stdlib("c") }} + host: + - cuda-version =${{ cuda_version }} + - if: cuda_major == "11" + then: + - cudatoolkit + - cuda-python >=11.8.5,<12.0a0 + else: + - cuda-cudart-dev + - cuda-python >=12.6.2,<13.0a0 + - cython >=3.0.0 + - rapids-build-backend >=0.3.0,<0.4.0.dev0 + - librmm =${{ version }} + - python + - pip + - scikit-build-core >=0.10.0 + run: + - if: cuda_major == "11" + then: + - cudatoolkit + - cuda-python >=11.8.5,<12.0a0 + else: + - cuda-cudart + - cuda-python >=12.6.2,<13.0a0 + - ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }} + - numpy >=1.23,<3.0a0 + - python + ignore_run_exports: + from_package: + - ${{ compiler("cuda") }} + - cuda-python + - if: not (cuda_major == "11") + then: "cuda-cudart-dev" + +tests: + - python: + imports: + - rmm + pip_check: false + +about: + homepage: ${{ load_from_file("python/rmm/pyproject.toml").project.urls.Homepage }} + license: ${{ load_from_file("python/rmm/pyproject.toml").project.license.text }} + summary: ${{ load_from_file("python/rmm/pyproject.toml").project.description }} diff --git a/python/librmm/pyproject.toml b/python/librmm/pyproject.toml index f7a6f7088..930663066 100644 --- a/python/librmm/pyproject.toml +++ b/python/librmm/pyproject.toml @@ -27,7 +27,7 @@ readme = { file = "README.md", content-type = "text/markdown" } authors = [ { name = "NVIDIA Corporation" }, ] -license = { text = "Apache 2.0" } +license = { text = "Apache-2.0" } classifiers = [ "Intended Audience :: Developers", "Topic :: Database", diff --git a/python/rmm/pyproject.toml b/python/rmm/pyproject.toml index 2771ee027..f6ba5415a 100644 --- a/python/rmm/pyproject.toml +++ b/python/rmm/pyproject.toml @@ -27,7 +27,7 @@ readme = { file = "README.md", content-type = "text/markdown" } authors = [ { name = "NVIDIA Corporation" }, ] -license = { text = "Apache 2.0" } +license = { text = "Apache-2.0" } requires-python = ">=3.10" dependencies = [ "cuda-python>=11.8.5,<12.0a0",