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

[feat ] OSS : optional closure argument for the optimizer #86

Merged
merged 4 commits into from
Sep 15, 2020

Conversation

blefaudeux
Copy link
Contributor

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos, doc improvements)
  • Did you read the contributor guideline?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?

What does this PR do?

Fixes #81. In short the closure keyword is optional for pytorch optimizer's, but OSS made it mandatory. nVidia's LARC does not support the closure keyword, so we broke down on them. This PR fixes it by checking once at runtime whether this optimizer supports the closure keyword.

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 14, 2020
loss = self.optim.step(closure=closure, **kwargs) # type: ignore
# Run the optimizer step on this shard only:
if self._pass_closure:
loss = self.optim.step(closure=closure, **kwargs) # type: ignore

This comment was marked as outdated.

@blefaudeux blefaudeux changed the title [feat ] OSS : optional closure [feat ] OSS : optional closure argument for the optimizer Sep 14, 2020
@blefaudeux blefaudeux merged commit 3d7f524 into master Sep 15, 2020
@blefaudeux blefaudeux deleted the oss_optional_closure branch September 16, 2020 17:17
myleott pushed a commit that referenced this pull request Feb 22, 2021
- this way, it is slightly easier to run all tests by

python -m pytest tests/nn/data_parallel/test_fsdp*
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 Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] OSS: Support nvidia's LARC
3 participants