mirror of
https://github.com/modelscope/DiffSynth-Studio.git
synced 2026-03-19 06:48:12 +00:00
[feature]:Add adaptation of all models to zero3
This commit is contained in:
@@ -21,6 +21,7 @@ def gradient_checkpoint_forward(
|
||||
*args,
|
||||
**kwargs,
|
||||
use_reentrant=False,
|
||||
determinism_check="none"
|
||||
)
|
||||
elif use_gradient_checkpointing:
|
||||
model_output = torch.utils.checkpoint.checkpoint(
|
||||
@@ -28,6 +29,7 @@ def gradient_checkpoint_forward(
|
||||
*args,
|
||||
**kwargs,
|
||||
use_reentrant=False,
|
||||
determinism_check="none"
|
||||
)
|
||||
else:
|
||||
model_output = model(*args, **kwargs)
|
||||
|
||||
Reference in New Issue
Block a user