-
Notifications
You must be signed in to change notification settings - Fork 4
[Feature] Updating dgl ROCm support #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
61b841e
PR ready
gcapodagAMD 3b2a3b2
Minor change
gcapodagAMD a38a18a
Fixed typo in readme
gcapodagAMD c61cc21
Attempt at fixing the linting errors
gcapodagAMD 24fba8d
Fixing linting
gcapodagAMD f27d36a
Merge branch 'develop' of github.com:ROCm/dgl into develop
gcapodagAMD ed3f23a
Addressing comments on PR
gcapodagAMD 9729b7b
Addressing latest set of comments
gcapodagAMD 9a82d43
Forgot to include one reverted change to CMakeLists.txt
gcapodagAMD cc9e550
Making install_graphbolt_deps.sh executable
gcapodagAMD 324eaf1
Addressing James' comments
gcapodagAMD File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,41 +1,85 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| ROCM_ROOT=/opt/rocm | ||
| usage() { | ||
| cat <<EOF | ||
| Usage: $(basename "$0") [OPTIONS] | ||
|
|
||
| Install graphbolt dependencies (hipCollections, rocPRIM patches). | ||
|
|
||
| Options: | ||
| --rocm-root DIR ROCm installation root. Takes priority over \$ROCM_ROOT and \$ROCM_PATH | ||
| env variables. Falls back to \$ROCM_ROOT, then \$ROCM_PATH, then /opt/rocm. | ||
| --install-prefix DIR Installation prefix for dependencies (default: same as rocm-root) | ||
| --hipcollections-branch B Branch to clone hipCollections from (default: release/rocmds-25.10) | ||
| --dry-run Print the commands that would be executed without running them | ||
| -h, --help Show this help message | ||
| EOF | ||
| exit 0 | ||
| } | ||
|
|
||
| _ROCM_ENV_SET=false | ||
| if [[ -n "${ROCM_ROOT}" || -n "${ROCM_PATH}" ]]; then | ||
| _ROCM_ENV_SET=true | ||
| fi | ||
|
|
||
| ROCM_ROOT="${ROCM_ROOT:-${ROCM_PATH:-/opt/rocm}}" | ||
| INSTALL_PREFIX="" | ||
| HIPCOLLECTIONS_BRANCH="release/rocmds-25.10" | ||
| DRY_RUN=false | ||
| _ROCM_FLAG_SET=false | ||
|
|
||
| while [[ $# -gt 0 ]]; do | ||
| case "$1" in | ||
| --rocm-root) ROCM_ROOT="$2"; _ROCM_FLAG_SET=true; shift 2 ;; | ||
| --install-prefix) INSTALL_PREFIX="$2"; shift 2 ;; | ||
| --hipcollections-branch) HIPCOLLECTIONS_BRANCH="$2"; shift 2 ;; | ||
| --dry-run) DRY_RUN=true; shift ;; | ||
| -h|--help) usage ;; | ||
| *) echo "Unknown option: $1"; usage ;; | ||
| esac | ||
| done | ||
|
|
||
| INSTALL_PREFIX="${INSTALL_PREFIX:-${ROCM_ROOT}}" | ||
|
|
||
| if ! $_ROCM_ENV_SET && ! $_ROCM_FLAG_SET; then | ||
| echo "Neither ROCM_ROOT nor ROCM_PATH is set, defaulting to /opt/rocm." | ||
| fi | ||
| echo "ROCM_ROOT: ${ROCM_ROOT}" | ||
| echo "INSTALL_PREFIX: ${INSTALL_PREFIX}" | ||
|
|
||
| run() { | ||
| if $DRY_RUN; then | ||
| echo "[dry-run] $*" | ||
| else | ||
| "$@" | ||
| fi | ||
| } | ||
|
|
||
| export CC=${ROCM_ROOT}/llvm/bin/clang | ||
| export CXX=${ROCM_ROOT}/llvm/bin/clang++ | ||
|
|
||
| set -x | ||
| INSTALL_PREFIX=${ROCM_ROOT} | ||
| FILE_SOURCE_DIR=$(dirname $(realpath $0)) | ||
| DEPS_DIR=$(pwd) | ||
| export CMAKE_PREFIX_PATH="/opt/rocm/hip/lib/cmake;/opt/rocm/lib/cmake" | ||
| export CMAKE_PREFIX_PATH="${ROCM_ROOT}/hip/lib/cmake;${ROCM_ROOT}/lib/cmake" | ||
|
|
||
| git clone https://github.com/ROCm/hipCollections.git -b release/rocmds-25.10 | ||
| export RAPIDS_CMAKE_SCRIPT_BRANCH=release/rocmds-25.10 | ||
| cd hipCollections | ||
| cmake -B build \ | ||
| run git clone https://github.com/ROCm/hipCollections.git -b "${HIPCOLLECTIONS_BRANCH}" | ||
|
gcapodagAMD marked this conversation as resolved.
|
||
| export RAPIDS_CMAKE_SCRIPT_BRANCH="${HIPCOLLECTIONS_BRANCH}" | ||
| run cd hipCollections | ||
| run cmake -B build \ | ||
| -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DINSTALL_CUCO=ON -DBUILD_TESTS=OFF -DBUILD_BENCHMARKS=OFF -DBUILD_EXAMPLES=OFF | ||
| cmake --build build --target install | ||
| run cmake --build build --target install | ||
| cd ${DEPS_DIR} | ||
|
|
||
| # TODO (#21) this is an unacceptable way to do this, | ||
| # see https://github.com/ROCm/libhipcxx/issues/10 for more details | ||
| # This was implicitly not allowed in previous releases we were using, | ||
| # but with v2.7.0 they are explicitly not allowed. | ||
|
|
||
| # We only use semaphores for a counter of IO operations in graphbolt, | ||
| # that only runs on the host (not on the device) so we should be "safe" | ||
| # to use this for now. | ||
| sed -i '/#error semaphore is not supported on AMD hardware and should not be included/d' ${INSTALL_PREFIX}/include/rapids/libhipcxx/cuda/semaphore | ||
| sed -i '/#error semaphore is not supported on AMD hardware and should not be included/d' ${INSTALL_PREFIX}/include/rapids/libhipcxx/hip/semaphore | ||
| sed -i '/#error semaphore is not supported on AMD hardware and should not be included/d' ${INSTALL_PREFIX}/include/rapids/libhipcxx/cuda/std/semaphore | ||
| sed -i '/#error semaphore is not supported on AMD hardware and should not be included/d' ${INSTALL_PREFIX}/include/rapids/libhipcxx/hip/std/semaphore | ||
|
|
||
| # TODO (#22) remove this once the patches are merged | ||
| # the patches for this were merged in https://github.com/ROCm/rocm-libraries/pull/1883 | ||
| # but may take more time to be released. | ||
|
|
||
| # Right now we need to patch the rocPRIM headers to fix the build because these | ||
| # config headers are missing gfx942 (I've added them manually) | ||
| cp ${FILE_SOURCE_DIR}/*.hpp ${INSTALL_PREFIX}/include/rocprim/device/detail/config/. | ||
| run cp ${FILE_SOURCE_DIR}/*.hpp ${INSTALL_PREFIX}/include/rocprim/device/detail/config/. | ||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.