Skip to content

deprecate function get_default_device in tools/base.py#26774

Merged
amyeroberts merged 3 commits intohuggingface:mainfrom
ji-huazhong:agent
Oct 31, 2023
Merged

deprecate function get_default_device in tools/base.py#26774
amyeroberts merged 3 commits intohuggingface:mainfrom
ji-huazhong:agent

Conversation

@ji-huazhong
Copy link
Contributor

@ji-huazhong ji-huazhong commented Oct 13, 2023

What does this PR do?

As per title.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

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.

@ji-huazhong ji-huazhong changed the title get default device through PartialState().default_device as is has get default device through PartialState().default_device as is has been officially released Oct 13, 2023
Copy link
Contributor

@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.

Thanks! @ArthurZucker should this be on a deprecation cycle for the function name? Otherwise looks great to me

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Yes! As @muellerzr mentions, I think we should leave it for now, with a deprecation warning mention that we'll remove it soon and that the accelerate version should be used!

@ji-huazhong ji-huazhong changed the title get default device through PartialState().default_device as is has been officially released deprecate function get_default_device in tools/base.py Oct 24, 2023
Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

LGTM with the proposed changes!

Co-authored-by: Zach Mueller <muellerzr@gmail.com>
@ji-huazhong
Copy link
Contributor Author

ji-huazhong commented Oct 25, 2023

this PR is ready to be merged :) @muellerzr @ArthurZucker

@ji-huazhong
Copy link
Contributor Author

cc @amyeroberts

Copy link
Contributor

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

Thanks for adding!

@amyeroberts amyeroberts merged commit df6f36a into huggingface:main Oct 31, 2023
@ji-huazhong ji-huazhong deleted the agent branch October 31, 2023 15:15
EduardoPach pushed a commit to EduardoPach/transformers that referenced this pull request Nov 19, 2023
…ce#26774)

* get default device through `PartialState().default_device` as is has
been officially released

* apply code review suggestion

* apply code review suggestion

Co-authored-by: Zach Mueller <muellerzr@gmail.com>

---------

Co-authored-by: Zach Mueller <muellerzr@gmail.com>
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.

5 participants