From 06f71de989c6fc14058e514cbe62e61fdf44f7a4 Mon Sep 17 00:00:00 2001 From: Disty0 Date: Thu, 11 Jan 2024 01:16:06 +0300 Subject: [PATCH] Add NNCF to installer --- installer.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/installer.py b/installer.py index 29159a305..75e1f9607 100644 --- a/installer.py +++ b/installer.py @@ -457,6 +457,12 @@ def check_torch(): elif allow_openvino and args.use_openvino: log.info('Using OpenVINO') torch_command = os.environ.get('TORCH_COMMAND', 'torch==2.1.2 torchvision==0.16.2 --index-url https://download.pytorch.org/whl/cpu') + install(os.environ.get('OPENVINO_PACKAGE', 'openvino==2023.2.0'), 'openvino') + install('onnxruntime-openvino', 'onnxruntime-openvino', ignore=True) # TODO openvino: numpy version conflicts with tensorflow and doesn't support Python 3.11 + install('nncf==2.7.0', 'nncf') + os.environ.setdefault('PYTORCH_TRACING_MODE', 'TORCHFX') + os.environ.setdefault('NEOReadDebugKeys', '1') + os.environ.setdefault('ClDeviceGlobalMemSizeAvailablePercent', '100') else: machine = platform.machine() if sys.platform == 'darwin': @@ -523,13 +529,8 @@ def check_torch(): log.debug(f'Cannot install xformers package: {e}') if opts.get('cuda_compile_backend', '') == 'hidet': install('hidet', 'hidet') - if args.use_openvino or opts.get('cuda_compile_backend', '') == 'openvino_fx': - install(os.environ.get('OPENVINO_PACKAGE', 'openvino==2023.2.0'), 'openvino') + if opts.get('nncf_compress_weights', False): install('nncf==2.7.0', 'nncf') - install('onnxruntime-openvino', 'onnxruntime-openvino', ignore=True) # TODO openvino: numpy version conflicts with tensorflow and doesn't support Python 3.11 - os.environ.setdefault('PYTORCH_TRACING_MODE', 'TORCHFX') - os.environ.setdefault('NEOReadDebugKeys', '1') - os.environ.setdefault('ClDeviceGlobalMemSizeAvailablePercent', '100') if args.profile: print_profile(pr, 'Torch')