Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Change timestep device to cpu for xla #11501

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

bhavya01
Copy link

@bhavya01 bhavya01 commented May 5, 2025

What does this PR do?

Change the timestep device to 'cpu' if we're using an xla device. This is needed because the diffusion schedulers generally loop over the timestep variable and it is used to index into other tensors. When using XLA, it is important that the timestep tensor resides on the cpu to avoid expensive compile operations.

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?
  • Did you read our philosophy doc (important for complex PRs)?
  • Was this discussed/approved via a GitHub issue or the forum? Please add a link to it if that's the case. Not associate with a github issue
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings. Not needed
  • Did you write any new necessary tests? No new tests needed

Who can review?

@sayakpaul @yiyixuxu

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.

@sayakpaul sayakpaul requested a review from yiyixuxu May 6, 2025 02:59
@sayakpaul
Copy link
Member

Seems like a harmless change to me. Maybe we can propagate this to the other pipelines where it makes sense.

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

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