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] Average Pbar Metrics #4534

Merged
merged 17 commits into from
Nov 12, 2020
Merged

Conversation

tchaton
Copy link
Contributor

@tchaton tchaton commented Nov 5, 2020

What does this PR do?

PB: loss from progress bar appears to be sum of loss across all GPUs in Lightning 1.0.3

The sync_dist being an in-place operation, it was reducing across gpu and then it was changing behaviour.

Solution: Clone the value if sync_dist.

TODO: Find a way to make the sync_dist only once.

Closes #4395

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • [x ] 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? Otherwise, we ask you to create a separate PR for every change.
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?
  • Did you verify new and existing tests pass locally with your changes?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

PR review

  • Is this pull request ready for review? (if not, please submit in draft mode)

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 🙃

@tchaton tchaton added logger Related to the Loggers priority: 1 Medium priority task labels Nov 5, 2020
@tchaton tchaton added this to the 1.0.x milestone Nov 5, 2020
@tchaton tchaton self-assigned this Nov 5, 2020
@pep8speaks
Copy link

pep8speaks commented Nov 5, 2020

Hello @tchaton! Thanks for updating this PR.

Line 206:45: E231 missing whitespace after ':'

Comment last updated at 2020-11-12 14:03:57 UTC

@edenlightning edenlightning modified the milestones: 1.0.x, 1.0.7 Nov 10, 2020
@Borda Borda modified the milestones: 1.0.7, 1.0.x Nov 11, 2020
@codecov
Copy link

codecov bot commented Nov 11, 2020

Codecov Report

Merging #4534 (7aa6a2e) into master (bd6c413) will increase coverage by 0%.
The diff coverage is 100%.

@@          Coverage Diff           @@
##           master   #4534   +/-   ##
======================================
  Coverage      93%     93%           
======================================
  Files         116     116           
  Lines        8879    8881    +2     
======================================
+ Hits         8261    8263    +2     
  Misses        618     618           

@tchaton tchaton changed the title [WIP] Average Pbar Metrics [FIX] Average Pbar Metrics Nov 11, 2020
@SeanNaren
Copy link
Contributor

Looks good! as mentioned I don't think its super priority to worry about a duplicate reduce call on a 1 item tensor, and for explicitness it's better to do it as a part of this func!

Copy link
Member

@SkafteNicki SkafteNicki left a comment

Choose a reason for hiding this comment

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

LGTM

@tchaton tchaton merged commit 4a01fd0 into master Nov 12, 2020
@tchaton tchaton deleted the bug_fix/4395_sum_of_loss_across_gpus branch November 12, 2020 15:59
Borda pushed a commit that referenced this pull request Nov 12, 2020
* wip

* update

* normalize loss

* update test

* resolve bug

* update test and add TODO

* make sure it can be sync

* add TODO

* update sol

(cherry picked from commit 4a01fd0)
Borda pushed a commit that referenced this pull request Nov 12, 2020
* wip

* update

* normalize loss

* update test

* resolve bug

* update test and add TODO

* make sure it can be sync

* add TODO

* update sol

(cherry picked from commit 4a01fd0)
Borda pushed a commit that referenced this pull request Nov 12, 2020
* wip

* update

* normalize loss

* update test

* resolve bug

* update test and add TODO

* make sure it can be sync

* add TODO

* update sol

(cherry picked from commit 4a01fd0)
rohitgr7 pushed a commit that referenced this pull request Nov 21, 2020
* wip

* update

* normalize loss

* update test

* resolve bug

* update test and add TODO

* make sure it can be sync

* add TODO

* update sol
@seannz
Copy link

seannz commented Jul 2, 2021

This fix seems to be broken in the latest master (commit 0e19d16) with the metrics summed across GPUs rather than averaged. Works correctly in 1.3.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
logger Related to the Loggers priority: 1 Medium priority task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

loss from progress bar appears to be sum of loss across all GPUs in Lightning 1.0.3
8 participants