-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
LLVM compilation #548
LLVM compilation #548
Conversation
Just please make it optional (so you can use mathics without llvmlite - because of pypy - it probably will only slowdown) |
@TiberiumPy, yes the dependency on LLVM is optional. I think even PyPy can be optimised with this (although The example above is still faster on PyPy (after warming up the JIT): In[46]:= data = RandomReal[1, 10000];
In[47]:= Map[f, data]; // Timing
Out[47]= {1.31894, Null}
In[48]:= Map[cf, data]; // Timing
Out[48]= {0.940861, Null} |
62c000f
to
86a12da
Compare
I've got some experimental plotting working (pushed to my Compile
Current
|
What about adding packed array support? It would be very useful throughout Mathics. It could be implemented using either numpy's array or directly using SIMD llvm compiling. It should of course be completely transparent to the user and as transparent as possible to functions. Maybe automatic conversion could be done during idle time between evaluations. |
16c21be
to
fb79ede
Compare
Packed arrays would be a useful addition from a performance perspective. As you mentioned the important (and difficult) thing is to make it transparent to the user. I'm not sure llvm is a good candidate for this but numpy might be. |
LLVM should handle SIMD optimizations for packed arrays beautifully: http://llvm.org/devmtg/2014-02/slides/golin-AutoVectorizationLLVM.pdf. Numpy will always have a disadvantage since it only packages certain operations, but cannot optimize the individual problem on an instruction level. I'm really excited about this LLVM introduction into Mathics. |
Some really interesting stuff on calling back into python from within llvm: http://eli.thegreenplace.net/2015/calling-back-into-python-from-llvmlite-jited-code/. I've got a basic |
23f843e
to
cc11fed
Compare
I am wondering if compiling to LLVM is better than using the resulting SymPy nodes and then use SymPy code generation to get some C++ and compile and import that to Python e.g. with |
I've rebased on master to fix conflicts in setup.py. I've fixed the |
Allows compiling simple expressions with
llvmlite
.At the moment nothing else is aware of
CompiledFunction
so the performance benefits are marginal (most of the time is spent looking for patterns) but this has the potential to speedup plotting significantly.Requires a minor bugfix to llvmlite: numba/llvmlite#205.