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 handling of params without gradients in closure-based optimizers #56

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

Conversation

ORippler
Copy link

@ORippler ORippler commented Jan 14, 2025

Closes #55 by initializing history state for parameters only the first time they receive gradients for closure-based optimizers. MWE posted in #55 will no longer error on this branch.


Unrelated design open: How should parameters be treated that have gradients first enabled, then disabled for some time, then reenabled? Should we reset history for them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Closure-based versions of Optimizers don't handle Parameters with requires_grad=False well
2 participants