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

[Bugfix] Fix location of unscale in mixed precision plugin #9606

Merged
merged 5 commits into from
Sep 27, 2021

Conversation

justusschock
Copy link
Member

@justusschock justusschock commented Sep 20, 2021

What does this PR do?

Fixes #9599, #9330, #9205, #9694

Unscale was called after gradnorm tracking and gradient clipping. Moving it to a different hook in the plugins should fix that.

Alternative solution would be to move gradient tracking and clipping. Finding a solution that works for all plugin combinations might be difficult though.

Probably same purpose as #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

Anyone in the community is welcome to review the PR.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:

  • 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

Did you have fun?

Make sure you had fun coding 🙃

Please don't merge before review from @carmocca

@justusschock justusschock self-assigned this Sep 20, 2021
@justusschock justusschock added the bug Something isn't working label Sep 20, 2021
@justusschock justusschock added this to the v1.4.x milestone Sep 20, 2021
@justusschock justusschock marked this pull request as draft September 20, 2021 13:51
@awaelchli awaelchli added the priority: 0 High priority task label Sep 22, 2021
@awaelchli
Copy link
Contributor

@justusschock I think this is ready for review now

@justusschock justusschock marked this pull request as ready for review September 23, 2021 11:19
@awaelchli awaelchli changed the title [Bugfix] Attempt fixing unscale position [Bugfix] Fix location of unscale in mixed precision plugin Sep 23, 2021
@codecov
Copy link

codecov bot commented Sep 24, 2021

Codecov Report

Merging #9606 (225d5f4) into release/1.4.x (25bfd06) will decrease coverage by 4%.
The diff coverage is 45%.

@@              Coverage Diff               @@
##           release/1.4.x   #9606    +/-   ##
==============================================
- Coverage             93%     88%    -4%     
==============================================
  Files                218     218            
  Lines              14513   14519     +6     
==============================================
- Hits               13425   12814   -611     
- Misses              1088    1705   +617     

@mergify mergify bot added the ready PRs ready to be merged label Sep 24, 2021
@awaelchli awaelchli force-pushed the bugfix/move_grad_tracking branch from 5a8d078 to 35d03b8 Compare September 24, 2021 16:16
@awaelchli awaelchli changed the base branch from master to release/1.4.x September 24, 2021 16:16
@awaelchli
Copy link
Contributor

As discussed with @carmocca I rebased this onto the 1.4.x bugfix branch as we desire a better, less hacky long-term solution for master #9287 . So this is considered a hotfix.

There were basically no merge conflicts, the changes stay the same.

Copy link
Contributor

@tchaton tchaton left a comment

Choose a reason for hiding this comment

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

LGTM !

tests/plugins/test_amp_plugins.py Outdated Show resolved Hide resolved
Co-authored-by: thomas chaton <thomas@grid.ai>
@lexierule lexierule merged commit a69b940 into release/1.4.x Sep 27, 2021
@lexierule lexierule deleted the bugfix/move_grad_tracking branch September 27, 2021 13:33
Copy link

@Hecim1984 Hecim1984 left a comment

Choose a reason for hiding this comment

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

Review all

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
8 participants