-
-
Notifications
You must be signed in to change notification settings - Fork 867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow MatDescriptor
to be pickle-able
#3157
Conversation
31062d0
to
2d2209b
Compare
(note to self: still needs tests) |
@emcastillo, could you or someone else please help us figure out where to put a test for this? Am not seeing any tests for |
FWIW I pushed some tests for pickling sparse matrices, which should exercise this a bit. |
As `MatDescriptor` contains a pointer to a `cusparseMatDescr_t` object, it will not be valid after pickling and reloaded in another process. So test that a new pointer is given on unpickling. This will indicate that `cusparseCreateMatDescr` was run again as part of unpickling. ref: https://docs.nvidia.com/cuda/cusparse/index.html#cusparseCreateMatDescr
Also may need some pointers on how testing is working here. I think I got the idea, but there were some differences between test modules. So could use some pointers from someone more familiar 🙂 |
John, if your new tests pass they should be fine. (I didn't review very carefully!) They are moving away from using |
Thanks Leo! 😄 That's good to hear. Yeah was noticing that some of these use a The other thing is some tests seem to have arguments for |
I think that current tests are fine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Jenkins, test this please |
Successfully created a job for commit 7c96b16: |
Jenkins CI test (for commit 7c96b16, target branch master) failed with status FAILURE. |
Jenkins, test this please |
Successfully created a job for commit 39264af: |
Only `_compressed_sparse_matrix` subclasses include `MatDescriptor`. Other sparse matrices don't. So drop this test from them.
As it appears the comparisons don't work with CuPy currently, perform them with SciPy instead.
Jenkins CI test (for commit 39264af, target branch master) failed with status FAILURE. |
Jenkins, test this please |
Successfully created a job for commit 77bd1eb: |
Sorry missed one thing (now fixed). 😅 Think that is the last thing. 🍀 |
Jenkins CI test (for commit 77bd1eb, target branch master) failed with status FAILURE. |
Just as an FYI the Jenkins CI status is for the commit before the latest one. So this needs a retest 🙂 |
Jenkins, test this please |
Successfully created a job for commit c2d40b3: |
Jenkins CI test (for commit c2d40b3, target branch master) succeeded! |
Thanks for the reviews! 😄 |
@kmaehashi, would it be ok to backport this? |
Squashed commit of the following: commit 081cb6a Merge: c1cec3d c2d40b3 Author: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Date: Wed Mar 11 03:02:49 2020 +0000 Merge pull request cupy#3157 from jakirkham/pickle_MatDescriptor Allow `MatDescriptor` to be pickle-able commit c2d40b3 Author: John Kirkham <[email protected]> Date: Tue Mar 10 01:48:18 2020 -0700 Assert no mismatches found in sparse pickle test commit 77bd1eb Author: John Kirkham <[email protected]> Date: Tue Mar 10 01:40:43 2020 -0700 Use SciPy in sparse matrix pickle test comparisons As it appears the comparisons don't work with CuPy currently, perform them with SciPy instead. commit d0b5090 Author: John Kirkham <[email protected]> Date: Tue Mar 10 01:36:21 2020 -0700 Only keep descriptor test in csc and csr Only `_compressed_sparse_matrix` subclasses include `MatDescriptor`. Other sparse matrices don't. So drop this test from them. commit 39264af Author: John Kirkham <[email protected]> Date: Tue Mar 10 00:52:33 2020 -0700 Just test CuPy sparse matrices in pickle tests commit 7c96b16 Author: John Kirkham <[email protected]> Date: Sun Mar 8 15:49:49 2020 -0700 Add a few tests for `MatDescriptor` directly commit 97c7bc1 Author: John Kirkham <[email protected]> Date: Thu Mar 5 19:03:32 2020 -0800 Test for a new `MatDescriptor` after pickling As `MatDescriptor` contains a pointer to a `cusparseMatDescr_t` object, it will not be valid after pickling and reloaded in another process. So test that a new pointer is given on unpickling. This will indicate that `cusparseCreateMatDescr` was run again as part of unpickling. ref: https://docs.nvidia.com/cuda/cusparse/index.html#cusparseCreateMatDescr commit 3524103 Author: John Kirkham <[email protected]> Date: Thu Mar 5 18:58:22 2020 -0800 Test pickling sparse matrices commit 2d2209b Author: John Kirkham <[email protected]> Date: Thu Mar 5 12:36:14 2020 -0800 Allow `MatDescriptor` to be pickle-able
Backporting with PR ( #3771 ). |
Fixes #3061