Merge branch 'comfyanonymous:master' into feature/custom_nodes-envvar

This commit is contained in:
Sas van Gulik 2025-11-12 18:27:05 +01:00 committed by GitHub
commit 64f07fa534
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1107,6 +1107,9 @@ def pin_memory(tensor):
if MAX_PINNED_MEMORY <= 0:
return False
if type(tensor) is not torch.nn.parameter.Parameter:
return False
if not is_device_cpu(tensor.device):
return False
@ -1116,6 +1119,9 @@ def pin_memory(tensor):
#on the GPU async. So dont trust the CUDA API and guard here
return False
if not tensor.is_contiguous():
return False
size = tensor.numel() * tensor.element_size()
if (TOTAL_PINNED_MEMORY + size) > MAX_PINNED_MEMORY:
return False