-
Notifications
You must be signed in to change notification settings - Fork 17
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
Numba integration #362
Comments
I agree, this would be awesome. In principle the code we generate with sympy uses numpy, and thus should be compatible in most typical cases. I would propose to add a numba argument to either fit itself, or |
I'd argue passing it to Model makes more sense. There's more ways of calling a model besides Fit. model_dict = {...}
model = Model(model_dict, numba=True) # Default, use default numba.jit arguments we decide on
model = Model(model_dict, numba={}) # Use default numba.jit default arguments
model = Model(model_dict, numba=False) # Don't jit at all
model = Model(model_dict, numba={'fastmath': False}) # Provide jit arguments explicitely. And note that anything we sympify should be jitted: not just the model itself, but also the jacobian |
Good point, fair enough! Model does make more sense indeed. |
If numba is installed, we should
@jit(nopython=True, fastmath=True)
compile the model when we lambdify them. This should of course be optional. If numba is not installed everything should work out of the box, and if it is installed everything should work faster. In addition, there should be a flag/option somewhere to never jit the models, just in case there's issues. Finally, the arguments to the jit function should be user-providable.The text was updated successfully, but these errors were encountered: