Side effect of jit_set_profiling_*(False) at import time?
See original GitHub issueI just spent 2 days wondering why my code got way slower and finally narrowed it down to a side effect of this line:
import speechbrain
How ironic! 😃
It looks like, when imported, it runs the following two lines that seem to have a huge impact on the speed of the rest of my (otherwise speechbrain-free) PyTorch code:
I found this related issue on pytorch repo: https://github.com/pytorch/pytorch/issues/38342
Any up-to-date details of why those two lines are needed?
Additional information about my setup:
import torch
torch.__version__
# 1.8.1+cu102
speechbrain.__version__
# 0.5.10
Issue Analytics
- State:
- Created 2 years ago
- Comments:11
Top Results From Across the Web
Discussion: Minimising code execution at import time / the ...
The import side-effects / order requirements alone mean that I've been unable to recommend the use of the JPype import system for anything...
Read more >Say “no” to import side‐effects in Python
In Python, side-effects are simply not acceptable at all. One should instead put the code with the side-effect in a function and call...
Read more >Say “no” to import side‐effects in Python
Sometimes it's a choice between "do something at import time" or "deal ... That doesn't have side-effects outside the module being imported, so...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
oh no, not jit again. Yeah, we did this due to a regression observed in between pytorch version with Jit based code. @mravanelli should we try to see if higher version of Pytorch are now free of this previously observed regression ? Then we could maybe remove these lines …
Anyway, feel free to rename/close this issue as it somehow diverged from what I thought it was about…