-
Notifications
You must be signed in to change notification settings - Fork 116
Add optional symjit generator. #530
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
Conversation
|
You state symjit >= 2.5.0 is required, so I guess, you added the 'high speed version'. |
I just made it the latest release. It may work with older versions. |
|
At the very bottom of this: siravan/symjit#3 |
|
Doesn't look like symjit 2.5 is available for Python 3.9 from conda forge. |
I don't think I will answer, so that you read the code here :) |
I read it for 30 min, but still not clear. :-(( |
This adds a new ODEFunctionGenerator that uses symjit as sympy->numeric code generator and compiler. symjit does not support iterable of iterables as function arguments and it can only output flat arrays, so a fair amount of input/output conversion is needed that slows down both the code generation and the numerical evaluation. Replacing symbols in the equations of motion does not seem to slow symjit's code generation which is clearly very fast but the numeric manipulation and type conversion does slow down the evaluation. If symjit can manage some things faster internally to manage similar inputs that lambdify accepts, then symjit may have equal evaluation speed to the Cython generation code and generate extremely faster.
Here is the benchmark run with 16 pendulum links, 100 integration steps, and 2 second duration.
This needs a bit more tidying and management of the optional dependency before merging.