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

[docs] add xpu device check #34684

Merged
merged 5 commits into from
Nov 13, 2024
Merged

[docs] add xpu device check #34684

merged 5 commits into from
Nov 13, 2024

Conversation

faaany
Copy link
Contributor

@faaany faaany commented Nov 11, 2024

What does this PR do?

There are many places in the task guides that only check the cuda device availability. This PR adds xpu besides cuda, but I am not sure whether my current change is the best one, because there are other ways to add xpu as, e.g.

  • add xpu in the inline-comment
  • use accelerate's get_backend API to get the underlying device

Just let me what is your favorite, @stevhliu Once agreed by you, I can submit further commits to replicate the change in other places.

Copy link
Member

@stevhliu stevhliu 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 the suggestion!

I think using get_backend may be the easiest option for users, and this will also include other devices such as mps.

@faaany
Copy link
Contributor Author

faaany commented Nov 12, 2024

Thanks for the suggestion!

I think using get_backend may be the easiest option for users, and this will also include other devices such as mps.

thanks! code update. Is this okay for you? Then I can change to other places as well.

Copy link
Member

@stevhliu stevhliu left a comment

Choose a reason for hiding this comment

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

Very nice, thank you! 👍

docs/source/en/tasks/semantic_segmentation.md Show resolved Hide resolved
@faaany
Copy link
Contributor Author

faaany commented Nov 13, 2024

Very nice, thank you! 👍

I only made one change: I removed GPU from the comment because GPU is a general term including CUDA, XPU, NPU. And I made the same change at other places as well. Pls have a review, thx a lot!

Copy link
Member

@stevhliu stevhliu left a comment

Choose a reason for hiding this comment

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

Fantastic, works for me!

@HuggingFaceDocBuilderDev

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.

@stevhliu stevhliu merged commit a3d69a8 into huggingface:main Nov 13, 2024
9 checks passed
2015aroras pushed a commit to 2015aroras/transformers that referenced this pull request Nov 14, 2024
* add XPU path

* use accelerate API

* Update docs/source/en/tasks/semantic_segmentation.md

Co-authored-by: Steven Liu <[email protected]>

* update more places with accelerate API

---------

Co-authored-by: Steven Liu <[email protected]>
2015aroras pushed a commit to 2015aroras/transformers that referenced this pull request Nov 15, 2024
* add XPU path

* use accelerate API

* Update docs/source/en/tasks/semantic_segmentation.md

Co-authored-by: Steven Liu <[email protected]>

* update more places with accelerate API

---------

Co-authored-by: Steven Liu <[email protected]>
BernardZach pushed a commit to BernardZach/transformers that referenced this pull request Dec 5, 2024
* add XPU path

* use accelerate API

* Update docs/source/en/tasks/semantic_segmentation.md

Co-authored-by: Steven Liu <[email protected]>

* update more places with accelerate API

---------

Co-authored-by: Steven Liu <[email protected]>
BernardZach pushed a commit to innovationcore/transformers that referenced this pull request Dec 6, 2024
* add XPU path

* use accelerate API

* Update docs/source/en/tasks/semantic_segmentation.md

Co-authored-by: Steven Liu <[email protected]>

* update more places with accelerate API

---------

Co-authored-by: Steven Liu <[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