This commit is contained in:
chinesewebman 2026-07-19 00:49:19 -07:00 committed by GitHub
commit 71fe9b134d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -319,7 +319,10 @@ def cast_bias_weight(s, input=None, dtype=None, device=None, bias_dtype=None, of
prefetched = hasattr(s, "_prefetch")
offload_stream = None
offload_device = None
if not prefetched:
# comfy_aimdo is only registered for CUDA / ROCm backends. On MPS (and
# CPU) we have to skip the vbar fast path and fall back to the plain
# cast in resolve_cast_module_with_vbar below.
if not prefetched and device.type not in ("cpu", "mps"):
offload_stream = cast_modules_with_vbar([s], dtype, device, bias_dtype, non_blocking)
comfy.model_management.sync_stream(device, offload_stream)