mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-09 14:45:19 +00:00
blocks_to_swap=0 means no swap
This commit is contained in:
@@ -265,7 +265,7 @@ def train(args):
|
|||||||
|
|
||||||
flux.requires_grad_(True)
|
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:
|
if is_swapping_blocks:
|
||||||
# Swap blocks between CPU and GPU to reduce memory usage, in forward and backward passes.
|
# 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!
|
# This idea is based on 2kpr's great work. Thank you!
|
||||||
|
|||||||
Reference in New Issue
Block a user