Skip to content

Conversation

patrickvonplaten
Copy link
Contributor

@patrickvonplaten patrickvonplaten commented Oct 3, 2022

Let's try to not force high PyTorch versions if we can avoid it.
Inference mode was only introduced in PyTorch 1.9. The safety checker is used in many different other libraries (mainly ComVis/stable-diffusion) and we don't want to force these libraries to use higher PyTorch versions.

cc @anton-l

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Oct 3, 2022

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

Copy link
Member

@pcuenca pcuenca left a comment

Choose a reason for hiding this comment

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

LGTM!

@anton-l
Copy link
Member

anton-l commented Oct 3, 2022

cc @NouamaneTazi

@pcuenca
Copy link
Member

pcuenca commented Oct 3, 2022

Comment: There are a few mentions of inference_mode in fp16.mdx. Let me know if we should remove them too.

I also have a question, do we have a policy to obsolete and upgrade dependencies? We currently seem to require PyTorch >= 1.4, I'm not sure about the features that got added in later versions and could inadvertently break that assumption. But more importantly, how do we decide that we no longer support an old version of any of the dependencies?

@NouamaneTazi
Copy link
Member

I'm okay with replacing it with torch.no_grad():

Copy link
Contributor

@patil-suraj patil-suraj left a comment

Choose a reason for hiding this comment

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

LGTM!

@patrickvonplaten
Copy link
Contributor Author

Ok for me to leave it in the docs (if we mention that one needs PyTorch >= 1.9). If torch.no_grad() gives equal speed then let's use this

@patrickvonplaten patrickvonplaten merged commit b35bac4 into main Oct 3, 2022
@patrickvonplaten patrickvonplaten deleted the replace_inference_mode_with_no_grad branch October 3, 2022 20:15
prathikr pushed a commit to prathikr/diffusers that referenced this pull request Oct 26, 2022
PhaneeshB pushed a commit to nod-ai/diffusers that referenced this pull request Mar 1, 2023
…ggingface#707)

At this point, all the utilities of SD web and CLI are exactly same.

Signed-Off-by: Gaurav Shukla <gaurav@nod-labs.com>

Signed-off-by: Gaurav Shukla <gaurav@nod-labs.com>
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
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.

6 participants