Get flux working with MPS on torch 2.4.1, with GGUF support #7113
+14
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
builds on top of my last pull request, #7063, to get a subset of Flux working with Torch 2.4.1. so new installs can use it. With these change, fp16 Flux will work and GGUF quantised Flux will work.
bitandbytes quantised models will still not work.
Related Issues / Discussions
#7060
https://discord.com/channels/1020123559063990373/1294664228757569587
QA Instructions
It will need testing against none MacOS setups. Has been tested locally on MacOS using Flux Q8 and Q5.1 models
and is all wrapped in "if mps then" code so it shouldn't have broke anything.
Merge Plan
It's pretty straight forward to merge. Note I ran ruff against the directors these files are in but it made changes
to other code and other files so I'm assuming ruff doesn't run against these. I have copied my code from the ruff formatted file to use in the repo.