From 9dcc76af023526cc602f2906b5cf600e91fa416d Mon Sep 17 00:00:00 2001 From: Disty0 Date: Sat, 23 Dec 2023 16:42:24 +0300 Subject: [PATCH] OpenVINO reduce System RAM usage --- CHANGELOG.md | 1 + modules/intel/openvino/__init__.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdac8d8e4..f5a2485a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,7 @@ - compatibility improvements - **OpenVINO**, thanks @disty0 - **8 bit support for CPUs** + - Reduce System RAM usage when compiling - add *Directory for OpenVINO cache* option to *System Paths* - remove Intel ARC specific 1024x1024 workaround - **HDR controls** diff --git a/modules/intel/openvino/__init__.py b/modules/intel/openvino/__init__.py index d9650ed20..40e989df2 100644 --- a/modules/intel/openvino/__init__.py +++ b/modules/intel/openvino/__init__.py @@ -397,6 +397,8 @@ def openvino_fx(subgraph, example_inputs): if inputs_reversed: example_inputs.reverse() model = make_fx(subgraph)(*example_inputs) + # Deleting unused subgraphs doesn't do anything, so we cast it down to fp8 + subgraph = subgraph.to(dtype=torch.float8_e4m3fn) for node in model.graph.nodes: if node.target == torch.ops.aten.mul_.Tensor: node.target = torch.ops.aten.mul.Tensor