Uh oh!
There was an error while loading. Please reload this page.
Use separate streams for pushsend/recv kernels in UB p2p exchanges - #188
Conversation
Signed-off-by: Sangkug Lym <slym@nvidia.com>
Signed-off-by: Sangkug Lym <slym@nvidia.com>
timmoon10
left a comment
There was a problem hiding this comment.
I see that _stream_send and _stream_compute[:] wait on _stream_recv and the main stream waits on _stream_compute[last_compute_stream_id]. I don't see if the main stream is ever synchronized with _stream_send and _stream_compute[:] though. Could we run into race conditions?
erhoo82
commented
May 1, 2023
I think it is fine. We need to make sure the dependency of The compute kernel on @timmoon10 Let me know this makes sense to you. |
timmoon10
commented
May 1, 2023
Ok, it makes sense to me that |
ksivaman
commented
May 1, 2023
/te-ci |
erhoo82
commented
May 1, 2023
The memcopy is for storing activation for backprop thus this is only valid execution path in fprop kernel. Since the following layers do not have direct dependency to this data, extended execution of memcopy is fine and this is intended for potential overlap with following kernels. |
I see, so we have a race condition but we don't expect it to cause problems in practice since the data is used much later during bprop. I see the benefit for inter-layer overlapping, but it feels delicate. Could we record an event on |
erhoo82
commented
May 1, 2023
Let me actually add a stream wait when using |
Signed-off-by: Sangkug Lym <slym@nvidia.com>
ksivaman
commented
May 2, 2023
/te-ci |
) * using different strems for pushsend and pushrecv Signed-off-by: Sangkug Lym <slym@nvidia.com> * fix stream dependency Signed-off-by: Sangkug Lym <slym@nvidia.com> * add wait from main_stream to memcpy stream Signed-off-by: Sangkug Lym <slym@nvidia.com> --------- Signed-off-by: Sangkug Lym <slym@nvidia.com> Co-authored-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
This fix uses separate streams that overlap these pooling kernels.
This can resolve potential deadlock involved with send/recv orders and also improves performance.