add two optimizations

--pin-shared-memory and --cuda-malloc

See also the updates in Readme for more details
This commit is contained in:
lllyasviel
2024-02-23 18:39:32 -08:00
committed by GitHub
parent 54c89503eb
commit 88f395091b
5 changed files with 114 additions and 6 deletions

View File

@@ -43,6 +43,10 @@ def initialize_forge():
os.environ['CUDA_VISIBLE_DEVICES'] = str(args_parser.args.gpu_device_id)
print("Set device to:", args_parser.args.gpu_device_id)
if args_parser.args.cuda_malloc:
from modules_forge.cuda_malloc import try_cuda_malloc
try_cuda_malloc()
import ldm_patched.modules.model_management as model_management
import torch