Conversation
|
@takagi, have you had a chance to take a look at this fix? 🙂 |
|
pfnCI, test this please. |
|
Successfully created a job for commit 5bfbbe4: |
|
Yes, please let me check if the change works on my local as well as running the CI. |
|
Jenkins CI test (for commit 5bfbbe4, target branch master) failed with status FAILURE. |
|
@econtal Sorry for leaving this PR so long. Would you fix the CI failure? It says to import |
|
Hi @takagi. No worries, thanks for reviewing. I'm not familiar with cupy testing, I guess the issue was the missing For this (and eventual further changes), do you prefer amend the commits and force push to clean the git history? |
|
Thanks, you're perfect. And you don't need to clean the git history, it is a reasonable change I think. |
|
pfnCI, test this please. |
|
Successfully created a job for commit 0052756: |
|
Jenkins CI test (for commit 0052756, target branch master) succeeded! |
|
I have an issue. With this change, How about sorting data_orig = x.data.copy()
_call_cusparse(
'gthr', x.dtype,
handle, nnz, data_orig.data.ptr, x.data.data.ptr,
P.data.ptr, cusparse.CUSPARSE_INDEX_BASE_ZERO)It may have some time penalty compared to your change, but I suppose the consistency of memory usage is more important here. In nature, this problem comes from the different representations of a sparse matrix between cuSparse and CuPy. Three raw arrays for the former, and a wrapped-up class for the latter. |
|
I see your point and agree that having hybrid in-place/copy doesn't seem like a good idea. Copying the data to force in-place on The other option would be to copy |
|
While pushing the changes I noticed that |
3910726 to
8d2d4fa
Compare
|
pfnCI, test this please. |
|
Successfully created a job for commit 8d2d4fa: |
|
Thanks for the change, I kicked the CI again. As for |
|
Jenkins CI test (for commit 8d2d4fa, target branch master) succeeded! |
|
I got a test of @testing.with_requires('scipy')
class TestCsrsort(unittest.TestCase):
def setUp(self):
self.a = scipy.sparse.random(
1, 10000, density=0.9, dtype=numpy.float32, format='csr')
numpy.random.shuffle(self.a.indices)
self.a.has_sorted_indices = False
def test_csrsort(self):
a = sparse.csr_matrix(self.a)
cupy.cusparse.csrsort(a)
self.a.sort_indices()
testing.assert_array_equal(self.a.indptr, a.indptr)
testing.assert_array_equal(self.a.indices, a.indices)
testing.assert_array_almost_equal(self.a.data, a.data) |
takagi
left a comment
There was a problem hiding this comment.
Only a minor fix, would you make it?
|
@takagi thanks for the useful test case. I added the fix on |
|
pfnCI, test this please. |
|
Successfully created a job for commit f84345e: |
|
Jenkins CI test (for commit f84345e, target branch master) succeeded! |
|
LGTM, thanks! |
Fixes #2005
Fixes #2365
Fix
coosortby havinggthrwrite to separated buffer instead of reading and writing tox.data