fix(hip): map Gemma4 BSA runtime calls#258
Open
weicj wants to merge 1 commit into
Open
Conversation
Contributor
|
Please add HiP build into CI workflow to avoid such breakage. |
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.
Summary
This PR fixes a HIP build failure in the Gemma4 BSA prefill path.
After the Gemma4 backend landed, HIP builds can reach
gemma4_graph.cppand fail because that path uses CUDA runtime names directly, includingcudaMemcpy2DandcudaDeviceSynchronize. Most of the project already routes these CUDA-style names throughgpu_runtime_compat.h, but Gemma4 did not include that compatibility header and the header did not map the synchronouscudaMemcpy2Dcall yet.Changes
cudaMemcpy2D -> hipMemcpy2Dtodflash/src/common/gpu_runtime_compat.h.common/gpu_runtime_compat.hfromdflash/src/gemma4/gemma4_graph.cppso the Gemma4 BSA path uses the same CUDA/HIP runtime compatibility layer as the rest of the C++ backend code.Notes
dflash_serverbuilds successfully, and a Gemma4 E4B Q4 smoke run loads onhip:0and returns a/v1/chat/completionsresponse.