OpenVINO Quantization support with NNCF

This commit is contained in:
Disty0
2024-01-25 20:22:57 +03:00
parent d1bb51eee0
commit db6fd95351
4 changed files with 78 additions and 44 deletions
+2 -2
View File
@@ -463,7 +463,7 @@ def check_torch():
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.3.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')
install('nncf==2.8.0', 'nncf')
os.environ.setdefault('PYTORCH_TRACING_MODE', 'TORCHFX')
os.environ.setdefault('NEOReadDebugKeys', '1')
os.environ.setdefault('ClDeviceGlobalMemSizeAvailablePercent', '100')
@@ -533,7 +533,7 @@ def check_torch():
log.debug(f'Cannot install xformers package: {e}')
if opts.get('cuda_compile_backend', '') == 'hidet':
install('hidet', 'hidet')
if opts.get('nncf_compress_weights', False):
if opts.get('nncf_compress_weights', False) and not args.use_openvino:
install('nncf==2.7.0', 'nncf')
if args.profile:
print_profile(pr, 'Torch')