diff --git a/README.md b/README.md index 8639c396..cc8d43ef 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Our commitment with rapids-singlecell is to deliver a powerful, user-centric too ### Conda The easiest way to install *rapids-singlecell* is to use one of the *yaml* file provided in the [conda](https://github.com/scverse/rapids_singlecell/tree/main/conda) folder. These *yaml* files install everything needed to run the example notbooks and get you started. ``` -conda env create -f conda/rsc_rapids_23.04.yml +conda env create -f conda/rsc_rapids_24.02.yml # or mamba env create -f conda/rsc_rapids_23.12.yml ``` diff --git a/ci/rsc_test_env.yml b/ci/rsc_test_env.yml index 1c8c9e47..608e26c6 100644 --- a/ci/rsc_test_env.yml +++ b/ci/rsc_test_env.yml @@ -4,9 +4,9 @@ channels: - nvidia - conda-forge dependencies: - - cudf=23.12 - - cuml=23.12 - - cugraph=23.12 + - cudf=24.02 + - cuml=24.02 + - cugraph=24.02 - python=3.10 - cuda-version=11.8 - cudnn diff --git a/conda/rsc_rapids_23.04.yml b/conda/rsc_rapids_24.02.yml similarity index 86% rename from conda/rsc_rapids_23.04.yml rename to conda/rsc_rapids_24.02.yml index d0cc4798..3672735e 100644 --- a/conda/rsc_rapids_23.04.yml +++ b/conda/rsc_rapids_24.02.yml @@ -5,9 +5,9 @@ channels: - conda-forge - bioconda dependencies: - - rapids=23.04 + - rapids=24.02 - python=3.10 - - cudatoolkit=11.8 + - cuda-version=11.8 - cudnn - cutensor - cusparselt @@ -17,7 +17,6 @@ dependencies: - jupyterlab - pip - pip: - - scanpy - decoupler - omnipath - gdown diff --git a/docs/Installation.md b/docs/Installation.md index 270ad4ba..36681960 100644 --- a/docs/Installation.md +++ b/docs/Installation.md @@ -2,7 +2,7 @@ ## Conda The easiest way to install *rapids-singlecell* is to use one of the *yaml* file provided in the [conda](https://github.com/scverse/rapids_singlecell/tree/main/conda) folder. These *yaml* files install everything needed to run the example notebooks and get you started. ``` -conda env create -f conda/rsc_rapids_23.04.yml +conda env create -f conda/rsc_rapids_24.02.yml # or mamba env create -f conda/rsc_rapids_23.12.yml ``` diff --git a/docs/MM.md b/docs/MM.md new file mode 100644 index 00000000..ff337c73 --- /dev/null +++ b/docs/MM.md @@ -0,0 +1,42 @@ +# Memory Management + +In rapids-singlecell, efficient memory management is crucial for handling large-scale datasets. This is facilitated by the integration of the RAPIDS Memory Manager ({mod}`rmm`). {mod}`rmm` is automatically invoked upon importing `rapids-singlecell`, modifying the default allocator for cupy. Integrating {mod}`rmm` with `rapids-singlecell` slightly modifies the execution speed of {mod}`cupy`. This change typically results in a minimal performance trade-off. However, it's crucial to be aware that certain specific functions, like {func}`~.pp.harmony_integrate`, might experience a more significant impact on performance efficiency due to this integration. Users can overwrite the default behavior with {func}`rmm.reinitialize`. + +## Managed Memory + +In {mod}`rmm`, the `managed_memory` feature facilitates VRAM oversubscription, allowing for the processing of data structures larger than the default VRAM capacity. This effectively extends the memory limit up to twice the VRAM size. Leveraging managed memory will introduce a performance overhead. This is particularly evident with substantial oversubscription, as it necessitates increased dependency on the comparatively slower system memory, leading to slowdowns in data processing tasks. + +``` +# Enable `managed_memory` +import rmm +from rmm.allocators.cupy import rmm_cupy_allocator +rmm.reinitialize( + managed_memory=True, + pool_allocator=False, +) +cp.cuda.set_allocator(rmm_cupy_allocator) +``` + +## Pool Allocator + +The `pool_allocator` functionality in {mod}`rmm` optimizes memory handling by pre-allocating a pool of memory, which can be swiftly accessed for GPU-related tasks. This approach, while being more memory-intensive, significantly boosts performance. It is particularly beneficial for operations that are heavy on memory usage, such as {func}`~.pp.harmony_integrate`, by minimizing the time spent on dynamic memory allocation during runtime. + +``` +# Enable `pool_allocator` +import rmm +from rmm.allocators.cupy import rmm_cupy_allocator +rmm.reinitialize( + managed_memory=False, + pool_allocator=True, +) +cp.cuda.set_allocator(rmm_cupy_allocator) +``` + +## Best Practices +To achieve optimal memory management in rapids-singlecell, consider the following guidelines: + +* **Large-scale Data Analysis:** Utilize `managed_memory` for datasets exceeding your VRAM's capacity, keeping in mind the potential performance penalties. +* **Performance-Critical Operations:** Choose `pool_allocator` when speed is critical and sufficient VRAM is available. + +## Further Reading +For a more in-depth understanding of rmm and its functionalities, refer to the [RAPIDS Memory Manager documentation](https://docs.rapids.ai/api/rmm/stable/python/). diff --git a/docs/index.md b/docs/index.md index 61fef919..9c15a948 100644 --- a/docs/index.md +++ b/docs/index.md @@ -21,6 +21,7 @@ Installation.md Usage_Principles.md api/index.md +MM.md release-notes/index.md references.md notebooks.rst diff --git a/docs/release-notes/0.9.6.md b/docs/release-notes/0.9.6.md index 3dd1dca8..9d54da27 100644 --- a/docs/release-notes/0.9.6.md +++ b/docs/release-notes/0.9.6.md @@ -1,5 +1,9 @@ -### 0.9.6 {small}`The Future` +### 0.9.6 {small} ```{rubric} Bug fixes ``` * {func}`~rapids_singlecell.tl.louvain` and {func}`~rapids_singlecell.tl.leiden` now works with next version of scanpy {pr}`127` {smaller}`S Dicks` + +```{rubric} Misc +``` +* Updates Conda yaml file to work with rapids-24.02 {pr}`128` {smaller}`S Dicks`