[QUESTION] The Reason for calling torch.cuda.synchronize() in func recv_from_prev_pipeline_rank_/send_to_next_pipeline_rank #1149
Replies: 1 comment
-
|
Even if events (
That said, your observation is valid: if the event dependencies fully capture all producer/consumer relationships, then an explicit Without additional context from the maintainers, it's difficult to say whether the synchronization is:
If anyone from the Megatron team could share the original motivation (e.g., a particular bug or CUDA/NCCL issue that prompted this), that would help clarify whether the synchronization is still necessary or could potentially be replaced with finer-grained stream synchronization. If this answer helped or pointed you in the right direction, I'd appreciate it if you could mark it as the accepted answer so it's easier for others with the same issue to find. Also, if you found my contribution useful, I'd appreciate it if you could check out my GitHub profile, follow me, and star any repositories you find interesting. GitHub: https://github.com/Advait251206 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Why do we need to Call "torch.cuda.synchronize()" to synchronize all streams in /megatron/core/inference/communication_utils.py?
It describes as "To protect against race condition when using batch_isend_irecv()". But Event Record/ Event wait already inserted in communication/compute streams to ensure order. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions