-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rapids-update * rapids-update * add mm docs * mm update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update code * update mm --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
7e70952
commit dc43ac2
Showing
7 changed files
with
55 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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` |