mirror of
https://github.com/vladmandic/automatic
synced 2026-09-02 02:50:47 +02:00
IPEX decrease Torch GC Threshold to 80
This commit is contained in:
@@ -2,6 +2,7 @@ import torch
|
||||
import networks
|
||||
from modules import patches, shared
|
||||
|
||||
|
||||
class LoraPatches:
|
||||
def __init__(self):
|
||||
self.active = False
|
||||
|
||||
+1
-1
@@ -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
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user