Error Profiling Code with Numba's njit decorator in Spyder
See original GitHub issueHi,
I’d like to profile my code - including the function below - using Spyder’s profiling tool on a Windows machine (equipped with Python 3.8).
@njit(cache = True)
def quadratic_form(vec, mat):
return np.dot(vec, mat @ vec)
However, when profiling the code I get the following output and error
from numba import njit from numba.core import config import llvmlite.binding as ll from .dylib import * from llvmlite.binding import ffi raise OSError(“Could not load shared object file: {}”.format(_lib_name)) OSError: Could not load shared object file: llvmlite.dll
I realised that with Version 0.49.0 Andreas Sodeur fixed a bug relating to cProfile and Numba JIT compiled functions in #4476.
Thanks for your help.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Troubleshooting and tips — Numba 0.50.1 documentation
In order to debug code, it is possible to disable JIT compilation, which makes the jit decorator (and the njit decorator) act as...
Read more >Python: How to profile code written with numba.njit() decorators
So my question would be this: What's the best way to profile code in which most functions have the njit() decorator, with a...
Read more >Profiling with a decorator and @njit - Numba Discussion
A problem arises when one function using @njit calls another with both @njit and @t. I think this is the key: An njit...
Read more >Performance Tips - Numba documentation - Read the Docs
A reasonably effective approach to achieving high performance code is to profile the code running with real data and use that to guide...
Read more >1.7.2.1 Basic code profiling | GEOG 489 - E-education.psu.edu
We will again use the Spyder IDE and our basic raster code from earlier in the ... you will receive an error that...
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 Free
Top 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
@hannahbus OK, thank you for reporting back. I am out of ideas here as to what to do so I can only guess from this point onwards. The error basically means, that the Python interpreter can not find the
llvmlite.dll
library so it is unlikely that #4476 will help in this case. My wild guess is that either the Windows equivalent ofLD_LIBRARY_PATH
(the environment variable that governs where libraries are found on Linux) is somehow incorrect in the case of profiling or that thepython
executable used by Spyder when profiling is different.My suggestions for next steps are:
python
executable is used by Spyder during profiling.cProfile
, to ensure that this is indeed a Spyder issue and doesn’t happen during ‘regular’ Profiling.Good luck and let us know how it goes!
Closing this issue as there’s no further information to reproduce and it’s been marked stale twice.