-
Notifications
You must be signed in to change notification settings - Fork 772
add patch to make PyTorch v1.10.0 detect CUDA-enabled OpenMPI when using UCX-CUDA #14496
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
Closed
akesandgren
wants to merge
3
commits into
easybuilders:develop
from
akesandgren:20211203134914_new_pr_PyTorch1100
Closed
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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
42 changes: 42 additions & 0 deletions
42
easybuild/easyconfigs/p/PyTorch/PyTorch-1.10.0_detect_ucx_cuda.patch
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 |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| Make PyTorch CUDA-aware-OpenMPI detection aware of UCX. | ||
| The old detection relies on the old pre-UCX smcuda btl from ompi_info. | ||
| Use ucx_info -d to find CUDA enabled UCX if there is no smcuda. | ||
| ucx_info -d only shows cuda_cpy when run on a node with a GPU available. | ||
|
|
||
| Åke Sandgren, 2021-12-03 | ||
| diff -ru pytorch.orig/cmake/Dependencies.cmake pytorch/cmake/Dependencies.cmake | ||
| --- pytorch.orig/cmake/Dependencies.cmake 2021-11-29 09:13:59.000000000 +0100 | ||
| +++ pytorch/cmake/Dependencies.cmake 2021-12-03 13:37:47.646865417 +0100 | ||
| @@ -1072,16 +1072,29 @@ | ||
| find_program(OMPI_INFO | ||
| NAMES ompi_info | ||
| HINTS ${MPI_CXX_LIBRARIES}/../bin) | ||
| + set(CUDA_MPI_FOUND False) | ||
| if(OMPI_INFO) | ||
| execute_process(COMMAND ${OMPI_INFO} | ||
| OUTPUT_VARIABLE _output) | ||
| if(_output MATCHES "smcuda") | ||
| - message(STATUS "Found OpenMPI with CUDA support built.") | ||
| + set(CUDA_MPI_FOUND True) | ||
| else() | ||
| - message(WARNING "OpenMPI found, but it is not built with CUDA support.") | ||
| - set(CAFFE2_FORCE_FALLBACK_CUDA_MPI 1) | ||
| + find_program(UCX_INFO NAMES ucx_info) | ||
| + if(UCX_INFO) | ||
| + execute_process(COMMAND ${UCX_INFO} -d | ||
| + OUTPUT_VARIABLE _output) | ||
| + if(_output MATCHES "cuda_cpy") | ||
| + set(CUDA_MPI_FOUND True) | ||
| + endif() | ||
| + endif() | ||
| endif() | ||
| endif() | ||
| + if (CUDA_MPI_FOUND) | ||
| + message(STATUS "Found OpenMPI with CUDA support built.") | ||
| + else() | ||
| + message(WARNING "OpenMPI found, but it is not built with CUDA support.") | ||
| + set(CAFFE2_FORCE_FALLBACK_CUDA_MPI 1) | ||
| + endif() | ||
| else() | ||
| message(WARNING "Not compiling with MPI. Suppress this warning with -DUSE_MPI=OFF") | ||
| caffe2_update_option(USE_MPI OFF) |
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.