devices.py - Update MPS FP16 check to account for upcoming MacOS Sonoma #3886
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.
float16 doesn't seem to work on MacOS Sonoma due to further changes with Metal. This'll default back to float32 for Sonoma users.
What type of PR is this? (check all applicable)
Have you discussed this change with the InvokeAI team?
Have you updated all relevant documentation?
Description
This enhances the FP16 check on Macs using MPS to also check the operating system version.
The upcoming MacOS Sonoma (14.0) has changed Metal again, which seems to break FP16 support.
Now, if the user is on Sonoma, we'll fall back to full precision.
Related Tickets & Documents
QA Instructions, Screenshots, Recordings
Don't think anything needs to be done here; uses two stdlib packages to determine macos version.
Added/updated tests?
[optional] Are there any post deployment tasks we need to perform?
Nope!