Repository navigation
Closed
Labels
arraybugSomething is brokenneeds attentionIt's been a while since this was pushed on. Needs attention from the owner or a maintainer.
Description
Describe the issue:
argwhere doesn't work chunk-wise. Ie. it fully processes the input before it's starting to process it. The output in this case should be empty, since none of the elements are < 0. However it's still running out of memory trying to process the input.
Minimal Complete Verifiable Example:
from dask.diagnostics import ProgressBar
import dask.array as da
class DummyStore:
def __setitem__(self, pos, item):
print("store", pos)
with ProgressBar():
arr = da.random.uniform(0, 1, size=(2000, 2000, 2000), chunks=(100, 100, 100)) < 0
out = da.argwhere(arr)
out.store(DummyStore())Anything else we need to know?:
Traceback (most recent call last):
File "<stdin>", line 4, in <module>
File "C:\Program Files\Python38\lib\site-packages\dask\array\core.py", line 1768, in store
r = store([self], [target], **kwargs)
File "C:\Program Files\Python38\lib\site-packages\dask\array\core.py", line 1236, in store
compute_as_if_collection(Array, store_dsk, map_keys, **kwargs)
File "C:\Program Files\Python38\lib\site-packages\dask\base.py", line 341, in compute_as_if_collection
return schedule(dsk2, keys, **kwargs)
File "C:\Program Files\Python38\lib\site-packages\dask\threaded.py", line 89, in get
results = get_async(
File "C:\Program Files\Python38\lib\site-packages\dask\local.py", line 511, in get_async
raise_exception(exc, tb)
File "C:\Program Files\Python38\lib\site-packages\dask\local.py", line 319, in reraise
raise exc
File "C:\Program Files\Python38\lib\site-packages\dask\local.py", line 224, in execute_task
result = _execute_task(task, data)
File "C:\Program Files\Python38\lib\site-packages\dask\core.py", line 119, in _execute_task
return func(*(_execute_task(a, cache) for a in args))
File "C:\Program Files\Python38\lib\site-packages\dask\array\chunk.py", line 427, in getitem
result = result.copy()
numpy.core._exceptions.MemoryError: Unable to allocate 31.7 MiB for an array with shape (25, 1000, 166) and data type int64
Environment:
- Dask version: 2023.3.1
- Python version: 3.8.10
- Operating System: Windows 10
- Install method (conda, pip, source): pip
Metadata
Metadata
Assignees
Labels
arraybugSomething is brokenneeds attentionIt's been a while since this was pushed on. Needs attention from the owner or a maintainer.
Activity
j-bennet commentedon Mar 22, 2023
@Dobatymo Thank you for the report. I tried your reproducible example, and while for me it completed and correctly returned an empty list, it did take an inordinate amount of memory. This deserves a closer look.
Dobatymo commentedon Jun 18, 2025
@phofl this is still not fixed in
dask==2025.5.1.Running the original snippet yields an error. My machine has 64GB of memory. It should definitely run this when chunked correctly.