-
Notifications
You must be signed in to change notification settings - Fork 346
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
Better cuBLAS handle management #1389
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Przemek Tredak <[email protected]>
for more information, see https://pre-commit.ci
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
May I have a question about the commit? If there is multiple devices invoke cublas_gemm(), it seems always use the same cublasLt handle? |
@shenzhenghai Yeah, if your usage is to have multiple devices per thread then you are correct - it would use the same handle, which is wrong. I don't necessarily like the fact that fixing this will require calling cudaGetDevice before every cuBLAS call - this adds overhead and the most typical usage by the DL Frameworks nowadays is 1 GPU per process. But I agree that the functional correctness is the most important - will submit a fix (also will fix the cuDNN handle management, since it has similar problem). |
Signed-off-by: Przemek Tredak <[email protected]>
for more information, see https://pre-commit.ci
/te-ci |
Signed-off-by: Przemek Tredak <[email protected]>
/te-ci |
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
/te-ci |
Description
Create only 1 (per thread) cublasLtHandle in order to not leak memory. We do not want to actually destroy the handle, since it would incur an implicit cudaDeviceSynchronize call (see cuBLAS docs).
Fixes #1372
Type of change
Changes
Checklist: