diff --git a/.clang-format b/.clang-format index 0c05436e9..951a549d0 100644 --- a/.clang-format +++ b/.clang-format @@ -15,7 +15,7 @@ AlignTrailingComments: true AllowAllArgumentsOnNextLine: true AllowAllConstructorInitializersOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: true -AllowShortBlocksOnASingleLine: true +AllowShortBlocksOnASingleLine: true AllowShortCaseLabelsOnASingleLine: true AllowShortEnumsOnASingleLine: true AllowShortFunctionsOnASingleLine: All @@ -27,7 +27,7 @@ AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: true AlwaysBreakTemplateDeclarations: Yes -BinPackArguments: false +BinPackArguments: false BinPackParameters: false BraceWrapping: AfterClass: false @@ -46,6 +46,7 @@ BraceWrapping: SplitEmptyFunction: false SplitEmptyRecord: false SplitEmptyNamespace: false +BreakAfterAttributes: Leave BreakAfterJavaFieldAnnotations: false BreakBeforeBinaryOperators: None BreakBeforeBraces: WebKit @@ -71,17 +72,20 @@ ForEachMacros: - foreach - Q_FOREACH - BOOST_FOREACH -IncludeBlocks: Preserve +IncludeBlocks: Regroup IncludeCategories: - - Regex: '^' - Priority: 2 - - Regex: '^<.*\.h>' + - Regex: '^"' # quoted includes Priority: 1 - - Regex: '^<.*' + - Regex: '^ + +Alternatively, open the VSCode command palette (typically `cmd/ctrl + shift + P`) and run the "Rebuild and Reopen in Container" command. diff --git a/.devcontainer/cuda12.9-conda/devcontainer.json b/.devcontainer/cuda12.9-conda/devcontainer.json new file mode 100644 index 000000000..b59b4662b --- /dev/null +++ b/.devcontainer/cuda12.9-conda/devcontainer.json @@ -0,0 +1,44 @@ +{ + "build": { + "context": "${localWorkspaceFolder}/.devcontainer", + "dockerfile": "${localWorkspaceFolder}/.devcontainer/Dockerfile", + "args": { + "CUDA": "12.9", + "PYTHON_PACKAGE_MANAGER": "conda", + "BASE": "rapidsai/devcontainers:25.10-cpp-mambaforge" + } + }, + "runArgs": [ + "--rm", + "--name", + "${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-25.10-cuda12.9-conda", + "--ulimit", + "nofile=500000" + ], + "hostRequirements": {"gpu": "optional"}, + "features": { + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:25.10": {} + }, + "overrideFeatureInstallOrder": [ + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" + ], + "initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config,conda/pkgs,conda/${localWorkspaceFolderBasename}-cuda12.9-envs}"], + "postAttachCommand": ["/bin/bash", "-c", "if [ ${CODESPACES:-false} = 'true' ]; then . devcontainer-utils-post-attach-command; . rapids-post-attach-command; fi"], + "workspaceFolder": "/home/coder", + "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/rmm,type=bind,consistency=consistent", + "mounts": [ + "source=${localWorkspaceFolder}/../.aws,target=/home/coder/.aws,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.cache,target=/home/coder/.cache,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.config,target=/home/coder/.config,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.conda/pkgs,target=/home/coder/.conda/pkgs,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.conda/${localWorkspaceFolderBasename}-cuda12.9-envs,target=/home/coder/.conda/envs,type=bind,consistency=consistent" + ], + "customizations": { + "vscode": { + "extensions": [ + "ms-python.flake8", + "nvidia.nsight-vscode-edition" + ] + } + } +} diff --git a/.devcontainer/cuda12.9-pip/devcontainer.json b/.devcontainer/cuda12.9-pip/devcontainer.json new file mode 100644 index 000000000..ba8b13cad --- /dev/null +++ b/.devcontainer/cuda12.9-pip/devcontainer.json @@ -0,0 +1,43 @@ +{ + "build": { + "context": "${localWorkspaceFolder}/.devcontainer", + "dockerfile": "${localWorkspaceFolder}/.devcontainer/Dockerfile", + "args": { + "CUDA": "12.9", + "PYTHON_PACKAGE_MANAGER": "pip", + "BASE": "rapidsai/devcontainers:25.10-cpp-cuda12.9" + } + }, + "runArgs": [ + "--rm", + "--name", + "${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-25.10-cuda12.9-pip", + "--ulimit", + "nofile=500000" + ], + "hostRequirements": {"gpu": "optional"}, + "features": { + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:25.10": {} + }, + "overrideFeatureInstallOrder": [ + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" + ], + "initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config/pip,local/share/${localWorkspaceFolderBasename}-cuda12.9-venvs}"], + "postAttachCommand": ["/bin/bash", "-c", "if [ ${CODESPACES:-false} = 'true' ]; then . devcontainer-utils-post-attach-command; . rapids-post-attach-command; fi"], + "workspaceFolder": "/home/coder", + "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/rmm,type=bind,consistency=consistent", + "mounts": [ + "source=${localWorkspaceFolder}/../.aws,target=/home/coder/.aws,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.cache,target=/home/coder/.cache,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.config,target=/home/coder/.config,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.local/share/${localWorkspaceFolderBasename}-cuda12.9-venvs,target=/home/coder/.local/share/venvs,type=bind,consistency=consistent" + ], + "customizations": { + "vscode": { + "extensions": [ + "ms-python.flake8", + "nvidia.nsight-vscode-edition" + ] + } + } +} diff --git a/.devcontainer/cuda13.0-conda/devcontainer.json b/.devcontainer/cuda13.0-conda/devcontainer.json new file mode 100644 index 000000000..4d8066823 --- /dev/null +++ b/.devcontainer/cuda13.0-conda/devcontainer.json @@ -0,0 +1,42 @@ +{ + "build": { + "context": "${localWorkspaceFolder}/.devcontainer", + "dockerfile": "${localWorkspaceFolder}/.devcontainer/Dockerfile", + "args": { + "CUDA": "13.0", + "PYTHON_PACKAGE_MANAGER": "conda", + "BASE": "rapidsai/devcontainers:25.10-cpp-mambaforge" + } + }, + "runArgs": [ + "--rm", + "--name", + "${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-25.10-cuda13.0-conda" + ], + "hostRequirements": {"gpu": "optional"}, + "features": { + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:25.10": {} + }, + "overrideFeatureInstallOrder": [ + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" + ], + "initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config,conda/pkgs,conda/${localWorkspaceFolderBasename}-cuda13.0-envs}"], + "postAttachCommand": ["/bin/bash", "-c", "if [ ${CODESPACES:-false} = 'true' ]; then . devcontainer-utils-post-attach-command; . rapids-post-attach-command; fi"], + "workspaceFolder": "/home/coder", + "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/rmm,type=bind,consistency=consistent", + "mounts": [ + "source=${localWorkspaceFolder}/../.aws,target=/home/coder/.aws,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.cache,target=/home/coder/.cache,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.config,target=/home/coder/.config,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.conda/pkgs,target=/home/coder/.conda/pkgs,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.conda/${localWorkspaceFolderBasename}-cuda13.0-envs,target=/home/coder/.conda/envs,type=bind,consistency=consistent" + ], + "customizations": { + "vscode": { + "extensions": [ + "ms-python.flake8", + "nvidia.nsight-vscode-edition" + ] + } + } +} diff --git a/.devcontainer/cuda13.0-pip/devcontainer.json b/.devcontainer/cuda13.0-pip/devcontainer.json new file mode 100644 index 000000000..71669f1b3 --- /dev/null +++ b/.devcontainer/cuda13.0-pip/devcontainer.json @@ -0,0 +1,41 @@ +{ + "build": { + "context": "${localWorkspaceFolder}/.devcontainer", + "dockerfile": "${localWorkspaceFolder}/.devcontainer/Dockerfile", + "args": { + "CUDA": "13.0", + "PYTHON_PACKAGE_MANAGER": "pip", + "BASE": "rapidsai/devcontainers:25.10-cpp-cuda13.0" + } + }, + "runArgs": [ + "--rm", + "--name", + "${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-25.10-cuda13.0-pip" + ], + "hostRequirements": {"gpu": "optional"}, + "features": { + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:25.10": {} + }, + "overrideFeatureInstallOrder": [ + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" + ], + "initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config/pip,local/share/${localWorkspaceFolderBasename}-cuda13.0-venvs}"], + "postAttachCommand": ["/bin/bash", "-c", "if [ ${CODESPACES:-false} = 'true' ]; then . devcontainer-utils-post-attach-command; . rapids-post-attach-command; fi"], + "workspaceFolder": "/home/coder", + "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/rmm,type=bind,consistency=consistent", + "mounts": [ + "source=${localWorkspaceFolder}/../.aws,target=/home/coder/.aws,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.cache,target=/home/coder/.cache,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.config,target=/home/coder/.config,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.local/share/${localWorkspaceFolderBasename}-cuda13.0-venvs,target=/home/coder/.local/share/venvs,type=bind,consistency=consistent" + ], + "customizations": { + "vscode": { + "extensions": [ + "ms-python.flake8", + "nvidia.nsight-vscode-edition" + ] + } + } +} diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 44656683c..b81fc3eb2 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -10,9 +10,15 @@ python/ @rapidsai/rmm-python-codeowners **/CMakeLists.txt @rapidsai/rmm-cmake-codeowners **/cmake/ @rapidsai/rmm-cmake-codeowners -#build/ops code owners -.github/ @rapidsai/ops-codeowners -ci/ @rapidsai/ops-codeowners -conda/ @rapidsai/ops-codeowners -**/Dockerfile @rapidsai/ops-codeowners -**/.dockerignore @rapidsai/ops-codeowners +#CI code owners +/.github/ @rapidsai/ci-codeowners +/ci/ @rapidsai/ci-codeowners +/.pre-commit-config.yaml @rapidsai/ci-codeowners +/.shellcheckrc @rapidsai/ci-codeowners + +#packaging code owners +/.devcontainer/ @rapidsai/packaging-codeowners +/conda/ @rapidsai/packaging-codeowners +/dependencies.yaml @rapidsai/packaging-codeowners +/build.sh @rapidsai/packaging-codeowners +pyproject.toml @rapidsai/packaging-codeowners diff --git a/.github/ISSUE_TEMPLATE/documentation-request.md b/.github/ISSUE_TEMPLATE/documentation-request.md index 29445495e..24215eceb 100644 --- a/.github/ISSUE_TEMPLATE/documentation-request.md +++ b/.github/ISSUE_TEMPLATE/documentation-request.md @@ -30,4 +30,3 @@ A clear and concise description of what documentation is needed and why. **Steps taken to search for needed documentation** List any steps you have taken. - diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 271cfc2ea..d1bbe38bb 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,49 +1,13 @@ - +## Description + + + + + + + + +## Checklist +- [ ] I am familiar with the [Contributing Guidelines](https://github.com/rapidsai/rmm/blob/HEAD/CONTRIBUTING.md). +- [ ] New or existing tests cover these changes. +- [ ] The documentation is up to date with these changes. diff --git a/.github/copy-pr-bot.yaml b/.github/copy-pr-bot.yaml new file mode 100644 index 000000000..e0ea775aa --- /dev/null +++ b/.github/copy-pr-bot.yaml @@ -0,0 +1,5 @@ +# Configuration file for `copy-pr-bot` GitHub App +# https://docs.gha-runners.nvidia.com/apps/copy-pr-bot/ + +enabled: true +auto_sync_draft: false diff --git a/.github/labeler.yml b/.github/labeler.yml index 112d0d2f9..496e17311 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -3,19 +3,25 @@ # Labels culled from https://github.com/rapidsai/rmm/labels Python: - - 'python/**' - + - changed-files: + any-glob-to-any-file: + - 'python/**' CMake: - - '**/CMakeLists.txt' - - '**/cmake/**' - + - changed-files: + any-glob-to-any-file: + - '**/CMakeLists.txt' + - '**/cmake/**' conda: - - 'conda/**' - + - changed-files: + any-glob-to-any-file: + - 'conda/**' cpp: - - 'include/**' - - 'tests/**' - - 'doxygen/**' - -gpuCI: - - 'ci/**' + - changed-files: + any-glob-to-any-file: + - 'include/**' + - 'tests/**' + - 'doxygen/**' +ci: + - changed-files: + any-glob-to-any-file: + - 'ci/**' diff --git a/.github/ops-bot.yaml b/.github/ops-bot.yaml new file mode 100644 index 000000000..2ed5231ae --- /dev/null +++ b/.github/ops-bot.yaml @@ -0,0 +1,9 @@ +# This file controls which features from the `ops-bot` repository below are enabled. +# - https://github.com/rapidsai/ops-bot + +auto_merger: true +branch_checker: true +label_checker: true +release_drafter: true +recently_updated: true +forward_merger: true diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 000000000..2c9a85805 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,27 @@ +# GitHub Auto-Generated Release Notes Configuration for RAPIDS +# This file configures how GitHub automatically generates release notes + +changelog: + exclude: + labels: + - ignore-for-release + - dependencies + authors: + - rapids-bot[bot] + - dependabot[bot] + categories: + - title: 🚨 Breaking Changes + labels: + - breaking + - title: 🐛 Bug Fixes + labels: + - bug + - title: 📖 Documentation + labels: + - doc + - title: 🚀 New Features + labels: + - feature request + - title: 🛠️ Improvements + labels: + - improvement diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 000000000..3a0676625 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,154 @@ +name: build + +on: + push: + branches: + - "branch-*" + tags: + - v[0-9][0-9].[0-9][0-9].[0-9][0-9] + workflow_dispatch: + inputs: + branch: + description: | + branch: git branch the workflow run targets. + Required even when 'sha' is provided because it is also used for organizing artifacts. + required: true + type: string + date: + description: "date: Date (YYYY-MM-DD) this run is for. Used to organize artifacts produced by nightly builds" + required: true + type: string + sha: + description: "sha: full git commit SHA to check out" + required: true + type: string + build_type: + description: "build_type: one of [branch, nightly, pull-request]" + type: string + default: nightly + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} + cancel-in-progress: true + +jobs: + telemetry-setup: + runs-on: ubuntu-latest + continue-on-error: true + env: + OTEL_SERVICE_NAME: "build-rmm" + steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 + with: + egress-policy: audit + + - name: Telemetry setup + # This gate is here and not at the job level because we need the job to not be skipped, + # since other jobs depend on it. + if: ${{ vars.TELEMETRY_ENABLED == 'true' }} + uses: rapidsai/shared-actions/telemetry-dispatch-stash-base-env-vars@main + cpp-build: + needs: [telemetry-setup] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-25.10 + with: + build_type: ${{ inputs.build_type || 'branch' }} + branch: ${{ inputs.branch }} + date: ${{ inputs.date }} + script: ci/build_cpp.sh + sha: ${{ inputs.sha }} + python-build: + needs: [telemetry-setup, cpp-build] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-25.10 + with: + build_type: ${{ inputs.build_type || 'branch' }} + branch: ${{ inputs.branch }} + date: ${{ inputs.date }} + script: ci/build_python.sh + sha: ${{ inputs.sha }} + upload-conda: + needs: [cpp-build, python-build] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/conda-upload-packages.yaml@branch-25.10 + with: + build_type: ${{ inputs.build_type || 'branch' }} + branch: ${{ inputs.branch }} + date: ${{ inputs.date }} + sha: ${{ inputs.sha }} + docs-build: + if: github.ref_type == 'branch' + needs: [python-build] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-25.10 + with: + build_type: ${{ inputs.build_type || 'branch' }} + branch: ${{ inputs.branch }} + sha: ${{ inputs.sha }} + date: ${{ inputs.date }} + node_type: "gpu-l4-latest-1" + arch: "amd64" + container_image: "rapidsai/ci-conda:25.10-latest" + script: ci/build_docs.sh + wheel-build-cpp: + needs: [telemetry-setup] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-25.10 + with: + matrix_filter: group_by([.ARCH, (.CUDA_VER|split(".")|map(tonumber)|.[0])]) | map(max_by(.PY_VER|split(".")|map(tonumber))) + build_type: ${{ inputs.build_type || 'branch' }} + branch: ${{ inputs.branch }} + sha: ${{ inputs.sha }} + date: ${{ inputs.date }} + script: ci/build_wheel_cpp.sh + package-name: librmm + package-type: cpp + wheel-build-python: + needs: [telemetry-setup, wheel-build-cpp] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-25.10 + with: + build_type: ${{ inputs.build_type || 'branch' }} + branch: ${{ inputs.branch }} + sha: ${{ inputs.sha }} + date: ${{ inputs.date }} + script: ci/build_wheel_python.sh + package-name: rmm + package-type: python + wheel-publish-cpp: + needs: wheel-build-cpp + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-25.10 + with: + build_type: ${{ inputs.build_type || 'branch' }} + branch: ${{ inputs.branch }} + sha: ${{ inputs.sha }} + date: ${{ inputs.date }} + package-name: librmm + package-type: cpp + wheel-publish-python: + needs: wheel-build-python + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-25.10 + with: + build_type: ${{ inputs.build_type || 'branch' }} + branch: ${{ inputs.branch }} + sha: ${{ inputs.sha }} + date: ${{ inputs.date }} + package-name: rmm + package-type: python + telemetry-summarize: + # This job must use a self-hosted runner to record telemetry traces. + runs-on: linux-amd64-cpu4 + needs: [wheel-publish-cpp, wheel-publish-python, upload-conda, docs-build] + if: ${{ vars.TELEMETRY_ENABLED == 'true' && !cancelled() }} + continue-on-error: true + steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 + with: + egress-policy: audit + + - name: Telemetry summarize + uses: rapidsai/shared-actions/telemetry-dispatch-summarize@main diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 7580f81f8..47c252cc6 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -3,10 +3,21 @@ name: "Pull Request Labeler" on: - pull_request_target +permissions: + contents: read + jobs: triage: + permissions: + contents: read # for actions/labeler to determine modified files + pull-requests: write # for actions/labeler to add labels to PRs runs-on: ubuntu-latest steps: - - uses: actions/labeler@main + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 + with: + egress-policy: audit + + - uses: actions/labeler@v5 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/new-issues-to-triage-projects.yml b/.github/workflows/new-issues-to-triage-projects.yml index 0d1f957dd..fd38cfb7b 100644 --- a/.github/workflows/new-issues-to-triage-projects.yml +++ b/.github/workflows/new-issues-to-triage-projects.yml @@ -12,6 +12,11 @@ jobs: runs-on: ubuntu-latest name: Assign to New Issues to Triage Project steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 + with: + egress-policy: audit + - name: Process bug issues uses: docker://takanabe/github-actions-automate-projects:v0.0.1 if: contains(github.event.issue.labels.*.name, 'bug') && contains(github.event.issue.labels.*.name, '? - Needs Triage') diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 000000000..f7acc41ba --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,193 @@ +name: pr +on: + push: + branches: + - "pull-request/[0-9]+" +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + pr-builder: + needs: + - check-nightly-ci + - changed-files + - checks + - conda-cpp-build + - conda-cpp-tests + - conda-python-build + - conda-python-tests + - docs-build + - wheel-build-cpp + - wheel-build-python + - wheel-tests + - devcontainer + - telemetry-setup + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-25.10 + if: always() + with: + needs: ${{ toJSON(needs) }} + telemetry-setup: + runs-on: ubuntu-latest + continue-on-error: true + env: + OTEL_SERVICE_NAME: "pr-rmm" + steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 + with: + egress-policy: audit + + - name: Telemetry setup + # This gate is here and not at the job level because we need the job to not be skipped, + # since other jobs depend on it. + if: ${{ vars.TELEMETRY_ENABLED == 'true' }} + uses: rapidsai/shared-actions/telemetry-dispatch-stash-base-env-vars@main + check-nightly-ci: + runs-on: ubuntu-latest + env: + RAPIDS_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 + with: + egress-policy: audit + + - name: Check if nightly CI is passing + uses: rapidsai/shared-actions/check_nightly_success/dispatch@main + with: + repo: rmm + changed-files: + needs: + - telemetry-setup + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/changed-files.yaml@branch-25.10 + with: + files_yaml: | + test_cpp: + - '**' + - '!.devcontainer/**' + - '!.pre-commit-config.yaml' + - '!CONTRIBUTING.md' + - '!README.md' + - '!ci/release/update-version.sh' + - '!img/**' + - '!python/**' + test_python: + - '**' + - '!.devcontainer/**' + - '!.pre-commit-config.yaml' + - '!CONTRIBUTING.md' + - '!README.md' + - '!ci/release/update-version.sh' + - '!img/**' + checks: + secrets: inherit + needs: + - telemetry-setup + uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-25.10 + with: + enable_check_generated_files: false + ignored_pr_jobs: "telemetry-summarize" + conda-cpp-build: + needs: checks + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-25.10 + with: + build_type: pull-request + script: ci/build_cpp.sh + conda-cpp-tests: + needs: [conda-cpp-build, changed-files] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@branch-25.10 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_cpp + with: + build_type: pull-request + script: ci/test_cpp.sh + conda-python-build: + needs: conda-cpp-build + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-25.10 + with: + build_type: pull-request + script: ci/build_python.sh + conda-python-tests: + needs: [conda-python-build, changed-files] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-25.10 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python + with: + build_type: pull-request + script: ci/test_python.sh + docs-build: + needs: conda-python-build + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-25.10 + with: + build_type: pull-request + node_type: "gpu-l4-latest-1" + arch: "amd64" + container_image: "rapidsai/ci-conda:25.10-latest" + script: "ci/build_docs.sh" + wheel-build-cpp: + needs: checks + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-25.10 + with: + matrix_filter: group_by([.ARCH, (.CUDA_VER|split(".")|map(tonumber)|.[0])]) | map(max_by(.PY_VER|split(".")|map(tonumber))) + build_type: pull-request + script: ci/build_wheel_cpp.sh + package-name: librmm + package-type: cpp + wheel-build-python: + needs: wheel-build-cpp + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-25.10 + with: + build_type: pull-request + script: ci/build_wheel_python.sh + package-name: rmm + package-type: python + wheel-tests: + needs: [wheel-build-python, changed-files] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-25.10 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python + with: + build_type: pull-request + script: ci/test_wheel.sh + devcontainer: + secrets: inherit + needs: + - telemetry-setup + uses: rapidsai/shared-workflows/.github/workflows/build-in-devcontainer.yaml@branch-25.10 + with: + arch: '["amd64", "arm64"]' + cuda: '["13.0"]' + node_type: "cpu8" + rapids-aux-secret-1: GIST_REPO_READ_ORG_GITHUB_TOKEN + env: | + SCCACHE_DIST_MAX_RETRIES=inf + SCCACHE_SERVER_LOG=sccache=debug + SCCACHE_DIST_FALLBACK_TO_LOCAL_COMPILE=false + SCCACHE_DIST_AUTH_TOKEN_VAR=RAPIDS_AUX_SECRET_1 + build_command: | + sccache --zero-stats; + build-all -j0 -DBUILD_BENCHMARKS=ON --verbose 2>&1 | tee telemetry-artifacts/build.log; + sccache --show-adv-stats | tee telemetry-artifacts/sccache-stats.txt; + telemetry-summarize: + # This job must use a self-hosted runner to record telemetry traces. + runs-on: linux-amd64-cpu4 + needs: pr-builder + if: ${{ vars.TELEMETRY_ENABLED == 'true' && !cancelled() && github.run_attempt == '1' }} + continue-on-error: true + steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 + with: + egress-policy: audit + + - name: Telemetry summarize + uses: rapidsai/shared-actions/telemetry-dispatch-summarize@main + env: + GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml deleted file mode 100644 index 8b65da69a..000000000 --- a/.github/workflows/stale.yaml +++ /dev/null @@ -1,57 +0,0 @@ -name: Mark inactive issues and pull requests - -on: - schedule: - - cron: "0 * * * *" - -jobs: - mark-inactive-30d: - runs-on: ubuntu-latest - steps: - - name: Mark 30 day inactive issues and pull requests - uses: actions/stale@v3 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: > - This issue has been labeled `inactive-30d` due to no recent activity in the past 30 days. - Please close this issue if no further response or action is needed. - Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. - This issue will be labeled `inactive-90d` if there is no activity in the next 60 days. - stale-issue-label: "inactive-30d" - exempt-issue-labels: "0 - Blocked,0 - Backlog,good first issue" - days-before-issue-stale: 30 - days-before-issue-close: -1 - stale-pr-message: > - This PR has been labeled `inactive-30d` due to no recent activity in the past 30 days. - Please close this PR if it is no longer required. - Otherwise, please respond with a comment indicating any updates. - This PR will be labeled `inactive-90d` if there is no activity in the next 60 days. - stale-pr-label: "inactive-30d" - exempt-pr-labels: "0 - Blocked,0 - Backlog,good first issue" - days-before-pr-stale: 30 - days-before-pr-close: -1 - operations-per-run: 50 - mark-inactive-90d: - runs-on: ubuntu-latest - steps: - - name: Mark 90 day inactive issues and pull requests - uses: actions/stale@v3 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: > - This issue has been labeled `inactive-90d` due to no recent activity in the past 90 days. - Please close this issue if no further response or action is needed. - Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. - stale-issue-label: "inactive-90d" - exempt-issue-labels: "0 - Blocked,0 - Backlog,good first issue" - days-before-issue-stale: 90 - days-before-issue-close: -1 - stale-pr-message: > - This PR has been labeled `inactive-90d` due to no recent activity in the past 90 days. - Please close this PR if it is no longer required. - Otherwise, please respond with a comment indicating any updates. - stale-pr-label: "inactive-90d" - exempt-pr-labels: "0 - Blocked,0 - Backlog,good first issue" - days-before-pr-stale: 90 - days-before-pr-close: -1 - operations-per-run: 50 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 000000000..118b0f2b8 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,52 @@ +name: test + +on: + workflow_dispatch: + inputs: + branch: + description: | + branch: git branch the workflow run targets. + Required even when 'sha' is provided because it is also used for organizing artifacts. + required: true + type: string + date: + description: "date: Date (YYYY-MM-DD) this run is for. Used to organize artifacts produced by nightly builds" + required: true + type: string + sha: + description: "sha: full git commit SHA to check out" + required: true + type: string + build_type: + description: "build_type: one of [branch, nightly, pull-request]" + type: string + default: nightly + +jobs: + cpp-tests: + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@branch-25.10 + with: + build_type: ${{ inputs.build_type }} + branch: ${{ inputs.branch }} + date: ${{ inputs.date }} + script: ci/test_cpp.sh + sha: ${{ inputs.sha }} + python-tests: + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-25.10 + with: + build_type: ${{ inputs.build_type }} + branch: ${{ inputs.branch }} + date: ${{ inputs.date }} + script: ci/test_python.sh + sha: ${{ inputs.sha }} + wheel-tests: + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-25.10 + with: + build_type: ${{ inputs.build_type }} + branch: ${{ inputs.branch }} + date: ${{ inputs.date }} + sha: ${{ inputs.sha }} + script: ci/test_wheel.sh diff --git a/.github/workflows/trigger-breaking-change-alert.yaml b/.github/workflows/trigger-breaking-change-alert.yaml new file mode 100644 index 000000000..48bf37afc --- /dev/null +++ b/.github/workflows/trigger-breaking-change-alert.yaml @@ -0,0 +1,26 @@ +name: Trigger Breaking Change Notifications + +on: + pull_request_target: + types: + - closed + - reopened + - labeled + - unlabeled + +jobs: + trigger-notifier: + if: contains(github.event.pull_request.labels.*.name, 'breaking') + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/breaking-change-alert.yaml@branch-25.10 + with: + sender_login: ${{ github.event.sender.login }} + sender_avatar: ${{ github.event.sender.avatar_url }} + repo: ${{ github.repository }} + pr_number: ${{ github.event.pull_request.number }} + pr_title: "${{ github.event.pull_request.title }}" + pr_body: "${{ github.event.pull_request.body || '_Empty PR description_' }}" + pr_base_ref: ${{ github.event.pull_request.base.ref }} + pr_author: ${{ github.event.pull_request.user.login }} + event_action: ${{ github.event.action }} + pr_merged: ${{ github.event.pull_request.merged }} diff --git a/.gitignore b/.gitignore index 0e2619266..e8084afe0 100644 --- a/.gitignore +++ b/.gitignore @@ -14,15 +14,20 @@ DartConfiguration.tcl .DS_Store *.manifest *.spec +compile_commands.json ## Python build directories & artifacts dist/ rmm.egg-info/ python/build python/*/build -python/rmm/**/_lib/**/*.cpp -python/rmm/**/_lib/**/*.h -python/rmm/**/_lib/.nfs* +python/rmm/rmm/librmm/*.cpp +!python/rmm/rmm/librmm/_torch_allocator.cpp +python/rmm/**/librmm/**/*.h +python/rmm/**/librmm/.nfs* +python/rmm/**/pylibrmm/**/*.cpp +python/rmm/**/pylibrmm/**/*.h +python/rmm/**/pylibrmm/.nfs* python/rmm/_cuda/*.cpp python/rmm/tests/*.cpp python/rmm/*.ipynb @@ -50,6 +55,9 @@ pip-delete-this-directory.txt # Ignore dynamically generated .pxd files python/rmm/_cuda/gpu.pxd +# Ignore _skbuild directory +_skbuild/ + # Unit test / coverage reports htmlcov/ .tox/ @@ -85,8 +93,10 @@ thirdparty/googletest/ *.ipr *.iws -## Doxygen -doxygen/html +## Documentation +cpp/doxygen/html +cpp/doxygen/xml +docs/_build #Java target @@ -106,9 +116,6 @@ instance/ # Scrapy stuff: .scrapy -# Sphinx documentation -python/docs/_build/ - # PyBuilder target/ @@ -145,5 +152,9 @@ ENV/ # mypy .mypy_cache/ -# RMM log files -rmm_log.txt +# cibuildwheel +/wheelhouse + +# clang tooling +compile_commands.json +.clangd/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2323a247a..2bc9acefb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,42 +1,104 @@ +# Copyright (c) 2022-2024, NVIDIA CORPORATION. +ci: + autofix_commit_msg: "[pre-commit.ci] auto code formatting" + autofix_prs: false + autoupdate_branch: "" + autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate" + autoupdate_schedule: quarterly + skip: ["verify-alpha-spec"] + submodules: false + repos: - - repo: https://github.com/pycqa/isort - rev: 5.6.4 - hooks: - - id: isort - args: ["--settings-path=python/setup.cfg"] - files: python/.* - exclude: __init__.py$ - types: [text] - types_or: [python, cython] - - repo: https://github.com/ambv/black - rev: 19.10b0 - hooks: - - id: black - - repo: https://gitlab.com/pycqa/flake8 - rev: 3.8.3 - hooks: - - id: flake8 - alias: flake8 - name: flake8 - args: ["--config=python/.flake8"] - types: [python] - - id: flake8 - alias: flake8-cython - name: flake8-cython - args: ["--config=python/.flake8.cython"] - types: [cython] - - repo: https://github.com/cheshirekow/cmake-format-precommit - rev: v0.6.11 - hooks: - - id: cmake-format - name: cmake-format - args: ["--config-files", "cmake/config.json", "--in-place", "--"] - types: [file] # override `types: [cmake]` - files: \.(cmake(\.in)?)$|CMakeLists\.txt - - id: cmake-lint - args: ["--config-files", "cmake/config.json", "--"] - types: [file] # override `types: [cmake]` - files: \.(cmake(\.in)?)$|CMakeLists\.txt + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.12.2 + hooks: + - id: ruff + args: ["--fix"] + - id: ruff-format + - repo: https://github.com/MarcoGorelli/cython-lint + rev: v0.16.7 + hooks: + - id: cython-lint + - repo: https://github.com/pre-commit/mirrors-clang-format + rev: v20.1.4 + hooks: + - id: clang-format + types_or: [c, c++, cuda] + args: ["-fallback-style=none", "-style=file", "-i"] + exclude: | + (?x)^( + ^cpp/benchmarks/utilities/cxxopts.hpp + ) + - repo: https://github.com/sirosen/texthooks + rev: 0.6.8 + hooks: + - id: fix-smartquotes + exclude: | + (?x)^( + ^cpp/benchmarks/utilities/cxxopts.hpp + ) + - repo: https://github.com/codespell-project/codespell + rev: v2.4.1 + hooks: + - id: codespell + additional_dependencies: [tomli] + args: ["--toml", "pyproject.toml"] + exclude: | + (?x)^( + ^pyproject.toml| + ^cpp/benchmarks/utilities/cxxopts.hpp + ) + - repo: local + hooks: + - id: cmake-format + name: cmake-format + entry: ./cpp/scripts/run-cmake-format.sh cmake-format + language: python + types: [cmake] + # Note that pre-commit autoupdate does not update the versions + # of dependencies, so we'll have to update this manually. + additional_dependencies: + - cmakelang==0.6.13 + - id: cmake-lint + name: cmake-lint + entry: ./cpp/scripts/run-cmake-format.sh cmake-lint + language: python + types: [cmake] + # Note that pre-commit autoupdate does not update the versions + # of dependencies, so we'll have to update this manually. + additional_dependencies: + - cmakelang==0.6.13 + - id: doxygen-check + name: doxygen-check + entry: ./cpp/scripts/doxygen.sh + types_or: [file] + language: system + pass_filenames: false + verbose: true + - repo: https://github.com/rapidsai/pre-commit-hooks + rev: v0.7.0 + hooks: + - id: verify-copyright + args: [--fix, --main-branch=main] + exclude: | + (?x)^( + ^cpp/benchmarks/utilities/cxxopts.hpp + ) + - id: verify-alpha-spec + - repo: https://github.com/rapidsai/dependency-file-generator + rev: v1.20.0 + hooks: + - id: rapids-dependency-file-generator + args: ["--clean", "--warn-all", "--strict"] + - repo: https://github.com/shellcheck-py/shellcheck-py + rev: v0.10.0.1 + hooks: + - id: shellcheck default_language_version: - python: python3 + python: python3 diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 000000000..b57b9d196 --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1,2 @@ +# Disable file checks (otherwise every use of `gha-tools` will get flagged) +disable=SC1091 diff --git a/CHANGELOG.md b/CHANGELOG.md index c0c6ee2db..e57f0fb7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,968 @@ -# RMM 21.10.00 (Date TBD) +# rmm 25.08.00 (6 Aug 2025) -Please see https://github.com/rapidsai/rmm/releases/tag/v21.10.00a for the latest changes to this development branch. +## 🚨 Breaking Changes + +- Update requirements to CUDA 12.0+ ([#1984](https://github.com/rapidsai/rmm/pull/1984)) [@bdice](https://github.com/bdice) +- Remove CUDA 11 from dependencies.yaml ([#1934](https://github.com/rapidsai/rmm/pull/1934)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- stop uploading packages to downloads.rapids.ai ([#1929](https://github.com/rapidsai/rmm/pull/1929)) [@jameslamb](https://github.com/jameslamb) + +## 🐛 Bug Fixes + +- Temporarily disable failing test on HMM systems. ([#1950](https://github.com/rapidsai/rmm/pull/1950)) [@bdice](https://github.com/bdice) +- Fix race conditions and deadlocks in REPLAY_BENCH ([#1940](https://github.com/rapidsai/rmm/pull/1940)) [@wence-](https://github.com/wence-) + +## 📖 Documentation + +- Update Python build instructions to include librmm wheel ([#1978](https://github.com/rapidsai/rmm/pull/1978)) [@gmarkall](https://github.com/gmarkall) +- Fix Python path in CONTRIBUTING.md ([#1936](https://github.com/rapidsai/rmm/pull/1936)) [@bdice](https://github.com/bdice) + +## 🚀 New Features + +- Update requirements to CUDA 12.0+ ([#1984](https://github.com/rapidsai/rmm/pull/1984)) [@bdice](https://github.com/bdice) + +## 🛠️ Improvements + +- Use size_type in device_uvector ([#1992](https://github.com/rapidsai/rmm/pull/1992)) [@bdice](https://github.com/bdice) +- chore: remove unused line from update-version.sh ([#1989](https://github.com/rapidsai/rmm/pull/1989)) [@gforsyth](https://github.com/gforsyth) +- Revert "Update branches that trigger nightlies ([#1954)" (#1988](https://github.com/rapidsai/rmm/pull/1954)" (#1988)) [@gforsyth](https://github.com/gforsyth) +- fix(docker): use versioned `-latest` tag for all `rapidsai` images ([#1987](https://github.com/rapidsai/rmm/pull/1987)) [@gforsyth](https://github.com/gforsyth) +- Move more implementations to precompiled shared library ([#1980](https://github.com/rapidsai/rmm/pull/1980)) [@bdice](https://github.com/bdice) +- [pre-commit.ci] pre-commit autoupdate ([#1979](https://github.com/rapidsai/rmm/pull/1979)) [@pre-commit-ci[bot]](https://github.com/pre-commit-ci[bot]) +- Add managed memory resource to replay benchmark ([#1938](https://github.com/rapidsai/rmm/pull/1938)) [@pentschev](https://github.com/pentschev) +- Remove CUDA 11 from dependencies.yaml ([#1934](https://github.com/rapidsai/rmm/pull/1934)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- Remove CUDA 11 devcontainers and update CI scripts ([#1933](https://github.com/rapidsai/rmm/pull/1933)) [@bdice](https://github.com/bdice) +- refactor(rattler): remove cuda11 options and general cleanup ([#1932](https://github.com/rapidsai/rmm/pull/1932)) [@gforsyth](https://github.com/gforsyth) +- stop uploading packages to downloads.rapids.ai ([#1929](https://github.com/rapidsai/rmm/pull/1929)) [@jameslamb](https://github.com/jameslamb) +- Forward-merge branch-25.06 into branch-25.08 ([#1925](https://github.com/rapidsai/rmm/pull/1925)) [@gforsyth](https://github.com/gforsyth) +- Branch 25.08 merge branch 25.06 ([#1914](https://github.com/rapidsai/rmm/pull/1914)) [@vyasr](https://github.com/vyasr) +- Forward-merge branch-25.06 into branch-25.08 ([#1905](https://github.com/rapidsai/rmm/pull/1905)) [@gforsyth](https://github.com/gforsyth) + +# rmm 25.06.00 (5 Jun 2025) + +## 🚨 Breaking Changes + +- Convert part of RMM to a precompiled library ([#1896](https://github.com/rapidsai/rmm/pull/1896)) [@bdice](https://github.com/bdice) +- Move RMM C++ code into cpp directory. ([#1883](https://github.com/rapidsai/rmm/pull/1883)) [@bdice](https://github.com/bdice) + +## 🐛 Bug Fixes + +- Run system MR tests in isolation. ([#1945](https://github.com/rapidsai/rmm/pull/1945)) [@bdice](https://github.com/bdice) +- Use auditwheel to properly retag the wheel ([#1913](https://github.com/rapidsai/rmm/pull/1913)) [@vyasr](https://github.com/vyasr) +- Fix logger macros ([#1884](https://github.com/rapidsai/rmm/pull/1884)) [@vyasr](https://github.com/vyasr) + +## 📖 Documentation + +- Move docs to top level. ([#1917](https://github.com/rapidsai/rmm/pull/1917)) [@bdice](https://github.com/bdice) +- Update Readme for the logging `set_level` ([#1911](https://github.com/rapidsai/rmm/pull/1911)) [@JigaoLuo](https://github.com/JigaoLuo) +- Fixed documentation example for `DeviceBuffer.to_device` ([#1881](https://github.com/rapidsai/rmm/pull/1881)) [@TomAugspurger](https://github.com/TomAugspurger) + +## 🚀 New Features + +- Convert part of RMM to a precompiled library ([#1896](https://github.com/rapidsai/rmm/pull/1896)) [@bdice](https://github.com/bdice) +- Set mempool hw_decompress flag if driver supports it ([#1875](https://github.com/rapidsai/rmm/pull/1875)) [@bdice](https://github.com/bdice) +- Expose option to enable fabric memory handle support to Python ([#1787](https://github.com/rapidsai/rmm/pull/1787)) [@pentschev](https://github.com/pentschev) + +## 🛠️ Improvements + +- fix(pytest): disable warning that gets raised to INTERNALERROR in pytest8.4.0 ([#1942](https://github.com/rapidsai/rmm/pull/1942)) [@gforsyth](https://github.com/gforsyth) +- use 'rapids-init-pip' in wheel CI, other CI changes ([#1926](https://github.com/rapidsai/rmm/pull/1926)) [@jameslamb](https://github.com/jameslamb) +- Finish CUDA 12.9 migration and use branch-25.06 workflows ([#1921](https://github.com/rapidsai/rmm/pull/1921)) [@bdice](https://github.com/bdice) +- Update to clang 20 ([#1918](https://github.com/rapidsai/rmm/pull/1918)) [@bdice](https://github.com/bdice) +- Quote head_rev in conda recipes ([#1915](https://github.com/rapidsai/rmm/pull/1915)) [@bdice](https://github.com/bdice) +- Build and test with CUDA 12.9.0 ([#1907](https://github.com/rapidsai/rmm/pull/1907)) [@bdice](https://github.com/bdice) +- Fix cpp wheel name to librmm. ([#1903](https://github.com/rapidsai/rmm/pull/1903)) [@bdice](https://github.com/bdice) +- Revert "Publish wheels and conda packages from Github Artifacts" ([#1898](https://github.com/rapidsai/rmm/pull/1898)) [@bdice](https://github.com/bdice) +- Publish wheels and conda packages from Github Artifacts ([#1897](https://github.com/rapidsai/rmm/pull/1897)) [@VenkateshJaya](https://github.com/VenkateshJaya) +- Download build artifacts from Github for CI ([#1895](https://github.com/rapidsai/rmm/pull/1895)) [@VenkateshJaya](https://github.com/VenkateshJaya) +- remove mkdir and test corresponding shared workflow ([#1892](https://github.com/rapidsai/rmm/pull/1892)) [@msarahan](https://github.com/msarahan) +- Revert "Auto-sync draft PRs" ([#1891](https://github.com/rapidsai/rmm/pull/1891)) [@bdice](https://github.com/bdice) +- Auto-sync draft PRs ([#1890](https://github.com/rapidsai/rmm/pull/1890)) [@bdice](https://github.com/bdice) +- Add ARM conda environments ([#1889](https://github.com/rapidsai/rmm/pull/1889)) [@bdice](https://github.com/bdice) +- Vendor RAPIDS.cmake to avoid network call. ([#1886](https://github.com/rapidsai/rmm/pull/1886)) [@bdice](https://github.com/bdice) +- [pre-commit.ci] pre-commit autoupdate ([#1885](https://github.com/rapidsai/rmm/pull/1885)) [@pre-commit-ci[bot]](https://github.com/pre-commit-ci[bot]) +- Move RMM C++ code into cpp directory. ([#1883](https://github.com/rapidsai/rmm/pull/1883)) [@bdice](https://github.com/bdice) +- refactor(rattler): enable strict channel priority for builds ([#1867](https://github.com/rapidsai/rmm/pull/1867)) [@gforsyth](https://github.com/gforsyth) +- Add support for Python 3.13 ([#1851](https://github.com/rapidsai/rmm/pull/1851)) [@bdice](https://github.com/bdice) +- Streamlining wheel builds to use fixed location and uploading build artifacts to Github ([#1810](https://github.com/rapidsai/rmm/pull/1810)) [@VenkateshJaya](https://github.com/VenkateshJaya) + +# rmm 25.04.00 (9 Apr 2025) + +## 🚨 Breaking Changes + +- Add OOM fail reason, attempted allocation size to exception messages (retry) ([#1844](https://github.com/rapidsai/rmm/pull/1844)) [@pmattione-nvidia](https://github.com/pmattione-nvidia) +- Use new rapids-logger library ([#1808](https://github.com/rapidsai/rmm/pull/1808)) [@vyasr](https://github.com/vyasr) + +## 🐛 Bug Fixes + +- Revert "Set mempool hw_decompress flag if driver supports it ([#1854)" (#1873](https://github.com/rapidsai/rmm/pull/1854)" (#1873)) [@wence-](https://github.com/wence-) +- Fix run export on cudatoolkit ([#1862](https://github.com/rapidsai/rmm/pull/1862)) [@vyasr](https://github.com/vyasr) +- Fix dependencies.yaml for update-version.sh ([#1859](https://github.com/rapidsai/rmm/pull/1859)) [@raydouglass](https://github.com/raydouglass) +- Embed `__FILE__` as C-string for prefix replacement ([#1858](https://github.com/rapidsai/rmm/pull/1858)) [@jakirkham](https://github.com/jakirkham) +- Add OOM fail reason, attempted allocation size to exception messages (retry) ([#1844](https://github.com/rapidsai/rmm/pull/1844)) [@pmattione-nvidia](https://github.com/pmattione-nvidia) +- Revert "Add OOM fail reason, attempted allocation size to exception messages" ([#1843](https://github.com/rapidsai/rmm/pull/1843)) [@pmattione-nvidia](https://github.com/pmattione-nvidia) +- fix GITHUB_WORKSPACE not being present locally ([#1841](https://github.com/rapidsai/rmm/pull/1841)) [@msarahan](https://github.com/msarahan) +- Add telemetry setup to build workflows ([#1838](https://github.com/rapidsai/rmm/pull/1838)) [@bdice](https://github.com/bdice) +- Use static gbench ([#1837](https://github.com/rapidsai/rmm/pull/1837)) [@bdice](https://github.com/bdice) +- Fixes for rattler recipe ([#1835](https://github.com/rapidsai/rmm/pull/1835)) [@bdice](https://github.com/bdice) +- Depend on rapids-logger in host to prevent redistribution ([#1834](https://github.com/rapidsai/rmm/pull/1834)) [@bdice](https://github.com/bdice) +- Add OOM fail reason, attempted allocation size to exception messages ([#1827](https://github.com/rapidsai/rmm/pull/1827)) [@pmattione-nvidia](https://github.com/pmattione-nvidia) + +## 📖 Documentation + +- mr/host: fix incorrect docs usage of device_memory_resource ([#1809](https://github.com/rapidsai/rmm/pull/1809)) [@ghost](https://github.com/ghost) + +## 🚀 New Features + +- Add async view memory resource bindings to Python. ([#1864](https://github.com/rapidsai/rmm/pull/1864)) [@bdice](https://github.com/bdice) +- Run examples in CI ([#1850](https://github.com/rapidsai/rmm/pull/1850)) [@bdice](https://github.com/bdice) +- Add tests for RMM internal macros. ([#1847](https://github.com/rapidsai/rmm/pull/1847)) [@bdice](https://github.com/bdice) +- Add basic example. ([#1800](https://github.com/rapidsai/rmm/pull/1800)) [@bdice](https://github.com/bdice) + +## 🛠️ Improvements + +- Set mempool hw_decompress flag if driver supports it ([#1854](https://github.com/rapidsai/rmm/pull/1854)) [@wence-](https://github.com/wence-) +- Error if LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE is not defined. ([#1852](https://github.com/rapidsai/rmm/pull/1852)) [@bdice](https://github.com/bdice) +- Fix for -fdebug-prefix-map breaking sccache ([#1846](https://github.com/rapidsai/rmm/pull/1846)) [@bdice](https://github.com/bdice) +- fix(rattler): force `cuda_major` and `date_string` to be strings ([#1842](https://github.com/rapidsai/rmm/pull/1842)) [@gforsyth](https://github.com/gforsyth) +- use gha-tools rapids-telemetry-setup for mkdir -p ([#1839](https://github.com/rapidsai/rmm/pull/1839)) [@msarahan](https://github.com/msarahan) +- fix(rattler): resolve all overlinking errors ([#1836](https://github.com/rapidsai/rmm/pull/1836)) [@gforsyth](https://github.com/gforsyth) +- Update rattler-build recipe with assorted small fixes ([#1832](https://github.com/rapidsai/rmm/pull/1832)) [@gforsyth](https://github.com/gforsyth) +- Sccache stats telemetry ([#1830](https://github.com/rapidsai/rmm/pull/1830)) [@msarahan](https://github.com/msarahan) +- Consolidate more Conda solves in CI ([#1828](https://github.com/rapidsai/rmm/pull/1828)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- Require CMake 3.30.4 ([#1826](https://github.com/rapidsai/rmm/pull/1826)) [@robertmaynard](https://github.com/robertmaynard) +- Create Conda CI test env in one step ([#1824](https://github.com/rapidsai/rmm/pull/1824)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- Apply IWYU changes and fix deprecated GTest usage ([#1821](https://github.com/rapidsai/rmm/pull/1821)) [@bdice](https://github.com/bdice) +- Remove unnecessary index ([#1820](https://github.com/rapidsai/rmm/pull/1820)) [@vyasr](https://github.com/vyasr) +- Use shared-workflows branch-25.04 ([#1816](https://github.com/rapidsai/rmm/pull/1816)) [@bdice](https://github.com/bdice) +- Use `rapids-pip-retry` in CI jobs that might need retries ([#1814](https://github.com/rapidsai/rmm/pull/1814)) [@gforsyth](https://github.com/gforsyth) +- Use nightly matrix for branch tests. ([#1813](https://github.com/rapidsai/rmm/pull/1813)) [@bdice](https://github.com/bdice) +- Use build_type input ([#1812](https://github.com/rapidsai/rmm/pull/1812)) [@bdice](https://github.com/bdice) +- Add `build_type` to workflow inputs ([#1811](https://github.com/rapidsai/rmm/pull/1811)) [@gforsyth](https://github.com/gforsyth) +- Use new rapids-logger library ([#1808](https://github.com/rapidsai/rmm/pull/1808)) [@vyasr](https://github.com/vyasr) +- Forward-merge branch-25.02 to branch-25.04 ([#1806](https://github.com/rapidsai/rmm/pull/1806)) [@bdice](https://github.com/bdice) +- disallow fallback to Make in wheel builds ([#1804](https://github.com/rapidsai/rmm/pull/1804)) [@jameslamb](https://github.com/jameslamb) +- Migrate to NVKS for amd64 CI runners ([#1803](https://github.com/rapidsai/rmm/pull/1803)) [@bdice](https://github.com/bdice) +- Branch 25.04 merge branch 25.02 ([#1799](https://github.com/rapidsai/rmm/pull/1799)) [@vyasr](https://github.com/vyasr) +- Port to rattler-build ([#1796](https://github.com/rapidsai/rmm/pull/1796)) [@gforsyth](https://github.com/gforsyth) + +# rmm 25.02.00 (13 Feb 2025) + +## 🚨 Breaking Changes + +- Switch to using separate rapids-logger repo ([#1774](https://github.com/rapidsai/rmm/pull/1774)) [@vyasr](https://github.com/vyasr) +- Remove deprecated factory functions from resource adaptors. ([#1767](https://github.com/rapidsai/rmm/pull/1767)) [@bdice](https://github.com/bdice) +- Remove `rmm._lib` ([#1765](https://github.com/rapidsai/rmm/pull/1765)) [@Matt711](https://github.com/Matt711) +- Remove memory access flags from cuda_async_memory_resource ([#1754](https://github.com/rapidsai/rmm/pull/1754)) [@abellina](https://github.com/abellina) +- Create logger wrapper around spdlog that can be easily reused in other libraries ([#1722](https://github.com/rapidsai/rmm/pull/1722)) [@vyasr](https://github.com/vyasr) + +## 🐛 Bug Fixes + +- Add missing array header include ([#1771](https://github.com/rapidsai/rmm/pull/1771)) [@robertmaynard](https://github.com/robertmaynard) +- Remove memory access flags from cuda_async_memory_resource ([#1754](https://github.com/rapidsai/rmm/pull/1754)) [@abellina](https://github.com/abellina) +- Update build.sh ([#1749](https://github.com/rapidsai/rmm/pull/1749)) [@vyasr](https://github.com/vyasr) +- Fix some logger issues ([#1739](https://github.com/rapidsai/rmm/pull/1739)) [@vyasr](https://github.com/vyasr) +- Use consistent signature for target_link_libraries ([#1738](https://github.com/rapidsai/rmm/pull/1738)) [@vyasr](https://github.com/vyasr) + +## 📖 Documentation + +- Revise README. ([#1747](https://github.com/rapidsai/rmm/pull/1747)) [@bdice](https://github.com/bdice) + +## 🚀 New Features + +- Make the stream module a part of the public API ([#1775](https://github.com/rapidsai/rmm/pull/1775)) [@Matt711](https://github.com/Matt711) +- Remove deprecated factory functions from resource adaptors. ([#1767](https://github.com/rapidsai/rmm/pull/1767)) [@bdice](https://github.com/bdice) +- Remove `rmm._lib` ([#1765](https://github.com/rapidsai/rmm/pull/1765)) [@Matt711](https://github.com/Matt711) +- Reduce dependencies on numba. ([#1761](https://github.com/rapidsai/rmm/pull/1761)) [@bdice](https://github.com/bdice) +- Use ruff, remove isort and black. ([#1759](https://github.com/rapidsai/rmm/pull/1759)) [@bdice](https://github.com/bdice) +- Use bindings layout for all cuda-python imports. ([#1756](https://github.com/rapidsai/rmm/pull/1756)) [@bdice](https://github.com/bdice) +- Add configuration for pre-commit.ci, update pre-commit hooks ([#1746](https://github.com/rapidsai/rmm/pull/1746)) [@bdice](https://github.com/bdice) +- Adds fabric handle and memory protection flags to cuda_async_memory_resource ([#1743](https://github.com/rapidsai/rmm/pull/1743)) [@abellina](https://github.com/abellina) +- Remove upper bounds on cuda-python to allow 12.6.2 and 11.8.5 ([#1729](https://github.com/rapidsai/rmm/pull/1729)) [@bdice](https://github.com/bdice) + +## 🛠️ Improvements + +- Revert CUDA 12.8 shared workflow branch changes ([#1805](https://github.com/rapidsai/rmm/pull/1805)) [@vyasr](https://github.com/vyasr) +- Build and test with CUDA 12.8.0 ([#1797](https://github.com/rapidsai/rmm/pull/1797)) [@bdice](https://github.com/bdice) +- Disable exec checks for `device_uvector::operator=` ([#1790](https://github.com/rapidsai/rmm/pull/1790)) [@miscco](https://github.com/miscco) +- Add upper bound to prevent usage of numba 0.61.0 ([#1789](https://github.com/rapidsai/rmm/pull/1789)) [@galipremsagar](https://github.com/galipremsagar) +- Add shellcheck to pre-commit and fix warnings ([#1788](https://github.com/rapidsai/rmm/pull/1788)) [@gforsyth](https://github.com/gforsyth) +- Add spdlog back as a requirement for now ([#1780](https://github.com/rapidsai/rmm/pull/1780)) [@vyasr](https://github.com/vyasr) +- [pre-commit.ci] pre-commit autoupdate ([#1778](https://github.com/rapidsai/rmm/pull/1778)) [@pre-commit-ci[bot]](https://github.com/pre-commit-ci[bot]) +- Use rapids-cmake for the logger ([#1776](https://github.com/rapidsai/rmm/pull/1776)) [@vyasr](https://github.com/vyasr) +- Switch to using separate rapids-logger repo ([#1774](https://github.com/rapidsai/rmm/pull/1774)) [@vyasr](https://github.com/vyasr) +- Use GCC 13 in CUDA 12 conda builds. ([#1773](https://github.com/rapidsai/rmm/pull/1773)) [@bdice](https://github.com/bdice) +- Check if nightlies have succeeded recently enough ([#1772](https://github.com/rapidsai/rmm/pull/1772)) [@vyasr](https://github.com/vyasr) +- Fix codespell behavior. ([#1769](https://github.com/rapidsai/rmm/pull/1769)) [@bdice](https://github.com/bdice) +- Remove ignored cuda-python deprecation warning. ([#1768](https://github.com/rapidsai/rmm/pull/1768)) [@bdice](https://github.com/bdice) +- Forward-merge branch-24.12 to branch-25.02 ([#1766](https://github.com/rapidsai/rmm/pull/1766)) [@bdice](https://github.com/bdice) +- Update version references in workflow ([#1757](https://github.com/rapidsai/rmm/pull/1757)) [@AyodeAwe](https://github.com/AyodeAwe) +- gate telemetry dispatch calls on TELEMETRY_ENABLED env var ([#1752](https://github.com/rapidsai/rmm/pull/1752)) [@msarahan](https://github.com/msarahan) +- Update cuda-python lower bounds to 12.6.2 / 11.8.5 ([#1751](https://github.com/rapidsai/rmm/pull/1751)) [@bdice](https://github.com/bdice) +- remove certs and simplify telemetry summarize ([#1750](https://github.com/rapidsai/rmm/pull/1750)) [@msarahan](https://github.com/msarahan) +- stop installing 'wheel' in wheel-building script ([#1748](https://github.com/rapidsai/rmm/pull/1748)) [@jameslamb](https://github.com/jameslamb) +- Require approval to run CI on draft PRs ([#1737](https://github.com/rapidsai/rmm/pull/1737)) [@bdice](https://github.com/bdice) +- Create logger wrapper around spdlog that can be easily reused in other libraries ([#1722](https://github.com/rapidsai/rmm/pull/1722)) [@vyasr](https://github.com/vyasr) +- Add breaking change workflow trigger ([#1719](https://github.com/rapidsai/rmm/pull/1719)) [@AyodeAwe](https://github.com/AyodeAwe) + +# rmm 24.12.00 (11 Dec 2024) + +## 🚨 Breaking Changes + +- Deprecate support for directly accessing logger ([#1690](https://github.com/rapidsai/rmm/pull/1690)) [@vyasr](https://github.com/vyasr) + +## 🐛 Bug Fixes + +- Query total memory in failure_callback_resource_adaptor tests ([#1734](https://github.com/rapidsai/rmm/pull/1734)) [@harrism](https://github.com/harrism) +- Treat deprecation warnings as errors and fix deprecation warnings in replay benchmark ([#1728](https://github.com/rapidsai/rmm/pull/1728)) [@harrism](https://github.com/harrism) +- Disallow cuda-python 12.6.1 and 11.8.4 ([#1720](https://github.com/rapidsai/rmm/pull/1720)) [@bdice](https://github.com/bdice) +- Fix typos in .gitignore ([#1697](https://github.com/rapidsai/rmm/pull/1697)) [@charlesbluca](https://github.com/charlesbluca) +- Fix `rmm ._lib` imports ([#1693](https://github.com/rapidsai/rmm/pull/1693)) [@Matt711](https://github.com/Matt711) + +## 📖 Documentation + +- Fix docs warning ([#1706](https://github.com/rapidsai/rmm/pull/1706)) [@bdice](https://github.com/bdice) +- Update cross-link to cuda-python object ([#1699](https://github.com/rapidsai/rmm/pull/1699)) [@wence-](https://github.com/wence-) + +## 🚀 New Features + +- Correct rmm tests for validity of device pointers ([#1714](https://github.com/rapidsai/rmm/pull/1714)) [@robertmaynard](https://github.com/robertmaynard) +- Update rmm tests to use rapids_cmake_support_conda_env ([#1707](https://github.com/rapidsai/rmm/pull/1707)) [@robertmaynard](https://github.com/robertmaynard) +- adding telemetry ([#1692](https://github.com/rapidsai/rmm/pull/1692)) [@msarahan](https://github.com/msarahan) +- Make `cudaMallocAsync` logic non-optional as we require CUDA 11.2+ ([#1667](https://github.com/rapidsai/rmm/pull/1667)) [@robertmaynard](https://github.com/robertmaynard) + +## 🛠️ Improvements + +- enforce wheel size limits, README formatting in CI ([#1726](https://github.com/rapidsai/rmm/pull/1726)) [@jameslamb](https://github.com/jameslamb) +- Remove all explicit usage of fmtlib ([#1724](https://github.com/rapidsai/rmm/pull/1724)) [@harrism](https://github.com/harrism) +- WIP: put a ceiling on cuda-python ([#1723](https://github.com/rapidsai/rmm/pull/1723)) [@jameslamb](https://github.com/jameslamb) +- use rapids-generate-pip-constraints to pin to oldest dependencies in CI ([#1716](https://github.com/rapidsai/rmm/pull/1716)) [@jameslamb](https://github.com/jameslamb) +- Deprecate `rmm._lib` ([#1713](https://github.com/rapidsai/rmm/pull/1713)) [@Matt711](https://github.com/Matt711) +- print sccache stats in builds ([#1712](https://github.com/rapidsai/rmm/pull/1712)) [@jameslamb](https://github.com/jameslamb) +- [fea] Expose the arena mr to the Python interface. ([#1711](https://github.com/rapidsai/rmm/pull/1711)) [@trivialfis](https://github.com/trivialfis) +- devcontainer: replace `VAULT_HOST` with `AWS_ROLE_ARN` ([#1708](https://github.com/rapidsai/rmm/pull/1708)) [@jjacobelli](https://github.com/jjacobelli) +- make conda installs in CI stricter (part 2) ([#1703](https://github.com/rapidsai/rmm/pull/1703)) [@jameslamb](https://github.com/jameslamb) +- Add BUILD_SHARED_LIBS option defaulting to ON ([#1702](https://github.com/rapidsai/rmm/pull/1702)) [@wence-](https://github.com/wence-) +- make conda installs in CI stricter ([#1696](https://github.com/rapidsai/rmm/pull/1696)) [@jameslamb](https://github.com/jameslamb) +- Prune workflows based on changed files ([#1695](https://github.com/rapidsai/rmm/pull/1695)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- Deprecate support for directly accessing logger ([#1690](https://github.com/rapidsai/rmm/pull/1690)) [@vyasr](https://github.com/vyasr) +- Use `rmm::percent_of_free_device_memory` in arena test ([#1689](https://github.com/rapidsai/rmm/pull/1689)) [@wence-](https://github.com/wence-) +- exclude 'gcovr' from list of development pip packages ([#1688](https://github.com/rapidsai/rmm/pull/1688)) [@jameslamb](https://github.com/jameslamb) +- [Improvement] Reorganize Cython to separate C++ bindings and make Cython classes public ([#1676](https://github.com/rapidsai/rmm/pull/1676)) [@Matt711](https://github.com/Matt711) + +# rmm 24.10.00 (9 Oct 2024) + +## 🚨 Breaking Changes + +- Inline functions that return static references must have default visibility ([#1653](https://github.com/rapidsai/rmm/pull/1653)) [@wence-](https://github.com/wence-) +- Hide visibility of non-public symbols ([#1644](https://github.com/rapidsai/rmm/pull/1644)) [@jameslamb](https://github.com/jameslamb) +- Deprecate adaptor factories. ([#1626](https://github.com/rapidsai/rmm/pull/1626)) [@bdice](https://github.com/bdice) + +## 🐛 Bug Fixes + +- Add missing include to `resource_ref.hpp` ([#1677](https://github.com/rapidsai/rmm/pull/1677)) [@miscco](https://github.com/miscco) +- Remove the friend declaration with an attribute ([#1669](https://github.com/rapidsai/rmm/pull/1669)) [@kingcrimsontianyu](https://github.com/kingcrimsontianyu) +- Fix `build.sh clean` to delete python build directory ([#1658](https://github.com/rapidsai/rmm/pull/1658)) [@rongou](https://github.com/rongou) +- Stream synchronize before deallocating SAM ([#1655](https://github.com/rapidsai/rmm/pull/1655)) [@rongou](https://github.com/rongou) +- Explicitly mark RMM headers with `RMM_EXPORT` ([#1654](https://github.com/rapidsai/rmm/pull/1654)) [@robertmaynard](https://github.com/robertmaynard) +- Inline functions that return static references must have default visibility ([#1653](https://github.com/rapidsai/rmm/pull/1653)) [@wence-](https://github.com/wence-) +- Use `tool.scikit-build.cmake.version` ([#1637](https://github.com/rapidsai/rmm/pull/1637)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) + +## 📖 Documentation + +- Recommend `miniforge` for conda install. ([#1681](https://github.com/rapidsai/rmm/pull/1681)) [@bdice](https://github.com/bdice) +- Fix docs cross reference in DeviceBuffer.prefetch ([#1636](https://github.com/rapidsai/rmm/pull/1636)) [@bdice](https://github.com/bdice) + +## 🚀 New Features + +- [FEA] Allow setting `*_pool_size` with human-readable string ([#1670](https://github.com/rapidsai/rmm/pull/1670)) [@Matt711](https://github.com/Matt711) +- Update RMM adaptors, containers and tests to use get/set_current_device_resource_ref() ([#1661](https://github.com/rapidsai/rmm/pull/1661)) [@harrism](https://github.com/harrism) +- Deprecate adaptor factories. ([#1626](https://github.com/rapidsai/rmm/pull/1626)) [@bdice](https://github.com/bdice) +- Allow testing of earliest/latest dependencies ([#1613](https://github.com/rapidsai/rmm/pull/1613)) [@seberg](https://github.com/seberg) +- Add resource_ref versions of get/set_current_device_resource ([#1598](https://github.com/rapidsai/rmm/pull/1598)) [@harrism](https://github.com/harrism) + +## 🛠️ Improvements + +- Update update-version.sh to use packaging lib ([#1685](https://github.com/rapidsai/rmm/pull/1685)) [@AyodeAwe](https://github.com/AyodeAwe) +- Use CI workflow branch 'branch-24.10' again ([#1683](https://github.com/rapidsai/rmm/pull/1683)) [@jameslamb](https://github.com/jameslamb) +- Update fmt (to 11.0.2) and spdlog (to 1.14.1). ([#1678](https://github.com/rapidsai/rmm/pull/1678)) [@jameslamb](https://github.com/jameslamb) +- Attempt to address oom failures in test suite ([#1672](https://github.com/rapidsai/rmm/pull/1672)) [@wence-](https://github.com/wence-) +- Add support for Python 3.12 ([#1666](https://github.com/rapidsai/rmm/pull/1666)) [@jameslamb](https://github.com/jameslamb) +- Update rapidsai/pre-commit-hooks ([#1663](https://github.com/rapidsai/rmm/pull/1663)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- Drop Python 3.9 support ([#1659](https://github.com/rapidsai/rmm/pull/1659)) [@jameslamb](https://github.com/jameslamb) +- Remove NumPy <2 pin ([#1650](https://github.com/rapidsai/rmm/pull/1650)) [@seberg](https://github.com/seberg) +- Hide visibility of non-public symbols ([#1644](https://github.com/rapidsai/rmm/pull/1644)) [@jameslamb](https://github.com/jameslamb) +- Update pre-commit hooks ([#1643](https://github.com/rapidsai/rmm/pull/1643)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- Improve update-version.sh ([#1640](https://github.com/rapidsai/rmm/pull/1640)) [@bdice](https://github.com/bdice) +- Install headers into `${CMAKE_INSTALL_INCLUDEDIR}` ([#1633](https://github.com/rapidsai/rmm/pull/1633)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- Merge branch-24.08 into branch-24.10 ([#1631](https://github.com/rapidsai/rmm/pull/1631)) [@jameslamb](https://github.com/jameslamb) + +# rmm 24.08.00 (7 Aug 2024) + +## 🚨 Breaking Changes + +- Add a stack to the statistics resource ([#1563](https://github.com/rapidsai/rmm/pull/1563)) [@madsbk](https://github.com/madsbk) + +## 🐛 Bug Fixes + +- Rename `.devcontainer`s for CUDA 12.5 ([#1615](https://github.com/rapidsai/rmm/pull/1615)) [@jakirkham](https://github.com/jakirkham) +- Avoid accessing statistics_resource_adaptor stack top if it is empty ([#1588](https://github.com/rapidsai/rmm/pull/1588)) [@harrism](https://github.com/harrism) +- Avoid `--find-links`. ([#1583](https://github.com/rapidsai/rmm/pull/1583)) [@bdice](https://github.com/bdice) +- Fix test_python matrix ([#1579](https://github.com/rapidsai/rmm/pull/1579)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- Allow anonymous user in devcontainer name ([#1576](https://github.com/rapidsai/rmm/pull/1576)) [@bdice](https://github.com/bdice) + +## 📖 Documentation + +- Instruct to create associated issue in PR template. ([#1624](https://github.com/rapidsai/rmm/pull/1624)) [@harrism](https://github.com/harrism) +- add rapids-build-backend to docs ([#1614](https://github.com/rapidsai/rmm/pull/1614)) [@jameslamb](https://github.com/jameslamb) +- Revert "Remove HTML builds of librmm ([#1415)" (#1604](https://github.com/rapidsai/rmm/pull/1415)" (#1604)) [@bdice](https://github.com/bdice) +- Add documentation for CPM usage ([#1600](https://github.com/rapidsai/rmm/pull/1600)) [@pauleonix](https://github.com/pauleonix) +- Update Thrust CMake Guide link in README.md ([#1593](https://github.com/rapidsai/rmm/pull/1593)) [@pauleonix](https://github.com/pauleonix) + +## 🚀 New Features + +- Prefetch resource adaptor ([#1608](https://github.com/rapidsai/rmm/pull/1608)) [@bdice](https://github.com/bdice) +- Add python wrapper for system memory resource ([#1605](https://github.com/rapidsai/rmm/pull/1605)) [@rongou](https://github.com/rongou) +- Refactor mr_ref_tests to not depend on MR base classes ([#1589](https://github.com/rapidsai/rmm/pull/1589)) [@harrism](https://github.com/harrism) +- Add system memory resource ([#1581](https://github.com/rapidsai/rmm/pull/1581)) [@rongou](https://github.com/rongou) +- Add rmm::prefetch() and DeviceBuffer.prefetch() ([#1573](https://github.com/rapidsai/rmm/pull/1573)) [@harrism](https://github.com/harrism) + +## 🛠️ Improvements + +- split up CUDA-suffixed dependencies in dependencies.yaml ([#1627](https://github.com/rapidsai/rmm/pull/1627)) [@jameslamb](https://github.com/jameslamb) +- Remove prefetch factory. ([#1625](https://github.com/rapidsai/rmm/pull/1625)) [@bdice](https://github.com/bdice) +- Use workflow branch 24.08 again ([#1617](https://github.com/rapidsai/rmm/pull/1617)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- Build and test with CUDA 12.5.1 ([#1607](https://github.com/rapidsai/rmm/pull/1607)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- skip CMake 3.30.0 ([#1603](https://github.com/rapidsai/rmm/pull/1603)) [@jameslamb](https://github.com/jameslamb) +- Add RMM_USE_NVTX cmake option to provide localized control of NVTX for RMM ([#1602](https://github.com/rapidsai/rmm/pull/1602)) [@jlowe](https://github.com/jlowe) +- Use verify-alpha-spec hook ([#1601](https://github.com/rapidsai/rmm/pull/1601)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- Avoid --find-links in wheel jobs ([#1586](https://github.com/rapidsai/rmm/pull/1586)) [@jameslamb](https://github.com/jameslamb) +- resolve dependency-file-generator warning, remove unnecessary rapids-build-backend configuration ([#1582](https://github.com/rapidsai/rmm/pull/1582)) [@jameslamb](https://github.com/jameslamb) +- Remove THRUST_WRAPPED_NAMESPACE and tests ([#1578](https://github.com/rapidsai/rmm/pull/1578)) [@harrism](https://github.com/harrism) +- Remove text builds of documentation ([#1575](https://github.com/rapidsai/rmm/pull/1575)) [@vyasr](https://github.com/vyasr) +- ensure update-version.sh preserves alpha specs ([#1572](https://github.com/rapidsai/rmm/pull/1572)) [@jameslamb](https://github.com/jameslamb) +- Add `available_device_memory` to fetch free amount of memory on a GPU ([#1567](https://github.com/rapidsai/rmm/pull/1567)) [@galipremsagar](https://github.com/galipremsagar) +- Add a stack to the statistics resource ([#1563](https://github.com/rapidsai/rmm/pull/1563)) [@madsbk](https://github.com/madsbk) +- Use rapids-build-backend. ([#1502](https://github.com/rapidsai/rmm/pull/1502)) [@bdice](https://github.com/bdice) + +# rmm 24.06.00 (5 Jun 2024) + +## 🚨 Breaking Changes + +- Refactor polymorphic allocator to use device_async_resource_ref ([#1555](https://github.com/rapidsai/rmm/pull/1555)) [@harrism](https://github.com/harrism) +- Remove deprecated functionality ([#1537](https://github.com/rapidsai/rmm/pull/1537)) [@harrism](https://github.com/harrism) +- Remove deprecated cuda_async_memory_resource constructor that takes thrust::optional parameters ([#1535](https://github.com/rapidsai/rmm/pull/1535)) [@harrism](https://github.com/harrism) +- Remove deprecated supports_streams and get_mem_info methods. ([#1519](https://github.com/rapidsai/rmm/pull/1519)) [@harrism](https://github.com/harrism) + +## 🐛 Bug Fixes + +- rmm needs to link to nvtx3::nvtx3-cpp to support installed nvtx3 ([#1569](https://github.com/rapidsai/rmm/pull/1569)) [@robertmaynard](https://github.com/robertmaynard) +- Make sure rmm wheel dependency on librmm is updated [skip ci] ([#1565](https://github.com/rapidsai/rmm/pull/1565)) [@raydouglass](https://github.com/raydouglass) +- Don't ignore GCC-specific warning under Clang ([#1557](https://github.com/rapidsai/rmm/pull/1557)) [@aaronmondal](https://github.com/aaronmondal) +- Add publish jobs for C++ wheels ([#1554](https://github.com/rapidsai/rmm/pull/1554)) [@vyasr](https://github.com/vyasr) +- Explicitly use the current device resource in DeviceBuffer ([#1514](https://github.com/rapidsai/rmm/pull/1514)) [@wence-](https://github.com/wence-) + +## 📖 Documentation + +- Allow specifying mr in DeviceBuffer construction, and document ownership requirements in Python/C++ interfacing ([#1552](https://github.com/rapidsai/rmm/pull/1552)) [@wence-](https://github.com/wence-) +- Fix Python install instruction ([#1547](https://github.com/rapidsai/rmm/pull/1547)) [@wence-](https://github.com/wence-) +- Update multi-gpu discussion for device_buffer and device_vector dtors ([#1524](https://github.com/rapidsai/rmm/pull/1524)) [@wence-](https://github.com/wence-) +- Fix ordering / heading levels in README.md and python example in guide.md ([#1513](https://github.com/rapidsai/rmm/pull/1513)) [@harrism](https://github.com/harrism) + +## 🚀 New Features + +- Add NVTX support and RMM_FUNC_RANGE() macro ([#1558](https://github.com/rapidsai/rmm/pull/1558)) [@harrism](https://github.com/harrism) +- Always use a static gtest ([#1532](https://github.com/rapidsai/rmm/pull/1532)) [@robertmaynard](https://github.com/robertmaynard) +- Build C++ wheel ([#1529](https://github.com/rapidsai/rmm/pull/1529)) [@vyasr](https://github.com/vyasr) +- Remove deprecated supports_streams and get_mem_info methods. ([#1519](https://github.com/rapidsai/rmm/pull/1519)) [@harrism](https://github.com/harrism) + +## 🛠️ Improvements + +- update copyright dates ([#1564](https://github.com/rapidsai/rmm/pull/1564)) [@jameslamb](https://github.com/jameslamb) +- Overhaul ops-codeowners ([#1561](https://github.com/rapidsai/rmm/pull/1561)) [@raydouglass](https://github.com/raydouglass) +- Adding support for cupy.cuda.stream.ExternalStream ([#1559](https://github.com/rapidsai/rmm/pull/1559)) [@lilohuang](https://github.com/lilohuang) +- Refactor polymorphic allocator to use device_async_resource_ref ([#1555](https://github.com/rapidsai/rmm/pull/1555)) [@harrism](https://github.com/harrism) +- add RAPIDS copyright pre-commit hook ([#1553](https://github.com/rapidsai/rmm/pull/1553)) [@jameslamb](https://github.com/jameslamb) +- Enable warnings as errors for Python tests ([#1551](https://github.com/rapidsai/rmm/pull/1551)) [@mroeschke](https://github.com/mroeschke) +- Remove header existence tests. ([#1550](https://github.com/rapidsai/rmm/pull/1550)) [@bdice](https://github.com/bdice) +- Only use functions in the limited API ([#1545](https://github.com/rapidsai/rmm/pull/1545)) [@vyasr](https://github.com/vyasr) +- Migrate to `{{ stdlib("c") }}` ([#1543](https://github.com/rapidsai/rmm/pull/1543)) [@hcho3](https://github.com/hcho3) +- Fix `cuda11.8` nvcc dependency ([#1542](https://github.com/rapidsai/rmm/pull/1542)) [@trxcllnt](https://github.com/trxcllnt) +- add --rm and --name to devcontainer run args ([#1539](https://github.com/rapidsai/rmm/pull/1539)) [@trxcllnt](https://github.com/trxcllnt) +- Remove deprecated functionality ([#1537](https://github.com/rapidsai/rmm/pull/1537)) [@harrism](https://github.com/harrism) +- Remove deprecated cuda_async_memory_resource constructor that takes thrust::optional parameters ([#1535](https://github.com/rapidsai/rmm/pull/1535)) [@harrism](https://github.com/harrism) +- Make thrust_allocator deallocate safe in multi-device setting ([#1533](https://github.com/rapidsai/rmm/pull/1533)) [@wence-](https://github.com/wence-) +- Move rmm Python package to subdirectory ([#1526](https://github.com/rapidsai/rmm/pull/1526)) [@vyasr](https://github.com/vyasr) +- Remove a file not being used ([#1521](https://github.com/rapidsai/rmm/pull/1521)) [@galipremsagar](https://github.com/galipremsagar) +- Remove unneeded `update-version.sh` update ([#1520](https://github.com/rapidsai/rmm/pull/1520)) [@AyodeAwe](https://github.com/AyodeAwe) +- Enable all tests for `arm` arch ([#1510](https://github.com/rapidsai/rmm/pull/1510)) [@galipremsagar](https://github.com/galipremsagar) + +# RMM 24.04.00 (10 Apr 2024) + +## 🚨 Breaking Changes + +- Accept stream argument in DeviceMemoryResource allocate/deallocate ([#1494](https://github.com/rapidsai/rmm/pull/1494)) [@wence-](https://github.com/wence-) +- Replace all internal usage of `get_upstream` with `get_upstream_resource` ([#1491](https://github.com/rapidsai/rmm/pull/1491)) [@miscco](https://github.com/miscco) +- Deprecate rmm::mr::device_memory_resource::supports_streams() ([#1452](https://github.com/rapidsai/rmm/pull/1452)) [@harrism](https://github.com/harrism) +- Remove deprecated rmm::detail::available_device_memory ([#1438](https://github.com/rapidsai/rmm/pull/1438)) [@harrism](https://github.com/harrism) +- Make device_memory_resource::supports_streams() not pure virtual. Remove derived implementations and calls in RMM ([#1437](https://github.com/rapidsai/rmm/pull/1437)) [@harrism](https://github.com/harrism) +- Deprecate rmm::mr::device_memory_resource::get_mem_info() and supports_get_mem_info(). ([#1436](https://github.com/rapidsai/rmm/pull/1436)) [@harrism](https://github.com/harrism) + +## 🐛 Bug Fixes + +- Fix search path for torch allocator in editable installs and ensure CUDA support is available ([#1498](https://github.com/rapidsai/rmm/pull/1498)) [@vyasr](https://github.com/vyasr) +- Accept stream argument in DeviceMemoryResource allocate/deallocate ([#1494](https://github.com/rapidsai/rmm/pull/1494)) [@wence-](https://github.com/wence-) +- Run STATISTICS_TEST and TRACKING_TEST in serial to avoid OOM errors. ([#1487](https://github.com/rapidsai/rmm/pull/1487)) [@bdice](https://github.com/bdice) + +## 📖 Documentation + +- Pin to recent breathe, to prevent getting an unsupported sphinx version. ([#1495](https://github.com/rapidsai/rmm/pull/1495)) [@bdice](https://github.com/bdice) + +## 🚀 New Features + +- Replace all internal usage of `get_upstream` with `get_upstream_resource` ([#1491](https://github.com/rapidsai/rmm/pull/1491)) [@miscco](https://github.com/miscco) +- Add complete set of resource ref aliases ([#1479](https://github.com/rapidsai/rmm/pull/1479)) [@nvdbaranec](https://github.com/nvdbaranec) +- Automate include grouping using clang-format ([#1463](https://github.com/rapidsai/rmm/pull/1463)) [@harrism](https://github.com/harrism) +- Add `get_upstream_resource` to resource adaptors ([#1456](https://github.com/rapidsai/rmm/pull/1456)) [@miscco](https://github.com/miscco) +- Deprecate rmm::mr::device_memory_resource::supports_streams() ([#1452](https://github.com/rapidsai/rmm/pull/1452)) [@harrism](https://github.com/harrism) +- Remove duplicated memory_resource_tests ([#1451](https://github.com/rapidsai/rmm/pull/1451)) [@miscco](https://github.com/miscco) +- Change `rmm::exec_policy` to take `async_resource_ref` ([#1449](https://github.com/rapidsai/rmm/pull/1449)) [@miscco](https://github.com/miscco) +- Change `device_scalar` to take `async_resource_ref` ([#1447](https://github.com/rapidsai/rmm/pull/1447)) [@miscco](https://github.com/miscco) +- Add device_async_resource_ref convenience alias ([#1441](https://github.com/rapidsai/rmm/pull/1441)) [@harrism](https://github.com/harrism) +- Remove deprecated rmm::detail::available_device_memory ([#1438](https://github.com/rapidsai/rmm/pull/1438)) [@harrism](https://github.com/harrism) +- Make device_memory_resource::supports_streams() not pure virtual. Remove derived implementations and calls in RMM ([#1437](https://github.com/rapidsai/rmm/pull/1437)) [@harrism](https://github.com/harrism) +- Deprecate rmm::mr::device_memory_resource::get_mem_info() and supports_get_mem_info(). ([#1436](https://github.com/rapidsai/rmm/pull/1436)) [@harrism](https://github.com/harrism) +- Support CUDA 12.2 ([#1419](https://github.com/rapidsai/rmm/pull/1419)) [@jameslamb](https://github.com/jameslamb) + +## 🛠️ Improvements + +- Use `conda env create --yes` instead of `--force` ([#1509](https://github.com/rapidsai/rmm/pull/1509)) [@bdice](https://github.com/bdice) +- Add upper bound to prevent usage of NumPy 2 ([#1501](https://github.com/rapidsai/rmm/pull/1501)) [@bdice](https://github.com/bdice) +- Remove hard-coding of RAPIDS version where possible ([#1496](https://github.com/rapidsai/rmm/pull/1496)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- Require NumPy 1.23+ ([#1488](https://github.com/rapidsai/rmm/pull/1488)) [@jakirkham](https://github.com/jakirkham) +- Use `rmm::device_async_resource_ref` in multi_stream_allocation benchmark ([#1482](https://github.com/rapidsai/rmm/pull/1482)) [@miscco](https://github.com/miscco) +- Update devcontainers to CUDA Toolkit 12.2 ([#1470](https://github.com/rapidsai/rmm/pull/1470)) [@trxcllnt](https://github.com/trxcllnt) +- Add support for Python 3.11 ([#1469](https://github.com/rapidsai/rmm/pull/1469)) [@jameslamb](https://github.com/jameslamb) +- target branch-24.04 for GitHub Actions workflows ([#1468](https://github.com/rapidsai/rmm/pull/1468)) [@jameslamb](https://github.com/jameslamb) +- [FEA]: Use `std::optional` instead of `thrust::optional` ([#1464](https://github.com/rapidsai/rmm/pull/1464)) [@miscco](https://github.com/miscco) +- Add environment-agnostic scripts for running ctests and pytests ([#1462](https://github.com/rapidsai/rmm/pull/1462)) [@trxcllnt](https://github.com/trxcllnt) +- Ensure that `ctest` is called with `--no-tests=error`. ([#1460](https://github.com/rapidsai/rmm/pull/1460)) [@bdice](https://github.com/bdice) +- Update ops-bot.yaml ([#1458](https://github.com/rapidsai/rmm/pull/1458)) [@AyodeAwe](https://github.com/AyodeAwe) +- Adopt the `rmm::device_async_resource_ref` alias ([#1454](https://github.com/rapidsai/rmm/pull/1454)) [@miscco](https://github.com/miscco) +- Refactor error.hpp out of detail ([#1439](https://github.com/rapidsai/rmm/pull/1439)) [@lamarrr](https://github.com/lamarrr) + +# RMM 24.02.00 (12 Feb 2024) + +## 🚨 Breaking Changes + +- Make device_memory_resource::do_get_mem_info() and supports_get_mem_info() not pure virtual. Remove derived implementations and calls in RMM ([#1430](https://github.com/rapidsai/rmm/pull/1430)) [@harrism](https://github.com/harrism) +- Deprecate detail::available_device_memory, most detail/aligned.hpp utilities, and optional pool_memory_resource initial size ([#1424](https://github.com/rapidsai/rmm/pull/1424)) [@harrism](https://github.com/harrism) +- Require explicit pool size in `pool_memory_resource` and move some things out of detail namespace ([#1417](https://github.com/rapidsai/rmm/pull/1417)) [@harrism](https://github.com/harrism) +- Remove HTML builds of librmm ([#1415](https://github.com/rapidsai/rmm/pull/1415)) [@vyasr](https://github.com/vyasr) +- Update to CCCL 2.2.0. ([#1404](https://github.com/rapidsai/rmm/pull/1404)) [@bdice](https://github.com/bdice) +- Switch to scikit-build-core ([#1287](https://github.com/rapidsai/rmm/pull/1287)) [@vyasr](https://github.com/vyasr) + +## 🐛 Bug Fixes + +- Exclude tests from builds ([#1459](https://github.com/rapidsai/rmm/pull/1459)) [@vyasr](https://github.com/vyasr) +- Update CODEOWNERS ([#1410](https://github.com/rapidsai/rmm/pull/1410)) [@raydouglass](https://github.com/raydouglass) +- Correct signatures for torch allocator plug in ([#1407](https://github.com/rapidsai/rmm/pull/1407)) [@wence-](https://github.com/wence-) +- Fix Arena MR to support simultaneous access by PTDS and other streams ([#1395](https://github.com/rapidsai/rmm/pull/1395)) [@tgravescs](https://github.com/tgravescs) +- Fix else-after-throw clang tidy error ([#1391](https://github.com/rapidsai/rmm/pull/1391)) [@harrism](https://github.com/harrism) + +## 📖 Documentation + +- remove references to setup.py in docs ([#1420](https://github.com/rapidsai/rmm/pull/1420)) [@jameslamb](https://github.com/jameslamb) +- Remove HTML builds of librmm ([#1415](https://github.com/rapidsai/rmm/pull/1415)) [@vyasr](https://github.com/vyasr) +- Update GPU support docs to drop Pascal ([#1413](https://github.com/rapidsai/rmm/pull/1413)) [@harrism](https://github.com/harrism) + +## 🚀 New Features + +- Make device_memory_resource::do_get_mem_info() and supports_get_mem_info() not pure virtual. Remove derived implementations and calls in RMM ([#1430](https://github.com/rapidsai/rmm/pull/1430)) [@harrism](https://github.com/harrism) +- Deprecate detail::available_device_memory, most detail/aligned.hpp utilities, and optional pool_memory_resource initial size ([#1424](https://github.com/rapidsai/rmm/pull/1424)) [@harrism](https://github.com/harrism) +- Add a host-pinned memory resource that can be used as upstream for `pool_memory_resource`. ([#1392](https://github.com/rapidsai/rmm/pull/1392)) [@harrism](https://github.com/harrism) + +## 🛠️ Improvements + +- Remove usages of rapids-env-update ([#1423](https://github.com/rapidsai/rmm/pull/1423)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- Refactor CUDA versions in dependencies.yaml. ([#1422](https://github.com/rapidsai/rmm/pull/1422)) [@bdice](https://github.com/bdice) +- Require explicit pool size in `pool_memory_resource` and move some things out of detail namespace ([#1417](https://github.com/rapidsai/rmm/pull/1417)) [@harrism](https://github.com/harrism) +- Update dependencies.yaml to support CUDA 12.*. ([#1414](https://github.com/rapidsai/rmm/pull/1414)) [@bdice](https://github.com/bdice) +- Define python dependency range as a matrix fallback. ([#1409](https://github.com/rapidsai/rmm/pull/1409)) [@bdice](https://github.com/bdice) +- Use latest cuda-python within CUDA major version. ([#1406](https://github.com/rapidsai/rmm/pull/1406)) [@bdice](https://github.com/bdice) +- Update to CCCL 2.2.0. ([#1404](https://github.com/rapidsai/rmm/pull/1404)) [@bdice](https://github.com/bdice) +- Remove RMM_BUILD_WHEELS and standardize Python builds ([#1401](https://github.com/rapidsai/rmm/pull/1401)) [@vyasr](https://github.com/vyasr) +- Update to fmt 10.1.1 and spdlog 1.12.0. ([#1374](https://github.com/rapidsai/rmm/pull/1374)) [@bdice](https://github.com/bdice) +- Switch to scikit-build-core ([#1287](https://github.com/rapidsai/rmm/pull/1287)) [@vyasr](https://github.com/vyasr) + +# RMM 23.12.00 (6 Dec 2023) + +## 🚨 Breaking Changes + +- Document minimum CUDA version of 11.4 ([#1385](https://github.com/rapidsai/rmm/pull/1385)) [@harrism](https://github.com/harrism) +- Store and set the correct CUDA device in device_buffer ([#1370](https://github.com/rapidsai/rmm/pull/1370)) [@harrism](https://github.com/harrism) +- Use `cuda::mr::memory_resource` instead of raw `device_memory_resource` ([#1095](https://github.com/rapidsai/rmm/pull/1095)) [@miscco](https://github.com/miscco) + +## 🐛 Bug Fixes + +- Update actions/labeler to v4 ([#1397](https://github.com/rapidsai/rmm/pull/1397)) [@raydouglass](https://github.com/raydouglass) +- Backport arena MR fix for simultaneous access by PTDS and other streams ([#1396](https://github.com/rapidsai/rmm/pull/1396)) [@bdice](https://github.com/bdice) +- Deliberately leak PTDS thread_local events in stream ordered mr ([#1375](https://github.com/rapidsai/rmm/pull/1375)) [@wence-](https://github.com/wence-) +- Add missing CUDA 12 dependencies and fix dlopen library names ([#1366](https://github.com/rapidsai/rmm/pull/1366)) [@vyasr](https://github.com/vyasr) + +## 📖 Documentation + +- Document minimum CUDA version of 11.4 ([#1385](https://github.com/rapidsai/rmm/pull/1385)) [@harrism](https://github.com/harrism) +- Fix more doxygen issues ([#1367](https://github.com/rapidsai/rmm/pull/1367)) [@vyasr](https://github.com/vyasr) +- Add groups to the doxygen docs ([#1358](https://github.com/rapidsai/rmm/pull/1358)) [@vyasr](https://github.com/vyasr) +- Enable doxygen XML and fix issues ([#1348](https://github.com/rapidsai/rmm/pull/1348)) [@vyasr](https://github.com/vyasr) + +## 🚀 New Features + +- Make internally stored default argument values public ([#1373](https://github.com/rapidsai/rmm/pull/1373)) [@vyasr](https://github.com/vyasr) +- Store and set the correct CUDA device in device_buffer ([#1370](https://github.com/rapidsai/rmm/pull/1370)) [@harrism](https://github.com/harrism) +- Update rapids-cmake functions to non-deprecated signatures ([#1357](https://github.com/rapidsai/rmm/pull/1357)) [@robertmaynard](https://github.com/robertmaynard) +- Generate unified Python/C++ docs ([#1324](https://github.com/rapidsai/rmm/pull/1324)) [@vyasr](https://github.com/vyasr) +- Use `cuda::mr::memory_resource` instead of raw `device_memory_resource` ([#1095](https://github.com/rapidsai/rmm/pull/1095)) [@miscco](https://github.com/miscco) + +## 🛠️ Improvements + +- Silence false gcc warning ([#1381](https://github.com/rapidsai/rmm/pull/1381)) [@miscco](https://github.com/miscco) +- Build concurrency for nightly and merge triggers ([#1380](https://github.com/rapidsai/rmm/pull/1380)) [@bdice](https://github.com/bdice) +- Update `shared-action-workflows` references ([#1363](https://github.com/rapidsai/rmm/pull/1363)) [@AyodeAwe](https://github.com/AyodeAwe) +- Use branch-23.12 workflows. ([#1360](https://github.com/rapidsai/rmm/pull/1360)) [@bdice](https://github.com/bdice) +- Update devcontainers to 23.12 ([#1355](https://github.com/rapidsai/rmm/pull/1355)) [@raydouglass](https://github.com/raydouglass) +- Generate proper, consistent nightly versions for pip and conda packages ([#1347](https://github.com/rapidsai/rmm/pull/1347)) [@vyasr](https://github.com/vyasr) +- RMM: Build CUDA 12.0 ARM conda packages. ([#1330](https://github.com/rapidsai/rmm/pull/1330)) [@bdice](https://github.com/bdice) + +# RMM 23.10.00 (11 Oct 2023) + +## 🚨 Breaking Changes + +- Update to Cython 3.0.0 ([#1313](https://github.com/rapidsai/rmm/pull/1313)) [@vyasr](https://github.com/vyasr) + +## 🐛 Bug Fixes + +- Compile cdef public functions from torch_allocator with C ABI ([#1350](https://github.com/rapidsai/rmm/pull/1350)) [@wence-](https://github.com/wence-) +- Make doxygen only a conda dependency. ([#1344](https://github.com/rapidsai/rmm/pull/1344)) [@bdice](https://github.com/bdice) +- Use `conda mambabuild` not `mamba mambabuild` ([#1338](https://github.com/rapidsai/rmm/pull/1338)) [@wence-](https://github.com/wence-) +- Fix stream_ordered_memory_resource attempt to record event in stream from another device ([#1333](https://github.com/rapidsai/rmm/pull/1333)) [@harrism](https://github.com/harrism) + +## 📖 Documentation + +- Clean up headers in CMakeLists.txt. ([#1341](https://github.com/rapidsai/rmm/pull/1341)) [@bdice](https://github.com/bdice) +- Add pre-commit hook to validate doxygen ([#1334](https://github.com/rapidsai/rmm/pull/1334)) [@vyasr](https://github.com/vyasr) +- Fix doxygen warnings ([#1317](https://github.com/rapidsai/rmm/pull/1317)) [@vyasr](https://github.com/vyasr) +- Treat warnings as errors in Python documentation ([#1316](https://github.com/rapidsai/rmm/pull/1316)) [@vyasr](https://github.com/vyasr) + +## 🚀 New Features + +- Enable RMM Debug Logging via Python ([#1339](https://github.com/rapidsai/rmm/pull/1339)) [@harrism](https://github.com/harrism) + +## 🛠️ Improvements + +- Update image names ([#1346](https://github.com/rapidsai/rmm/pull/1346)) [@AyodeAwe](https://github.com/AyodeAwe) +- Update to clang 16.0.6. ([#1343](https://github.com/rapidsai/rmm/pull/1343)) [@bdice](https://github.com/bdice) +- Update doxygen to 1.9.1 ([#1337](https://github.com/rapidsai/rmm/pull/1337)) [@vyasr](https://github.com/vyasr) +- Simplify wheel build scripts and allow alphas of RAPIDS dependencies ([#1335](https://github.com/rapidsai/rmm/pull/1335)) [@divyegala](https://github.com/divyegala) +- Use `copy-pr-bot` ([#1329](https://github.com/rapidsai/rmm/pull/1329)) [@ajschmidt8](https://github.com/ajschmidt8) +- Add RMM devcontainers ([#1328](https://github.com/rapidsai/rmm/pull/1328)) [@trxcllnt](https://github.com/trxcllnt) +- Add Python bindings for `limiting_resource_adaptor` ([#1327](https://github.com/rapidsai/rmm/pull/1327)) [@pentschev](https://github.com/pentschev) +- Fix missing jQuery error in docs ([#1321](https://github.com/rapidsai/rmm/pull/1321)) [@AyodeAwe](https://github.com/AyodeAwe) +- Use fetch_rapids.cmake. ([#1319](https://github.com/rapidsai/rmm/pull/1319)) [@bdice](https://github.com/bdice) +- Update to Cython 3.0.0 ([#1313](https://github.com/rapidsai/rmm/pull/1313)) [@vyasr](https://github.com/vyasr) +- Branch 23.10 merge 23.08 ([#1312](https://github.com/rapidsai/rmm/pull/1312)) [@vyasr](https://github.com/vyasr) +- Branch 23.10 merge 23.08 ([#1309](https://github.com/rapidsai/rmm/pull/1309)) [@vyasr](https://github.com/vyasr) + +# RMM 23.08.00 (9 Aug 2023) + +## 🚨 Breaking Changes + +- Stop invoking setup.py ([#1300](https://github.com/rapidsai/rmm/pull/1300)) [@vyasr](https://github.com/vyasr) +- Remove now-deprecated top-level allocator functions ([#1281](https://github.com/rapidsai/rmm/pull/1281)) [@wence-](https://github.com/wence-) +- Remove padding from device_memory_resource ([#1278](https://github.com/rapidsai/rmm/pull/1278)) [@vyasr](https://github.com/vyasr) + +## 🐛 Bug Fixes + +- Fix typo in wheels-test.yaml. ([#1310](https://github.com/rapidsai/rmm/pull/1310)) [@bdice](https://github.com/bdice) +- Add a missing '#include <array>' in logger.hpp ([#1295](https://github.com/rapidsai/rmm/pull/1295)) [@valgur](https://github.com/valgur) +- Use gbench `thread_index()` accessor to fix replay bench compilation ([#1293](https://github.com/rapidsai/rmm/pull/1293)) [@harrism](https://github.com/harrism) +- Ensure logger tests don't generate temp directories in build dir ([#1289](https://github.com/rapidsai/rmm/pull/1289)) [@robertmaynard](https://github.com/robertmaynard) + +## 🚀 New Features + +- Remove now-deprecated top-level allocator functions ([#1281](https://github.com/rapidsai/rmm/pull/1281)) [@wence-](https://github.com/wence-) + +## 🛠️ Improvements + +- Switch to new CI wheel building pipeline ([#1305](https://github.com/rapidsai/rmm/pull/1305)) [@vyasr](https://github.com/vyasr) +- Revert CUDA 12.0 CI workflows to branch-23.08. ([#1303](https://github.com/rapidsai/rmm/pull/1303)) [@bdice](https://github.com/bdice) +- Update linters: remove flake8, add ruff, update cython-lint ([#1302](https://github.com/rapidsai/rmm/pull/1302)) [@vyasr](https://github.com/vyasr) +- Adding identify minimum version requirement ([#1301](https://github.com/rapidsai/rmm/pull/1301)) [@hyperbolic2346](https://github.com/hyperbolic2346) +- Stop invoking setup.py ([#1300](https://github.com/rapidsai/rmm/pull/1300)) [@vyasr](https://github.com/vyasr) +- Use cuda-version to constrain cudatoolkit. ([#1296](https://github.com/rapidsai/rmm/pull/1296)) [@bdice](https://github.com/bdice) +- Update to CMake 3.26.4 ([#1291](https://github.com/rapidsai/rmm/pull/1291)) [@vyasr](https://github.com/vyasr) +- use rapids-upload-docs script ([#1288](https://github.com/rapidsai/rmm/pull/1288)) [@AyodeAwe](https://github.com/AyodeAwe) +- Reorder parameters in RMM_EXPECTS ([#1286](https://github.com/rapidsai/rmm/pull/1286)) [@vyasr](https://github.com/vyasr) +- Remove documentation build scripts for Jenkins ([#1285](https://github.com/rapidsai/rmm/pull/1285)) [@ajschmidt8](https://github.com/ajschmidt8) +- Remove padding from device_memory_resource ([#1278](https://github.com/rapidsai/rmm/pull/1278)) [@vyasr](https://github.com/vyasr) +- Unpin scikit-build upper bound ([#1275](https://github.com/rapidsai/rmm/pull/1275)) [@vyasr](https://github.com/vyasr) +- RMM: Build CUDA 12 packages ([#1223](https://github.com/rapidsai/rmm/pull/1223)) [@bdice](https://github.com/bdice) + +# RMM 23.06.00 (7 Jun 2023) + +## 🚨 Breaking Changes + +- Update minimum Python version to Python 3.9 ([#1252](https://github.com/rapidsai/rmm/pull/1252)) [@shwina](https://github.com/shwina) + +## 🐛 Bug Fixes + +- Ensure Logger tests aren't run in parallel ([#1277](https://github.com/rapidsai/rmm/pull/1277)) [@robertmaynard](https://github.com/robertmaynard) +- Pin to scikit-build<0.17.2. ([#1262](https://github.com/rapidsai/rmm/pull/1262)) [@bdice](https://github.com/bdice) + +## 🛠️ Improvements + +- Require Numba 0.57.0+ & NumPy 1.21.0+ ([#1279](https://github.com/rapidsai/rmm/pull/1279)) [@jakirkham](https://github.com/jakirkham) +- Align test_cpp.sh with conventions in other RAPIDS repos. ([#1269](https://github.com/rapidsai/rmm/pull/1269)) [@bdice](https://github.com/bdice) +- Switch back to using primary shared-action-workflows branch ([#1268](https://github.com/rapidsai/rmm/pull/1268)) [@vyasr](https://github.com/vyasr) +- Update recipes to GTest version >=1.13.0 ([#1263](https://github.com/rapidsai/rmm/pull/1263)) [@bdice](https://github.com/bdice) +- Support CUDA 12.0 for pip wheels ([#1259](https://github.com/rapidsai/rmm/pull/1259)) [@bdice](https://github.com/bdice) +- Add build vars ([#1258](https://github.com/rapidsai/rmm/pull/1258)) [@AyodeAwe](https://github.com/AyodeAwe) +- Enable sccache hits from local builds ([#1257](https://github.com/rapidsai/rmm/pull/1257)) [@AyodeAwe](https://github.com/AyodeAwe) +- Revert to branch-23.06 for shared-action-workflows ([#1256](https://github.com/rapidsai/rmm/pull/1256)) [@shwina](https://github.com/shwina) +- run docs builds nightly too ([#1255](https://github.com/rapidsai/rmm/pull/1255)) [@AyodeAwe](https://github.com/AyodeAwe) +- Build wheels using new single image workflow ([#1254](https://github.com/rapidsai/rmm/pull/1254)) [@vyasr](https://github.com/vyasr) +- Update minimum Python version to Python 3.9 ([#1252](https://github.com/rapidsai/rmm/pull/1252)) [@shwina](https://github.com/shwina) +- Remove usage of rapids-get-rapids-version-from-git ([#1251](https://github.com/rapidsai/rmm/pull/1251)) [@jjacobelli](https://github.com/jjacobelli) +- Remove wheel pytest verbosity ([#1249](https://github.com/rapidsai/rmm/pull/1249)) [@sevagh](https://github.com/sevagh) +- Update clang-format to 16.0.1. ([#1246](https://github.com/rapidsai/rmm/pull/1246)) [@bdice](https://github.com/bdice) +- Remove uses-setup-env-vars ([#1242](https://github.com/rapidsai/rmm/pull/1242)) [@vyasr](https://github.com/vyasr) +- Move RMM_LOGGING_ASSERT into separate header ([#1241](https://github.com/rapidsai/rmm/pull/1241)) [@ahendriksen](https://github.com/ahendriksen) +- Use ARC V2 self-hosted runners for GPU jobs ([#1239](https://github.com/rapidsai/rmm/pull/1239)) [@jjacobelli](https://github.com/jjacobelli) + +# RMM 23.04.00 (6 Apr 2023) + +## 🐛 Bug Fixes + +- Remove MANIFEST.in use auto-generated one for sdists and package_data for wheels ([#1233](https://github.com/rapidsai/rmm/pull/1233)) [@vyasr](https://github.com/vyasr) +- Fix update-version.sh. ([#1227](https://github.com/rapidsai/rmm/pull/1227)) [@vyasr](https://github.com/vyasr) +- Specify include_package_data to setup ([#1218](https://github.com/rapidsai/rmm/pull/1218)) [@vyasr](https://github.com/vyasr) +- Revert changes overriding rapids-cmake repo. ([#1209](https://github.com/rapidsai/rmm/pull/1209)) [@bdice](https://github.com/bdice) +- Synchronize stream in `DeviceBuffer.c_from_unique_ptr` constructor ([#1100](https://github.com/rapidsai/rmm/pull/1100)) [@shwina](https://github.com/shwina) + +## 🚀 New Features + +- Use rapids-cmake parallel testing feature ([#1183](https://github.com/rapidsai/rmm/pull/1183)) [@robertmaynard](https://github.com/robertmaynard) + +## 🛠️ Improvements + +- Stop setting package version attribute in wheels ([#1236](https://github.com/rapidsai/rmm/pull/1236)) [@vyasr](https://github.com/vyasr) +- Add codespell as a linter ([#1231](https://github.com/rapidsai/rmm/pull/1231)) [@bdice](https://github.com/bdice) +- Pass `AWS_SESSION_TOKEN` and `SCCACHE_S3_USE_SSL` vars to conda build ([#1230](https://github.com/rapidsai/rmm/pull/1230)) [@ajschmidt8](https://github.com/ajschmidt8) +- Update to GCC 11 ([#1228](https://github.com/rapidsai/rmm/pull/1228)) [@bdice](https://github.com/bdice) +- Fix some minor oversights in the conversion to pyproject.toml ([#1226](https://github.com/rapidsai/rmm/pull/1226)) [@vyasr](https://github.com/vyasr) +- Remove pickle compatibility layer in tests for Python < 3.8. ([#1224](https://github.com/rapidsai/rmm/pull/1224)) [@bdice](https://github.com/bdice) +- Move external allocators into rmm.allocators module to defer imports ([#1221](https://github.com/rapidsai/rmm/pull/1221)) [@wence-](https://github.com/wence-) +- Generate pyproject.toml dependencies using dfg ([#1219](https://github.com/rapidsai/rmm/pull/1219)) [@vyasr](https://github.com/vyasr) +- Run rapids-dependency-file-generator via pre-commit ([#1217](https://github.com/rapidsai/rmm/pull/1217)) [@vyasr](https://github.com/vyasr) +- Skip docs job in nightly runs ([#1215](https://github.com/rapidsai/rmm/pull/1215)) [@AyodeAwe](https://github.com/AyodeAwe) +- CI: Remove specification of manual stage for check_style.sh script. ([#1214](https://github.com/rapidsai/rmm/pull/1214)) [@csadorf](https://github.com/csadorf) +- Use script rather than environment variable to modify package names ([#1212](https://github.com/rapidsai/rmm/pull/1212)) [@vyasr](https://github.com/vyasr) +- Reduce error handling verbosity in CI tests scripts ([#1204](https://github.com/rapidsai/rmm/pull/1204)) [@AjayThorve](https://github.com/AjayThorve) +- Update shared workflow branches ([#1203](https://github.com/rapidsai/rmm/pull/1203)) [@ajschmidt8](https://github.com/ajschmidt8) +- Use date in build string instead of in the version. ([#1195](https://github.com/rapidsai/rmm/pull/1195)) [@bdice](https://github.com/bdice) +- Stop using versioneer to manage versions ([#1190](https://github.com/rapidsai/rmm/pull/1190)) [@vyasr](https://github.com/vyasr) +- Update to spdlog>=1.11.0, fmt>=9.1.0. ([#1177](https://github.com/rapidsai/rmm/pull/1177)) [@bdice](https://github.com/bdice) +- Migrate as much as possible to `pyproject.toml` ([#1151](https://github.com/rapidsai/rmm/pull/1151)) [@jakirkham](https://github.com/jakirkham) + +# RMM 23.02.00 (9 Feb 2023) + +## 🐛 Bug Fixes + +- pre-commit: Update isort version to 5.12.0 ([#1197](https://github.com/rapidsai/rmm/pull/1197)) [@wence-](https://github.com/wence-) +- Revert "Upgrade to spdlog 1.10 ([#1173)" (#1176](https://github.com/rapidsai/rmm/pull/1173)" (#1176)) [@bdice](https://github.com/bdice) +- Ensure `UpstreamResourceAdaptor` is not cleared by the Python GC ([#1170](https://github.com/rapidsai/rmm/pull/1170)) [@shwina](https://github.com/shwina) + +## 📖 Documentation + +- Fix documentation author ([#1188](https://github.com/rapidsai/rmm/pull/1188)) [@bdice](https://github.com/bdice) + +## 🚀 New Features + +- Add RMM PyTorch allocator ([#1168](https://github.com/rapidsai/rmm/pull/1168)) [@shwina](https://github.com/shwina) + +## 🛠️ Improvements + +- Update shared workflow branches ([#1201](https://github.com/rapidsai/rmm/pull/1201)) [@ajschmidt8](https://github.com/ajschmidt8) +- Fix update-version.sh ([#1199](https://github.com/rapidsai/rmm/pull/1199)) [@raydouglass](https://github.com/raydouglass) +- Use CTK 118/cp310 branch of wheel workflows ([#1193](https://github.com/rapidsai/rmm/pull/1193)) [@sevagh](https://github.com/sevagh) +- Update `build.yaml` workflow to reduce verbosity ([#1192](https://github.com/rapidsai/rmm/pull/1192)) [@AyodeAwe](https://github.com/AyodeAwe) +- Fix `build.yaml` workflow ([#1191](https://github.com/rapidsai/rmm/pull/1191)) [@ajschmidt8](https://github.com/ajschmidt8) +- add docs_build step ([#1189](https://github.com/rapidsai/rmm/pull/1189)) [@AyodeAwe](https://github.com/AyodeAwe) +- Upkeep/wheel param cleanup ([#1187](https://github.com/rapidsai/rmm/pull/1187)) [@sevagh](https://github.com/sevagh) +- Update workflows for nightly tests ([#1186](https://github.com/rapidsai/rmm/pull/1186)) [@ajschmidt8](https://github.com/ajschmidt8) +- Build CUDA `11.8` and Python `3.10` Packages ([#1184](https://github.com/rapidsai/rmm/pull/1184)) [@ajschmidt8](https://github.com/ajschmidt8) +- Build wheels alongside conda CI ([#1182](https://github.com/rapidsai/rmm/pull/1182)) [@sevagh](https://github.com/sevagh) +- Update conda recipes. ([#1180](https://github.com/rapidsai/rmm/pull/1180)) [@bdice](https://github.com/bdice) +- Update PR Workflow ([#1174](https://github.com/rapidsai/rmm/pull/1174)) [@ajschmidt8](https://github.com/ajschmidt8) +- Upgrade to spdlog 1.10 ([#1173](https://github.com/rapidsai/rmm/pull/1173)) [@kkraus14](https://github.com/kkraus14) +- Enable `codecov` ([#1171](https://github.com/rapidsai/rmm/pull/1171)) [@ajschmidt8](https://github.com/ajschmidt8) +- Add support for Python 3.10. ([#1166](https://github.com/rapidsai/rmm/pull/1166)) [@bdice](https://github.com/bdice) +- Update pre-commit hooks ([#1154](https://github.com/rapidsai/rmm/pull/1154)) [@bdice](https://github.com/bdice) + +# RMM 22.12.00 (8 Dec 2022) + +## 🐛 Bug Fixes + +- Don't use CMake 3.25.0 as it has a show stopping FindCUDAToolkit bug ([#1162](https://github.com/rapidsai/rmm/pull/1162)) [@robertmaynard](https://github.com/robertmaynard) +- Relax test for async memory pool IPC handle support ([#1130](https://github.com/rapidsai/rmm/pull/1130)) [@bdice](https://github.com/bdice) + +## 📖 Documentation + +- Use rapidsai CODE_OF_CONDUCT.md ([#1159](https://github.com/rapidsai/rmm/pull/1159)) [@bdice](https://github.com/bdice) +- Fix doxygen formatting for set_stream. ([#1153](https://github.com/rapidsai/rmm/pull/1153)) [@bdice](https://github.com/bdice) +- Document required Python dependencies to build from source ([#1146](https://github.com/rapidsai/rmm/pull/1146)) [@ccoulombe](https://github.com/ccoulombe) +- fix failed automerge (Branch 22.12 merge 22.10) ([#1131](https://github.com/rapidsai/rmm/pull/1131)) [@harrism](https://github.com/harrism) + +## 🚀 New Features + +- Add wheel builds to rmm ([#1148](https://github.com/rapidsai/rmm/pull/1148)) [@vyasr](https://github.com/vyasr) + +## 🛠️ Improvements + +- Align __version__ with wheel version ([#1161](https://github.com/rapidsai/rmm/pull/1161)) [@sevagh](https://github.com/sevagh) +- Add `ninja` & Update CI environment variables ([#1155](https://github.com/rapidsai/rmm/pull/1155)) [@ajschmidt8](https://github.com/ajschmidt8) +- Remove CUDA 11.0 from dependencies.yaml. ([#1152](https://github.com/rapidsai/rmm/pull/1152)) [@bdice](https://github.com/bdice) +- Update dependencies schema. ([#1147](https://github.com/rapidsai/rmm/pull/1147)) [@bdice](https://github.com/bdice) +- Enable sccache for python build ([#1145](https://github.com/rapidsai/rmm/pull/1145)) [@Ethyling](https://github.com/Ethyling) +- Remove Jenkins scripts ([#1143](https://github.com/rapidsai/rmm/pull/1143)) [@ajschmidt8](https://github.com/ajschmidt8) +- Use `ninja` in GitHub Actions ([#1142](https://github.com/rapidsai/rmm/pull/1142)) [@ajschmidt8](https://github.com/ajschmidt8) +- Switch to using rapids-cmake for gbench. ([#1139](https://github.com/rapidsai/rmm/pull/1139)) [@vyasr](https://github.com/vyasr) +- Remove stale labeler ([#1137](https://github.com/rapidsai/rmm/pull/1137)) [@raydouglass](https://github.com/raydouglass) +- Add a public `copy` API to `DeviceBuffer` ([#1128](https://github.com/rapidsai/rmm/pull/1128)) [@galipremsagar](https://github.com/galipremsagar) +- Format gdb script. ([#1127](https://github.com/rapidsai/rmm/pull/1127)) [@bdice](https://github.com/bdice) + +# RMM 22.10.00 (12 Oct 2022) + +## 🐛 Bug Fixes + +- Ensure consistent spdlog dependency target no matter the source ([#1101](https://github.com/rapidsai/rmm/pull/1101)) [@robertmaynard](https://github.com/robertmaynard) +- Remove cuda event deadlocking issues in device mr tests ([#1097](https://github.com/rapidsai/rmm/pull/1097)) [@robertmaynard](https://github.com/robertmaynard) +- Propagate exceptions raised in Python callback functions ([#1096](https://github.com/rapidsai/rmm/pull/1096)) [@madsbk](https://github.com/madsbk) +- Avoid unused parameter warnings in do_get_mem_info ([#1084](https://github.com/rapidsai/rmm/pull/1084)) [@fkallen](https://github.com/fkallen) +- Use rapids-cmake 22.10 best practice for RAPIDS.cmake location ([#1083](https://github.com/rapidsai/rmm/pull/1083)) [@robertmaynard](https://github.com/robertmaynard) + +## 📖 Documentation + +- Document that minimum required CMake version is now 3.23.1 ([#1098](https://github.com/rapidsai/rmm/pull/1098)) [@robertmaynard](https://github.com/robertmaynard) +- Fix docs for module-level API ([#1091](https://github.com/rapidsai/rmm/pull/1091)) [@bdice](https://github.com/bdice) +- Improve DeviceBuffer docs. ([#1090](https://github.com/rapidsai/rmm/pull/1090)) [@bdice](https://github.com/bdice) +- Branch 22.10 merge 22.08 ([#1089](https://github.com/rapidsai/rmm/pull/1089)) [@harrism](https://github.com/harrism) +- Improve docs formatting and update links. ([#1086](https://github.com/rapidsai/rmm/pull/1086)) [@bdice](https://github.com/bdice) +- Add resources section to README. ([#1085](https://github.com/rapidsai/rmm/pull/1085)) [@bdice](https://github.com/bdice) +- Simplify PR template. ([#1080](https://github.com/rapidsai/rmm/pull/1080)) [@bdice](https://github.com/bdice) + +## 🚀 New Features + +- Add `gdb` pretty-printers for rmm types ([#1088](https://github.com/rapidsai/rmm/pull/1088)) [@upsj](https://github.com/upsj) +- Support using THRUST_WRAPPED_NAMESPACE ([#1077](https://github.com/rapidsai/rmm/pull/1077)) [@robertmaynard](https://github.com/robertmaynard) + +## 🛠️ Improvements + +- GH Actions - Enforce `checks` before builds run ([#1125](https://github.com/rapidsai/rmm/pull/1125)) [@ajschmidt8](https://github.com/ajschmidt8) +- Update GH Action Workflows ([#1123](https://github.com/rapidsai/rmm/pull/1123)) [@ajschmidt8](https://github.com/ajschmidt8) +- Add `cudatoolkit` versions to `dependencies.yaml` ([#1119](https://github.com/rapidsai/rmm/pull/1119)) [@ajschmidt8](https://github.com/ajschmidt8) +- Remove `rmm` installation from `librmm` tests` ([#1117](https://github.com/rapidsai/rmm/pull/1117)) [@ajschmidt8](https://github.com/ajschmidt8) +- Add GitHub Actions workflows ([#1104](https://github.com/rapidsai/rmm/pull/1104)) [@Ethyling](https://github.com/Ethyling) +- `build.sh`: accept `--help` ([#1093](https://github.com/rapidsai/rmm/pull/1093)) [@madsbk](https://github.com/madsbk) +- Move clang dependency to conda develop packages. ([#1092](https://github.com/rapidsai/rmm/pull/1092)) [@bdice](https://github.com/bdice) +- Add device_uvector::reserve and device_buffer::reserve ([#1079](https://github.com/rapidsai/rmm/pull/1079)) [@upsj](https://github.com/upsj) +- Bifurcate Dependency Lists ([#1073](https://github.com/rapidsai/rmm/pull/1073)) [@ajschmidt8](https://github.com/ajschmidt8) + +# RMM 22.08.00 (17 Aug 2022) + +## 🐛 Bug Fixes + +- Specify `language` as `'en'` instead of `None` ([#1059](https://github.com/rapidsai/rmm/pull/1059)) [@jakirkham](https://github.com/jakirkham) +- Add a missed `except *` ([#1057](https://github.com/rapidsai/rmm/pull/1057)) [@shwina](https://github.com/shwina) +- Properly handle cudaMemHandleTypeNone and cudaErrorInvalidValue in is_export_handle_type_supported ([#1055](https://github.com/rapidsai/rmm/pull/1055)) [@gerashegalov](https://github.com/gerashegalov) + +## 📖 Documentation + +- Centralize common css & js code in docs ([#1075](https://github.com/rapidsai/rmm/pull/1075)) [@galipremsagar](https://github.com/galipremsagar) + +## 🛠️ Improvements + +- Add the ability to register and unregister reinitialization hooks ([#1072](https://github.com/rapidsai/rmm/pull/1072)) [@shwina](https://github.com/shwina) +- Update isort to 5.10.1 ([#1069](https://github.com/rapidsai/rmm/pull/1069)) [@vyasr](https://github.com/vyasr) +- Forward merge 22.06 into 22.08 ([#1067](https://github.com/rapidsai/rmm/pull/1067)) [@vyasr](https://github.com/vyasr) +- Forward merge 22.06 into 22.08 ([#1066](https://github.com/rapidsai/rmm/pull/1066)) [@vyasr](https://github.com/vyasr) +- Pin max version of `cuda-python` to `11.7` ([#1062](https://github.com/rapidsai/rmm/pull/1062)) [@galipremsagar](https://github.com/galipremsagar) +- Change build.sh to find C++ library by default and avoid shadowing CMAKE_ARGS ([#1053](https://github.com/rapidsai/rmm/pull/1053)) [@vyasr](https://github.com/vyasr) + +# RMM 22.06.00 (7 Jun 2022) + +## 🐛 Bug Fixes + +- Clarifies Python requirements and version constraints ([#1037](https://github.com/rapidsai/rmm/pull/1037)) [@jakirkham](https://github.com/jakirkham) +- Use `lib` (not `lib64`) for libraries ([#1024](https://github.com/rapidsai/rmm/pull/1024)) [@jakirkham](https://github.com/jakirkham) +- Properly enable Cython docstrings. ([#1020](https://github.com/rapidsai/rmm/pull/1020)) [@vyasr](https://github.com/vyasr) +- Update `RMMNumbaManager` to handle `NUMBA_CUDA_USE_NVIDIA_BINDING=1` ([#1004](https://github.com/rapidsai/rmm/pull/1004)) [@brandon-b-miller](https://github.com/brandon-b-miller) + +## 📖 Documentation + +- Clarify using RMM with other Python libraries ([#1034](https://github.com/rapidsai/rmm/pull/1034)) [@jrhemstad](https://github.com/jrhemstad) +- Replace `to_device` with `DeviceBuffer.to_device` ([#1033](https://github.com/rapidsai/rmm/pull/1033)) [@wence-](https://github.com/wence-) +- Documentation Fix: Replace `cudf::logic_error` with `rmm::logic_error` ([#1021](https://github.com/rapidsai/rmm/pull/1021)) [@codereport](https://github.com/codereport) + +## 🚀 New Features + +- Add rmm::exec_policy_nosync ([#1009](https://github.com/rapidsai/rmm/pull/1009)) [@fkallen](https://github.com/fkallen) +- Callback memory resource ([#980](https://github.com/rapidsai/rmm/pull/980)) [@shwina](https://github.com/shwina) + +## 🛠️ Improvements + +- Fix conda recipes for conda compilers ([#1043](https://github.com/rapidsai/rmm/pull/1043)) [@Ethyling](https://github.com/Ethyling) +- Use new rapids-cython component of rapids-cmake to simplify builds ([#1031](https://github.com/rapidsai/rmm/pull/1031)) [@vyasr](https://github.com/vyasr) +- Merge branch-22.04 to branch-22.06 ([#1028](https://github.com/rapidsai/rmm/pull/1028)) [@jakirkham](https://github.com/jakirkham) +- Update CMake pinning to just avoid 3.23.0. ([#1023](https://github.com/rapidsai/rmm/pull/1023)) [@vyasr](https://github.com/vyasr) +- Build python using conda in GPU jobs ([#1017](https://github.com/rapidsai/rmm/pull/1017)) [@Ethyling](https://github.com/Ethyling) +- Remove pip requirements file. ([#1015](https://github.com/rapidsai/rmm/pull/1015)) [@bdice](https://github.com/bdice) +- Clean up Thrust includes. ([#1011](https://github.com/rapidsai/rmm/pull/1011)) [@bdice](https://github.com/bdice) +- Update black version ([#1010](https://github.com/rapidsai/rmm/pull/1010)) [@vyasr](https://github.com/vyasr) +- Update cmake-format version for pre-commit and environments. ([#995](https://github.com/rapidsai/rmm/pull/995)) [@vyasr](https://github.com/vyasr) +- Use conda compilers ([#977](https://github.com/rapidsai/rmm/pull/977)) [@Ethyling](https://github.com/Ethyling) +- Build conda packages using mambabuild ([#900](https://github.com/rapidsai/rmm/pull/900)) [@Ethyling](https://github.com/Ethyling) + +# RMM 22.04.00 (6 Apr 2022) + +## 🐛 Bug Fixes + +- Add cuda-python dependency to pyproject.toml ([#994](https://github.com/rapidsai/rmm/pull/994)) [@sevagh](https://github.com/sevagh) +- Disable opportunistic reuse in async mr when cuda driver < 11.5 ([#993](https://github.com/rapidsai/rmm/pull/993)) [@rongou](https://github.com/rongou) +- Use CUDA 11.2+ features via dlopen ([#990](https://github.com/rapidsai/rmm/pull/990)) [@robertmaynard](https://github.com/robertmaynard) +- Skip async mr tests when cuda runtime/driver < 11.2 ([#986](https://github.com/rapidsai/rmm/pull/986)) [@rongou](https://github.com/rongou) +- Fix warning/error in debug assertion in device_uvector.hpp ([#979](https://github.com/rapidsai/rmm/pull/979)) [@harrism](https://github.com/harrism) +- Fix signed/unsigned comparison warning ([#970](https://github.com/rapidsai/rmm/pull/970)) [@jlowe](https://github.com/jlowe) +- Fix comparison of async MRs with different underlying pools. ([#965](https://github.com/rapidsai/rmm/pull/965)) [@harrism](https://github.com/harrism) + +## 🚀 New Features + +- Use scikit-build for the build process ([#976](https://github.com/rapidsai/rmm/pull/976)) [@vyasr](https://github.com/vyasr) + +## 🛠️ Improvements + +- Temporarily disable new `ops-bot` functionality ([#1005](https://github.com/rapidsai/rmm/pull/1005)) [@ajschmidt8](https://github.com/ajschmidt8) +- Rename `librmm_tests` to `librmm-tests` ([#1000](https://github.com/rapidsai/rmm/pull/1000)) [@ajschmidt8](https://github.com/ajschmidt8) +- Update `librmm` `conda` recipe ([#997](https://github.com/rapidsai/rmm/pull/997)) [@ajschmidt8](https://github.com/ajschmidt8) +- Remove `no_cma`/`has_cma` variants ([#996](https://github.com/rapidsai/rmm/pull/996)) [@ajschmidt8](https://github.com/ajschmidt8) +- Fix free-before-alloc in multithreaded test ([#992](https://github.com/rapidsai/rmm/pull/992)) [@aladram](https://github.com/aladram) +- Add `.github/ops-bot.yaml` config file ([#991](https://github.com/rapidsai/rmm/pull/991)) [@ajschmidt8](https://github.com/ajschmidt8) +- Log allocation failures ([#988](https://github.com/rapidsai/rmm/pull/988)) [@rongou](https://github.com/rongou) +- Update `librmm` `conda` outputs ([#983](https://github.com/rapidsai/rmm/pull/983)) [@ajschmidt8](https://github.com/ajschmidt8) +- Bump Python requirements in `setup.cfg` and `rmm_dev.yml` ([#982](https://github.com/rapidsai/rmm/pull/982)) [@shwina](https://github.com/shwina) +- New benchmark compares concurrent throughput of device_vector and device_uvector ([#981](https://github.com/rapidsai/rmm/pull/981)) [@harrism](https://github.com/harrism) +- Update `librmm` recipe to output `librmm_tests` package ([#978](https://github.com/rapidsai/rmm/pull/978)) [@ajschmidt8](https://github.com/ajschmidt8) +- Update upload.sh to use `--croot` ([#975](https://github.com/rapidsai/rmm/pull/975)) [@AyodeAwe](https://github.com/AyodeAwe) +- Fix `conda` uploads ([#974](https://github.com/rapidsai/rmm/pull/974)) [@ajschmidt8](https://github.com/ajschmidt8) +- Add CMake `install` rules for tests ([#969](https://github.com/rapidsai/rmm/pull/969)) [@ajschmidt8](https://github.com/ajschmidt8) +- Add device_buffer::ssize() and device_uvector::ssize() ([#966](https://github.com/rapidsai/rmm/pull/966)) [@harrism](https://github.com/harrism) +- Added yml file for cudatoolkit version 11.6 ([#964](https://github.com/rapidsai/rmm/pull/964)) [@alhad-deshpande](https://github.com/alhad-deshpande) +- Replace `ccache` with `sccache` ([#963](https://github.com/rapidsai/rmm/pull/963)) [@ajschmidt8](https://github.com/ajschmidt8) +- Make `pool_memory_resource::pool_size()` public ([#962](https://github.com/rapidsai/rmm/pull/962)) [@shwina](https://github.com/shwina) +- Allow construction of cuda_async_memory_resource from existing pool ([#889](https://github.com/rapidsai/rmm/pull/889)) [@fkallen](https://github.com/fkallen) + +# RMM 22.02.00 (2 Feb 2022) + +## 🐛 Bug Fixes + +- Use numba to get CUDA runtime version. ([#946](https://github.com/rapidsai/rmm/pull/946)) [@bdice](https://github.com/bdice) +- Temporarily disable warnings for unknown pragmas ([#942](https://github.com/rapidsai/rmm/pull/942)) [@harrism](https://github.com/harrism) +- Build benchmarks in RMM CI ([#941](https://github.com/rapidsai/rmm/pull/941)) [@harrism](https://github.com/harrism) +- Headers that use `std::thread` now include <thread> ([#938](https://github.com/rapidsai/rmm/pull/938)) [@robertmaynard](https://github.com/robertmaynard) +- Fix failing stream test with a debug-only death test ([#934](https://github.com/rapidsai/rmm/pull/934)) [@harrism](https://github.com/harrism) +- Prevent `DeviceBuffer` DeviceMemoryResource premature release ([#931](https://github.com/rapidsai/rmm/pull/931)) [@viclafargue](https://github.com/viclafargue) +- Fix failing tracking test ([#929](https://github.com/rapidsai/rmm/pull/929)) [@harrism](https://github.com/harrism) + +## 🛠️ Improvements + +- Prepare upload scripts for Python 3.7 removal ([#952](https://github.com/rapidsai/rmm/pull/952)) [@Ethyling](https://github.com/Ethyling) +- Fix imports tests syntax ([#935](https://github.com/rapidsai/rmm/pull/935)) [@Ethyling](https://github.com/Ethyling) +- Remove `IncludeCategories` from `.clang-format` ([#933](https://github.com/rapidsai/rmm/pull/933)) [@codereport](https://github.com/codereport) +- Replace use of custom CUDA bindings with CUDA-Python ([#930](https://github.com/rapidsai/rmm/pull/930)) [@shwina](https://github.com/shwina) +- Remove `setup.py` from `update-release.sh` script ([#926](https://github.com/rapidsai/rmm/pull/926)) [@ajschmidt8](https://github.com/ajschmidt8) +- Improve C++ Test Coverage ([#920](https://github.com/rapidsai/rmm/pull/920)) [@harrism](https://github.com/harrism) +- Improve the Arena allocator to reduce memory fragmentation ([#916](https://github.com/rapidsai/rmm/pull/916)) [@rongou](https://github.com/rongou) +- Simplify CMake linting with cmake-format ([#913](https://github.com/rapidsai/rmm/pull/913)) [@vyasr](https://github.com/vyasr) + +# RMM 21.12.00 (9 Dec 2021) + +## 🚨 Breaking Changes + +- Parameterize exception type caught by failure_callback_resource_adaptor ([#898](https://github.com/rapidsai/rmm/pull/898)) [@harrism](https://github.com/harrism) + +## 🐛 Bug Fixes + +- Update recipes for Enhanced Compatibility ([#910](https://github.com/rapidsai/rmm/pull/910)) [@ajschmidt8](https://github.com/ajschmidt8) +- Fix `librmm` uploads ([#909](https://github.com/rapidsai/rmm/pull/909)) [@ajschmidt8](https://github.com/ajschmidt8) +- Use spdlog/fmt/ostr.h as it supports external fmt library ([#907](https://github.com/rapidsai/rmm/pull/907)) [@robertmaynard](https://github.com/robertmaynard) +- Fix variable names in logging macro calls ([#897](https://github.com/rapidsai/rmm/pull/897)) [@harrism](https://github.com/harrism) +- Keep rapids cmake version in sync ([#876](https://github.com/rapidsai/rmm/pull/876)) [@robertmaynard](https://github.com/robertmaynard) + +## 📖 Documentation + +- Replace `to_device()` in docs with `DeviceBuffer.to_device()` ([#902](https://github.com/rapidsai/rmm/pull/902)) [@shwina](https://github.com/shwina) +- Fix return value docs for supports_get_mem_info ([#884](https://github.com/rapidsai/rmm/pull/884)) [@harrism](https://github.com/harrism) + +## 🚀 New Features + +- Out-of-memory callback resource adaptor ([#892](https://github.com/rapidsai/rmm/pull/892)) [@madsbk](https://github.com/madsbk) + +## 🛠️ Improvements + +- suppress spurious clang-tidy warnings in debug macros ([#914](https://github.com/rapidsai/rmm/pull/914)) [@rongou](https://github.com/rongou) +- C++ code coverage support ([#905](https://github.com/rapidsai/rmm/pull/905)) [@harrism](https://github.com/harrism) +- Provide ./build.sh flag to control CUDA async malloc support ([#901](https://github.com/rapidsai/rmm/pull/901)) [@robertmaynard](https://github.com/robertmaynard) +- Parameterize exception type caught by failure_callback_resource_adaptor ([#898](https://github.com/rapidsai/rmm/pull/898)) [@harrism](https://github.com/harrism) +- Throw `rmm::out_of_memory` when we know for sure ([#894](https://github.com/rapidsai/rmm/pull/894)) [@rongou](https://github.com/rongou) +- Update `conda` recipes for Enhanced Compatibility effort ([#893](https://github.com/rapidsai/rmm/pull/893)) [@ajschmidt8](https://github.com/ajschmidt8) +- Add functions to query the stream of device_uvector and device_scalar ([#887](https://github.com/rapidsai/rmm/pull/887)) [@fkallen](https://github.com/fkallen) +- Add spdlog to install export set ([#886](https://github.com/rapidsai/rmm/pull/886)) [@trxcllnt](https://github.com/trxcllnt) + +# RMM 21.10.00 (7 Oct 2021) + +## 🚨 Breaking Changes + +- Delete cuda_async_memory_resource copy/move ctors/operators ([#860](https://github.com/rapidsai/rmm/pull/860)) [@jrhemstad](https://github.com/jrhemstad) + +## 🐛 Bug Fixes + +- Fix parameter name in asserts ([#875](https://github.com/rapidsai/rmm/pull/875)) [@vyasr](https://github.com/vyasr) +- Disallow zero-size stream pools ([#873](https://github.com/rapidsai/rmm/pull/873)) [@harrism](https://github.com/harrism) +- Correct namespace usage in host memory resources ([#872](https://github.com/rapidsai/rmm/pull/872)) [@divyegala](https://github.com/divyegala) +- fix race condition in limiting resource adapter ([#869](https://github.com/rapidsai/rmm/pull/869)) [@rongou](https://github.com/rongou) +- Install the right cudatoolkit in the conda env in gpu/build.sh ([#864](https://github.com/rapidsai/rmm/pull/864)) [@shwina](https://github.com/shwina) +- Disable copy/move ctors and operator= from free_list classes ([#862](https://github.com/rapidsai/rmm/pull/862)) [@harrism](https://github.com/harrism) +- Delete cuda_async_memory_resource copy/move ctors/operators ([#860](https://github.com/rapidsai/rmm/pull/860)) [@jrhemstad](https://github.com/jrhemstad) +- Improve concurrency of stream_ordered_memory_resource by stealing less ([#851](https://github.com/rapidsai/rmm/pull/851)) [@harrism](https://github.com/harrism) +- Use the new RAPIDS.cmake to fetch rapids-cmake ([#838](https://github.com/rapidsai/rmm/pull/838)) [@robertmaynard](https://github.com/robertmaynard) + +## 📖 Documentation + +- Forward-merge branch-21.08 to branch-21.10 ([#846](https://github.com/rapidsai/rmm/pull/846)) [@jakirkham](https://github.com/jakirkham) + +## 🛠️ Improvements + +- Forward-merge `branch-21.08` into `branch-21.10` ([#877](https://github.com/rapidsai/rmm/pull/877)) [@ajschmidt8](https://github.com/ajschmidt8) +- Add .clang-tidy and fix clang-tidy warnings ([#857](https://github.com/rapidsai/rmm/pull/857)) [@harrism](https://github.com/harrism) +- Update to use rapids-cmake 21.10 pre-configured packages ([#854](https://github.com/rapidsai/rmm/pull/854)) [@robertmaynard](https://github.com/robertmaynard) +- Clean up: use std::size_t, include cstddef and aligned.hpp where missing ([#852](https://github.com/rapidsai/rmm/pull/852)) [@harrism](https://github.com/harrism) +- tweak the arena mr to reduce fragmentation ([#845](https://github.com/rapidsai/rmm/pull/845)) [@rongou](https://github.com/rongou) +- Fix transitive include in cuda_device header ([#843](https://github.com/rapidsai/rmm/pull/843)) [@wphicks](https://github.com/wphicks) +- Refactor cmake style ([#842](https://github.com/rapidsai/rmm/pull/842)) [@robertmaynard](https://github.com/robertmaynard) +- add multi stream allocations benchmark. ([#841](https://github.com/rapidsai/rmm/pull/841)) [@cwharris](https://github.com/cwharris) +- Enforce default visibility for `get_map`. ([#833](https://github.com/rapidsai/rmm/pull/833)) [@trivialfis](https://github.com/trivialfis) +- ENH Replace gpuci_conda_retry with gpuci_mamba_retry ([#823](https://github.com/rapidsai/rmm/pull/823)) [@dillon-cullinan](https://github.com/dillon-cullinan) +- Execution policy class ([#816](https://github.com/rapidsai/rmm/pull/816)) [@viclafargue](https://github.com/viclafargue) # RMM 21.08.00 (4 Aug 2021) @@ -257,10 +1219,10 @@ Please see https://github.com/rapidsai/rmm/releases/tag/v21.10.00a for the lates - PR #425 Add CUDA per-thread default stream support and thread safety to `pool_memory_resource` - PR #436 Always build and test with per-thread default stream enabled in the GPU CI build - PR #444 Add `owning_wrapper` to simplify lifetime management of resources and their upstreams -- PR #449 Stream-ordered suballocator base class and per-thread default stream support +- PR #449 Stream-ordered suballocator base class and per-thread default stream support and thread safety for `fixed_size_memory_resource` - PR #450 Add support for new build process (Project Flash) -- PR #457 New `binning_memory_resource` (replaces `hybrid_memory_resource` and +- PR #457 New `binning_memory_resource` (replaces `hybrid_memory_resource` and `fixed_multisize_memory_resource`). - PR #458 Add `get/set_per_device_resource` to better support multi-GPU per process applications - PR #466 Deprecate CNMeM. diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 11c7ffd92..000000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,160 +0,0 @@ -# ============================================================================= -# Copyright (c) 2018-2021, NVIDIA CORPORATION. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except -# in compliance with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License -# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -# or implied. See the License for the specific language governing permissions and limitations under -# the License. -# ============================================================================= - -cmake_minimum_required(VERSION 3.20.1 FATAL_ERROR) - -file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-21.10/RAPIDS.cmake - ${CMAKE_BINARY_DIR}/RAPIDS.cmake) -include(${CMAKE_BINARY_DIR}/RAPIDS.cmake) - -include(rapids-cmake) -include(rapids-cpm) -include(rapids-export) -include(rapids-find) - -project( - RMM - VERSION 21.10.00 - LANGUAGES CXX) - -# Write the version header -rapids_cmake_write_version_file(include/rmm/version_config.hpp) - -# Set a default build type if none was specified -rapids_cmake_build_type(Release) - -# build options -option(BUILD_TESTS "Configure CMake to build tests" ON) -option(BUILD_BENCHMARKS "Configure CMake to build (google) benchmarks" OFF) -set(RMM_LOGGING_LEVEL - "INFO" - CACHE STRING "Choose the logging level.") -set_property(CACHE RMM_LOGGING_LEVEL PROPERTY STRINGS "TRACE" "DEBUG" "INFO" "WARN" "ERROR" - "CRITICAL" "OFF") - -# Set logging level. Must go before including gtests and benchmarks. Set the possible values of -# build type for cmake-gui -message(STATUS "RMM: RMM_LOGGING_LEVEL = '${RMM_LOGGING_LEVEL}'") - -# cudart can be statically linked or dynamically linked the python ecosystem wants dynamic linking -option(CUDA_STATIC_RUNTIME "Statically link the CUDA runtime" OFF) - -# find packages we depend on -rapids_find_package( - CUDAToolkit REQUIRED - BUILD_EXPORT_SET rmm-exports - INSTALL_EXPORT_SET rmm-exports) -rapids_cpm_init() -include(cmake/thirdparty/get_spdlog.cmake) -include(cmake/thirdparty/get_thrust.cmake) - -# library targets -add_library(rmm INTERFACE) -add_library(rmm::rmm ALIAS rmm) - -target_include_directories(rmm INTERFACE "$" - "$") - -if(CUDA_STATIC_RUNTIME) - message(STATUS "RMM: Enabling static linking of cudart") - target_link_libraries(rmm INTERFACE CUDA::cudart_static) -else() - target_link_libraries(rmm INTERFACE CUDA::cudart) -endif() - -target_link_libraries(rmm INTERFACE rmm::Thrust) -target_link_libraries(rmm INTERFACE spdlog::spdlog_header_only) -target_link_libraries(rmm INTERFACE dl) -target_compile_features(rmm INTERFACE cxx_std_17 $) - -if((BUILD_TESTS OR BUILD_BENCHMARKS) AND CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) - include(rapids-cuda) - rapids_cuda_init_architectures(RMM) - enable_language(CUDA) - - # Since RMM only enables CUDA optionally we need to manually include the file that - # rapids_cuda_init_architectures relies on `project` calling - include("${CMAKE_PROJECT_RMM_INCLUDE}") - message(STATUS "RMM: Building benchmarks with GPU Architectures: ${CMAKE_CUDA_ARCHITECTURES}") -endif() - -# optionally build tests -if(BUILD_TESTS AND CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) - include(cmake/thirdparty/get_gtest.cmake) - include(CTest) # calls enable_testing() - - add_subdirectory(tests) -endif() - -# optionally build benchmarks -if(BUILD_BENCHMARKS AND CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) - include(cmake/thirdparty/get_gbench.cmake) - add_subdirectory(benchmarks) -endif() - -include(CPack) - -# install export targets -install(TARGETS rmm EXPORT rmm-exports) -install(DIRECTORY include/rmm/ DESTINATION include/rmm) -install(FILES ${RMM_BINARY_DIR}/include/rmm/version_config.hpp DESTINATION include/rmm) - -set(doc_string - [=[ -Provide targets for RMM: RAPIDS Memory Manager. - -The goal of the [RMM](https://github.com/rapidsai/rmm) is to provide: - - A common interface that allows customizing device and host memory allocation - A collection of implementations of the interface - A collection of data structures that use the interface for memory allocation -]=]) - -set(code_string - [=[ -if(NOT TARGET rmm::Thrust) - thrust_create_target(rmm::Thrust FROM_OPTIONS) -endif() -]=]) - -rapids_export( - INSTALL rmm - EXPORT_SET rmm-exports - GLOBAL_TARGETS rmm - NAMESPACE rmm:: - DOCUMENTATION doc_string - FINAL_CODE_BLOCK code_string) - -# build export targets -rapids_export( - BUILD rmm - EXPORT_SET rmm-exports - GLOBAL_TARGETS rmm - NAMESPACE rmm:: - DOCUMENTATION doc_string - FINAL_CODE_BLOCK code_string) - -# make documentation - -add_custom_command( - OUTPUT RMM_DOXYGEN - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doxygen - COMMAND doxygen Doxyfile - VERBATIM - COMMENT "Custom command for RMM doxygen docs") - -add_custom_target( - rmm_doc - DEPENDS RMM_DOXYGEN - COMMENT "Target for the custom command to build the RMM doxygen docs") diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index f68b37023..000000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,76 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, sex characteristics, gender identity and expression, -level of experience, education, socio-economic status, nationality, personal -appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at conduct@rapids.ai. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see -https://www.contributor-covenant.org/faq diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5e730cbb0..4fe31340d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,6 +34,12 @@ into three categories: 8. Once reviewed and approved, a RAPIDS developer will merge your pull request. Note that for C++ code, two reviewers are required. +To set up a development environment, follow the steps in the [README](https://github.com/rapidsai/rmm/blob/main/README.md) for cloning the repository and creating the conda environment. +Once the environment is created, you can build and install RMM using +```bash +$ python -m pip install ./python/rmm +``` +This command will build the RMM Python library inside the clone and automatically make it importable when running Python anywhere on your machine. Remember, if you are unsure about anything, don't hesitate to comment on issues and ask for clarifications! @@ -50,10 +56,5 @@ contributing to. Start with _Step 3_ from above, commenting on the issue to let others know you are working on it. If you have any questions related to the implementation of the issue, ask them in the issue instead of the PR. -### Building and Testing on a gpuCI image locally - - Before submitting a pull request, you can do a local build and test on your machine that mimics our gpuCI environment using the `ci/local/build.sh` script. -For detailed information on usage of this script, see [here](ci/local/README.md). - ## Attribution Portions adopted from https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md diff --git a/RAPIDS_BRANCH b/RAPIDS_BRANCH new file mode 100644 index 000000000..9b1c52d94 --- /dev/null +++ b/RAPIDS_BRANCH @@ -0,0 +1 @@ +branch-25.10 diff --git a/README.md b/README.md index 2f028a20d..887853d83 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,21 @@ #
 RMM: RAPIDS Memory Manager
