Skip to content
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

Support cusolverDn<t>gesvdj and cusolverDn<t>gesvdaStridedBatched #3192

Merged
merged 12 commits into from
Mar 24, 2020

Conversation

anaruse
Copy link
Contributor

@anaruse anaruse commented Mar 13, 2020

This PR makes following two types of cuSolver SVD implementations available in CuPy.

gesvdj uses Jacobi method and can give better performance compared with standard gesvd using QR factorization when matrix size is not large.

gesvda is approximate SVD solver and better in performance when a tall skinny matrix.

This is related to #3174

@anaruse anaruse changed the title [WIP] support cusolverDn<t>gesvdj and cusolverDn<t>gesvdaStridedBatched Support cusolverDn<t>gesvdj and cusolverDn<t>gesvdaStridedBatched Mar 16, 2020
@kmaehashi
Copy link
Member

@toslunar Could you take a look?

@toslunar toslunar self-requested a review March 17, 2020 04:30
@toslunar toslunar added the cat:enhancement Improvements to existing features label Mar 17, 2020
cupy/cuda/cupy_cusolver.h Outdated Show resolved Hide resolved
cupy/cuda/cupy_cusolver.h Outdated Show resolved Hide resolved
status = cusolverDnXgesvdjGetResidual(<Handle>handle, <GesvdjInfo>info,
&residual)
check_status(status)
return residual
Copy link
Member

Choose a reason for hiding this comment

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

Fair to leave it untested because the functionality (to compute residual of the decomposition) does not seem available in NumPy or SciPy.

cuda_version = runtime.runtimeGetVersion()
if version_added is not None and cuda_version < version_added:
return False
if version_removed is not None and cuda_version >= version_removed:
Copy link
Member

Choose a reason for hiding this comment

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

Agree to have version_removed to align with cupy/cusparse.py.

cupy/cupy/cusparse.py

Lines 82 to 93 in 2d10549

_available_cuda_version = {
'csrmv': (8000, 11000),
'csrmvEx': (8000, None),
'csrmm': (8000, 11000),
'csrmm2': (8000, 11000),
'csrgeam': (8000, 11000),
'csrgeam2': (9020, None),
'csrgemm': (8000, 11000),
'csrgemm2': (8000, None),
'spmv': (10010, None),
'spmm': (10010, None),
}

@anaruse
Copy link
Contributor Author

anaruse commented Mar 17, 2020

Thanks for your review. I fixed typos.

@toslunar
Copy link
Member

Jenkins, test this please.

@pfn-ci-bot
Copy link
Collaborator

Successfully created a job for commit f1df4a9:

@toslunar toslunar self-requested a review March 18, 2020 05:34
@chainer-ci
Copy link
Member

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

@emcastillo emcastillo added this to the v8.0.0b2 milestone Mar 23, 2020
Copy link
Member

@toslunar toslunar left a comment

Choose a reason for hiding this comment

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

LGTM

@toslunar toslunar merged commit 775cb7d into cupy:master Mar 24, 2020
@toslunar toslunar mentioned this pull request Apr 1, 2020
toslunar added a commit to toslunar/cupy that referenced this pull request Apr 1, 2020
@kmaehashi kmaehashi removed the cat:enhancement Improvements to existing features label Apr 23, 2020
@kmaehashi kmaehashi added the cat:feature New features/APIs label Apr 23, 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.

6 participants