Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/branch-23.10' into cccl-update…
Browse files Browse the repository at this point in the history
…-2.1.0
  • Loading branch information
bdice committed Aug 16, 2023
2 parents 73f0b13 + 663e659 commit 889f14a
Show file tree
Hide file tree
Showing 12 changed files with 118 additions and 8 deletions.
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
# 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
Expand Down
8 changes: 4 additions & 4 deletions ci/build_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ popd

rapids-logger "Build Python docs"
pushd python/docs
sphinx-build -b dirhtml . _html
sphinx-build -b text . _text
make dirhtml
make text
mkdir -p "${RAPIDS_DOCS_DIR}/rmm/"{html,txt}
mv _html/* "${RAPIDS_DOCS_DIR}/rmm/html"
mv _text/* "${RAPIDS_DOCS_DIR}/rmm/txt"
mv _build/dirhtml/* "${RAPIDS_DOCS_DIR}/rmm/html"
mv _build/text/* "${RAPIDS_DOCS_DIR}/rmm/txt"
popd

rapids-upload-docs
10 changes: 10 additions & 0 deletions conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,28 @@ dependencies:
- cuda-version=11.8
- cudatoolkit
- cython>=3.0.0
- doxygen=1.8.20
- fmt>=9.1.0,<10
- gcovr>=5.0
- graphviz
- identify>=2.5.20
- ipython
- make
- nbsphinx
- ninja
- numba>=0.57
- numpy>=1.21
- numpydoc
- nvcc_linux-64=11.8
- pre-commit
- pytest
- pytest-cov
- python>=3.9,<3.11
- scikit-build>=0.13.1
- spdlog>=1.11.0,<1.12
- sphinx
- sphinx-copybutton
- sphinx-markdown-tables
- sphinx_rtd_theme
- tomli
name: all_cuda-118_arch-x86_64
10 changes: 10 additions & 0 deletions conda/environments/all_cuda-120_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,27 @@ dependencies:
- cuda-python>=12.0,<13.0a0
- cuda-version=12.0
- cython>=3.0.0
- doxygen=1.8.20
- fmt>=9.1.0,<10
- gcovr>=5.0
- graphviz
- identify>=2.5.20
- ipython
- make
- nbsphinx
- ninja
- numba>=0.57
- numpy>=1.21
- numpydoc
- pre-commit
- pytest
- pytest-cov
- python>=3.9,<3.11
- scikit-build>=0.13.1
- spdlog>=1.11.0,<1.12
- sphinx
- sphinx-copybutton
- sphinx-markdown-tables
- sphinx_rtd_theme
- tomli
name: all_cuda-120_arch-x86_64
2 changes: 2 additions & 0 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ files:
- checks
- cudatoolkit
- develop
- docs
- run
- test_python
test_python:
Expand Down Expand Up @@ -155,6 +156,7 @@ dependencies:
- doxygen=1.8.20
- graphviz
- ipython
- make
- nbsphinx
- numpydoc
- sphinx
Expand Down
2 changes: 1 addition & 1 deletion python/docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXOPTS = -n -v -W --keep-going
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
Expand Down
2 changes: 2 additions & 0 deletions python/docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Memory Resources

.. automodule:: rmm.mr
:members:
:inherited-members:
:undoc-members:
:show-inheritance:

Expand All @@ -28,6 +29,7 @@ Memory Allocators

.. automodule:: rmm.allocators.numba
:members:
:inherited-members:
:undoc-members:
:show-inheritance:

Expand Down
2 changes: 1 addition & 1 deletion python/docs/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ example, enabling the `ManagedMemoryResource` tells RMM to use
> :warning: The default resource must be set for any device **before**
> allocating any device memory on that device. Setting or changing the
> resource after device allocations have been made can lead to unexpected
> behaviour or crashes. See [Multiple Devices](#multiple-devices)
> behaviour or crashes.
As another example, `PoolMemoryResource` allows you to allocate a
large "pool" of device memory up-front. Subsequent allocations will
Expand Down
13 changes: 11 additions & 2 deletions python/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
# ones.

extensions = [
"sphinxcontrib.jquery",
"sphinx.ext.intersphinx",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
Expand Down Expand Up @@ -113,7 +114,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
html_static_path = []


# -- Options for HTMLHelp output ------------------------------------------
Expand Down Expand Up @@ -179,14 +180,22 @@


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {"https://docs.python.org/": None}
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"numba": ("https://numba.readthedocs.io/en/stable", None),
}

# Config numpydoc
numpydoc_show_inherited_class_members = True
numpydoc_class_members_toctree = False

autoclass_content = "init"

nitpick_ignore = [
("py:class", "size_t"),
("py:class", "void"),
]


def setup(app):
app.add_js_file("copybutton_pydocs.js")
Expand Down
23 changes: 23 additions & 0 deletions python/rmm/_lib/memory_resource.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -217,18 +217,41 @@ cdef extern from "rmm/mr/device/failure_callback_resource_adaptor.hpp" \
cdef class DeviceMemoryResource:

cdef device_memory_resource* get_mr(self):
"""Get the underlying C++ memory resource object."""
return self.c_obj.get()

def allocate(self, size_t nbytes):
"""Allocate ``nbytes`` bytes of memory.
Parameters
----------
nbytes : size_t
The size of the allocation in bytes
"""
return <uintptr_t>self.c_obj.get().allocate(nbytes)

def deallocate(self, uintptr_t ptr, size_t nbytes):
"""Deallocate memory pointed to by ``ptr`` of size ``nbytes``.
Parameters
----------
ptr : uintptr_t
Pointer to be deallocated
nbytes : size_t
Size of the allocation in bytes
"""
self.c_obj.get().deallocate(<void*>(ptr), nbytes)


# See the note about `no_gc_clear` in `device_buffer.pyx`.
@cython.no_gc_clear
cdef class UpstreamResourceAdaptor(DeviceMemoryResource):
"""Parent class for all memory resources that track an upstream.
Upstream resource tracking requires maintaining a reference to the upstream
mr so that it is kept alive and may be accessed by any downstream resource
adaptors.
"""

def __cinit__(self, DeviceMemoryResource upstream_mr, *args, **kwargs):

Expand Down
17 changes: 17 additions & 0 deletions python/rmm/allocators/numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import ctypes
import inspect

from cuda.cuda import CUdeviceptr, cuIpcGetMemHandle
from numba import config, cuda
Expand Down Expand Up @@ -112,13 +113,29 @@ def get_ipc_handle(self, memory):
)

def get_memory_info(self):
"""Returns ``(free, total)`` memory in bytes in the context.
This implementation raises `NotImplementedError` because the allocation
will be performed using rmm's currently set default mr, which may be a
pool allocator.
"""
raise NotImplementedError()

@property
def interface_version(self):
return 1


# The parent class docstrings contain references without fully qualified names,
# so we need to replace them here for our Sphinx docs to render properly.
for _, method in inspect.getmembers(RMMNumbaManager, inspect.isfunction):
if method.__doc__ is not None:
method.__doc__ = method.__doc__.replace(
":class:`BaseCUDAMemoryManager`",
":class:`numba.cuda.BaseCUDAMemoryManager`",
)


# Enables the use of RMM for Numba via an environment variable setting,
# NUMBA_CUDA_MEMORY_MANAGER=rmm. See:
# https://numba.readthedocs.io/en/stable/cuda/external-memory.html#environment-variable
Expand Down
2 changes: 2 additions & 0 deletions python/rmm/mr.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
PoolMemoryResource,
StatisticsResourceAdaptor,
TrackingResourceAdaptor,
UpstreamResourceAdaptor,
_flush_logs,
_initialize,
disable_logging,
Expand Down Expand Up @@ -51,6 +52,7 @@
"StatisticsResourceAdaptor",
"TrackingResourceAdaptor",
"FailureCallbackResourceAdaptor",
"UpstreamResourceAdaptor",
"_flush_logs",
"_initialize",
"set_per_device_resource",
Expand Down

0 comments on commit 889f14a

Please sign in to comment.