Skip to content

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

Merged
toslunar merged 12 commits intocupy:masterfrom
anaruse:cusolver_gesvdj_gesvda
Mar 24, 2020
Merged

Support cusolverDn<t>gesvdj and cusolverDn<t>gesvdaStridedBatched#3192
toslunar merged 12 commits intocupy:masterfrom
anaruse:cusolver_gesvdj_gesvda

Conversation

@anaruse
Copy link
Copy Markdown
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
Copy Markdown
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
status = cusolverDnXgesvdjGetResidual(<Handle>handle, <GesvdjInfo>info,
&residual)
check_status(status)
return residual
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.

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
Copy Markdown
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
Copy Markdown
Contributor Author

anaruse commented Mar 17, 2020

Thanks for your review. I fixed typos.

@toslunar
Copy link
Copy Markdown
Member

Jenkins, test this please.

@pfn-ci-bot
Copy link
Copy Markdown
Collaborator

Successfully created a job for commit f1df4a9:

@toslunar toslunar self-requested a review March 18, 2020 05:34
@chainer-ci
Copy link
Copy Markdown
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
Copy Markdown
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