Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions docs/user-guide/gpu.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# Using GPUs with Zarr

Zarr can use GPUs to accelerate your workload by running `zarr.Config.enable_gpu`.
Zarr can use GPUs to accelerate your workload by enabling GPU buffers and codecs
with `zarr.config.enable_gpu()`.

!!! note
`zarr-python` currently supports reading the ndarray data into device (GPU)
memory as the final stage of the codec pipeline. Data will still be read into
or copied to host (CPU) memory for encoding and decoding.
With `enable_gpu()`:

In the future, codecs will be available compressing and decompressing data on
the GPU, avoiding the need to move data between the host and device for
compression and decompression.
- array reads return `cupy.ndarray` values
- the default Zarr v3 `zstd` codec is replaced with a GPU-backed nvCOMP
implementation
- Blosc chunks can be decoded on the GPU when `cname="zstd"` and `shuffle`
is `bitshuffle` or `noshuffle`

Blosc GPU acceleration currently applies to decode only.

## Reading data into device memory

Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ remote = [
]
gpu = [
"cupy-cuda12x",
"nvidia-nvcomp-cu12",
]
cli = ["typer"]
# Testing extras
Expand Down Expand Up @@ -154,6 +155,9 @@ omit = [
[tool.hatch]
version.source = "vcs"

[tool.hatch.version.raw-options]
fallback_version = "3.1.0"

[tool.hatch.build]
hooks.vcs.version-file = "src/zarr/_version.py"

Expand Down
3 changes: 3 additions & 0 deletions src/zarr/codecs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from zarr.codecs.blosc import BloscCname, BloscCodec, BloscShuffle
from zarr.codecs.bytes import BytesCodec, Endian
from zarr.codecs.crc32c_ import Crc32cCodec
from zarr.codecs.gpu import NvcompBloscCodec, NvcompZstdCodec
from zarr.codecs.gzip import GzipCodec
from zarr.codecs.numcodecs import (
BZ2,
Expand Down Expand Up @@ -41,6 +42,8 @@
"Crc32cCodec",
"Endian",
"GzipCodec",
"NvcompBloscCodec",
"NvcompZstdCodec",
"ShardingCodec",
"ShardingCodecIndexLocation",
"TransposeCodec",
Expand Down
Loading