Skip to content
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

[inf] Add config var to enable keeping module on host #6846

Merged
merged 9 commits into from
Jan 15, 2025

Conversation

oelayan7
Copy link
Contributor

Using keep_module_on_host config var will let us control if the loaded checkpoints to model parameters will be moved to the device or stay on host

Using keep_module_on_host config var will let us control if the loaded
checkpoints to model parameters will be moved to the device or stay on
host
@@ -17,9 +17,11 @@
from deepspeed.module_inject.tp_shard import get_shard_size, get_shard_size_list


def move(tensor, device):
def move(tensor, device, keep_module_on_host=False):
Copy link
Contributor

Choose a reason for hiding this comment

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

Won't it be simpler to modify callers to pass device='cpu' when keep_module_on_host=True?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@oelayan7 oelayan7 requested a review from hwchen2017 as a code owner December 24, 2024 06:49
@oelayan7
Copy link
Contributor Author

@tjruwase Can you please rereview and retrigger the CI?

@oelayan7 oelayan7 requested a review from tjruwase January 7, 2025 13:51
@loadams loadams removed the request for review from awan-10 January 7, 2025 16:08
@loadams loadams enabled auto-merge January 15, 2025 19:15
@loadams loadams added this pull request to the merge queue Jan 15, 2025
Merged via the queue into deepspeedai:master with commit fae714d Jan 15, 2025
12 checks passed
@oelayan7 oelayan7 deleted the keep_module_on_host branch January 16, 2025 06:29
siqi654321 pushed a commit to siqi654321/DeepSpeed that referenced this pull request Feb 7, 2025
Using keep_module_on_host config var will let us control if the loaded
checkpoints to model parameters will be moved to the device or stay on
host

---------

Co-authored-by: Olatunji Ruwase <[email protected]>
Co-authored-by: Logan Adams <[email protected]>
Signed-off-by: siqi <[email protected]>
traincheck-team pushed a commit to traincheck-team/DeepSpeed that referenced this pull request Feb 9, 2025
Using keep_module_on_host config var will let us control if the loaded
checkpoints to model parameters will be moved to the device or stay on
host

---------

Co-authored-by: Olatunji Ruwase <[email protected]>
Co-authored-by: Logan Adams <[email protected]>
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.

3 participants