-
Notifications
You must be signed in to change notification settings - Fork 10k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cuda : improve cuda pool efficiency using virtual memory (#4606)
* cuda : improve cuda pool efficiency using virtual memory * fix mixtral * fix cmake build * check for vmm support, disable for hip ggml-ci * fix hip build * clarify granularity * move all caps to g_device_caps * refactor error checking * add cuda_pool_alloc, refactor most pool allocations ggml-ci * fix hip build * CUBLAS_TF32_TENSOR_OP_MATH is not a macro * more hip crap * llama : fix msvc warnings * ggml : fix msvc warnings * minor * minor * cuda : fallback to CPU on host buffer alloc fail * Update ggml-cuda.cu Co-authored-by: Johannes Gäßler <[email protected]> * Update ggml-cuda.cu Co-authored-by: Johannes Gäßler <[email protected]> * ensure allocations are always aligned * act_size -> actual_size --------- Co-authored-by: Johannes Gäßler <[email protected]>
- Loading branch information
1 parent
708e179
commit 5bf3953
Showing
8 changed files
with
328 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
5bf3953
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.
Hmm this commit broke CUDA 10 compilation again.
5bf3953
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.
We're trying to build for cuda with Conda and since this commit, we've been getting a linker(?) error
../x86_64-conda-linux-gnu/bin/ld: cannot find -lcuda: No such file or directory
error. This is using the same library includes as the makefile. Is it possible that the library path is different or something else is missing?cc: @henk717
5bf3953
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.
The issue for us is bigger than that, -lcuda tries to target the driver directly while we are trying to create a universal binary for our end users.
Github CI doesn't have a GPU so we can't install lcuda on it, this is part of the driver so I have no way to install it.
5bf3953
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.
@LostRuins You need to add the path to the CUDA driver library. The
llama.cpp
Makefile does not cover all possible locations. You can open a PR to add the path suitable for Conda:llama.cpp/Makefile
Line 370 in 9fbda71
@henk717 I'm not sure what is the common practice in this case, but surely there has to be a way to link CUDA. Quick search shows that people are using stub libraries:
https://stackoverflow.com/questions/20186848/can-i-compile-a-cuda-program-without-having-a-cuda-device
5bf3953
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.
The stub was a good shout, I had been misdirected yesterday night into finding the non-stub.
With your reminder and a good night sleep I got it now, the stub is provided in our case by the conda package cuda-driver-dev so I can work with that package.
5bf3953
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.
I think adding
-Lconda/envs/linux/lib -Lconda/envs/linux/lib/stubs
does seem to work for conda, although I wonder if there are any other cases missing.