question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Should da ufuncs be lazy or immediate on numpy arrays?

See original GitHub issue

Currently functions like da.sin on a numpy array compute immediately. However all other cases of atop wrap the numpy array into a single-chunk dask.array and compute lazily. Should we change the immediate behavior of dask.array ufuncs to be lazy?

cc @shoyer @jhamman

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
jsignellcommented, Oct 19, 2021

I 100% agree that dask outputs should always be lazy. Even conditional statements.

1reaction
pelsoncommented, Jun 21, 2017

As per the sentiment in https://github.com/dask/dask/pull/2301#issuecomment-310097823:

Dask’s convention so far is to call the equivalent numpy method in these cases.

Personally, I’d expect to always have a lazy dask thing if I’ve called dask functions/methods. If I wanted immediate, I’d call numpy directly…


Is that an overly simplistic view?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does NumPy use lazy memory allocation? - Stack Overflow
When I allocate large arrays with NumPy, it appears as though some kind of lazy allocation is taking place, which I do not...
Read more >
Create Dask Arrays - Dask documentation
NumPy Slicing​​ Create dask array from something that looks like an array. This process is entirely lazy.
Read more >
NEP 37 — A dispatch protocol for NumPy-like modules
This generalizes well to handling many different types of objects, as evidenced by its use for implementing arithmetic operators in Python, but ...
Read more >
Lazyarray Documentation
lazyarray is a Python package that provides a lazily-evaluated numerical array class, larray, based on and compati- ble with NumPy arrays.
Read more >
Chapter 4. NumPy Basics: Arrays and Vectorized Computation
See that I was a bit lazy and wrote float instead of np.float64 ; NumPy is smart enough to alias the Python types...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found