Profiler slows down my code #6174
Unanswered
azouaoui-cv
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 2 comments 2 replies
-
UPDATEUpdating to the latest stable PL release (v.1.2.0) did not solve it:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @inzouzouwetrust, are you running on GPU? If so can you try either on CPU or launch the script with |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello fellow PL users :)
PL version used:
1.0.5
I'm experiencing some weird slowness when training basic CV models that seem to be related to the profiler.
I'm using the
simple
profiler by default in myTrainer
.I first noticed that the
optimizer_step
was taking a large amount of time which should not be the case. See simple profiler output below for a single epoch on cifar10:I then investigated further using the
advanced
profile to pinpoint the function call that was slow and found out that{method 'enable' of '_lsprof.Profiler' objects}
was the culprit inoptimizer_step
. See the output below:By further investigating, I was able to see that
{method 'enable' of '_lsprof.Profiler' objects}
is only set toenable
inmodel_forward
andoptimizer_step
. For some reason it is much faster inmodel_forward
. See below:I looked up on Google what could be the issue but so far I've only identified that
nested
profilers are a bad practice but I do not even know if this is what happening here.Questions:
Any help would be greatly appreciated.
Have a nice day!
Alex
Beta Was this translation helpful? Give feedback.
All reactions