Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix grad_checkpoint feature for torch2.5.x #2389

Closed
wants to merge 1 commit into from

Conversation

Yux1angJi
Copy link

@Yux1angJi Yux1angJi commented Jan 2, 2025

In PyTorch version 2.5.x, passing kwargs alongside use_reentrant=True in torch.utils.checkpoint results in an error. To address this, it needs to explicitly set use_reentrant=False to avoid runtime issues.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@rwightman
Copy link
Collaborator

rwightman commented Jan 6, 2025

@Yux1angJi thanks for the PR, I had a todo to sort this out library wide and I just added that now #2394 . I wrapped the torch checkpoint to default the use_reentrant to False and allow an override if needed.

@rwightman rwightman closed this Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants