diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ffca4343..4913138a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.16.4 + rev: v0.16.5 hooks: - id: ruff-check args: ["--fix"] @@ -33,7 +33,7 @@ repos: docs/references.bib| ) - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v22.1.8 + rev: v23.1.0 hooks: - id: clang-format args: [--style=file, -i] diff --git a/docs/contributing.md b/docs/contributing.md index 6f31a661..de6cd2c2 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -155,6 +155,7 @@ The `add_nb_cuda_module` helper automatically handles: ```python from rapids_singlecell._cuda import _my_module_cuda as _my + def my_function(adata): # _my is either the real module or None _my.kernel(...) diff --git a/docs/gpu_configuration.md b/docs/gpu_configuration.md index bebd4ddd..b5d137e2 100644 --- a/docs/gpu_configuration.md +++ b/docs/gpu_configuration.md @@ -175,7 +175,7 @@ AnnData stores {attr}`~anndata.AnnData.raw` in CPU memory, even when `.X` was al rsc.get.anndata_to_GPU(adata) adata.raw = adata.copy() -print(type(adata.X)) # CuPy or cupyx: GPU +print(type(adata.X)) # CuPy or cupyx: GPU print(type(adata.raw.X)) # NumPy or SciPy: CPU ``` diff --git a/docs/memory_management.md b/docs/memory_management.md index 754696f9..f914a024 100644 --- a/docs/memory_management.md +++ b/docs/memory_management.md @@ -52,6 +52,7 @@ cp.cuda.set_allocator(rmm_cupy_allocator) import rmm import cupy as cp from rmm.allocators.cupy import rmm_cupy_allocator + rmm.reinitialize( managed_memory=False, pool_allocator=True, diff --git a/docs/out_of_core.md b/docs/out_of_core.md index 8d0184a9..292e629f 100644 --- a/docs/out_of_core.md +++ b/docs/out_of_core.md @@ -21,9 +21,9 @@ from dask_cuda import LocalCUDACluster cluster = LocalCUDACluster( CUDA_VISIBLE_DEVICES="0,1,2,3,4,5,6,7", protocol="ucx", - threads_per_worker=1, # GPU-safe default - rmm_pool_size="80%", # per-worker pool; % of free VRAM at start - rmm_managed_memory=False, # avoid UM to maximize P2P + threads_per_worker=1, # GPU-safe default + rmm_pool_size="80%", # per-worker pool; % of free VRAM at start + rmm_managed_memory=False, # avoid UM to maximize P2P rmm_allocator_external_lib_list=["cupy"], # auto-patch CuPy to use RMM ) client = Client(cluster) @@ -36,10 +36,10 @@ from dask.distributed import Client from dask_cuda import LocalCUDACluster cluster = LocalCUDACluster( - CUDA_VISIBLE_DEVICES="0,1", # scale as needed - protocol="tcp", # TCP is often more predictable with UVM + CUDA_VISIBLE_DEVICES="0,1", # scale as needed + protocol="tcp", # TCP is often more predictable with UVM threads_per_worker=1, - rmm_managed_memory=True, # allow oversubscription (paging) + rmm_managed_memory=True, # allow oversubscription (paging) rmm_allocator_external_lib_list=["cupy"], ) client = Client(cluster) @@ -85,6 +85,7 @@ adata = ad.AnnData( ```python import rapids_singlecell as rsc + rsc.get.anndata_to_GPU(adata) # Normalize and transform rsc.pp.normalize_total(adata) @@ -106,7 +107,6 @@ Most functions operate lazily; use `.compute()` only when you need concrete valu ```python # Dense dask+cupy matrix → cupy X_gpu = adata.X.compute() - ``` ## Persist and chunk sizes diff --git a/docs/usage_principles.md b/docs/usage_principles.md index 580bfd22..d20322e3 100644 --- a/docs/usage_principles.md +++ b/docs/usage_principles.md @@ -86,7 +86,7 @@ from rapids_singlecell import ptg distance = ptg.Distance(metric="edistance", obsm_key="X_pca") result = distance.pairwise(adata, groupby="perturbation") res, res_var = distance.pairwise( - adata, groupby="perturbation", bootstrap=True, n_bootstrap=100, multi_gpu=None + adata, groupby="perturbation", bootstrap=True, n_bootstrap=100, multi_gpu=None ) ```