Skip to content

HIP: use -O0 for host code in debug builds - #29795

Merged
JohannesGaessler merged 1 commit into
ggml-org:masterfrom
JohannesGaessler:hip-debug-fix
Oct 6, 2026
Merged

JohannesGaessler merged 1 commit into
ggml-org:masterfrom
JohannesGaessler:hip-debug-fix

Conversation

@JohannesGaessler

Copy link
Copy Markdown
Contributor

On master, when you compile with -DCMAKE_BUILD_TYPE=Debug -DGGML_HIP=ON the code is still being compiled with -O2 by 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 -O0 is used for the host code while keeping -O2 for the device code.

Requirements

@JohannesGaessler
JohannesGaessler removed the request for review from IMbackK October 1, 2026 10:34
@github-actions github-actions Bot added the ggml changes relating to the ggml tensor library for machine learning label Oct 1, 2026

@IMbackK IMbackK left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@JohannesGaessler
JohannesGaessler merged commit 4f54067 into ggml-org:master Oct 6, 2026
31 of 33 checks passed
edwardyoon pushed a commit to edwardyoon/focus-llama that referenced this pull request Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants