Skip to content

CMAKE CUDA fix: Unknown option '-Wall' #5543

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

Closed
wants to merge 3 commits into from
Closed

CMAKE CUDA fix: Unknown option '-Wall' #5543

wants to merge 3 commits into from

Conversation

clibdev
Copy link
Contributor

@clibdev clibdev commented Feb 17, 2024

Closes #5542

@phymbert
Copy link
Collaborator

I was also facing this issue with CLion CMake import, thanks a lot @clibdev

@ggerganov ggerganov requested a review from slaren February 17, 2024 21:08
@slaren slaren requested a review from cebtenzzre February 17, 2024 21:38
@clibdev clibdev requested a review from slaren February 18, 2024 16:25
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.

I think we can merge this to solve the immediate problem, but the way CXX_FLAGS and the function get_flags is being used looks completely wrong to me. get_flags is only used with LLAMA_ALL_WARNINGS, yet it also contains optimization flags for the Intel compiler. get_flags is also used with CUDA to set the host compiler flags, and it actually checks what is the host compiler instead of assuming that it is the same than for the rest of the C++ code, which is great, but there are still flags from CXX_FLAGS that should also be passed to the host compiler. Adding CXX_FLAGS to CUDA_CXX_FLAGS is not correct either, because CXX_FLAGS also includes the flags from get_flags, but checked for the wrong compiler.

@ggerganov
Copy link
Member

@slaren Thanks for the review

get_flags is only used with LLAMA_ALL_WARNINGS, yet it also contains optimization flags for the Intel compiler

@abhilash1910 Could you take a look into this - it does look incorrect to add Intel compiler flags here

Will wait for @cebtenzzre to review get_flags usage and see if we can improve

@cebtenzzre
Copy link
Collaborator

cebtenzzre commented Feb 18, 2024

get_flags is only used with LLAMA_ALL_WARNINGS, yet it also contains optimization flags for the Intel compiler.

This was added by @ngxson in #5068, I didn't review that PR because the title and commit messages only mentioned Docker.

Adding CXX_FLAGS to CUDA_CXX_FLAGS is not correct either, because CXX_FLAGS also includes the flags from get_flags, but checked for the wrong compiler.

The idea is that CXX_FLAGS contains generic flags, and GF_CXX_FLAGS contains the compiler-specific flags - they must both be combined to get the full list of flags. For the host this is done in the add_compile_options step, for CUDA this is currently not done consistently (mainly because I've never personally seen nvcc choke on e.g. -Wall - I'm not sure what causes this).

@cebtenzzre
Copy link
Collaborator

I propose this solution: #5570

@slaren slaren closed this Feb 18, 2024
@abhilash1910
Copy link
Collaborator

@slaren Thanks for the review

get_flags is only used with LLAMA_ALL_WARNINGS, yet it also contains optimization flags for the Intel compiler

@abhilash1910 Could you take a look into this - it does look incorrect to add Intel compiler flags here

Will wait for @cebtenzzre to review get_flags usage and see if we can improve

Yes it does not appear to be correct as that is in the scope of LLAMA_ALL_WARNINGS. I will remove this. Thanks for pointing this out.

@ngxson
Copy link
Collaborator

ngxson commented Feb 19, 2024

@cebtenzzre Thanks for pointing it out, #5068 was a trial to make the compilation with intel dpcpp yield more performance, but this is pretty much deprecated now after the introduction of sycl. I'm planning to remove these flags.

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.

CMAKE error nvcc fatal : Unknown option '-Wall'
7 participants