InvokeAI/tests
Lincoln Stein e93f4d632d
[util] Add generic torch device class (#6174)
* introduce new abstraction layer for GPU devices

* add unit test for device abstraction

* fix ruff

* convert TorchDeviceSelect into a stateless class

* move logic to select context-specific execution device into context API

* add mock hardware environments to pytest

* remove dangling mocker fixture

* fix unit test for running on non-CUDA systems

* remove unimplemented get_execution_device() call

* remove autocast precision

* Multiple changes:

1. Remove TorchDeviceSelect.get_execution_device(), as well as calls to
   context.models.get_execution_device().
2. Rename TorchDeviceSelect to TorchDevice
3. Added back the legacy public API defined in `invocation_api`, including
   choose_precision().
4. Added a config file migration script to accommodate removal of precision=autocast.

* add deprecation warnings to choose_torch_device() and choose_precision()

* fix test crash

* remove app_config argument from choose_torch_device() and choose_torch_dtype()

---------

Co-authored-by: Lincoln Stein <lstein@gmail.com>
2024-04-15 13:12:49 +00:00
..
app tests: update model rename test 2024-04-04 07:17:38 +11:00
backend [util] Add generic torch device class (#6174) 2024-04-15 13:12:49 +00:00
fixtures test: clean up & fix tests 2024-03-01 10:42:33 +11:00
inpainting Rename default schedulers across the app 2023-05-12 03:44:20 +12:00
test_model_manager prevent vae: '' from crashing model 2023-08-10 17:33:04 -04:00
test_model_probe/vae add concept of repo variant 2024-03-01 10:42:33 +11:00
__init__.py parent 9eed1919c2 2023-02-24 18:57:02 -08:00
conftest.py fix tests 2024-03-06 21:57:41 -05:00
dev_prompts.txt Added linux to the workflows (#463) 2022-09-16 17:46:57 -04:00
legacy_tests.sh Add back old dream.py as legacy_api.py 2022-10-12 20:35:56 -04:00
test_config.py fix(config): handle windows paths in invokeai.yaml migration for legacy_conf_dir 2024-04-02 08:06:59 -04:00
test_docs.py tidy(config): move config docstring builder to its script 2024-03-19 09:24:28 +11:00
test_graph_execution_state.py tests: add test for iterate execution order 2024-03-26 09:18:46 +11:00
test_invocation_cache_memory.py tests: add invocation cache tests 2024-03-06 08:14:12 -05:00
test_item_storage_memory.py chore(item-storage): improve types 2024-02-03 07:34:06 -05:00
test_model_hash.py feat(mm): rename "blake3" to "blake3_multi" 2024-03-22 08:26:36 +11:00
test_model_probe.py tests: add test_probe_handles_state_dict_with_integer_keys 2024-03-27 09:30:25 +11:00
test_model_search.py tidy(mm): ModelSearch cleanup 2024-03-10 12:09:47 +11:00
test_node_graph.py tidy(nodes): remove commented tests 2024-03-01 10:42:33 +11:00
test_nodes.py test: clean up & fix tests 2024-03-01 10:42:33 +11:00
test_object_serializer_disk.py feat(nodes): use TemporaryDirectory to handle ephemeral storage in ObjectSerializerDisk 2024-03-01 10:42:33 +11:00
test_path.py chore: ruff 2024-03-01 10:42:33 +11:00
test_profiler.py feat: add profiler util (#5601) 2024-01-31 10:51:57 +00:00
test_session_queue.py tidy(nodes): remove commented tests 2024-03-01 10:42:33 +11:00
test_sqlite_migrator.py feat(db): back up database before running migrations 2024-04-02 09:10:53 +11:00
validate_pr_prompt.txt fixes to env parsing, textual inversion & help text 2023-05-18 10:48:23 -04:00