I'm trying to execute some code that doesn't fit in the GPU (this also happens with my CPU memory and our data is usually stored as zarr array), and I'm not sure how I could do that with Dask.
I found this example and I'm following a similar strategy but I received several warnings, distributed.worker - WARNING - Memory use is high but worker has no data to store to disk. Perhaps some other process is leaking memory? Process memory: 12.85 GiB -- Worker memory limit: 7.45 GiB
and the data is not being processed on the GPU.
For example:
import cupy as cp
import numpy as np
import dask.array as da
from dask_image import ndfilters as dfilters
from dask.distributed import Client
from functools import partial
if __name__ == '__main__':
client = Client(memory_limit='8GB', processes=False)
arr = da.from_array(np.zeros((50, 256, 512, 512), dtype=np.uint16), chunks=(1, 64, 256, 256))
arr = arr.map_blocks(cp.asarray)
filtering = partial(dfilters.gaussian_filter, sigma=2)
scattered_data = client.scatter(arr)
sent = client.submit(filtering, scattered_data)
filtered = sent.result().compute()
client.close()
The GPU has 24GB of memory.
Thanks in advance.