Skip to content

[REVIEW] Register support for cupy sparse hstack/vstack - #5735

Merged
jakirkham merged 12 commits into
dask:masterfrom
cjnolet:cupy-sparse-stack
Mar 20, 2020
Merged

jakirkham merged 12 commits into
dask:masterfrom
cjnolet:cupy-sparse-stack

Conversation

@cjnolet

@cjnolet cjnolet commented Dec 19, 2019 •

Copy link
Copy Markdown
Contributor
  • Tests added / passed
  • Passes black dask / flake8 dask

Fixes #5604

@mrocklin

Copy link
Copy Markdown
Member

Thanks @cjnolet ! In principle this looks good to me. It would be good to add tests to this, even if they're not going to be run by CI. Perhaps something like the following?

def test_cupy_sparse():
    pytest.importorskip("cupyx")
    ...

@cjnolet

cjnolet commented Dec 20, 2019

Copy link
Copy Markdown
Contributor Author

@mrocklin,

There will be tests for this before it's ready for review. I started writing them and found some deltas between cupy and scipy's support for slicing csr matrices, which I believe is going to require further changes to cupy.

@mrocklin

mrocklin commented Dec 20, 2019 via email

Copy link
Copy Markdown
Member

@mrocklin

Copy link
Copy Markdown
Member

Checking in @cjnolet , are you still working on this or have you moved on?

@cjnolet

cjnolet commented Feb 16, 2020 via email

Copy link
Copy Markdown
Contributor Author

@mrocklin

Copy link
Copy Markdown
Member

OK. Thanks for the update @cjnolet !

@cjnolet

cjnolet commented Mar 6, 2020

Copy link
Copy Markdown
Contributor Author

@mrocklin @quasiben, I think this is ready for an initial review, now that cupy/cupy#2665 has been approved.

The test currently creates the dask.array from a dense array and then converts it to sparse. Unfortunately, I think some updates need to be made to the slicing of CuPy's csr_matrix, because it doesn't appear to support some of the same indexing as SciPy.

I'm hopeful we can get this PR reviewed and merged in the meantime, while I continue to work through the slicing deltas on the CuPy side.

@cjnolet cjnolet changed the title [WIP] Register support for cupy sparse hstack/vstack [REVIEW] Register support for cupy sparse hstack/vstack Mar 6, 2020
@quasiben

quasiben commented Mar 6, 2020

Copy link
Copy Markdown
Member

looks good to me. Verified test pass -- also found a lot of out of scope cupy tests failing which should be fixed in a separate PR.

@TomAugspurger

Copy link
Copy Markdown
Member

@quasiben

quasiben commented Mar 6, 2020

Copy link
Copy Markdown
Member

Ah, i just assumed that was a flaky test. Sorry @TomAugspurger

@jakirkham

Copy link
Copy Markdown
Member

If you run black on dask/array/tests/test_cupy.py @cjnolet, the linting issue should be fixed 🙂

@cjnolet

cjnolet commented Mar 6, 2020

Copy link
Copy Markdown
Contributor Author

Done. Thanks @jakirkham! And thanks @quasiben for the quick review!

Comment thread dask/array/tests/test_cupy.py Resolved

@jakirkham jakirkham left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To follow-up, here are a couple of suggestions on how we might improve this concatenation test.

Comment thread dask/array/tests/test_cupy.py Resolved
Comment thread dask/array/tests/test_cupy.py Resolved
@cjnolet

cjnolet commented Mar 10, 2020

Copy link
Copy Markdown
Contributor Author

@jakirkham quickly verified that your change works with CuPy 8.0.0 and accepted your suggestion.

@cjnolet

cjnolet commented Mar 10, 2020

Copy link
Copy Markdown
Contributor Author

Opened CuPy issue for remaining sparse slicing issue: cupy/cupy#3178

@jakirkham

Copy link
Copy Markdown
Member

Pushed a style fix. Hope that is ok.

@TomAugspurger

Copy link
Copy Markdown
Member

The windows 3.7 CI failure was unrelated. Restarted the builds.

@cjnolet

cjnolet commented Mar 16, 2020

Copy link
Copy Markdown
Contributor Author

Pushed a style fix. Hope that is ok.

@jakirkham, no problem at all! Thank you for your help on this PR.

@jakirkham

Copy link
Copy Markdown
Member

How did you restart @TomAugspurger? Seems we are seeing a spurious failure for Windows Python 3.7 again. Or are you ok just merging (since we know it is spurious)?

@TomAugspurger

TomAugspurger commented Mar 19, 2020 via email

Copy link
Copy Markdown
Member

@jakirkham

jakirkham commented Mar 20, 2020 •

Copy link
Copy Markdown
Member

Yeah I was about to restart via the GitHub UI, but it still thought it was running? So canceled and restarted, but that didn't seem to work (even after a few tries).

Sounds like we can ignore it though. So let's do that 🙂

Edit: ...and it passed on master 🤷‍♂

@jakirkham
jakirkham merged commit 3bc0fe4 into dask:master Mar 20, 2020
@jakirkham

Copy link
Copy Markdown
Member

Thanks @cjnolet! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dask.Array to support cupy.sparse arrays

5 participants