-
Notifications
You must be signed in to change notification settings - Fork 12.2k
[CUDA] Enable CUDA Graph on CUDA Toolkit < 12.x #12394
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
[CUDA] Enable CUDA Graph on CUDA Toolkit < 12.x #12394
Conversation
`cudaGraphExecUpdate` API was changed on 12.x. For this reason CUDA graph support was disabled on older CUDA toolkit. This change enables CUDA support in CTK version < 12.x by using older API if CTK < 12.x.
Seems to cause error in the MUSA build: |
Added a change that should fix issues with MUSA build. |
ggml/src/ggml-cuda/ggml-cuda.cu
Outdated
#else | ||
cudaGraphExecUpdateResultInfo result_info; |
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.
Is this correctly cudaGraphExecUpdateResultInfo
? Or it should be cudaGraphExecUpdateResult
?
As it is, cudaGraphExecUpdateResultInfo
is only defined in vendors/musa.h
:
llama.cpp/ggml/src/ggml-cuda/vendors/musa.h
Line 122 in db400a6
#define cudaGraphExecUpdateResultInfo musaGraphExecUpdateResult |
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.
This is correct. cudaGraphExecUpdateResultInfo
is declared in headers of CTK >= 12.x. CTK < 12.x declares cudaGraphExecUpdateResult
.
Looked into MUSA headers and it seems musaGraphExecUpdate
itself is commented out in its headers.
I realized earlier CUDA graph was disabled on MUSA platform and hence that part of code was not even getting compiled on MUSA. But, my change had enabled it on MUSA when I removed CUDART_VERSION >= 12000
check. I have again disabled CUDA graph on MUSA platform now. I have also updated musa.h
to use right macros but this doesn't matter as code is not getting compiled on MUSA.
* Enable CUDA Graph on CTK < 12.x `cudaGraphExecUpdate` API was changed on 12.x. For this reason CUDA graph support was disabled on older CUDA toolkit. This change enables CUDA support in CTK version < 12.x by using older API if CTK < 12.x. * Fix compilation errors with MUSA * Disable CUDA Graph for MUSA
cudaGraphExecUpdate
API signature was changed in CTK 12.x. For this reason, CUDA graph support was disabled on older CUDA toolkit. This change enables CUDA graph support on CTK version < 12.x by using older API if CTK < 12.x.Performance Gains on CUDA 11.8, RTX 4090
This PR improves performance by around 35% in generation phase.
Master
This PR
Make sure to read the contributing guidelines before submitting a PR