-
Notifications
You must be signed in to change notification settings - Fork 218
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
CUSOLVER (dense): cache workspace in fat handle #2465
Conversation
tests pass locally but i have not battle tested this yet |
54d62a4
to
8865fb6
Compare
ready for review. tests really pass locally now, and it works well in my application. |
Superficially LGTM, but I don't have the time for a thorough review right now. This probably should also integrate with the |
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.
@bjarthur I really like the idea of a "fat" handle!
We discussed about it with @maleadt regarding CUSPARSE, aiming to avoid allocating a new buffer for each sparse matrix product, but we never got the chance to implement it.
@maleadt, I’m wondering if CUDA.jl consistently reuses the same handle.
I know we can have up to 32 handles, but for efficiency, we should reuse the one that stored the buffer from the previous factorization.
Otherwise, we'll end up storing a lot of unnecessary workspaces.
If that’s not the case, wouldn’t it be better to implement a cache of workspaces where the "fat" handle could pick a workspace from the pool based on a specific "id" related to the routine?
We do as long as you're using the same task, which I assume you are. In that case, calling |
8865fb6
to
93d970d
Compare
Forgot about this; rebased to give it another CI run. |
riffing off of #2279 for getrf, getrs, sytrf, sytrs and friends. much cleaner API than #2464.