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

Fix implementation of float64 in torch_utils #16058

Closed
wants to merge 2 commits into from

Conversation

viking1304
Copy link
Contributor

Description

Implementation of float64 in torch_utils added in #15815 does not work as intended.

I was getting errors while testing PLMS, DDIM, DDIM CFG++ on my M3 Pro Mac.

TypeError: Cannot convert a MPS Tensor to float64 dtype as the MPS framework doesn't support float64. Please use float32 instead.

This is fixed implementation of float64, which now works as it was intended.

Screenshots/videos:

Checklist:

@viking1304 viking1304 changed the base branch from master to dev June 20, 2024 21:46
@viking1304 viking1304 mentioned this pull request Jun 20, 2024
4 tasks
modules/torch_utils.py Outdated Show resolved Hide resolved
@viking1304
Copy link
Contributor Author

@w-e-w should I close this PR in favor of #16088?

@w-e-w
Copy link
Collaborator

w-e-w commented Jun 25, 2024

TBH, I am not sure

one part of me thinks the new PR is totally reasonable providing 3.9 is nice

but another part of me thinks that we should drop 3.9 compatibility

  • we said on the readme we wrote python 3.10
  • Google Collab also has upgraded 3.10+
  • beginner users should just use the distribution package or use any of those third party installers
  • some extension uses match case syntax
  • also some and forcing anyone that is 3.9 to upgrade might reduce some version 3.9 completely issues so 3.9 compatibility like this in the future
    not only that I kind of hope that we could "officially" move to 3.11 for the improvements
    love the PEP 657: Fine-grained error location in traceback, that would make reading bug report much easier

I believe some devs are already using 3.11 > > I believe torch support is still not ready in 3.12

TLDR, as I am not the one making the decisions I don't need to use my brain to
I'll just leave the PR open and AUTO decide

@viking1304
Copy link
Contributor Author

I didn't notice any problem with 3.11 on Mac, but I still use 3.10 for my main installation and when I am testing code before submitting PRs. I also managed to use 3.12 with just a few minor tweaks and issues.

@w-e-w
Copy link
Collaborator

w-e-w commented Jun 25, 2024

https://github.com/pytorch/pytorch/releases/tag/v2.3.0

PyTorch support for Python 3.12 in general is considered experimental. Please use Python version between 3.8 and 3.11 instead. This is an existing issue since PyTorch 2.2.

@AUTOMATIC1111
Copy link
Owner

Already merged the other one.

@viking1304 viking1304 deleted the fix-torch-utils branch July 6, 2024 17:53
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