-
Notifications
You must be signed in to change notification settings - Fork 6k
Follow up for Group Offload to Disk #11760
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
base: main
Are you sure you want to change the base?
Conversation
btw @sayakpaul This line
Uses the memory address of the group object to create the filename, but that can change across sessions. So you could have the offload directory growing quite substantially if running an inference script multiple times. Might need to come up with another way to name the files so that new ones aren't created across sessions. |
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean as water. Thanks a lot.
Looking into the memory address thing.
@torch.compiler.disable() | ||
def onload_(self): | ||
r"""Onloads the group of modules to the onload_device.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for it to et out? 👁️
|
||
@torch.compiler.disable() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we don't need it as it's being called from offload_()
which is already decorated with it.
What does this PR do?
Since we now have multiple offload options available in group offload (standard, low_cpu_mem_usage, offload_to_disk), it would make sense to create separate utility functions for them and try to reuse common patterns e.g. try to use
cpu_param_dict
and the pinned_memory context manager with streams.This PR is just to organize the module a bit so that it's a bit easier to add further functionality, e.g. #11758 without having a lot of conditional paths.
Fixes # (issue)
Before submitting
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.