Skip to content

Fix all-reduce memory usage #2151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 17, 2023
Merged

Fix all-reduce memory usage #2151

merged 2 commits into from
Dec 17, 2023

Conversation

WoosukKwon
Copy link
Collaborator

@WoosukKwon WoosukKwon commented Dec 17, 2023

Fixes #2150

Related issue: https://discuss.pytorch.org/t/cuda-allocation-lifetime-for-inputs-to-distributed-all-reduce/191573

  • Before:
Screenshot 2023-12-16 at 11 38 15 PM
  • After:
Screenshot 2023-12-16 at 11 40 51 PM

The peak memory usage was reduced from 25.5 GiB to 19.5 GiB for Llama-70B with TP=8.

@WoosukKwon WoosukKwon changed the title Fix all reduce memory usage Fix all-reduce memory usage Dec 17, 2023
Copy link
Member

@zhuohan123 zhuohan123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

torch.distributed.all_reduce does not free memory
3 participants