Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 956 Bytes

File metadata and controls

28 lines (21 loc) · 956 Bytes

Using GPUs with Zarr

Zarr can use GPUs to accelerate your workload by running zarr.Config.enable_gpu.

Reading data into device memory

[zarr.config][] configures Zarr to use GPU memory for the data buffers used internally by Zarr via enable_gpu().

import zarr
import cupy as cp
zarr.config.enable_gpu()
store = zarr.storage.MemoryStore()
z = zarr.create_array(
    store=store, shape=(100, 100), chunks=(10, 10), dtype="float32",
)
type(z[:10, :10])
# cupy.ndarray

Note that the output type is a cupy.ndarray rather than a NumPy array.

For supported codecs, data will be decoded using the GPU via the nvcomp library. See [runtime-configuration][config-runtime-configuration] for more. Issues and feature requests for NVIDIA nvCOMP can be reported on the nvcomp issue tracker.