IPEX decrease Torch GC Threshold to 80

This commit is contained in:
Disty0
2023-11-21 16:47:35 +03:00
parent 1793c2e116
commit bd141bbfeb
3 changed files with 3 additions and 2 deletions
+1
View File
@@ -2,6 +2,7 @@ import torch
import networks
from modules import patches, shared
class LoraPatches:
def __init__(self):
self.active = False
+1 -1
View File
@@ -134,7 +134,7 @@ def torch_gc(force=False):
if oom > previous_oom:
previous_oom = oom
log.warning(f'GPU out-of-memory error: {mem}')
if used > shared.opts.torch_gc_threshold:
if used >= shared.opts.torch_gc_threshold:
log.info(f'GPU high memory utilization: {used}% {mem}')
force = True
if not force:
+1 -1
View File
@@ -300,7 +300,7 @@ options_templates.update(options_section(('cuda', "Compute Settings"), {
"other_sep": OptionInfo("<h2>Execution precision</h2>", "", gr.HTML),
"opt_channelslast": OptionInfo(False, "Use channels last as torch memory format "),
"cudnn_benchmark": OptionInfo(False, "Enable full-depth cuDNN benchmark feature"),
"torch_gc_threshold": OptionInfo(90, "VRAM usage threshold before running Torch GC to clear up VRAM", gr.Slider, {"minimum": 0, "maximum": 100, "step": 1}),
"torch_gc_threshold": OptionInfo(80 if devices.backend == "ipex" else 90, "VRAM usage threshold before running Torch GC to clear up VRAM", gr.Slider, {"minimum": 0, "maximum": 100, "step": 1}),
"cuda_compile_sep": OptionInfo("<h2>Model Compile</h2>", "", gr.HTML),
"cuda_compile": OptionInfo(True if cmd_opts.use_openvino else False, "Compile UNet"),