mirror of
https://github.com/SWivid/F5-TTS.git
synced 2026-07-28 13:26:59 -07:00
Merge pull request #859 from ZhikangNiu/main
fix #858 and pass use_reentrant explicitly in checkpoint_activation mode
This commit is contained in:
@@ -219,7 +219,9 @@ class DiT(nn.Module):
|
||||
|
||||
for block in self.transformer_blocks:
|
||||
if self.checkpoint_activations:
|
||||
x = torch.utils.checkpoint.checkpoint(self.ckpt_wrapper(block), x, t, mask, rope)
|
||||
# if you have question, please check: https://pytorch.org/docs/stable/checkpoint.html#torch.utils.checkpoint.checkpoint
|
||||
# After PyTorch 2.4, we must pass the use_reentrant explicitly
|
||||
x = torch.utils.checkpoint.checkpoint(self.ckpt_wrapper(block), x, t, mask, rope, use_reentrant=False)
|
||||
else:
|
||||
x = block(x, t, mask=mask, rope=rope)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user