Unexpected behavior of @jit and @boost
Recently I tested transonic with this simple code:
transonic_test.py
import numpy as np
from transonic import jit,boost
#transonic def norming(float[])
@boost
def norming(np_array):
norm_array = np.linalg.norm(np_array, axis=1)
return norm_array
I use this command to compile it ahead-of-time:
transonic transonic_test.py -af "-march=native -DUSE_XSIMD -Ofast"
which ran successfully. However, when I execute the following program
transonic_test_main.py
from transonic_test import *
from timeit import default_timer as timer
start_1 = timer()
for i in range(1000):
in_arr = np.random.rand(10000, 3)
norm_arr = norming(in_arr)
end_1 = timer()
print("time spent are {}".format(end_1 - start_1))
with python, the output shows:
DEBUG Using rich for tracking progress.
WARNING Pythran file does not seem to be up-to-date:
<module '__pythran__.transonic_test_4f3187f787722cc89a00775cc0002503' from '/Users/jw598/Desktop/high_entropy_
alloy/__pythran__/transonic_test_4f3187f787722cc89a00775cc0002503.cpython-37m-darwin.so'>
func: norming
time spent are 0.3765912619999999
with the timing almost the same as pure python. This problem is identical to the one reported here:
https://stackoverflow.com/questions/64857530/transonic-run-python-code-instead-of-pythran
My system configuration is:
OS: MacOS Catalina 10.15.7
gcc: 10.2.0
python: 3.7.7
pythran: 0.9.8.post2
transonic: 0.4.7.post0
Thanks a lot!
Jingyang Wang
Edited by Jingyang Wang