add dynamo options

This commit is contained in:
Vladimir Mandic
2023-04-30 09:31:38 -04:00
parent 14055afb9b
commit 917ecad43c
4 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -178,7 +178,8 @@ class StableDiffusionModelHijack:
if opts.cuda_compile and opts.cuda_compile_mode != 'none':
try:
import torch._dynamo as dynamo # pylint: disable=unused-import
torch._dynamo.config.verbose = True # pylint: disable=protected-access
torch._dynamo.config.verbose = opts.cuda_compile_verbose # pylint: disable=protected-access
torch._dynamo.config.suppress_errors = opts.cuda_compile_errors # pylint: disable=protected-access
torch.backends.cudnn.benchmark = True
m.model = torch.compile(m.model, mode="default", backend=opts.cuda_compile_mode, fullgraph=False, dynamic=False)
print("Model compile enabled:", opts.cuda_compile_mode)
+2
View File
@@ -325,6 +325,8 @@ options_templates.update(options_section(('cuda', "CUDA Settings"), {
"cuda_allow_tf16_reduced": OptionInfo(True, "Allow TF16 reduced precision math ops"),
"cuda_compile": OptionInfo(False, "Enable model compile (experimental)"),
"cuda_compile_mode": OptionInfo("none", "Model compile mode (experimental)", gr.Radio, lambda: {"choices": ['none', 'inductor', 'cudagraphs', 'aot_ts_nvfuser']}),
"cuda_compile_verbose": OptionInfo(True, "Compile verbose mode"),
"cuda_compile_errors": OptionInfo(True, "Compile suppress errors"),
}))
options_templates.update(options_section(('upscaling', "Upscaling"), {
+1 -1
Submodule wiki updated: 6cd8fde165...4cbdffaa95