Skip to content

fix(ggml-cuda): make fattn-sparse build under HIP (cudaStreamDefault)#15

Merged
davide221 merged 1 commit into
luce-dflashfrom
fix/fattn-sparse-hip-cudastreamdefault
Jun 7, 2026
Merged

fix(ggml-cuda): make fattn-sparse build under HIP (cudaStreamDefault)#15
davide221 merged 1 commit into
luce-dflashfrom
fix/fattn-sparse-hip-cudastreamdefault

Conversation

@davide221

Copy link
Copy Markdown

Problem

ggml/src/ggml-cuda/fattn-sparse.cu uses cudaStreamDefault (lines 209, 216). Under the HIP build (-DGGML_HIP=ON), that identifier is not defined (the HIP shim does not alias cudaStreamDefault), so ggml-hip fails to compile:

fattn-sparse.cu:209:36: error: use of undeclared identifier 'cudaStreamDefault'
fattn-sparse.cu:216:39: error: use of undeclared identifier 'cudaStreamDefault'
2 errors generated when compiling for gfx1151.

This breaks every HIP build of the dflash server / backend_ipc_daemon on AMD GPUs (e.g. Strix Halo gfx1151). The CUDA build is unaffected.

Fix

Replace cudaStreamDefault with ((cudaStream_t)0), the default-stream handle. It is numerically identical (the default stream is handle 0 under both CUDA and HIP), and cudaStream_t is aliased to hipStream_t by the HIP shim, so it compiles on both backends with no behavior change.

Validation

Built backend_ipc_daemon for gfx1151 (ROCm 7.2) on lucebox2 with this patch: ggml-hip compiles and links cleanly; CUDA build still green. Required by Luce-Org/lucebox-hub#321 (mixed CUDA+HIP target layer split), whose HIP shard daemon will not build without it.

🧙 Built with WOZCODE

fattn-sparse.cu used cudaStreamDefault, which is not defined in the HIP
translation (the HIP shim does not alias it), so the ggml-hip build
failed with "use of undeclared identifier cudaStreamDefault". Use
((cudaStream_t)0) (the default-stream handle), valid and identical under
both CUDA and HIP.

Co-Authored-By: WOZCODE <contact@withwoz.com>
@davide221 davide221 merged commit 570d978 into luce-dflash Jun 7, 2026
11 of 50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant