Skip to content

CUDA: fixed LLAMA_FAST compilation option #2473

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

Merged

Conversation

JohannesGaessler
Copy link
Collaborator

The LLAMA_FAST compilation option which replaces -O3 with -Ofast currently does not work in combination with CUDA because nvcc does not have that compilation option. This PR makes it so that -O3 is always used for nvcc and -Ofast otherwise.

Copy link
Member

@slaren slaren left a comment

Choose a reason for hiding this comment

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

Looks good, but I wonder if LLAMA_FAST should toggle -use_fast_math for nvcc instead.

@JohannesGaessler
Copy link
Collaborator Author

All llama.cpp CUDA calculations at some point use half precision or worse so I don't think there's a point in disabling --use_fast_math. I don't know if there are side effects for using -Ofast for llama.cpp/ggml in general so I'm being conservative in not making it the default.

@JohannesGaessler JohannesGaessler merged commit 49e7cb5 into ggml-org:master Jul 31, 2023
@ggerganov
Copy link
Member

All llama.cpp CUDA calculations at some point use half precision or worse so I don't think there's a point in disabling --use_fast_math. I don't know if there are side effects for using -Ofast for llama.cpp/ggml in general so I'm being conservative in not making it the default.

At some point there was discussion about this in whisper.cpp and I decided to keep O3 as default:

ggml-org/whisper.cpp#252 (comment)

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.

3 participants