From 180f8c9c93d8e03f053602058acef8a1caee3538 Mon Sep 17 00:00:00 2001 From: Disty0 Date: Wed, 27 Sep 2023 20:09:59 +0300 Subject: [PATCH 1/2] Update OpenVINO --- README.md | 6 +++--- installer.py | 2 +- modules/intel/openvino/__init__.py | 20 ++++++++++++++++++++ 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bc1f07692..5926a6470 100644 --- a/README.md +++ b/README.md @@ -69,10 +69,10 @@ Additional models will be added as they become available and there is public int - *nVidia* GPUs using **CUDA** libraries on both *Windows and Linux* - *AMD* GPUs using **ROCm** libraries on *Linux*. Support will be extended to *Windows* once AMD releases ROCm for Windows -- Any GPU compatibile with *DirectX* on *Windows* using **DirectML** libraries. - This includes support for AMD GPUs that are not supported by native ROCm libraries - *Intel Arc* GPUs using **OneAPI** with *IPEX XPU* libraries on both *Windows and Linux* -- *Intel* GPUs using **OpenVINO** libraries on both *Windows and Linux* +- Any GPU compatible with *DirectX* on *Windows* using **DirectML** libraries. + This includes support for AMD GPUs that are not supported by native ROCm libraries +- Any GPU compatible with **OpenVINO** libraries on both *Windows and Linux* - *Apple M1/M2* on *OSX* using built-in support in Torch with **MPS** optimizations ## Install & Run diff --git a/installer.py b/installer.py index 9a322b677..d7350654f 100644 --- a/installer.py +++ b/installer.py @@ -430,7 +430,7 @@ def check_torch(): elif allow_openvino and args.use_openvino: #Remove this after 2.1.0 releases log.info('Using OpenVINO') - torch_command = os.environ.get('TORCH_COMMAND', '--pre torch==2.1.0.dev20230726+cpu torchvision==0.16.0.dev20230726+cpu -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html') + torch_command = os.environ.get('TORCH_COMMAND', '--pre torch==2.1.0.dev20230820+cpu torchvision==0.16.0.dev20230820+cpu -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html') else: machine = platform.machine() if sys.platform == 'darwin': diff --git a/modules/intel/openvino/__init__.py b/modules/intel/openvino/__init__.py index 460062a7b..30ac588d4 100644 --- a/modules/intel/openvino/__init__.py +++ b/modules/intel/openvino/__init__.py @@ -1,4 +1,5 @@ import os +import sys import torch from openvino.frontend import FrontEndManager from openvino.frontend.pytorch.fx_decoder import TorchFXPythonDecoder @@ -13,6 +14,25 @@ from hashlib import sha256 import functools from modules import shared, devices +def BUILD_MAP_UNPACK(self, inst): + items = self.popn(inst.argval) + # ensure everything is a dict + items = [BuiltinVariable(dict).call_function(self, [x], {}) for x in items] # noqa: F821 + result = dict() + for x in items: + assert isinstance(x, ConstDictVariable) # noqa: F821 + result.update(x.items) + self.push( + ConstDictVariable( # noqa: F821 + result, + dict, + mutable_local=MutableLocal(), # noqa: F821 + **VariableTracker.propagate(items), # noqa: F821 + ) + ) +tmp_torch = sys.modules["torch"] +tmp_torch.BUILD_MAP_UNPACK_WITH_CALL = BUILD_MAP_UNPACK + compiled_cache = {} max_openvino_partitions = 0 partitioned_modules = {} From 49d181b8a3a24a73400c4f78afe8f1b922bf7b80 Mon Sep 17 00:00:00 2001 From: Disty0 Date: Thu, 28 Sep 2023 00:26:53 +0300 Subject: [PATCH 2/2] Remove OpenVINO device warning --- extensions-builtin/sd-dynamic-thresholding | 1 + modules/intel/openvino/__init__.py | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) create mode 160000 extensions-builtin/sd-dynamic-thresholding diff --git a/extensions-builtin/sd-dynamic-thresholding b/extensions-builtin/sd-dynamic-thresholding new file mode 160000 index 000000000..55ca687fb --- /dev/null +++ b/extensions-builtin/sd-dynamic-thresholding @@ -0,0 +1 @@ +Subproject commit 55ca687fb8f23044666414b7478fd52a8ec85a55 diff --git a/modules/intel/openvino/__init__.py b/modules/intel/openvino/__init__.py index 30ac588d4..698c162be 100644 --- a/modules/intel/openvino/__init__.py +++ b/modules/intel/openvino/__init__.py @@ -85,10 +85,6 @@ def get_device(): shared.log.warning("OpenVINO: No compatible GPU detected!") os.environ.setdefault('OPENVINO_TORCH_BACKEND_DEVICE', device) shared.log.debug(f"OpenVINO Device: {device}") - if shared.opts.cuda_compile_errors and device not in core.available_devices: - shared.log.error(f"OpenVINO: Specified device {device} is not in the list of OpenVINO Available Devices") - assert device in core.available_devices, f"OpenVINO: Specified device {device} is not in the list of OpenVINO Available Devices" - return device def cache_root_path():