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

Profiler summary #1259

Merged
merged 8 commits into from
Mar 31, 2020
Merged

Profiler summary #1259

merged 8 commits into from
Mar 31, 2020

Conversation

Borda
Copy link
Member

@Borda Borda commented Mar 27, 2020

What does this PR do?

Reaction to #1253. in particular:

  • moves profilers do debugging package
  • created abstraction over Profiler writing streams and add summary methods returning a string

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 🙃

@Borda Borda added the feature Is an improvement or enhancement label Mar 27, 2020
@Borda Borda requested a review from jeremyjordan March 27, 2020 11:36
@pep8speaks
Copy link

pep8speaks commented Mar 27, 2020

Hello @Borda! Thanks for updating this PR.

Line 116:111: E501 line too long (116 > 110 characters)

Comment last updated at 2020-03-31 11:39:34 UTC

@Borda
Copy link
Member Author

Borda commented Mar 27, 2020

@jeremyjordan mind have a look at it before finalizing?

@jeremyjordan
Copy link
Contributor

i don't understand the package rename. we went from logging/ to loggers/ but now we're changing profiler/ to profiling/? it seems like an unnecessary change.

i like the abstraction over writing the summary more flexibly, however if you're going to rename describe to summary, then you'll want to update the training loop teardown method to call summary instead.

@Borda
Copy link
Member Author

Borda commented Mar 28, 2020

i don't understand the package rename. we went from logging/ to loggers/ but now we're changing profiler/ to profiling/? it seems like an unnecessary change.

The case with with logging was that there was collision with native python logging package and it was not clear which was imposed as root __init__ imported both
In parallel to loggers here we also have multiple profilers so plural make more sense, right?

i like the abstraction over writing the summary more flexibly, however if you're going to rename describe to summary, then you'll want to update the training loop teardown method to call summary instead.

It is not renaming at all as it may appear from diff, just adding extra function to generate the string text and so there is no no change for user at all (except before you write it file or console, no always write console and optional file)

@jeremyjordan
Copy link
Contributor

It is not renaming at all as it may appear from diff, just adding extra function to generate the string text

ahh i see the describe method is just in the base class now and it calls the abstract method summary. makes sense, i like this refactor.

however, i'd say that we should keep the module where it's currently located in pytorch_lightning/profiler/. changing the location doesn't seem to give us much benefit but then we're left with adding more deprecation warnings and asking users to change their code. as a user it might be frustrating to have to change your import from pytorch_lightning.profiler to pytorch_lightning.profilers

@williamFalcon
Copy link
Contributor

I agree with @jeremyjordan we need to stop making unnecessary changes to package names @Borda

@Borda Borda marked this pull request as ready for review March 28, 2020 15:58
@mergify
Copy link
Contributor

mergify bot commented Mar 29, 2020

This pull request is now in conflict... :(

@codecov
Copy link

codecov bot commented Mar 30, 2020

Codecov Report

Merging #1259 into master will decrease coverage by 0%.
The diff coverage is 92%.

@@          Coverage Diff           @@
##           master   #1259   +/-   ##
======================================
- Coverage      92%     92%   -0%     
======================================
  Files          62      62           
  Lines        3181    3210   +29     
======================================
+ Hits         2924    2949   +25     
- Misses        257     261    +4     

@mergify
Copy link
Contributor

mergify bot commented Mar 30, 2020

This pull request is now in conflict... :(

@mergify
Copy link
Contributor

mergify bot commented Mar 30, 2020

This pull request is now in conflict... :(

@mergify mergify bot requested a review from a team March 30, 2020 22:33
@Borda Borda requested review from jeremyjordan, justusschock and a team March 31, 2020 11:55
@Borda Borda added this to the 0.7.2 milestone Mar 31, 2020
@Borda Borda added the ready PRs ready to be merged label Mar 31, 2020
@Borda Borda requested a review from a team March 31, 2020 12:50
@williamFalcon williamFalcon merged commit 6ddb039 into master Mar 31, 2020
@Borda Borda deleted the profiler branch March 31, 2020 13:06
@jeremyjordan
Copy link
Contributor

@Borda mind submitting a follow-up PR which makes log.info write stream optional for the AdvancedProfiler?

@Borda
Copy link
Member Author

Borda commented Mar 31, 2020

I changed it as it was so it is file or info... Or you want to remove info for any case?

@jeremyjordan
Copy link
Contributor

jeremyjordan commented Mar 31, 2020

ah i missed that last round of commits, thanks! this looks great.

alexeykarnachev pushed a commit to alexeykarnachev/pytorch-lightning that referenced this pull request Apr 3, 2020
* refactor and add types

* add Prorfiler summary

* fix imports

* Revert "refactor and add types"

This reverts commit b4c552f

* changelog

* revert rename

* fix test

* mute verbose
@Borda Borda modified the milestones: v0.7., v0.7.x Apr 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is an improvement or enhancement ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants