Skip to content

Conversation

patrickvonplaten
Copy link
Contributor

No description provided.

torch_device = "mps" if torch.backends.mps.is_available() else torch_device
is_torch_higher_equal_than_1_12 = version.parse(version.parse(torch.__version__).base_version) >= version.parse("1.12")

if is_torch_higher_equal_than_1_12:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

cc @pcuenca

We need to be careful when using features that are quite new in PyTorch. This would have broken PyTorch 1.11 here.
In the future we should run backwards compatible version tests starting from our oldest supported version. For now we need to be a bit careful when adding very new features to not break PyTorch 1.11

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I thought about asking when I first added the line but then forgot. Thanks for fixing it.

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Sep 8, 2022

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

@patrickvonplaten patrickvonplaten merged commit f8325cf into main Sep 8, 2022
@patrickvonplaten patrickvonplaten deleted the make_mps_backwards_comp branch September 8, 2022 14:44
PhaneeshB pushed a commit to nod-ai/diffusers that referenced this pull request Mar 1, 2023
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
* [MPS] Make sure it doesn't break torch < 1.12

* up
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