mirror of
https://github.com/vladmandic/automatic
synced 2026-09-07 21:40:46 +02:00
Add Torch GC threshold slider
This commit is contained in:
+1
-1
@@ -116,7 +116,7 @@ def torch_gc(force=False):
|
||||
if oom > previous_oom:
|
||||
previous_oom = oom
|
||||
log.warning(f'GPU out-of-memory error: {mem}')
|
||||
if used > 90:
|
||||
if used > shared.opts.torch_gc_threshold:
|
||||
log.info(f'GPU high memory utilization: {used}% {mem}')
|
||||
force = True
|
||||
if not force:
|
||||
|
||||
@@ -415,6 +415,7 @@ options_templates.update(options_section(('cuda', "Compute Settings"), {
|
||||
"cudnn_benchmark": OptionInfo(False, "Enable full-depth cuDNN benchmark feature"),
|
||||
"ipex_optimize": OptionInfo(True if devices.backend == "ipex" else False, "Enable IPEX Optimize for Intel GPUs"),
|
||||
"directml_memory_provider": OptionInfo(default_memory_provider, 'DirectML memory stats provider', gr.Radio, lambda: {"choices": memory_providers}),
|
||||
"torch_gc_threshold": OptionInfo(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, "Enable model compile"),
|
||||
"cuda_compile_backend": OptionInfo("openvino_fx" if cmd_opts.use_openvino else "none", "Model compile backend", gr.Radio, lambda: {"choices": ['none', 'inductor', 'cudagraphs', 'aot_ts_nvfuser', 'hidet', 'ipex', 'openvino_fx']}),
|
||||
|
||||
Reference in New Issue
Block a user