blocks_to_swap=0 means no swap

This commit is contained in:
Kohya S
2024-09-17 21:42:14 +09:00
parent 0cbe95bcc7
commit a2ad7e5644

View File

@@ -265,7 +265,7 @@ def train(args):
flux.requires_grad_(True)
is_swapping_blocks = args.double_blocks_to_swap is not None or args.single_blocks_to_swap is not None
is_swapping_blocks = args.double_blocks_to_swap or args.single_blocks_to_swap
if is_swapping_blocks:
# Swap blocks between CPU and GPU to reduce memory usage, in forward and backward passes.
# This idea is based on 2kpr's great work. Thank you!