-[![Build Status](https://gpuci.gpuopenanalytics.com/job/rapidsai/job/gpuci/job/rmm/job/branches/job/rmm-branch-pipeline/badge/icon)](https://gpuci.gpuopenanalytics.com/job/rapidsai/job/gpuci/job/rmm/job/branches/job/rmm-branch-pipeline/) +**NOTE:** For the latest stable [README.md](https://github.com/rapidsai/rmm/blob/main/README.md) ensure you are on the `main` branch. +## Resources + +- [RMM Reference Documentation](https://docs.rapids.ai/api/rmm/stable/): Python and C++ API references, tutorials, and topic guides. +- [RAPIDS Installation Guide](https://docs.rapids.ai/install/): Instructions for installing RMM. +- [GitHub Repository](https://github.com/rapidsai/rmm): Download the RMM source code. +- [Issue Tracker](https://github.com/rapidsai/rmm/issues): Report issues or request features. +- [RAPIDS Community](https://rapids.ai/learn-more/#get-involved): Get help, contribute, and collaborate. + +## Overview Achieving optimal performance in GPU-centric workflows frequently requires customizing how host and device memory are allocated. For example, using "pinned" host memory for asynchronous host <-> device memory transfers, or using a device memory pool sub-allocator to reduce the cost of -dynamic device memory allocation. +dynamic device memory allocation. The goal of the RAPIDS Memory Manager (RMM) is to provide: - A common interface that allows customizing [device](#device_memory_resource) and @@ -17,36 +26,28 @@ The goal of the RAPIDS Memory Manager (RMM) is to provide: For information on the interface RMM provides and how to use RMM in your C++ code, see [below](#using-rmm-in-c). -**NOTE:** For the latest stable [README.md](https://github.com/rapidsai/rmm/blob/main/README.md) -ensure you are on the `main` branch. +For a walkthrough about the design of the RAPIDS Memory Manager, read [Fast, Flexible Allocation for NVIDIA CUDA with RAPIDS Memory Manager](https://developer.nvidia.com/blog/fast-flexible-allocation-for-cuda-with-rapids-memory-manager/) on the NVIDIA Developer Blog. ## Installation ### Conda -RMM can be installed with Conda ([miniconda](https://conda.io/miniconda.html), or the full -[Anaconda distribution](https://www.anaconda.com/download)) from the `rapidsai` channel: +RMM can be installed with conda. You can get a minimal conda installation with [miniforge](https://github.com/conda-forge/miniforge). + +Install RMM with: ```bash -# for CUDA 11.2 -conda install -c nvidia -c rapidsai -c conda-forge \ - rmm cudatoolkit=11.2 -# for CUDA 11.1 -conda install -c nvidia -c rapidsai -c conda-forge \ - rmm cudatoolkit=11.1 -# for CUDA 11.0 -conda install -c nvidia -c rapidsai -c conda-forge \ - rmm cudatoolkit=11.0 +conda install -c rapidsai -c conda-forge -c nvidia rmm cuda-version=13.0 ``` -We also provide [nightly Conda packages](https://anaconda.org/rapidsai-nightly) built from the HEAD +We also provide [nightly conda packages](https://anaconda.org/rapidsai-nightly) built from the HEAD of our latest development branch. -Note: RMM is supported only on Linux, and with Python versions 3.7 and later. +Note: RMM is supported only on Linux, and only tested with Python versions 3.10, 3.11, 3.12, and 3.13. -Note: The RMM package from Conda requires building with GCC 9 or later. Otherwise, your application may fail to build. +Note: The RMM package from conda requires building with GCC 9 or later. Otherwise, your application may fail to build. -See the [Get RAPIDS version picker](https://rapids.ai/start.html) for more OS and version info. +See the [RAPIDS Installation Guide](https://docs.rapids.ai/install/) for system requirements. ## Building from Source @@ -55,31 +56,42 @@ See the [Get RAPIDS version picker](https://rapids.ai/start.html) for more OS an Compiler requirements: * `gcc` version 9.3+ -* `nvcc` version 11.0+ -* `cmake` version 3.20.1+ +* `nvcc` version 12.0+ +* `cmake` version 3.30.4+ CUDA/GPU requirements: -* CUDA 11.0+ -* NVIDIA driver 450.51+ -* Pascal architecture or better +* CUDA 12.0+. You can obtain CUDA from + [https://developer.nvidia.com/cuda-downloads](https://developer.nvidia.com/cuda-downloads) + +GPU Support: +* RMM is tested and supported only on Volta architecture and newer (Compute Capability 7.0+). + +Python requirements: +* `rapids-build-backend` (available from PyPI or the `rapidsai` conda channel) +* `scikit-build-core` +* `cuda-python` +* `cython` + +For more details, see [pyproject.toml](python/rmm/pyproject.toml) -You can obtain CUDA from [https://developer.nvidia.com/cuda-downloads](https://developer.nvidia.com/cuda-downloads) ### Script to build RMM from source To install RMM from source, ensure the dependencies are met and follow the steps below: -- Clone the repository and submodules +- Clone the repository: + ```bash -$ git clone --recurse-submodules https://github.com/rapidsai/rmm.git +$ git clone https://github.com/rapidsai/rmm.git $ cd rmm ``` -- Create the conda development environment `rmm_dev` +- Create the conda development environment `rmm_dev`: + ```bash # create the conda environment (assuming in base `rmm` directory) -$ conda env create --name rmm_dev --file conda/environments/rmm_dev_cuda11.0.yml +$ conda env create --name rmm_dev --file conda/environments/all_cuda-130_arch-$(arch).yaml # activate the environment $ conda activate rmm_dev ``` @@ -88,7 +100,6 @@ $ conda activate rmm_dev your path or defined in `CUDACXX` environment variable. ```bash - $ mkdir build # make a build directory $ cd build # enter the build directory $ cmake .. -DCMAKE_INSTALL_PREFIX=/install/path # configure cmake ... use $CONDA_PREFIX if you're using Anaconda @@ -101,7 +112,6 @@ $ make install # install the library librmm `CUDACXX` environment variable. ```bash - $ ./build.sh -h # Display help and exit $ ./build.sh -n librmm # Build librmm without installing $ ./build.sh -n rmm # Build rmm without installing @@ -110,15 +120,18 @@ $ ./build.sh librmm rmm # Build and install librmm a ``` - To run tests (Optional): + ```bash $ cd build (if you are not already in build directory) $ make test ``` - Build, install, and test the `rmm` python package, in the `python` folder: + ```bash -$ python setup.py build_ext --inplace -$ python setup.py install +# In the root rmm directory +$ python -m pip wheel ./python/librmm +$ python -m pip install --find-links=. -e ./python/rmm $ pytest -v ``` @@ -126,7 +139,7 @@ Done! You are ready to develop for the RMM OSS project. ### Caching third-party dependencies -RMM uses [CPM.cmake](https://github.com/TheLartians/CPM.cmake) to +RMM uses [CPM.cmake](https://github.com/cpm-cmake/CPM.cmake) to handle third-party dependencies like spdlog, Thrust, GoogleTest, GoogleBenchmark. In general you won't have to worry about it. If CMake finds an appropriate version on your system, it uses it (you can @@ -141,12 +154,12 @@ directory to avoid repeated downloads of the third-party dependencies. ## Using RMM in a downstream CMake project The installed RMM library provides a set of config files that makes it easy to -integrate RMM into your own CMake project. In your `CMakeLists.txt`, just add +integrate RMM into your own CMake project. Add the following to `CMakeLists.txt`: ```cmake find_package(rmm [VERSION]) # ... -target_link_libraries( (PRIVATE|PUBLIC) rmm::rmm) +target_link_libraries( (PRIVATE|PUBLIC|INTERFACE) rmm::rmm) ``` Since RMM is a header-only library, this does not actually link RMM, @@ -159,11 +172,32 @@ automatically pulls in `Thrust` by means of a dependency on the `rmm::Thrust` target. By default it uses the standard configuration of Thrust. If you want to customize it, you can set the variables `THRUST_HOST_SYSTEM` and `THRUST_DEVICE_SYSTEM`; see -[Thrust's CMake documentation](https://github.com/NVIDIA/thrust/blob/main/thrust/cmake/README.md). +[Thrust's CMake documentation](https://github.com/NVIDIA/cccl/blob/main/thrust/thrust/cmake/README.md). + +### Using CPM to manage RMM + +RMM uses [CPM.cmake](https://github.com/cpm-cmake/CPM.cmake) to manage +its dependencies, including [CCCL](https://github.com/nvidia/cccl), and you can +use CPM for your project's dependency on RMM. + +There is an issue with using CPM's *single-argument compact syntax* for +RMM/CCCL as it transitively marks targets as `SYSTEM` dependencies. +This causes the CCCL headers pulled in through CPM to be of lower priority +to the preprocessor than the (potentially outdated) CCCL headers provided +by the CUDA SDK. To avoid this issue, use CPM's *multi-argument syntax* +instead: + +```cmake +CPMAddPackage(NAME rmm [VERSION] + GITHUB_REPOSITORY rapidsai/rmm + SYSTEM Off) +# ... +target_link_libraries( (PRIVATE|PUBLIC|INTERFACE) rmm::rmm) +``` # Using RMM in C++ -The first goal of RMM is to provide a common interface for device and host memory allocation. +The first goal of RMM is to provide a common interface for device and host memory allocation. This allows both _users_ and _implementers_ of custom allocation logic to program to a single interface. @@ -186,50 +220,19 @@ It has two key functions: - Returns a pointer to an allocation of at least `bytes` bytes. 2. `void device_memory_resource::deallocate(void* p, std::size_t bytes, cuda_stream_view s)` - - Reclaims a previous allocation of size `bytes` pointed to by `p`. + - Reclaims a previous allocation of size `bytes` pointed to by `p`. - `p` *must* have been returned by a previous call to `allocate(bytes)`, otherwise behavior is undefined It is up to a derived class to provide implementations of these functions. See -[available resources](#available-resources) for example `device_memory_resource` derived classes. +[available resources](#available-resources) for example `device_memory_resource` derived classes. -Unlike `std::pmr::memory_resource`, `rmm::mr::device_memory_resource` does not allow specifying an -alignment argument. All allocations are required to be aligned to at least 256B. Furthermore, +Unlike `std::pmr::memory_resource`, `rmm::mr::device_memory_resource` does not allow specifying an +alignment argument. All allocations are required to be aligned to at least 256B. Furthermore, `device_memory_resource` adds an additional `cuda_stream_view` argument to allow specifying the stream on which to perform the (de)allocation. -## `cuda_stream_view` and `cuda_stream` - -`rmm::cuda_stream_view` is a simple non-owning wrapper around a CUDA `cudaStream_t`. This wrapper's -purpose is to provide strong type safety for stream types. (`cudaStream_t` is an alias for a pointer, -which can lead to ambiguity in APIs when it is assigned `0`.) All RMM stream-ordered APIs take a -`rmm::cuda_stream_view` argument. - -`rmm::cuda_stream` is a simple owning wrapper around a CUDA `cudaStream_t`. This class provides -RAII semantics (constructor creates the CUDA stream, destructor destroys it). An `rmm::cuda_stream` -can never represent the CUDA default stream or per-thread default stream; it only ever represents -a single non-default stream. `rmm::cuda_stream` cannot be copied, but can be moved. - -## `cuda_stream_pool` - -`rmm::cuda_stream_pool` provides fast access to a pool of CUDA streams. This class can be used to -create a set of `cuda_stream` objects whose lifetime is equal to the `cuda_stream_pool`. Using the -stream pool can be faster than creating the streams on the fly. The size of the pool is configurable. -Depending on this size, multiple calls to `cuda_stream_pool::get_stream()` may return instances of -`rmm::cuda_stream_view` that represent identical CUDA streams. - -### Thread Safety - -All current device memory resources are thread safe unless documented otherwise. More specifically, -calls to memory resource `allocate()` and `deallocate()` methods are safe with respect to calls to -either of these functions from other threads. They are _not_ thread safe with respect to -construction and destruction of the memory resource object. - -Note that a class `thread_safe_resource_adapter` is provided which can be used to adapt a memory -resource that is not thread safe to be thread safe (as described above). This adapter is not needed -with any current RMM device memory resources. - -### Stream-ordered Memory Allocation +## Stream-ordered Memory Allocation `rmm::mr::device_memory_resource` is a base class that provides stream-ordered memory allocation. This allows optimizations such as re-using memory deallocated on the same stream without the @@ -247,7 +250,7 @@ used internally by a `device_memory_resource` for managing available memory with synchronization, and it may also be synchronized at a later time, for example using a call to `cudaStreamSynchronize()`. -For this reason, it is Undefined Behavior to destroy a CUDA stream that is passed to +For this reason, it is Undefined Behavior to destroy a CUDA stream that is passed to `device_memory_resource::deallocate`. If the stream on which the allocation was last used has been destroyed before calling `deallocate` or it is known that it will be destroyed, it is likely better to synchronize the stream (before destroying it) and then pass a different stream to `deallocate` @@ -256,41 +259,46 @@ to synchronize the stream (before destroying it) and then pass a different strea Note that device memory data structures such as `rmm::device_buffer` and `rmm::device_uvector` follow these stream-ordered memory allocation semantics and rules. -### Available Resources +For further information about stream-ordered memory allocation semantics, read +[Using the NVIDIA CUDA Stream-Ordered Memory +Allocator](https://developer.nvidia.com/blog/using-cuda-stream-ordered-memory-allocator-part-1/) +on the NVIDIA Developer Blog. + +## Available Device Resources RMM provides several `device_memory_resource` derived classes to satisfy various user requirements. For more detailed information about these resources, see their respective documentation. -#### `cuda_memory_resource` +### `cuda_memory_resource` Allocates and frees device memory using `cudaMalloc` and `cudaFree`. -#### `managed_memory_resource` +### `managed_memory_resource` -Allocates and frees device memory using `cudaMallocManaged` and `cudaFree`. +Allocates and frees device memory using `cudaMallocManaged` and `cudaFree`. Note that `managed_memory_resource` cannot be used with NVIDIA Virtual GPU Software (vGPU, for use -with virtual machines or hypervisors) because [NVIDIA CUDA Unified Memory is not supported by +with virtual machines or hypervisors) because [NVIDIA CUDA Unified Memory is not supported by NVIDIA vGPU](https://docs.nvidia.com/grid/latest/grid-vgpu-user-guide/index.html#cuda-open-cl-support-vgpu). -#### `pool_memory_resource` +### `pool_memory_resource` A coalescing, best-fit pool sub-allocator. -#### `fixed_size_memory_resource` +### `fixed_size_memory_resource` A memory resource that can only allocate a single fixed size. Average allocation and deallocation cost is constant. -#### `binning_memory_resource` +### `binning_memory_resource` -Configurable to use multiple upstream memory resources for allocations that fall within different +Configurable to use multiple upstream memory resources for allocations that fall within different bin sizes. Often configured with multiple bins backed by `fixed_size_memory_resource`s and a single `pool_memory_resource` for allocations larger than the largest bin size. -### Default Resources and Per-device Resources +## Default Resources and Per-device Resources -RMM users commonly need to configure a `device_memory_resource` object to use for all allocations +RMM users commonly need to configure a `device_memory_resource` object to use for all allocations where another resource has not explicitly been provided. A common example is configuring a `pool_memory_resource` to use for all allocations to get fast dynamic allocation. @@ -301,7 +309,7 @@ Accessing and modifying the default resource is done through two functions: - `device_memory_resource* get_current_device_resource()` - Returns a pointer to the default resource for the current CUDA device. - The initial default memory resource is an instance of `cuda_memory_resource`. - - This function is thread safe with respect to concurrent calls to it and + - This function is thread safe with respect to concurrent calls to it and `set_current_device_resource()`. - For more explicit control, you can use `get_per_device_resource()`, which takes a device ID. @@ -313,51 +321,156 @@ Accessing and modifying the default resource is done through two functions: `get_current_device_resource()` - For more explicit control, you can use `set_per_device_resource()`, which takes a device ID. -#### Example +### Example ```c++ rmm::mr::cuda_memory_resource cuda_mr; // Construct a resource that uses a coalescing best-fit pool allocator -rmm::mr::pool_memory_resource pool_mr{&cuda_mr}; +// With the pool initially half of available device memory +auto initial_size = rmm::percent_of_free_device_memory(50); +rmm::mr::pool_memory_resource pool_mr{&cuda_mr, initial_size}; rmm::mr::set_current_device_resource(&pool_mr); // Updates the current device resource pointer to `pool_mr` rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource(); // Points to `pool_mr` ``` -#### Multiple Devices +### Multiple Devices A `device_memory_resource` should only be used when the active CUDA device is the same device that was active when the `device_memory_resource` was created. Otherwise behavior is undefined. If a `device_memory_resource` is used with a stream associated with a different CUDA device than the device for which the memory resource was created, behavior is undefined. - + Creating a `device_memory_resource` for each device requires care to set the current device before creating each resource, and to maintain the lifetime of the resources as long as they are set as per-device resources. Here is an example loop that creates `unique_ptr`s to `pool_memory_resource` objects for each device and sets them as the per-device resource for that device. -```c++ -std::vector> per_device_pools; +```c++ +using pool_mr = rmm::mr::pool_memory_resource; +std::vector> per_device_pools; for(int i = 0; i < N; ++i) { - cudaSetDevice(i); // set device i before creating MR - // Use a vector of unique_ptr to maintain the lifetime of the MRs - per_device_pools.push_back(std::make_unique()); - // Set the per-device resource for device i - set_per_device_resource(cuda_device_id{i}, &per_device_pools.back()); + cudaSetDevice(i); // set device i before creating MR + // Use a vector of unique_ptr to maintain the lifetime of the MRs + // Note: for brevity, omitting creation of upstream and computing initial_size + per_device_pools.push_back(std::make_unique(upstream, initial_size)); + // Set the per-device resource for device i + set_per_device_resource(cuda_device_id{i}, &per_device_pools.back()); +} +``` + +Note that the CUDA device that is current when creating a `device_memory_resource` must also be +current any time that `device_memory_resource` is used to deallocate memory, including in a +destructor. The RAII class `rmm::device_buffer` and classes that use it as a backing store +(`rmm::device_scalar` and `rmm::device_uvector`) handle this by storing the active device when the +constructor is called, and then ensuring that the stored device is active whenever an allocation or +deallocation is performed (including in the destructor). The user must therefore only ensure that +the device active during _creation_ of an `rmm::device_buffer` matches the active device of the +memory resource being used. + +Here is an incorrect example that creates a memory resource on device `0` and then uses it to +allocate a `device_buffer` on device `1`: + +```c++ +{ + RMM_CUDA_TRY(cudaSetDevice(0)); + auto mr = rmm::mr::cuda_memory_resource{}; + { + RMM_CUDA_TRY(cudaSetDevice(1)); + // Invalid, current device is 1, but MR is only valid for device 0 + rmm::device_buffer buf(16, rmm::cuda_stream_default, &mr); + } +} +``` + +A correct example creates the device buffer with device `0` active. After that it is safe to switch +devices and let the buffer go out of scope and destruct with a different device active. For example, +this code is correct: + +```c++ +{ + RMM_CUDA_TRY(cudaSetDevice(0)); + auto mr = rmm::mr::cuda_memory_resource{}; + rmm::device_buffer buf(16, rmm::cuda_stream_default, &mr); + RMM_CUDA_TRY(cudaSetDevice(1)); + ... + // No need to switch back to device 0 before ~buf runs +} +``` + +#### Use of `rmm::device_vector` with multiple devices + +`rmm:device_vector` uses an `rmm::mr::thrust_allocator` to enable `thrust::device_vector` to +allocate and deallocate memory using RMM. As such, the usual rules for usage of the backing memory +resource apply: the active device must match the active device at resource construction time. To +facilitate use in an RAII setting, `rmm::mr::thrust_allocator` records the active device at +construction time and ensures that device is active whenever it allocates or deallocates memory. +Usage of `rmm::device_vector` with multiple devices is therefore the same as `rmm::device_buffer`. +One must _create_ `device_vector`s with the correct device active, but it is safe to destroy them +with a different active device. + +For example, recapitulating the previous example using `rmm::device_vector`: + +```c++ +{ + RMM_CUDA_TRY(cudaSetDevice(0)); + auto mr = rmm::mr::cuda_memory_resource{}; + rmm::device_vector vec(16, rmm::mr::thrust_allocator(rmm::cuda_stream_default, &mr)); + RMM_CUDA_TRY(cudaSetDevice(1)); + ... + // No need to switch back to device 0 before ~vec runs } ``` -### Allocators +> [!NOTE] +> Although allocation and deallocation in the `thrust_allocator` run with the correct active device, +> modification of `rmm::device_vector` might necessitate a kernel launch, and this must run with the +> correct device active. For example, `.resize()` might both allocate _and_ launch a kernel to +> initialize new elements: the user must arrange for this kernel launch to occur with the correct +> device for the memory resource active. + +## `cuda_stream_view` and `cuda_stream` + +`rmm::cuda_stream_view` is a simple non-owning wrapper around a CUDA `cudaStream_t`. This wrapper's +purpose is to provide strong type safety for stream types. (`cudaStream_t` is an alias for a pointer, +which can lead to ambiguity in APIs when it is assigned `0`.) All RMM stream-ordered APIs take a +`rmm::cuda_stream_view` argument. + +`rmm::cuda_stream` is a simple owning wrapper around a CUDA `cudaStream_t`. This class provides +RAII semantics (constructor creates the CUDA stream, destructor destroys it). An `rmm::cuda_stream` +can never represent the CUDA default stream or per-thread default stream; it only ever represents +a single non-default stream. `rmm::cuda_stream` cannot be copied, but can be moved. + +## `cuda_stream_pool` + +`rmm::cuda_stream_pool` provides fast access to a pool of CUDA streams. This class can be used to +create a set of `cuda_stream` objects whose lifetime is equal to the `cuda_stream_pool`. Using the +stream pool can be faster than creating the streams on the fly. The size of the pool is configurable. +Depending on this size, multiple calls to `cuda_stream_pool::get_stream()` may return instances of +`rmm::cuda_stream_view` that represent identical CUDA streams. + +## Thread Safety + +All current device memory resources are thread safe unless documented otherwise. More specifically, +calls to memory resource `allocate()` and `deallocate()` methods are safe with respect to calls to +either of these functions from other threads. They are _not_ thread safe with respect to +construction and destruction of the memory resource object. + +Note that a class `thread_safe_resource_adapter` is provided which can be used to adapt a memory +resource that is not thread safe to be thread safe (as described above). This adapter is not needed +with any current RMM device memory resources. + +## Allocators -C++ interfaces commonly allow customizable memory allocation through an [`Allocator`](https://en.cppreference.com/w/cpp/named_req/Allocator) object. +C++ interfaces commonly allow customizable memory allocation through an [`Allocator`](https://en.cppreference.com/w/cpp/named_req/Allocator) object. RMM provides several `Allocator` and `Allocator`-like classes. -#### `polymorphic_allocator` +### `polymorphic_allocator` -A [stream-ordered](#stream-ordered-memory-allocation) allocator similar to [`std::pmr::polymorphic_allocator`](https://en.cppreference.com/w/cpp/memory/polymorphic_allocator). +A [stream-ordered](#stream-ordered-memory-allocation) allocator similar to [`std::pmr::polymorphic_allocator`](https://en.cppreference.com/w/cpp/memory/polymorphic_allocator). Unlike the standard C++ `Allocator` interface, the `allocate` and `deallocate` functions take a `cuda_stream_view` indicating the stream on which the (de)allocation occurs. -#### `stream_allocator_adaptor` +### `stream_allocator_adaptor` `stream_allocator_adaptor` can be used to adapt a stream-ordered allocator to present a standard `Allocator` interface to consumers that may not be designed to work with a stream-ordered interface. @@ -367,20 +480,20 @@ rmm::cuda_stream stream; rmm::mr::polymorphic_allocator stream_alloc; // Constructs an adaptor that forwards all (de)allocations to `stream_alloc` on `stream`. -auto adapted = rmm::mr::make_stream_allocator_adaptor(stream_alloc, stream); +auto adapted = rmm::mr::stream_allocator_adaptor(stream_alloc, stream); // Allocates 100 bytes using `stream_alloc` on `stream` -auto p = adapted.allocate(100); +auto p = adapted.allocate(100); ... // Deallocates using `stream_alloc` on `stream` -adapted.deallocate(p,100); +adapted.deallocate(p,100); ``` -#### `thrust_allocator` +### `thrust_allocator` `thrust_allocator` is a device memory allocator that uses the strongly typed `thrust::device_ptr`, making it usable with containers like `thrust::device_vector`. -See [below](#using-rmm-with-thrust) for more information on using RMM with Thrust. +See [below](#using-rmm-with-thrust) for more information on using RMM with Thrust. ## Device Data Structures @@ -393,7 +506,7 @@ An untyped, uninitialized RAII class for stream ordered device memory allocation ```c++ cuda_stream_view s{...}; // Allocates at least 100 bytes on stream `s` using the *default* resource -rmm::device_buffer b{100,s}; +rmm::device_buffer b{100,s}; void* p = b.data(); // Raw, untyped pointer to underlying device memory kernel<<<..., s.value()>>>(b.data()); // `b` is only safe to use on `s` @@ -416,11 +529,11 @@ cuda_stream_view s{...}; // default resource rmm::device_uvector v(100, s); // Initializes the elements to 0 -thrust::uninitialized_fill(thrust::cuda::par.on(s.value()), v.begin(), v.end(), int32_t{0}); +thrust::uninitialized_fill(thrust::cuda::par.on(s.value()), v.begin(), v.end(), int32_t{0}); rmm::mr::device_memory_resource * mr = new my_custom_resource{...}; // Allocates uninitialized storage for 100 `int32_t` elements on stream `s` using the resource `mr` -rmm::device_uvector v2{100, s, mr}; +rmm::device_uvector v2{100, s, mr}; ``` ### `device_scalar` @@ -432,7 +545,7 @@ modifying the value in device memory from the host, or retrieving the value from ```c++ cuda_stream_view s{...}; // Allocates uninitialized storage for a single `int32_t` in device memory -rmm::device_scalar a{s}; +rmm::device_scalar a{s}; a.set_value(42, s); // Updates the value in device memory to `42` on stream `s` kernel<<<...,s.value()>>>(a.data()); // Pass raw pointer to underlying element in device memory @@ -452,19 +565,19 @@ Similar to `device_memory_resource`, it has two key functions for (de)allocation `alignment` 2. `void host_memory_resource::deallocate(void* p, std::size_t bytes, std::size_t alignment)` - - Reclaims a previous allocation of size `bytes` pointed to by `p`. + - Reclaims a previous allocation of size `bytes` pointed to by `p`. Unlike `device_memory_resource`, the `host_memory_resource` interface and behavior is identical to -`std::pmr::memory_resource`. +`std::pmr::memory_resource`. -### Available Resources +## Available Host Resources -#### `new_delete_resource` +### `new_delete_resource` Uses the global `operator new` and `operator delete` to allocate host memory. -#### `pinned_memory_resource` +### `pinned_memory_resource` Allocates "pinned" host memory using `cuda(Malloc/Free)Host`. @@ -505,7 +618,7 @@ RMM includes two forms of logging. Memory event logging and debug logging. ### Memory Event Logging and `logging_resource_adaptor` Memory event logging writes details of every allocation or deallocation to a CSV (comma-separated -value) file. In C++, Memory Event Logging is enabled by using the `logging_resource_adaptor` as a +value) file. In C++, Memory Event Logging is enabled by using the `logging_resource_adaptor` as a wrapper around any other `device_memory_resource` object. Each row in the log represents either an allocation or a deallocation. The columns of the file are @@ -524,7 +637,7 @@ rmm::mr::cuda_memory_resource upstream; rmm::mr::logging_resource_adaptor log_mr{&upstream, filename}; ``` -If a file name is not specified, the environment variable `RMM_LOG_FILE` is queried for the file +If a file name is not specified, the environment variable `RMM_LOG_FILE` is queried for the file name. If `RMM_LOG_FILE` is not set, then an exception is thrown by the `logging_resource_adaptor` constructor. @@ -534,42 +647,44 @@ set to `True`. The log file name can be set using the `log_file_name` parameter. ### Debug Logging -RMM includes a debug logger which can be enabled to log trace and debug information to a file. This -information can show when errors occur, when additional memory is allocated from upstream resources, -etc. The default log file is `rmm_log.txt` in the current working directory, but the environment -variable `RMM_DEBUG_LOG_FILE` can be set to specify the path and file name. +RMM leverages [`rapids-logger`](https://github.com/rapidsai/rapids-logger) to log trace and debug +information to a file. This information can show when errors occur, when additional memory is +allocated from upstream resources, etc. By default output is logged to stderr, but the environment +variable `RMM_DEBUG_LOG_FILE` can be set to specify a path and file name to dump the logs to +instead. There is a CMake configuration variable `RMM_LOGGING_LEVEL`, which can be set to enable compilation of more detailed logging. The default is `INFO`. Available levels are `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `CRITICAL` and `OFF`. -The log relies on the [spdlog](https://github.com/gabime/spdlog.git) library. - -Note that to see logging below the `INFO` level, the C++ application must also call -`rmm::logger().set_level()`, e.g. to enable all levels of logging down to `TRACE`, call -`rmm::logger().set_level(spdlog::level::trace)` (and compile with `-DRMM_LOGGING_LEVEL=TRACE`). +Note that to see logging below the `INFO` level, the application must also set the logging level at +run time. C++ applications must must call `rmm::default_logger().set_level()`, for example to enable all +levels of logging down to `TRACE`, call `rmm::default_logger().set_level(rapids_logger::level_enum::trace)` (and compile +librmm with `-DRMM_LOGGING_LEVEL=TRACE`). Python applications must call `rmm.set_logging_level()`, +for example to enable all levels of logging down to `TRACE`, call `rmm.set_logging_level("trace")` +(and compile the RMM Python module with `-DRMM_LOGGING_LEVEL=TRACE`). -Note that debug logging is different from the CSV memory allocation logging provided by +Note that debug logging is different from the CSV memory allocation logging provided by `rmm::mr::logging_resource_adapter`. The latter is for logging a history of allocation / deallocation actions which can be useful for replay with RMM's replay benchmark. ## RMM and CUDA Memory Bounds Checking Memory allocations taken from a memory resource that allocates a pool of memory (such as -`pool_memory_resource` and `arena_memory_resource`) are part of the same low-level CUDA memory -allocation. Therefore, out-of-bounds or misaligned accesses to these allocations are not likely to -be detected by CUDA tools such as +`pool_memory_resource` and `arena_memory_resource`) are part of the same low-level CUDA memory +allocation. Therefore, out-of-bounds or misaligned accesses to these allocations are not likely to +be detected by CUDA tools such as [CUDA Compute Sanitizer](https://docs.nvidia.com/cuda/compute-sanitizer/index.html) memcheck. -Exceptions to this are `cuda_memory_resource`, which wraps `cudaMalloc`, and -`cuda_async_memory_resource`, which uses `cudaMallocAsync` with CUDA's built-in memory pool -functionality (CUDA 11.2 or later required). Illegal memory accesses to memory allocated by these +Exceptions to this are `cuda_memory_resource`, which wraps `cudaMalloc`, and +`cuda_async_memory_resource`, which uses `cudaMallocAsync` with CUDA's built-in memory pool +functionality (introduced in CUDA 11.2). Illegal memory accesses to memory allocated by these resources are detectable with Compute Sanitizer Memcheck. -It may be possible in the future to add support for memory bounds checking with other memory +It may be possible in the future to add support for memory bounds checking with other memory resources using NVTX APIs. -## Using RMM in Python Code +# Using RMM in Python There are two ways to use RMM in Python code: @@ -580,7 +695,7 @@ There are two ways to use RMM in Python code: RMM provides a `MemoryResource` abstraction to control _how_ device memory is allocated in both the above uses. -### DeviceBuffers +## DeviceBuffer A DeviceBuffer represents an **untyped, uninitialized device memory allocation**. DeviceBuffers can be created by providing the @@ -607,7 +722,7 @@ DeviceBuffers can also be created by copying data from host memory: >>> import rmm >>> import numpy as np >>> a = np.array([1, 2, 3], dtype='float64') ->>> buf = rmm.to_device(a.tobytes()) +>>> buf = rmm.DeviceBuffer.to_device(a.tobytes()) >>> buf.size 24 ``` @@ -620,12 +735,12 @@ host: array([1., 2., 3.]) ``` -### MemoryResource objects +## MemoryResource objects `MemoryResource` objects are used to configure how device memory allocations are made by RMM. -By default if a `MemoryResource` is not set explicitly, RMM uses the `CudaMemoryResource`, which +By default if a `MemoryResource` is not set explicitly, RMM uses the `CudaMemoryResource`, which uses `cudaMalloc` for allocating device memory. `rmm.reinitialize()` provides an easy way to initialize RMM with specific memory resource options @@ -657,20 +772,22 @@ of 1 GiB and a maximum size of 4 GiB. The pool uses >>> import rmm >>> pool = rmm.mr.PoolMemoryResource( ... rmm.mr.CudaMemoryResource(), -... initial_pool_size=2**30, -... maximum_pool_size=2**32 +... initial_pool_size="1GiB", # equivalent to initial_pool_size=2**30 +... maximum_pool_size="4GiB" ... ) >>> rmm.mr.set_current_device_resource(pool) ``` Other MemoryResources include: * `FixedSizeMemoryResource` for allocating fixed blocks of memory -* `BinningMemoryResource` for allocating blocks within specified "bin" sizes from different memory +* `BinningMemoryResource` for allocating blocks within specified "bin" sizes from different memory resources -MemoryResources are highly configurable and can be composed together in different ways. +MemoryResources are highly configurable and can be composed together in different ways. See `help(rmm.mr)` for more information. +## Using RMM with third-party libraries + ### Using RMM with CuPy You can configure [CuPy](https://cupy.dev/) to use RMM for memory @@ -678,28 +795,177 @@ allocations by setting the CuPy CUDA allocator to `rmm_cupy_allocator`: ```python ->>> import rmm +>>> from rmm.allocators.cupy import rmm_cupy_allocator >>> import cupy ->>> cupy.cuda.set_allocator(rmm.rmm_cupy_allocator) +>>> cupy.cuda.set_allocator(rmm_cupy_allocator) ``` + +**Note:** This only configures CuPy to use the current RMM resource for allocations. +It does not initialize nor change the current resource, e.g., enabling a memory pool. +See [here](#memoryresource-objects) for more information on changing the current memory resource. + ### Using RMM with Numba You can configure Numba to use RMM for memory allocations using the -Numba [EMM Plugin](http://numba.pydata.org/numba-doc/latest/cuda/external-memory.html#setting-the-emm-plugin). +Numba [EMM Plugin](https://numba.readthedocs.io/en/stable/cuda/external-memory.html#setting-emm-plugin). This can be done in two ways: 1. Setting the environment variable `NUMBA_CUDA_MEMORY_MANAGER`: ```python - $ NUMBA_CUDA_MEMORY_MANAGER=rmm python (args) + $ NUMBA_CUDA_MEMORY_MANAGER=rmm.allocators.numba python (args) ``` 2. Using the `set_memory_manager()` function provided by Numba: ```python >>> from numba import cuda - >>> import rmm - >>> cuda.set_memory_manager(rmm.RMMNumbaManager) + >>> from rmm.allocators.numba import RMMNumbaManager + >>> cuda.set_memory_manager(RMMNumbaManager) ``` + +**Note:** This only configures Numba to use the current RMM resource for allocations. +It does not initialize nor change the current resource, e.g., enabling a memory pool. +See [here](#memoryresource-objects) for more information on changing the current memory resource. + +### Using RMM with PyTorch + +[PyTorch](https://pytorch.org/docs/stable/notes/cuda.html) can use RMM +for memory allocation. For example, to configure PyTorch to use an +RMM-managed pool: + +```python +import rmm +from rmm.allocators.torch import rmm_torch_allocator +import torch + +rmm.reinitialize(pool_allocator=True) +torch.cuda.memory.change_current_allocator(rmm_torch_allocator) +``` + +PyTorch and RMM will now share the same memory pool. + +You can, of course, use a custom memory resource with PyTorch as well: + +```python +import rmm +from rmm.allocators.torch import rmm_torch_allocator +import torch + +# note that you can configure PyTorch to use RMM either before or +# after changing RMM's memory resource. PyTorch will use whatever +# memory resource is configured to be the "current" memory resource at +# the time of allocation. +torch.cuda.change_current_allocator(rmm_torch_allocator) + +# configure RMM to use a managed memory resource, wrapped with a +# statistics resource adaptor that can report information about the +# amount of memory allocated: +mr = rmm.mr.StatisticsResourceAdaptor(rmm.mr.ManagedMemoryResource()) +rmm.mr.set_current_device_resource(mr) + +x = torch.tensor([1, 2]).cuda() + +# the memory resource reports information about PyTorch allocations: +mr.allocation_counts +Out[6]: +{'current_bytes': 16, + 'current_count': 1, + 'peak_bytes': 16, + 'peak_count': 1, + 'total_bytes': 16, + 'total_count': 1} +``` + +## Taking ownership of C++ objects from Python + +When interacting with a C++ library that uses RMM from Python, one +must be careful when taking ownership of `rmm::device_buffer` objects +on the Python side. The `rmm::device_buffer` does not contain an +owning reference to the memory resource used for its allocation (only +a `device_async_resource_ref`), and the allocating user is expected to +keep this memory resource alive for at least the lifetime of the +buffer. When taking ownership of such a buffer in Python, we have no +way (in the general case) of ensuring that the memory resource will +outlive the buffer we are now holding. + +To avoid any issues, we need two things: + +1. The C++ library we are interfacing with should accept a memory + resource that is used for allocations that are returned to the + user. +2. When calling into the library from python, we should provide a + memory resource whose lifetime we control. This memory resource + should then be provided when we take ownership of any allocated + `rmm::device_buffer`s. + +For example, suppose we have a C++ function that allocates +`device_buffer`s, which has a utility overload that defaults the +memory resource to the current device resource: + +```c++ +std::unique_ptr allocate( + std::size_t size, + rmm::mr::device_async_resource_ref mr = get_current_device_resource()) +{ + return std::make_unique(size, rmm::cuda_stream_default, mr); +} +``` + +The Python `DeviceBuffer` class has a convenience Cython function, +`c_from_unique_ptr` to construct a `DeviceBuffer` from a +`unique_ptr`, taking ownership of it. To do this +safely, we must ensure that the allocation that was done on the C++ +side uses a memory resource we control. So: + +```cython +# Bad, doesn't control lifetime +buffer_bad = DeviceBuffer.c_from_unique_ptr(allocate(10)) + +# Good, allocation happens with a memory resource we control +# mr is a DeviceMemoryResource +buffer_good = DeviceBuffer.c_from_unique_ptr( + allocate(10, mr.get_mr()), + mr=mr, +) +``` + +Note two differences between the bad and good cases: + +1. In the good case we pass the memory resource to the allocation + function. +2. In the good case, we pass _the same_ memory resource to the + `DeviceBuffer` constructor so that its lifetime is tied to the + lifetime of the buffer. + +### Potential pitfalls of relying on `get_current_device_resource` + +Functions in both the C++ and Python APIs that perform allocation +typically default the memory resource argument to the value of +`get_current_device_resource`. This is to simplify the interface for +callers. When using a C++ library from Python, this defaulting is +safe, _as long as_ it is only the Python process that ever calls +`set_current_device_resource`. + +This is because the current device resource on the C++ side has a +lifetime which is expected to be managed by the user. The resources +set by `rmm::mr::set_current_device_resource` are stored in a static +`std::map` whose keys are device ids and values are raw pointers to +the memory resources. Consequently, +`rmm::mr::get_current_device_resource` returns an object with no +lifetime provenance. This is, for the reasons discussed above, not +usable from Python. To handle this on the Python side, the +Python-level `set_current_device_resource` sets the C++ resource _and_ +stores the Python object in a static global dictionary. The Python +`get_current_device_resource` then _does not use_ +`rmm::mr::get_current_device_resource` and instead looks up the +current device resource in this global dictionary. + +Hence, if the C++ library we are interfacing with calls +`rmm::mr::set_current_device_resource`, the C++ and Python sides of +the program can disagree on what `get_current_device_resource` +returns. The only safe thing to do if using the simplified interfaces +is therefore to ensure that `set_current_device_resource` is only ever +called on the Python side. diff --git a/VERSION b/VERSION new file mode 100644 index 000000000..296e35288 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +25.10.00 diff --git a/benchmarks/device_uvector/device_uvector_bench.cu b/benchmarks/device_uvector/device_uvector_bench.cu deleted file mode 100644 index 7e73451e6..000000000 --- a/benchmarks/device_uvector/device_uvector_bench.cu +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2020-2021, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either ex ess or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include -#include -#include - -#include - -#include - -static void BM_UvectorSizeConstruction(benchmark::State& state) -{ - rmm::mr::cuda_memory_resource cuda_mr{}; - rmm::mr::pool_memory_resource mr{&cuda_mr}; - rmm::mr::set_current_device_resource(&mr); - - for (auto _ : state) { // NOLINT(clang-analyzer-deadcode.DeadStores) - rmm::device_uvector vec(state.range(0), rmm::cuda_stream_view{}); - cudaDeviceSynchronize(); - } - - state.SetItemsProcessed(static_cast(state.iterations())); - - rmm::mr::set_current_device_resource(nullptr); -} - -BENCHMARK(BM_UvectorSizeConstruction) - ->RangeMultiplier(10) // NOLINT - ->Range(10'000, 1'000'000'000) // NOLINT - ->Unit(benchmark::kMicrosecond); - -static void BM_ThrustVectorSizeConstruction(benchmark::State& state) -{ - rmm::mr::cuda_memory_resource cuda_mr{}; - rmm::mr::pool_memory_resource mr{&cuda_mr}; - rmm::mr::set_current_device_resource(&mr); - - for (auto _ : state) { // NOLINT(clang-analyzer-deadcode.DeadStores) - rmm::device_vector vec(state.range(0)); - cudaDeviceSynchronize(); - } - - state.SetItemsProcessed(static_cast(state.iterations())); - - rmm::mr::set_current_device_resource(nullptr); -} - -BENCHMARK(BM_ThrustVectorSizeConstruction) - ->RangeMultiplier(10) // NOLINT - ->Range(10'000, 1'000'000'000) // NOLINT - ->Unit(benchmark::kMicrosecond); - -BENCHMARK_MAIN(); diff --git a/benchmarks/utilities/cxxopts.hpp b/benchmarks/utilities/cxxopts.hpp deleted file mode 100644 index e021297bb..000000000 --- a/benchmarks/utilities/cxxopts.hpp +++ /dev/null @@ -1,1521 +0,0 @@ -/* - -Copyright (c) 2014, 2015, 2016, 2017 Jarryd Beck - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -*/ - -#ifndef CXXOPTS_HPP_INCLUDED -#define CXXOPTS_HPP_INCLUDED - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef __cpp_lib_optional -#include -#define CXXOPTS_HAS_OPTIONAL -#endif - -#ifndef CXXOPTS_VECTOR_DELIMITER -#define CXXOPTS_VECTOR_DELIMITER ',' -#endif - -#define CXXOPTS__VERSION_MAJOR 2 -#define CXXOPTS__VERSION_MINOR 2 -#define CXXOPTS__VERSION_PATCH 0 - -namespace cxxopts { -static constexpr struct { - uint8_t major, minor, patch; -} version = {CXXOPTS__VERSION_MAJOR, CXXOPTS__VERSION_MINOR, CXXOPTS__VERSION_PATCH}; -} // namespace cxxopts - -// when we ask cxxopts to use Unicode, help strings are processed using ICU, -// which results in the correct lengths being computed for strings when they -// are formatted for the help output -// it is necessary to make sure that can be found by the -// compiler, and that icu-uc is linked in to the binary. - -#ifdef CXXOPTS_USE_UNICODE -#include - -namespace cxxopts { -typedef icu::UnicodeString String; - -inline String toLocalString(std::string s) { return icu::UnicodeString::fromUTF8(std::move(s)); } - -class UnicodeStringIterator : public std::iterator { - public: - UnicodeStringIterator(const icu::UnicodeString* string, int32_t pos) : s(string), i(pos) {} - - value_type operator*() const { return s->char32At(i); } - - bool operator==(const UnicodeStringIterator& rhs) const { return s == rhs.s && i == rhs.i; } - - bool operator!=(const UnicodeStringIterator& rhs) const { return !(*this == rhs); } - - UnicodeStringIterator& operator++() - { - ++i; - return *this; - } - - UnicodeStringIterator operator+(int32_t v) { return UnicodeStringIterator(s, i + v); } - - private: - const icu::UnicodeString* s; - int32_t i; -}; - -inline String& stringAppend(String& s, String a) { return s.append(std::move(a)); } - -inline String& stringAppend(String& s, int n, UChar32 c) -{ - for (int i = 0; i != n; ++i) { - s.append(c); - } - - return s; -} - -template -String& stringAppend(String& s, Iterator begin, Iterator end) -{ - while (begin != end) { - s.append(*begin); - ++begin; - } - - return s; -} - -inline size_t stringLength(const String& s) { return s.length(); } - -inline std::string toUTF8String(const String& s) -{ - std::string result; - s.toUTF8String(result); - - return result; -} - -inline bool empty(const String& s) { return s.isEmpty(); } -} // namespace cxxopts - -namespace std { -inline cxxopts::UnicodeStringIterator begin(const icu::UnicodeString& s) -{ - return cxxopts::UnicodeStringIterator(&s, 0); -} - -inline cxxopts::UnicodeStringIterator end(const icu::UnicodeString& s) -{ - return cxxopts::UnicodeStringIterator(&s, s.length()); -} -} // namespace std - -// ifdef CXXOPTS_USE_UNICODE -#else - -namespace cxxopts { -typedef std::string String; - -template -T toLocalString(T&& t) -{ - return std::forward(t); -} - -inline size_t stringLength(const String& s) { return s.length(); } - -inline String& stringAppend(String& s, String a) { return s.append(std::move(a)); } - -inline String& stringAppend(String& s, size_t n, char c) { return s.append(n, c); } - -template -String& stringAppend(String& s, Iterator begin, Iterator end) -{ - return s.append(begin, end); -} - -template -std::string toUTF8String(T&& t) -{ - return std::forward(t); -} - -inline bool empty(const std::string& s) { return s.empty(); } -} // namespace cxxopts - -// ifdef CXXOPTS_USE_UNICODE -#endif - -namespace cxxopts { -namespace { -#ifdef _WIN32 -const std::string LQUOTE("\'"); -const std::string RQUOTE("\'"); -#else -const std::string LQUOTE("‘"); -const std::string RQUOTE("’"); -#endif -} // namespace - -class Value : public std::enable_shared_from_this { - public: - virtual ~Value() = default; - - virtual std::shared_ptr clone() const = 0; - - virtual void parse(const std::string& text) const = 0; - - virtual void parse() const = 0; - - virtual bool has_default() const = 0; - - virtual bool is_container() const = 0; - - virtual bool has_implicit() const = 0; - - virtual std::string get_default_value() const = 0; - - virtual std::string get_implicit_value() const = 0; - - virtual std::shared_ptr default_value(const std::string& value) = 0; - - virtual std::shared_ptr implicit_value(const std::string& value) = 0; - - virtual std::shared_ptr no_implicit_value() = 0; - - virtual bool is_boolean() const = 0; -}; - -class OptionException : public std::exception { - public: - OptionException(const std::string& message) : m_message(message) {} - - virtual const char* what() const noexcept { return m_message.c_str(); } - - private: - std::string m_message; -}; - -class OptionSpecException : public OptionException { - public: - OptionSpecException(const std::string& message) : OptionException(message) {} -}; - -class OptionParseException : public OptionException { - public: - OptionParseException(const std::string& message) : OptionException(message) {} -}; - -class option_exists_error : public OptionSpecException { - public: - option_exists_error(const std::string& option) - : OptionSpecException("Option " + LQUOTE + option + RQUOTE + " already exists") - { - } -}; - -class invalid_option_format_error : public OptionSpecException { - public: - invalid_option_format_error(const std::string& format) - : OptionSpecException("Invalid option format " + LQUOTE + format + RQUOTE) - { - } -}; - -class option_syntax_exception : public OptionParseException { - public: - option_syntax_exception(const std::string& text) - : OptionParseException("Argument " + LQUOTE + text + RQUOTE + - " starts with a - but has incorrect syntax") - { - } -}; - -class option_not_exists_exception : public OptionParseException { - public: - option_not_exists_exception(const std::string& option) - : OptionParseException("Option " + LQUOTE + option + RQUOTE + " does not exist") - { - } -}; - -class missing_argument_exception : public OptionParseException { - public: - missing_argument_exception(const std::string& option) - : OptionParseException("Option " + LQUOTE + option + RQUOTE + " is missing an argument") - { - } -}; - -class option_requires_argument_exception : public OptionParseException { - public: - option_requires_argument_exception(const std::string& option) - : OptionParseException("Option " + LQUOTE + option + RQUOTE + " requires an argument") - { - } -}; - -class option_not_has_argument_exception : public OptionParseException { - public: - option_not_has_argument_exception(const std::string& option, const std::string& arg) - : OptionParseException("Option " + LQUOTE + option + RQUOTE + - " does not take an argument, but argument " + LQUOTE + arg + RQUOTE + - " given") - { - } -}; - -class option_not_present_exception : public OptionParseException { - public: - option_not_present_exception(const std::string& option) - : OptionParseException("Option " + LQUOTE + option + RQUOTE + " not present") - { - } -}; - -class argument_incorrect_type : public OptionParseException { - public: - argument_incorrect_type(const std::string& arg) - : OptionParseException("Argument " + LQUOTE + arg + RQUOTE + " failed to parse") - { - } -}; - -class option_required_exception : public OptionParseException { - public: - option_required_exception(const std::string& option) - : OptionParseException("Option " + LQUOTE + option + RQUOTE + " is required but not present") - { - } -}; - -template -void throw_or_mimic(const std::string& text) -{ - static_assert(std::is_base_of::value, - "throw_or_mimic only works on std::exception and " - "deriving classes"); - -#ifndef CXXOPTS_NO_EXCEPTIONS - // If CXXOPTS_NO_EXCEPTIONS is not defined, just throw - throw T{text}; -#else - // Otherwise manually instantiate the exception, print what() to stderr, - // and abort - T exception{text}; - std::cerr << exception.what() << std::endl; - std::cerr << "Aborting (exceptions disabled)..." << std::endl; - std::abort(); -#endif -} - -namespace values { -namespace { -std::basic_regex integer_pattern("(-)?(0x)?([0-9a-zA-Z]+)|((0x)?0)"); -std::basic_regex truthy_pattern("(t|T)(rue)?|1"); -std::basic_regex falsy_pattern("(f|F)(alse)?|0"); -} // namespace - -namespace detail { -template -struct SignedCheck; - -template -struct SignedCheck { - template - void operator()(bool negative, U u, const std::string& text) - { - if (negative) { - if (u > static_cast((std::numeric_limits::min)())) { - throw_or_mimic(text); - } - } else { - if (u > static_cast((std::numeric_limits::max)())) { - throw_or_mimic(text); - } - } - } -}; - -template -struct SignedCheck { - template - void operator()(bool, U, const std::string&) - { - } -}; - -template -void check_signed_range(bool negative, U value, const std::string& text) -{ - SignedCheck::is_signed>()(negative, value, text); -} -} // namespace detail - -template -R checked_negate(T&& t, const std::string&, std::true_type) -{ - // if we got to here, then `t` is a positive number that fits into - // `R`. So to avoid MSVC C4146, we first cast it to `R`. - // See https://github.com/jarro2783/cxxopts/issues/62 for more details. - return static_cast(-static_cast(t - 1) - 1); -} - -template -T checked_negate(T&& t, const std::string& text, std::false_type) -{ - throw_or_mimic(text); - return t; -} - -template -void integer_parser(const std::string& text, T& value) -{ - std::smatch match; - std::regex_match(text, match, integer_pattern); - - if (match.length() == 0) { throw_or_mimic(text); } - - if (match.length(4) > 0) { - value = 0; - return; - } - - using US = typename std::make_unsigned::type; - - constexpr bool is_signed = std::numeric_limits::is_signed; - const bool negative = match.length(1) > 0; - const uint8_t base = match.length(2) > 0 ? 16 : 10; - - auto value_match = match[3]; - - US result = 0; - - for (auto iter = value_match.first; iter != value_match.second; ++iter) { - US digit = 0; - - if (*iter >= '0' && *iter <= '9') { - digit = static_cast(*iter - '0'); - } else if (base == 16 && *iter >= 'a' && *iter <= 'f') { - digit = static_cast(*iter - 'a' + 10); - } else if (base == 16 && *iter >= 'A' && *iter <= 'F') { - digit = static_cast(*iter - 'A' + 10); - } else { - throw_or_mimic(text); - } - - const US next = static_cast(result * base + digit); - if (result > next) { throw_or_mimic(text); } - - result = next; - } - - detail::check_signed_range(negative, result, text); - - if (negative) { - value = checked_negate(result, text, std::integral_constant()); - } else { - value = static_cast(result); - } -} - -template -void stringstream_parser(const std::string& text, T& value) -{ - std::stringstream in(text); - in >> value; - if (!in) { throw_or_mimic(text); } -} - -inline void parse_value(const std::string& text, uint8_t& value) { integer_parser(text, value); } - -inline void parse_value(const std::string& text, int8_t& value) { integer_parser(text, value); } - -inline void parse_value(const std::string& text, uint16_t& value) { integer_parser(text, value); } - -inline void parse_value(const std::string& text, int16_t& value) { integer_parser(text, value); } - -inline void parse_value(const std::string& text, uint32_t& value) { integer_parser(text, value); } - -inline void parse_value(const std::string& text, int32_t& value) { integer_parser(text, value); } - -inline void parse_value(const std::string& text, uint64_t& value) { integer_parser(text, value); } - -inline void parse_value(const std::string& text, int64_t& value) { integer_parser(text, value); } - -inline void parse_value(const std::string& text, bool& value) -{ - std::smatch result; - std::regex_match(text, result, truthy_pattern); - - if (!result.empty()) { - value = true; - return; - } - - std::regex_match(text, result, falsy_pattern); - if (!result.empty()) { - value = false; - return; - } - - throw_or_mimic(text); -} - -inline void parse_value(const std::string& text, std::string& value) { value = text; } - -// The fallback parser. It uses the stringstream parser to parse all types -// that have not been overloaded explicitly. It has to be placed in the -// source code before all other more specialized templates. -template -void parse_value(const std::string& text, T& value) -{ - stringstream_parser(text, value); -} - -template -void parse_value(const std::string& text, std::vector& value) -{ - std::stringstream in(text); - std::string token; - while (in.eof() == false && std::getline(in, token, CXXOPTS_VECTOR_DELIMITER)) { - T v; - parse_value(token, v); - value.emplace_back(std::move(v)); - } -} - -#ifdef CXXOPTS_HAS_OPTIONAL -template -void parse_value(const std::string& text, std::optional& value) -{ - T result; - parse_value(text, result); - value = std::move(result); -} -#endif - -inline void parse_value(const std::string& text, char& c) -{ - if (text.length() != 1) { throw_or_mimic(text); } - - c = text[0]; -} - -template -struct type_is_container { - static constexpr bool value = false; -}; - -template -struct type_is_container> { - static constexpr bool value = true; -}; - -template -class abstract_value : public Value { - using Self = abstract_value; - - public: - abstract_value() : m_result(std::make_shared()), m_store(m_result.get()) {} - - abstract_value(T* t) : m_store(t) {} - - virtual ~abstract_value() = default; - - abstract_value(const abstract_value& rhs) - { - if (rhs.m_result) { - m_result = std::make_shared(); - m_store = m_result.get(); - } else { - m_store = rhs.m_store; - } - - m_default = rhs.m_default; - m_implicit = rhs.m_implicit; - m_default_value = rhs.m_default_value; - m_implicit_value = rhs.m_implicit_value; - } - - void parse(const std::string& text) const { parse_value(text, *m_store); } - - bool is_container() const { return type_is_container::value; } - - void parse() const { parse_value(m_default_value, *m_store); } - - bool has_default() const { return m_default; } - - bool has_implicit() const { return m_implicit; } - - std::shared_ptr default_value(const std::string& value) - { - m_default = true; - m_default_value = value; - return shared_from_this(); - } - - std::shared_ptr implicit_value(const std::string& value) - { - m_implicit = true; - m_implicit_value = value; - return shared_from_this(); - } - - std::shared_ptr no_implicit_value() - { - m_implicit = false; - return shared_from_this(); - } - - std::string get_default_value() const { return m_default_value; } - - std::string get_implicit_value() const { return m_implicit_value; } - - bool is_boolean() const { return std::is_same::value; } - - const T& get() const - { - if (m_store == nullptr) { - return *m_result; - } else { - return *m_store; - } - } - - protected: - std::shared_ptr m_result; - T* m_store; - - bool m_default = false; - bool m_implicit = false; - - std::string m_default_value; - std::string m_implicit_value; -}; - -template -class standard_value : public abstract_value { - public: - using abstract_value::abstract_value; - - std::shared_ptr clone() const { return std::make_shared>(*this); } -}; - -template <> -class standard_value : public abstract_value { - public: - ~standard_value() = default; - - standard_value() { set_default_and_implicit(); } - - standard_value(bool* b) : abstract_value(b) { set_default_and_implicit(); } - - std::shared_ptr clone() const { return std::make_shared>(*this); } - - private: - void set_default_and_implicit() - { - m_default = true; - m_default_value = "false"; - m_implicit = true; - m_implicit_value = "true"; - } -}; -} // namespace values - -template -std::shared_ptr value() -{ - return std::make_shared>(); -} - -template -std::shared_ptr value(T& t) -{ - return std::make_shared>(&t); -} - -class OptionAdder; - -class OptionDetails { - public: - OptionDetails(const std::string& short_, - const std::string& long_, - const String& desc, - std::shared_ptr val) - : m_short(short_), m_long(long_), m_desc(desc), m_value(val), m_count(0) - { - } - - OptionDetails(const OptionDetails& rhs) : m_desc(rhs.m_desc), m_count(rhs.m_count) - { - m_value = rhs.m_value->clone(); - } - - OptionDetails(OptionDetails&& rhs) = default; - - const String& description() const { return m_desc; } - - const Value& value() const { return *m_value; } - - std::shared_ptr make_storage() const { return m_value->clone(); } - - const std::string& short_name() const { return m_short; } - - const std::string& long_name() const { return m_long; } - - private: - std::string m_short; - std::string m_long; - String m_desc; - std::shared_ptr m_value; - int m_count; -}; - -struct HelpOptionDetails { - std::string s; - std::string l; - String desc; - bool has_default; - std::string default_value; - bool has_implicit; - std::string implicit_value; - std::string arg_help; - bool is_container; - bool is_boolean; -}; - -struct HelpGroupDetails { - std::string name; - std::string description; - std::vector options; -}; - -class OptionValue { - public: - void parse(std::shared_ptr details, const std::string& text) - { - ensure_value(details); - ++m_count; - m_value->parse(text); - } - - void parse_default(std::shared_ptr details) - { - ensure_value(details); - m_default = true; - m_value->parse(); - } - - size_t count() const noexcept { return m_count; } - - // TODO: maybe default options should count towards the number of arguments - bool has_default() const noexcept { return m_default; } - - template - const T& as() const - { - if (m_value == nullptr) { throw_or_mimic("No value"); } - -#ifdef CXXOPTS_NO_RTTI - return static_cast&>(*m_value).get(); -#else - return dynamic_cast&>(*m_value).get(); -#endif - } - - private: - void ensure_value(std::shared_ptr details) - { - if (m_value == nullptr) { m_value = details->make_storage(); } - } - - std::shared_ptr m_value; - size_t m_count = 0; - bool m_default = false; -}; - -class KeyValue { - public: - KeyValue(std::string key_, std::string value_) - : m_key(std::move(key_)), m_value(std::move(value_)) - { - } - - const std::string& key() const { return m_key; } - - const std::string& value() const { return m_value; } - - template - T as() const - { - T result; - values::parse_value(m_value, result); - return result; - } - - private: - std::string m_key; - std::string m_value; -}; - -class ParseResult { - public: - ParseResult( - const std::shared_ptr>>, - std::vector, - bool allow_unrecognised, - int&, - char**&); - - size_t count(const std::string& o) const - { - auto iter = m_options->find(o); - if (iter == m_options->end()) { return 0; } - - auto riter = m_results.find(iter->second); - - return riter->second.count(); - } - - const OptionValue& operator[](const std::string& option) const - { - auto iter = m_options->find(option); - - if (iter == m_options->end()) { throw_or_mimic(option); } - - auto riter = m_results.find(iter->second); - - return riter->second; - } - - const std::vector& arguments() const { return m_sequential; } - - private: - void parse(int& argc, char**& argv); - - void add_to_option(const std::string& option, const std::string& arg); - - bool consume_positional(std::string a); - - void parse_option(std::shared_ptr value, - const std::string& name, - const std::string& arg = ""); - - void parse_default(std::shared_ptr details); - - void checked_parse_arg(int argc, - char* argv[], - int& current, - std::shared_ptr value, - const std::string& name); - - const std::shared_ptr>> m_options; - std::vector m_positional; - std::vector::iterator m_next_positional; - std::unordered_set m_positional_set; - std::unordered_map, OptionValue> m_results; - - bool m_allow_unrecognised; - - std::vector m_sequential; -}; - -struct Option { - Option(const std::string& opts, - const std::string& desc, - const std::shared_ptr& value = ::cxxopts::value(), - const std::string& arg_help = "") - : opts_(opts), desc_(desc), value_(value), arg_help_(arg_help) - { - } - - std::string opts_; - std::string desc_; - std::shared_ptr value_; - std::string arg_help_; -}; - -class Options { - typedef std::unordered_map> OptionMap; - - public: - Options(std::string program, std::string help_string = "") - : m_program(std::move(program)), - m_help_string(toLocalString(std::move(help_string))), - m_custom_help("[OPTION...]"), - m_positional_help("positional parameters"), - m_show_positional(false), - m_allow_unrecognised(false), - m_options(std::make_shared()), - m_next_positional(m_positional.end()) - { - } - - Options& positional_help(std::string help_text) - { - m_positional_help = std::move(help_text); - return *this; - } - - Options& custom_help(std::string help_text) - { - m_custom_help = std::move(help_text); - return *this; - } - - Options& show_positional_help() - { - m_show_positional = true; - return *this; - } - - Options& allow_unrecognised_options() - { - m_allow_unrecognised = true; - return *this; - } - - ParseResult parse(int& argc, char**& argv); - - OptionAdder add_options(std::string group = ""); - - void add_options(const std::string& group, std::initializer_list