We are preparing to update the default value of the use_reentrant parameter in torch.utils.checkpoint from True to False. To prevent these changes from silently affecting users, we are implementing the change in the following stages.
Timeline:
-
2.1 (current state) - If use_reentrant is not explicitly passed, a warning is raised (if the flag is not passed, it still defaults to True)
-
2.2 - Behavior unchanged
-
2.3 - If use_reentrant is not explicitly passed, an exception will now be raised
-
2.4 - Remove the requirement to explicitly pass use_reentrant and set the default value to False.
On the main branch after #115868 lands and in the 2.3 release, you’ll need to explicitly specify either use_reentrant=True or use_reentrant=False when using torch.utils.checkpoint.checkpoint.
To keep the current behavior, you should use use_reentrant=True. However, we recommend using use_reentrant=False. You can refer to the documentation for a more detailed comparison between these two options.