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

Run plugin closure before on_before_optimizer_step [1/2] #9288

Merged
merged 13 commits into from Sep 7, 2021

Conversation

carmocca
Copy link
Member

@carmocca carmocca commented Sep 2, 2021

What does this PR do?

Fixes:

  • The lambda closure should run before on_before_optimizer_step
  • The lambda closure should also be run for manual optimization
  • The optimizer update needs to always run regardless of the skipped_backward value during manual optimization. This is because the closure is not required to return a value in that case.
  • Extend coverage of backward skipping for Apex and DeepSpeed.

Part 2: #9287

Does your PR introduce any breaking changes? If yes, please list them.

None

Before submitting

  • Was this discussed/approved via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or internal minor changes/refactorings)

PR review

  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

@carmocca carmocca added the bug Something isn't working label Sep 2, 2021
@carmocca carmocca added this to the v1.5 milestone Sep 2, 2021
@carmocca carmocca self-assigned this Sep 2, 2021
@carmocca carmocca modified the milestones: v1.5, v1.4.x Sep 3, 2021
@carmocca carmocca marked this pull request as ready for review September 3, 2021 01:51
@codecov
Copy link

codecov bot commented Sep 3, 2021

Codecov Report

Merging #9288 (2db195d) into master (98e2f56) will increase coverage by 0%.
The diff coverage is 100%.

@@          Coverage Diff           @@
##           master   #9288   +/-   ##
======================================
  Coverage      92%     92%           
======================================
  Files         178     178           
  Lines       14895   14899    +4     
======================================
+ Hits        13748   13752    +4     
  Misses       1147    1147           

@carmocca carmocca marked this pull request as draft September 3, 2021 15:29
@carmocca carmocca added the priority: 0 High priority task label Sep 6, 2021
@carmocca carmocca force-pushed the bugfix/plugin-closure-execution branch from 1149a74 to f078e29 Compare September 6, 2021 13:12
@carmocca carmocca force-pushed the bugfix/plugin-closure-execution branch from 22fb070 to 33ecf13 Compare September 6, 2021 15:32
@carmocca carmocca marked this pull request as ready for review September 6, 2021 15:33
Copy link
Contributor

@SeanNaren SeanNaren left a comment

Choose a reason for hiding this comment

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

Thanks @carmocca!

@mergify mergify bot added the ready PRs ready to be merged label Sep 7, 2021
tests/plugins/test_deepspeed_plugin.py Outdated Show resolved Hide resolved
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
@carmocca carmocca enabled auto-merge (squash) September 7, 2021 11:42
@carmocca carmocca merged commit 6892d53 into master Sep 7, 2021
@carmocca carmocca deleted the bugfix/plugin-closure-execution branch September 7, 2021 11:52
justusschock added a commit that referenced this pull request Sep 7, 2021
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: 0 High priority task ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants