You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
We are teaching python in our HPC lecture in a master in Math at Pau university, France. We are using scalene with the students to profile code and get a feeling of interpreted code vs native code thanks to the nice line profiling provided by scalene. Once the hot spot found we teach them how to convert the piece of code to compiled C++ code using pythran. Redoing the profiling afterwards, execution time is smaller and we expect to see the routine exhibiting some native time. But we see nothing, scalene seems to be blind.
(hpc) mhaefele@slurm-ens1:~/hands-on_optimize$ scalene --off run.py
[2.96320573 2.0312119 ]
Solve time: 10.28561806678772 seconds
Scalene: Program did not run for long enough to profile.
Total execution time is very similar to the pure python execution, so I guess it is this one that is executed and not the compiled one
Scalene does not see anything
Weird also, when running scalene with python -m scalene does give a profile, the pure pyhton one (I guess, according to execution time):
Desktop (please complete the following information):
OS: Linux Debian 10 Buster
Browser Firefox
Version 1.5.31.1 (2023.09.15)
Additional remark
By the way, we have exactly the same behavior with a refactored version of mse_numpy.py in a cython version. However, the profiling is as expected for a numba version.
Thanks for your help
The text was updated successfully, but these errors were encountered:
Describe the bug
We are teaching python in our HPC lecture in a master in Math at Pau university, France. We are using scalene with the students to profile code and get a feeling of interpreted code vs native code thanks to the nice line profiling provided by scalene. Once the hot spot found we teach them how to convert the piece of code to compiled C++ code using pythran. Redoing the profiling afterwards, execution time is smaller and we expect to see the routine exhibiting some native time. But we see nothing, scalene seems to be blind.
To Reproduce
mse_numpy.py
run.py
Running the pure python version is fine:
Now running the pythran compiled version gives a smaller execution time:
However, running with scalene profiling:
Weird also, when running scalene with
python -m scalene
does give a profile, the pure pyhton one (I guess, according to execution time):Expected behavior
Execution using the compiled version with the right execution time + a pure native timing for the
py_descent
routineDesktop (please complete the following information):
Additional remark
By the way, we have exactly the same behavior with a refactored version of
mse_numpy.py
in a cython version. However, the profiling is as expected for a numba version.Thanks for your help
The text was updated successfully, but these errors were encountered: