Skip to content
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

WIP: Use PTDS for synchronization in UCX communication #4034

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jakirkham
Copy link
Member

This changes the stream we synchronize on to support the per-thread default stream.

Requires numba version 0.50.0+ ( numba/numba#5347 )


Note: This is pending other changes in RAPIDS. Just putting this up to show what changes would be needed here at this point.


cc @shwina @kkraus14 @jrhemstad (as we discussed this earlier)
cc @quasiben @pentschev @harrism (for awareness)

This changes the stream we synchronize on to support the per-thread
default stream.
Comment on lines +223 to +224
# We synchronize the per-thread default stream because UCX is not stream-ordered and
# syncing the per-thread default stream will wait for other non-blocking CUDA streams.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't wait for other threads' default per-thread default streams...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So should we leave this as-is? Or is there something else we should be doing here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Mark is referring to the section of syncing the per-thread default stream will wait for other non-blocking CUDA streams as that line is incorrect. Syncing the per-thread default stream will only wait for the current stream WITHOUT blocking work on other non-blocking CUDA streams.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I just wasn't sure if this implied changes beyond the text in the comment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming syncing only the PTDS is correct behaviour, I think only the comment is incorrect.

@kkraus14
Copy link
Member

One concern, what if someone is doing non-synchronized work on the legacy default stream and then goes to send here? We'll synchronize only the per-thread default stream and not synchronize the legacy default stream which can leave UCX in a bad state.

@jakirkham
Copy link
Member Author

So what would the counterproposal be? Leave things as-is?

@kkraus14
Copy link
Member

So what would the counterproposal be? Leave things as-is?

I think medium term is work with the community to get the stream included in __cuda_array_interface__. Short term, I'm not sure.

Base automatically changed from master to main March 8, 2021 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants