InvokeAI/invokeai/backend/util
psychedelicious c7562dd6c0
fix(backend): mps should not use non_blocking
We can get black outputs when moving tensors from CPU to MPS. It appears MPS to CPU is fine. See:
- https://github.com/pytorch/pytorch/issues/107455
- https://discuss.pytorch.org/t/should-we-set-non-blocking-to-true/38234/28

Changes:
- Add properties for each device on `TorchDevice` as a convenience.
- Add `get_non_blocking` static method on `TorchDevice`. This utility takes a torch device and returns the flag to be used for non_blocking when moving a tensor to the device provided.
- Update model patching and caching APIs to use this new utility.

Fixes: #6545
2024-06-27 19:15:23 +10:00
..
__init__.py [util] Add generic torch device class (#6174) 2024-04-15 13:12:49 +00:00
attention.py chore: ruff 2024-03-01 10:42:33 +11:00
catch_sigint.py Re-enable app shutdown actions (#6244) 2024-04-19 06:45:42 -04:00
db_maintenance.py Use defaults for db_dir and outdir since config no longer writes defaults to invokeai.yaml 2024-03-28 22:39:48 -04:00
devices.py fix(backend): mps should not use non_blocking 2024-06-27 19:15:23 +10:00
hotfixes.py Fix ruff? 2024-02-01 20:40:28 -05:00
logging.py partially address --root CLI argument handling 2024-03-19 09:24:28 +11:00
mask.py Add utility to_standard_float_mask(...) to convert various mask formats to a standardized format. 2024-04-09 08:12:12 -04:00
mps_fixes.py add note about discriminated union and Body() issue; blackified 2023-11-12 16:50:05 -05:00
silence_warnings.py Tidy SilenceWarnings context manager: 2024-06-18 15:06:22 -04:00
test_utils.py tidy(mm): remove convenience methods from high level model manager service 2024-03-07 10:56:59 +11:00
util.py Tidy SilenceWarnings context manager: 2024-06-18 15:06:22 -04:00