fix(ggml-cuda): make fattn-sparse build under HIP (cudaStreamDefault)#15
Merged
Merged
Conversation
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>
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.
Problem
ggml/src/ggml-cuda/fattn-sparse.cuusescudaStreamDefault(lines 209, 216). Under the HIP build (-DGGML_HIP=ON), that identifier is not defined (the HIP shim does not aliascudaStreamDefault), soggml-hipfails to compile:This breaks every HIP build of the dflash server /
backend_ipc_daemonon AMD GPUs (e.g. Strix Halo gfx1151). The CUDA build is unaffected.Fix
Replace
cudaStreamDefaultwith((cudaStream_t)0), the default-stream handle. It is numerically identical (the default stream is handle0under both CUDA and HIP), andcudaStream_tis aliased tohipStream_tby the HIP shim, so it compiles on both backends with no behavior change.Validation
Built
backend_ipc_daemonforgfx1151(ROCm 7.2) on lucebox2 with this patch:ggml-hipcompiles 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