-
Notifications
You must be signed in to change notification settings - Fork 163
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
[CUDAX] Add can_peer_access_to API to device_ref and check both ways access in get_peers #2642
Conversation
🟩 CI finished in 27m 39s: Pass: 100%/54 | Total: 4h 19m | Avg: 4m 48s | Max: 23m 08s | Hits: 89%/224
|
Project | |
---|---|
CCCL Infrastructure | |
libcu++ | |
CUB | |
Thrust | |
+/- | CUDA Experimental |
pycuda | |
CCCL C Parallel Library |
Modifications in project or dependencies?
Project | |
---|---|
CCCL Infrastructure | |
libcu++ | |
CUB | |
Thrust | |
+/- | CUDA Experimental |
pycuda | |
CCCL C Parallel Library |
🏃 Runner counts (total jobs: 54)
# | Runner |
---|---|
43 | linux-amd64-cpu16 |
5 | linux-amd64-gpu-v100-latest-1 |
4 | linux-arm64-cpu16 |
2 | windows-amd64-cpu16 |
//! | ||
//! @param __other_dev Device to query the peer access | ||
//! @return true if its possible for this device to access the specified device's memory | ||
bool can_peer_access_to(device_ref __other_dev) const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about can_access_peer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be fine with it too, I guess the issue is that in almost all cases the peer access is symmetrical, but technically there could be cases where it's not. I tried to capture the direction in the name dev1.can_peer_access_to(dev2)
, but I don't know if its a good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dev1.has_peer_access_to(dev2)
? or just dev1.is_peer_of(dev2)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What complicates it further is that this API queries only the possibility of peer access, while the actual enablement is a separate API (cudaDeviceEnablePeerAccess). But maybe because we don't expose the device level enablement of peer access and instead do it on memory pool / memory resource basis, then it's fine and these two won't be confused?
(So capability query is done on device level, enablement is on memory_pool / memory_resource and type separation handles the semantic separation).
I also very much like how is_peer_of
reads like, the main problem is that technically it's possible to have GPU1 with peer access to GPU2, but not the other way. Being a peer sounds like a symmetric relation, while "peer access to" less so?
I think I would lean towards "peer accessible" meaning a GPU can access another GPU memory and "peers" being both ways peer accessible GPUs, like in get_peers
. Since this is a one way query it would stay as peer_access_to
and I think has
might be better than can
. I will update the name.
Another problem is I am not sure if the current CUDA Programming Guide considers peer devices to be just any two devices or peer access capable devices. But maybe it doesn't stop as from committing to the above definition of "peer" devices.
🟩 CI finished in 1h 33m: Pass: 100%/54 | Total: 4h 49m | Avg: 5m 21s | Max: 17m 39s | Hits: 55%/224
|
Project | |
---|---|
CCCL Infrastructure | |
libcu++ | |
CUB | |
Thrust | |
+/- | CUDA Experimental |
pycuda | |
CCCL C Parallel Library |
Modifications in project or dependencies?
Project | |
---|---|
CCCL Infrastructure | |
libcu++ | |
CUB | |
Thrust | |
+/- | CUDA Experimental |
pycuda | |
CCCL C Parallel Library |
🏃 Runner counts (total jobs: 54)
# | Runner |
---|---|
43 | linux-amd64-cpu16 |
5 | linux-amd64-gpu-v100-latest-1 |
4 | linux-arm64-cpu16 |
2 | windows-amd64-cpu16 |
…access in get_peers (NVIDIA#2642)
While working on the P2P sample I realized in addition to
get_peers()
it can be useful to have a lower level directed p2p query. The name I picked,can_peer_access_to
, might not be the best, but I think matches what the API does. This API does not query if memory if accessible, but if its possible to enable peers access and what-can-access-to-what order of devices I believe is the correct order here. It is also in line with the order oncudaDeviceCanAccessPeer
.I also changed
get_peers()
to check peer accessibility both ways just to be safe. The above API can be used in those weird non-symmetrical peer access cases instead.