FileNotFoundError when using jit
Hi, I'm getting a FileNotFoundError when trying to jit a function in my Jupyter notebook. This is on an M2 Macbook Air on macOS 12.5. The noarch version on conda-forge is on 0.4.7, so I installed 0.5.0 with pip.
import numpy as np
from transonic import jit
from transonic.util import print_versions
def somefunc(a, b):
return a[:, np.newaxis] * b
print_versions()
somefunc_jit = jit(backend="pythran")(somefunc)
Transonic 0.5.0
Pythran 0.11.0
Numba not importable
Cython not importable
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
File /opt/homebrew/Caskroom/mambaforge/base/envs/firthlogist/lib/python3.10/site-packages/transonic/justintime.py:147, in ModuleJIT.get_source(self)
146 try:
--> 147 mod = sys.modules[self.module_name]
148 except KeyError:
KeyError: '3113780246'
During handling of the above exception, another exception occurred:
FileNotFoundError Traceback (most recent call last)
Input In [15], in <cell line: 9>()
3 from transonic.util import print_versions
5 # def br(X, rootW):
6 # z = rootW[:, np.newaxis] * X
7 # return z
9 @jit
---> 10 def somefunc(a, b):
11 return a[:, np.newaxis] * b
13 print_versions()
File /opt/homebrew/Caskroom/mambaforge/base/envs/firthlogist/lib/python3.10/site-packages/transonic/justintime.py:188, in jit(func, backend, native, xsimd, openmp)
184 """Decorator to record that the function has to be jit compiled
185
186 """
187 frame = get_frame(1)
--> 188 decor = JIT(frame, backend=backend, native=native, xsimd=xsimd, openmp=openmp)
189 if callable(func):
190 return decor(func)
File /opt/homebrew/Caskroom/mambaforge/base/envs/firthlogist/lib/python3.10/site-packages/transonic/justintime.py:203, in JIT.__init__(self, frame, backend, native, xsimd, openmp)
199 def __init__(
200 self, frame, backend: str, native=False, xsimd=False, openmp=False
201 ):
--> 203 self.mod = _get_module_jit(backend, frame=frame)
205 self.backend = self.mod.backend
206 self.native = native
File /opt/homebrew/Caskroom/mambaforge/base/envs/firthlogist/lib/python3.10/site-packages/transonic/justintime.py:180, in _get_module_jit(backend_name, depth_frame, frame)
178 return modules[module_name]
179 else:
--> 180 return ModuleJIT(backend_name=backend_name, frame=frame)
File /opt/homebrew/Caskroom/mambaforge/base/envs/firthlogist/lib/python3.10/site-packages/transonic/justintime.py:117, in ModuleJIT.__init__(self, backend_name, frame)
108 self.used_functions = {}
109 self.jit_functions = {}
111 (
112 jitted_dicts,
113 codes_dependance,
114 codes_dependance_classes,
115 code_ext,
116 special,
--> 117 ) = analysis_jit(self.get_source(), self.filename, backend_name)
119 self.info_analysis = {
120 "jitted_dicts": jitted_dicts,
121 "codes_dependance": codes_dependance,
122 "codes_dependance_classes": codes_dependance_classes,
123 "special": special,
124 }
126 self.backend = backend = backends[backend_name]
File /opt/homebrew/Caskroom/mambaforge/base/envs/firthlogist/lib/python3.10/site-packages/transonic/justintime.py:149, in ModuleJIT.get_source(self)
147 mod = sys.modules[self.module_name]
148 except KeyError:
--> 149 with open(self.filename) as file:
150 return file.read()
151 else:
FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/31/h99fpx813jz___z01ln52hw80000gn/T/ipykernel_82978/3113780246.py'