Open pentschev opened 5 years ago
Just checking in, is this resolved by the xref'd PRs above @pentschev or is there still more to do here?
I'd say that #4954 improved this dramatically, but I don't consider it resolved, as per my comment https://github.com/dask/dask/pull/4954#issuecomment-502717153. In particular https://github.com/dask/dask/pull/4954/files#diff-3598e11c3b3a16881fecff61abdf1f4cR118 would still prevent other exceptions from a backend library's code to be raised. We don't yet have a general solution for that, so I would prefer to leave this open for now.
Current
blockwise_meta
/blockwise
implementation defaults todtype
construction ofDask.Array
when an non-trivial exception is raised when computing_meta
. This is suboptimal for two reasons:blockwise
for somewhat complex user code;Ideally, we would handle all possible exceptions, with all remaining ones assumed to be user's mistake, such as passing
casting
tocupy.einsum
(which isn't supported), as discussed in https://github.com/dask/dask/pull/4914.Given that
_meta
now exists, Dask has become a universal scheduler, which probably means we can't handle every single possible exception, but we should at least allow developers to know about such cases, as well as letting users know they possibly made a mistake. We should therefore let most exceptions pass back to the user inblockwise
.This is loosely related to #4951, where we wish to allow users/developers be alerted of conditions that Dask can't handle and should probably be better handled by the library which Dask is using as a backend through
__array_function__
.