Skip to content
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

ggml-cuda : compute ptrs for cublasGemmBatchedEx in a kernel #3891

Merged
merged 2 commits into from
Nov 1, 2023

Conversation

slaren
Copy link
Collaborator

@slaren slaren commented Nov 1, 2023

Computes the pointers in kernel so that this can be done asynchronously, and uses the CUDA pool to avoid the call to cudaMalloc.

Fixes #3884

@slaren
Copy link
Collaborator Author

slaren commented Nov 1, 2023

Ideally, we would also launch cuBLAS from the same kernel, but it seems that using device-side cuBLAS would require some changes to the build system.

model size params backend ngl test t/s
mistral 7B mostly Q8_0 7.17 GiB 7.24 B CUDA 99 pp 512 3673.15 ± 55.61
mistral 7B mostly Q8_0 7.17 GiB 7.24 B CUDA 99 tg 512 79.59 ± 0.34

build: a9ab02e (1456)

Copy link
Owner

@ggerganov ggerganov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and it also works on the GTX 1660 which was crashing when using the mem pool + memcpy

@slaren slaren merged commit d02e98c into master Nov 1, 2023
33 checks passed
@slaren slaren deleted the batched-krn branch November 1, 2023 22:10
LostRuins pushed a commit to LostRuins/koboldcpp that referenced this pull request Nov 2, 2023
…ov#3891)

* ggml-cuda : compute ptrs for cublasGemmBatchedEx in a kernel

* fix warnings

(cherry picked from commit d02e98c)
olexiyb pushed a commit to Sanctum-AI/llama.cpp that referenced this pull request Nov 23, 2023
…ov#3891)

* ggml-cuda : compute ptrs for cublasGemmBatchedEx in a kernel

* fix warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows - CUDA GPU - Performance Difference - 1429 vs 1430+
3 participants