-
-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Numba caching and source generation #1419
Comments
I'm thinking of the following approach:
Some of the questions in the implementation that we have are:
|
Here's a high-level pseudocode outline of what we need: https://gist.github.com/brandonwillard/b9262d0eccb0e7016f836447ba8870fc.
Yes, we need to investigate whether or not we can directly use the pickled modules produced by
The outline uses a not-so-good
Per the outline, we can use an in-memory, file-backed cache like |
Once we have completed #1470, I think we can then try to refactor some nodes like Numba with partial funcs
import numba
from functools import partial
import numpy as np
import time
def some_func(arr, other_one):
t = 0.0
for a in arr:
t+=a
return t + other_one
arr = np.random.rand(1_000_000)
a = time.time()
f = numba.njit(some_func, cache=True)
f2 = partial(f, other_one=100)
tmp = f2(arr)
b = time.time()
print("Time 1:", b - a, tmp)
a = time.time()
f = numba.njit(some_func, cache=True)
f2 = partial(f, other_one=0)
tmp = f2(arr)
b = time.time()
print("Time 2:", b - a, tmp) |
Are we sure that using Also, we can make the tests work using the same approach we have been using. That Numba disable-JIT approach would be a nicer, but it shouldn't be blocking anything. |
Looks like this wasn't given its own issue, but we need to improve the caching and way we generate source for Numba JITing.
To clarify, we need to do the following:
_numba_funcify
based on theirnode
arguments (i.e. theApply
nodes).aesara.config.compiledir
We can repurpose the compile directory code for the C backend to do most of this, but, if there are other packages that would simplify the entirely process, we should look into those, too.
The text was updated successfully, but these errors were encountered: