add sharded data parallel all gather time estimation #15
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.
When using fsdp shard_grad_op and full_shard, model weights are unsharded through allgather before being used for execution. This PR adds the time estimation of the all gather. If the all gather time > layer compute time, all gather time cannot be fully overlapped with compute. The time estimation relies on intra node and inter node memory bandwidth efficiency, which depends on the size of the data to transfer. 0.8 is a good estimation for data size > 128MB. for small data size, set the efficiency to a lower number.