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

Torch optimisers expect the step function to run the closure immediately if passed #91

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tomogwen
Copy link

@tomogwen tomogwen commented Feb 21, 2024

As per title. If the closure is not None, we should assume that the parameter's gradients have not been computed, and immediately run the closure. See, e.g., the step function in torch.optim.adamw as an example of this.

Without this, the library won't work out the box with PyTorch Lightning, and I imagine this is also the source of the problem for #90 with the HF transformers/accelerate libraries.

Copy link

stale bot commented Apr 22, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant