fix for dask.array.linalg.tsqr fails tests (intermittently) with arrays of uncertain dimensions#3662
Conversation
cause: uncertain dimensions mean the possibility of chunks with zero height, which np.linalg.qr does not accept fix: a wrapper function for np.linalg.qr was written to handle the case
|
Thanks @convexset ! I appreciate it. I'm happy to merge this as-is. However, if there is a regression test we can add to make sure that this doesn't happen again that would also be helpful. Given your description, it sounds like maybe this should be something like the following? nx = np.ones(10, 5)
nq, nr = np.linalg.qr(nx)
x = da.ones((10, 5), chunks=((5, 0, 5), (5,))
q, r = da.linalg.qr(x)
assert_eq(q, nq)
assert_eq(r, nr) |
|
Yeah sure, but we can't compare q and nq, and r & nr... we have to check the product and orthogonality. Let me add a test. |
…th in the case of known and unknown chunk sizes)
|
Added the requested tests. The tests look at both cases of known and unknown chunk sizes. |
|
The test failures on Travis CI look interesting |
|
Very unusual how running it on my own machine (even repeatedly, I don't get the error). But that said, it looks like something that might depend on the version of numpy that one has... hmmm... Note: |
|
Playing around with Error reproduced. |
|
So I can fix things by having |
…s) in the edge case of a valid tensordot where some contraction axes has size 0
|
Thanks for following up here @convexset . Merging |
….com/convexset/dask into fix-tsqr-case-chunk-with-zero-height * 'fix-tsqr-case-chunk-with-zero-height' of https://github.com/convexset/dask: fixed typo in documentation and improved clarity Implement .blocks accessor (dask#3689) Fix wrong names (dask#3695) Adds endpoint and retstep support for linspace (dask#3675) Add the @ operator to the delayed objects (dask#3691) Align auto chunks to provided chunks, rather than shape (dask#3679) Adds quotes to source pip install (dask#3678) Prefer end-tasks with low numbers of dependencies when ordering (dask#3588) Reimplement argtopk to release the GIL (dask#3610) Note `da.pad` can be used with `map_overlap` (dask#3672) Allow tasks back onto ordering stack if they have one dependency (dask#3652) Fix extra progressbar (dask#3669) Break apart uneven array-of-int slicing to separate chunks (dask#3648) fix for `dask.array.linalg.tsqr` fails tests (intermittently) with arrays of uncertain dimensions (dask#3662)
Fix for issue #3659 where
dask.array.linalg.tsqrfails tests with uncertain dimensions (after suitably many runs; test is stochastic)Cause: uncertain dimensions mean the possibility of chunks with zero height, which
np.linalg.qrdoes not acceptFix: a wrapper function for
np.linalg.qrwas written to handle the caseflake8 dask