Skip to content

Add hstack, vstack, and bmat to cupyx.scipy.sparse - #2665

Merged
niboshi merged 29 commits into
cupy:masterfrom
cjnolet:fea-bmat_vstack_hstack
Mar 6, 2020
Merged

niboshi merged 29 commits into
cupy:masterfrom
cjnolet:fea-bmat_vstack_hstack

Conversation

@cjnolet

@cjnolet cjnolet commented Nov 20, 2019 •

Copy link
Copy Markdown
Member

I started with the corresponding functions from scipy.sparse and made some modifications to make them work with cupy. Unfortunately, since cupy.sparse.coo_matrix does not take a dense matrix as an argument to its constructor, the example in the pydocs will need to change slightly.

I will be working to add tests next.

Comment thread cupyx/scipy/sparse/construct.py Resolved
Comment thread cupy/sparse/__init__.py Resolved
Comment thread cupyx/scipy/sparse/sputils.py Resolved
@grlee77

grlee77 commented Nov 20, 2019

Copy link
Copy Markdown
Member

Nice start, @cjnolet. I left a few initial comments, but haven't done a close review

@cjnolet cjnolet changed the title [WIP] Add hstack, vstack, and bmat to cupy.sparse [REVIEW] Add hstack, vstack, and bmat to cupy.sparse Dec 9, 2019
@cjnolet

cjnolet commented Dec 9, 2019

Copy link
Copy Markdown
Member Author

@niboshi, I believe this PR is ready for review.

Comment thread cupyx/scipy/sparse/construct.py Resolved
Comment thread cupyx/scipy/sparse/construct.py Resolved
Comment thread cupyx/scipy/sparse/construct.py Resolved
Comment thread cupyx/scipy/sparse/construct.py Resolved
Comment thread cupyx/scipy/sparse/construct.py Resolved
@cjnolet

cjnolet commented Dec 19, 2019

Copy link
Copy Markdown
Member Author

@niboshi, Thank you for the review.

I've implemented your review feedback. I believe this is ready for re-review.

@dloney

dloney commented Jan 10, 2020

Copy link
Copy Markdown
Contributor

What's the status with this? I could use this functionality as well, and I'm happy to help get the feature finalized.

@cjnolet

cjnolet commented Jan 14, 2020

Copy link
Copy Markdown
Member Author

@dloney, I believe this PR is ready to go. Awaiting further feedback, or merge, from @niboshi.

@niboshi niboshi added this to the v8.0.0a1 milestone Jan 22, 2020
@cjnolet

cjnolet commented Jan 25, 2020

Copy link
Copy Markdown
Member Author

@niboshi, checking in. We really need this feature in RAPIDS. Do you have any further change requests on this PR?

@cjnolet

cjnolet commented Feb 5, 2020 •

Copy link
Copy Markdown
Member Author

@grlee77 @niboshi

Ping. It looks like there are other folks interested in this PR as well. We require this feature in RAPIDS and would appreciate a re-review.

@niboshi niboshi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm sorry for delay. Please check.

Comment thread cupyx/scipy/sparse/construct.py Resolved
Comment thread cupyx/scipy/sparse/construct.py Resolved
Comment thread cupyx/scipy/sparse/construct.py Resolved
Comment thread cupyx/scipy/sparse/sputils.py Resolved
Comment thread cupyx/scipy/sparse/sputils.py Resolved
Comment thread cupyx/scipy/sparse/sputils.py Resolved
Comment thread cupyx/scipy/sparse/sputils.py Resolved
Comment thread cupy/sparse/__init__.py Resolved
@emcastillo emcastillo modified the milestones: v8.0.0a1, v8.0.0b1 Feb 14, 2020
@cjnolet

cjnolet commented Mar 2, 2020

Copy link
Copy Markdown
Member Author

@niboshi requested changes have been made

Comment thread docs/source/reference/sparse.rst Resolved
@cjnolet

cjnolet commented Mar 3, 2020

Copy link
Copy Markdown
Member Author

@niboshi requested changes have been made

@niboshi

niboshi commented Mar 3, 2020

Copy link
Copy Markdown
Contributor

Thanks!
Jenkins, test this please

@pfn-ci-bot

Copy link
Copy Markdown
Collaborator

Successfully created a job for commit 997bc57:

@chainer-ci

Copy link
Copy Markdown
Member

Jenkins CI test (for commit 997bc57, target branch master) failed with status FAILURE.

Comment thread cupyx/scipy/sparse/construct.py Resolved
Comment thread cupyx/scipy/sparse/construct.py Resolved
Comment thread cupyx/scipy/sparse/construct.py Resolved
@cjnolet

cjnolet commented Mar 5, 2020

Copy link
Copy Markdown
Member Author

@niboshi the requested changes have been made. I used csr_matrix instead of coo_matrix and used array() to put the Python lists on device.

@niboshi

niboshi commented Mar 6, 2020

Copy link
Copy Markdown
Contributor

Thanks! Why would you need to add float32?

@cjnolet

cjnolet commented Mar 6, 2020

Copy link
Copy Markdown
Member Author

I can use decimals if you prefer. I guess I'm just in the habit of using single precision float wherever possible because of the performance implications of double precision. Let me know if you'd like me to change it and I'll do so quickly.

@cjnolet

cjnolet commented Mar 6, 2020

Copy link
Copy Markdown
Member Author

@niboshi, I updated it anyways. Makes the docs look cleaner.

@niboshi

niboshi commented Mar 6, 2020

Copy link
Copy Markdown
Contributor

We don't use float32 explicitly in other example codes.
Thank you for the fix!
Jenkins, test this please.

@pfn-ci-bot

This comment has been minimized.

@cjnolet

cjnolet commented Mar 6, 2020

Copy link
Copy Markdown
Member Author

Forgive me, @niboshi, I should have regenerated the output for the example after modifying it.

@niboshi

niboshi commented Mar 6, 2020

Copy link
Copy Markdown
Contributor

NP, I didn't notice either. 😅
Jenkins, test this please

@pfn-ci-bot

Copy link
Copy Markdown
Collaborator

Successfully created a job for commit 171ff88:

@chainer-ci

Copy link
Copy Markdown
Member

Jenkins CI test (for commit 171ff88, target branch master) succeeded!

@niboshi niboshi changed the title [REVIEW] Add hstack, vstack, and bmat to cupy.sparse Add hstack, vstack, and bmat to cupyx.scipy.sparse Mar 6, 2020
@niboshi

niboshi commented Mar 6, 2020

Copy link
Copy Markdown
Contributor

Thank you so much!

@niboshi
niboshi merged commit 463a353 into cupy:master Mar 6, 2020
@cjnolet

cjnolet commented Mar 6, 2020

Copy link
Copy Markdown
Member Author

Thank you, @niboshi!

@kmaehashi kmaehashi added the cat:feature New features/APIs label Mar 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cat:feature New features/APIs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants