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

Fixed CUDA arch: OFF -> 52;61 #389

Merged
merged 1 commit into from
Jul 14, 2023

Conversation

JohannesGaessler
Copy link
Collaborator

Fixes the issue described in #338 where the __dp4a based CUDA kernels cause the model to produce garbage. The problem is that the cmake CUDA compute capabilities set in llama.cpp and ggml are different. In llama.cpp they are set to 52;61, the lowest allowed compute capability and the minimum compute capability for __dp4a. A GPU will automatically use the highest compute capability PTX code that was compiled. If only 5.2 PTX code is generated (the default) the fallback implementation in which 0 is returned is used for GPUs with compute capability >= 6.1 which causes the model to produce garbage outputs. Ideally I would have put the __CUDA_ARCH__ check outside the kernels but unfortunately this is not possible; __CUDA_ARCH__ is only available in device code.

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.

2 participants