[Feature] Over 99% communication overlap in Tensor Parallelism using Domino #286
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi nanotron team, this is the follow-up work of #285. This PR implements the cross layer communication computation overlapping, and it can achieve over 99% communication overlapping on single node. Using Domino, TP training on single node is almost communication "free".
Domino paper: https://arxiv.org/abs/2409.15241
Profiling results
Forward pass
Backward pass

Please note that the flag enabling Domino is hardcoded here. It needs to be configurable for ease of use, but I haven't done it yet. There might also be other considerations on your side. You can further improve the code quality based on this branch. Please let me know if you have any other questions.
Cc: @GuanhuaWang