perf(multimodal): optimize SHM input transport#610
Conversation
Signed-off-by: yechank-nvidia <161688079+yechank-nvidia@users.noreply.github.com>
Signed-off-by: yechank-nvidia <161688079+yechank-nvidia@users.noreply.github.com>
Signed-off-by: yechank-nvidia <161688079+yechank-nvidia@users.noreply.github.com>
Signed-off-by: yechank-nvidia <161688079+yechank-nvidia@users.noreply.github.com>
Signed-off-by: yechank-nvidia <161688079+yechank-nvidia@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1d749e519b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for handle in handles: | ||
| handle.release() | ||
|
|
||
| torch.distributed.broadcast(base, src=src_rank, group=process_group) |
There was a problem hiding this comment.
Order TP broadcast with the model stream
When this large-SHM TP path runs under overlap scheduling, _move_pixel_features_to_device has switched to the H2D stream and that stream never waits for the current model stream before issuing this NCCL broadcast. Unlike the other work on this stream, this collective uses the same TP process group as model collectives, so if the current stream still has queued TP all-reduces from the overlapped forward, this broadcast can overtake them on some ranks and create a different collective order, hanging the communicator. Please run the broadcast on the model stream or add an explicit dependency on the current stream before entering the collective path.
Useful? React with 👍 / 👎.
Summary
Test Plan
pytest -q test/runtime/test_multimodal_encoder_dtype.py test/runtime/test_multimodal_shm_transport.py test/runtime/test_multimodal_tp_broadcast.pypre-commit run --all-files