-
Notifications
You must be signed in to change notification settings - Fork 21
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
GPU-Aware Communication #208
Draft
ZwFink
wants to merge
113
commits into
main
Choose a base branch
from
feature-gpu_direct
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains 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
…m4py into feature-gpu_direct
This pull request introduces 9 alerts when merging ba3e95c into d95c29d - view on LGTM.com new alerts:
|
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.
Goal: Use UCX for both intra-node and inter-node GPU communication.
Building and Running on OLCF Summit
Prerequisites: OpenPMIx, CUDA-enabled UCX
Building OpenPMIx
Building CUDA-enabled UCX
Commit
971aad12d142341770c8f918cb91727cd180cb31
of master branch recommended, v1.9.0 has issues withucx_perftest
on Summit, latest commit breaks CUDA linkage somehow.Building Charm4Py with UCX
The following diff should be applied to the Charm++ repository, and the paths specified should be changed to the local installation: location
The install directories of OpenPMIx and UCX should be passed in with
--basedir
.Then, Charm4Py can be installed normally:
Running Charm4Py with UCX
You can check if UCX is picking up CUDA and GDRCOPY modules properly on the compute nodes by running
jsrun -n1 ucx_info -d | grep cuda
andjsrun -n1 ucx_info -d | grep gdr
.You may need to pass in
--smpiargs="-disable_gpu_hooks"
tojsrun
if you observe any CUDA hook library failure messages.Running the Charm4Py GPU latency benchmark (between 2 GPUs, intra-socket):
jsrun -n2 -a1 -c2 -g1 -K2 -r2 --smpiargs="-disable_gpu_hooks" ./latency +ppn 1 +pemap L0,8 +commap L4,12
You can change the rendezvous threshold by using the
UCX_RNDV_THRESH
environment variable. The values that I found to work best for the OSU benchmarks are131072
for intra-socket,65536
for inter-socket, and524288
for inter-node. Note that a too small value (less than64
in my tests) will cause hangs, probably due to the UCX layer implementation in Charm++.Charm4Py API
The Charm4Py implementation uses the Channels API. When a channel has been created between chares, there are two options for sending GPU-direct messages: by passing the buffers themselves and by passing arrays containing the pointers/sizes of the arrays. The latter is an optimization when the same buffers are used for communication multiple times, as the cost of determining the address/size of the buffers is paid only once; this optimiziation saves ~20us for each message.
Direct Access
Assume that
partner_channel
is a channel between two chares, and thatd_data_send
andd_data_recv
are arrays implementing the CUDA Array Interface. To send these arrays through the channel, the following can be used:Note that multiple arrays can be sent, and that combinations of GPU and host parameters are allowed.
Persistent Communication Optimization
The Direct Access method extracts the address and size of each array using the CUDA Array Interface. Many applications use the same buffer for communication many times, and using the Direct Access the address and size must be extracted each time the Array is used. While we plan to implement a cache to optimize for these situations, we currently offer a workaround that allows to provide this information to the runtime system.
References
https://github.com/openucx/ucx/wiki/NVIDIA-GPU-Support
https://openucx.readthedocs.io/en/master/faq.html#working-with-gpu