Universal CUDA/ROCm wheel via runtime platform detection#78
Merged
takeshi-yoshimura merged 1 commit intoMay 22, 2026
Merged
Conversation
5eaf1c9 to
51e25fe
Compare
…latforms Signed-off-by: Turner Jabbour <doubleujabbour@gmail.com>
Contributor
Author
|
@takeshi-yoshimura Hey Takeshi, this PR is good for review! |
799a5de
into
foundation-model-stack:main
12 checks passed
Collaborator
|
@wjabbour |
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
ROCM_PATH/USE_ROCMplatform selection with runtimedlopendetectionlibcudart.sofirst, thenlibamdhip64.so— whichever succeeds sets the GPU function pointersis_cuda_found()andis_hip_found()are now real runtime queries (both always exported), not compile-time constantsis_gds_supported()uses the runtimeis_hip_runtimeflag instead of#ifdef USE_ROCMcuda_compat.h→gpu_compat.hwith updated include guards and two parallelCUDA_SYM_*/HIP_SYM_*define sets (no#ifdefguards)detect_platform()fromsetup.py— single build works on both platformsis_hip_found()stub tocpp.pyiROCM_PATH=prefix)Test plan
is_cuda_found()→False,is_hip_found()→Trueon ROCmcuda:0cuda:0in 9.5s--load-format fastsafetensorswithibm-granite/granite-3.3-2b-instructon ROCm (weights loaded in 0.43s, server fully up)Closes #68
🤖 Generated with Claude Code