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

Allow custom device placements for different objects #716

Merged
merged 4 commits into from
Sep 23, 2022

Conversation

sgugger
Copy link
Collaborator

@sgugger sgugger commented Sep 23, 2022

This PR lets the user customize whether device_placement should be True or False for the different objects passed along to prepare. This feature was requested in #624

Fixes #624

Copy link
Collaborator

@muellerzr muellerzr left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks for this. One suggestion on the docstring for clarity but otherwise awesome!

src/accelerate/accelerator.py Outdated Show resolved Hide resolved
@sgugger sgugger force-pushed the custom_device_placement branch from 7001191 to 4ece3e5 Compare September 23, 2022 14:33
sgugger and others added 3 commits September 23, 2022 10:34
Co-authored-by: Zachary Mueller <muellerzr@gmail.com>
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Sep 23, 2022

The documentation is not available anymore as the PR was closed or merged.

Copy link
Contributor

@pacman100 pacman100 left a comment

Choose a reason for hiding this comment

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

Thank you, LGTM! 🤗

@sgugger sgugger merged commit b67b760 into main Sep 23, 2022
@sgugger sgugger deleted the custom_device_placement branch September 23, 2022 15:31
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.

Let device_placement parameter can be overridden for different type object
4 participants