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

Profiling #269

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

Profiling #269

wants to merge 2 commits into from

Conversation

jhaux
Copy link
Collaborator

@jhaux jhaux commented Jun 22, 2020

Introducing: The Pytorch Profiling hook! Saves a trace, that can be interactively viewed via the chrome://tracing tool. Take a look at the attached pictures.

Still on the todo list:

  • Add warning that traces get huge fast! Solution: `--num_steps 20``
  • Add example interpretation (?)

Image 1: Some 15 training steps. Note the validation steps every 2^n steps.
zoom_0
Image 2: Zoom to about one step. Left: Forward pass, middle: gradient calculation, right: gradient application.
zoom_1
Image 3: Some Conv - Batch-Norm - ReLU layers
zoom_2

jhaux and others added 2 commits March 2, 2020 10:35
Outputs chrome tracing profiles, which are beautifully readable
@jhaux jhaux requested a review from pesser June 22, 2020 23:47
Copy link
Owner

@pesser pesser left a comment

Choose a reason for hiding this comment

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

Nice, I love it! I was always wondering if there is such a functionality which can be integrated. I guess you just need to reformat and fix the typo if you feel like doing so ;)

class PyProfilingHook(Hook):
'''Allows to profile your pytorch code!

Best of all: It allows you to create chrome traces, which can be view
Copy link
Owner

Choose a reason for hiding this comment

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

view -> viewed

Copy link
Owner

Choose a reason for hiding this comment

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

btw. your docstring is great and allows one to get going immediately, but if you have a link to an exhaustive documentation of the profiler you could add it, too!

@theRealSuperMario
Copy link
Collaborator

This needs to be documented, otherwise it is just another awesome feature which nobody will ever know about and we will kick it out again after some time.

Besides that, I love it!

@theRealSuperMario
Copy link
Collaborator

black formatting is missing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants