Repository navigation
HIP: use -O0 for host code in debug builds - #29795
Merged
Merged
Conversation
CISC
approved these changes
Oct 1, 2026
IMbackK
approved these changes
Oct 2, 2026
IMbackK
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Note that the compiler produces incorrect code for gfx10+ devices in -O0 mode and AMD dose not intend to fix this. Perhaps that should be a comment above this line.
edwardyoon
pushed a commit
to edwardyoon/focus-llama
that referenced
this pull request
Oct 8, 2026
(cherry picked from commit 4f54067)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On master, when you compile with
-DCMAKE_BUILD_TYPE=Debug -DGGML_HIP=ONthe code is still being compiled with-O2by default to avoid the device code being compiled differently. However, as it is this also affects the host code which is annoying in conjunction with a debugger. This PR makes it so that by default-O0is used for the host code while keeping-O2for the device code.Requirements