I looked at the PRs yesterday, there are some overlap in the basic functions. However, I have a longer road map about the JIT compilation. Let me briefly list out it, so you all may think about if it is worthy or suitable to put it in SymPy.
For the JIT compilation, it should provide the class or function interfaces that wrap the details of llvmlite, the following functions are included:
1. Compile a single SymPy expression, a number is returned as the result
2. Compile a list of SymPy expresions, an array is returned as the result (batch compile)
3. Compile a single SymPy expression, a array is returned when an array is passed into the compiled function (vectorization)
- This is very useful since the over head of the function call can be reduced when you want to do many times evaluation against the compiled expressison
Advanced features:
4. The extension from 3, provide Cartisian product of parameters like the Cartisian product in SQL
expr = x*y
f = jit_compile([x,y], expr)
f([2,3], [4,5,6]) # return [2*4, 2*5, 2*6, 3*4, 3*5, 3*6]
5. The extension from 4, vector symbol can be used instead of symbol of double number
- This can be used in design algorithms which involve in a double loop between two list of vectors
Even longer road map:
6. The compiled IR can be send to a remote server and the evaluation can be performed on the server.
All the above has been implemented in my another project SymJava in the experimental branch dist-snc. Actually, SymJava is motivated by SymPy, so I believe is easy to implement the proposed features in SymPy.