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

[Bug] Use torch.no_grad() in the QNG-SPSA algorithm #25

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

inafergra
Copy link
Collaborator

We were accidentally tracking the gradients when calculating the QFI matrix and updating the model's parameters in the QNG-SPSA algorithm, which slows down the calculations and uses up a lot of memory

@inafergra inafergra self-assigned this Oct 14, 2024
@jpmoutinho
Copy link
Collaborator

Thanks @inafergra, is this ready for review?

@inafergra
Copy link
Collaborator Author

Thanks @inafergra, is this ready for review?

Yes! Forgot to change from draft

@inafergra inafergra marked this pull request as ready for review October 14, 2024 14:16
Copy link
Collaborator

@jpmoutinho jpmoutinho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well LGTM, not much to say :) I assume you ran some benchmark to check this does indeed fix the issue.

@inafergra inafergra merged commit 9f8fcc6 into main Oct 14, 2024
7 checks passed
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.

2 participants