Dear LLVM, I am a young developer who have just uploaded my first opensource project based on LLVM. I would like to know what professionals think of my project. I have started a JIT extension to Python called Pymothoa ( http://code.google.com/p/pymothoa/). Unlike other similar projects, I did not modify the interpreter. Pymothoa uses Python decorators to mark function for JIT compiling. It uses the AST generated by Python; thereby, it uses the same syntax of Python but works like a low-level programming language (like C). The goal is to get speedup in compute-intensive code without writing C-extensions. If you are interested, there are two demo applications in the source tree: matrix-matrix multiplication and reduce-sum. I would appreciate any comment. Siu Kwan Lam -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120628/8b6c3bf1/attachment.html>
On 06/29/2012 01:06 AM, Siu Kwan Lam wrote:> Dear LLVM, > > I am a young developer who have just uploaded my first opensource > project based on LLVM. I would like to know what professionals think of > my project. > > I have started a JIT extension to Python called Pymothoa ( > http://code.google.com/p/pymothoa/). Unlike other similar projects, I > did not modify the interpreter. Pymothoa uses Python decorators to mark > function for JIT compiling. It uses the AST generated by Python; > thereby, it uses the same syntax of Python but works like a low-level > programming language (like C). The goal is to get speedup in > compute-intensive code without writing C-extensions. > > If you are interested, there are two demo applications in the source > tree: matrix-matrix multiplication and reduce-sum. I would appreciate > any comment. > > Siu Kwan LamHi Siu Kwan Lam, that looks very interesting! It is very nice to see how easy it is to install and how easy it is to add proper function annotations. Also, the generated source code seems to be a good start. It would be interesting to try it with Polly [1]. I believe that this could give great speedups for the naive matrix multiply implementation. Is there a way I can dump the content of the entire LLVM-IR module generated in the demo/matrixmul/matrixmul.py example? Cheers Tobi [1] http://polly.llvm.org
On 06/29/2012 02:47 AM, Tobias Grosser wrote:> On 06/29/2012 01:06 AM, Siu Kwan Lam wrote: >> Dear LLVM, >> >> I am a young developer who have just uploaded my first opensource >> project based on LLVM. I would like to know what professionals think of >> my project. >> >> I have started a JIT extension to Python called Pymothoa ( >> http://code.google.com/p/pymothoa/). Unlike other similar projects, I >> did not modify the interpreter. Pymothoa uses Python decorators to mark >> function for JIT compiling. It uses the AST generated by Python; >> thereby, it uses the same syntax of Python but works like a low-level >> programming language (like C). The goal is to get speedup in >> compute-intensive code without writing C-extensions. >> >> If you are interested, there are two demo applications in the source >> tree: matrix-matrix multiplication and reduce-sum. I would appreciate >> any comment. >> >> Siu Kwan Lam > > Hi Siu Kwan Lam, > > that looks very interesting! It is very nice to see how easy it is to > install and how easy it is to add proper function annotations. Also, > the generated source code seems to be a good start. It would be > interesting to try it with Polly [1]. I believe that this could give > great speedups for the naive matrix multiply implementation. > Is there a way I can dump the content of the entire LLVM-IR module > generated in the demo/matrixmul/matrixmul.py example? > > Cheers > Tobi > > [1] http://polly.llvm.org >Hi Tobi, Thank you for your feedback. I will be looking at Polly for better locality optimization. Can I simply include Polly as optimization passes? If so, the pymothoa/llvm_backend/default_passes.py can be easily edited to add new passes. I am still trying to figure out what to include for the optimization pass for the best result.> Is there a way I can dump the content of the entire LLVM-IR module > generated in the demo/matrixmul/matrixmul.py example?You can do so by printing the default_module: print default_module You may want to do so before optimizing with "default_module.optimize()" to see what my codegen is doing. I will be adding more documentation to the project wiki. Thanks, Siu Kwan Lam
This is awesome! The noninvasive approach that you took is really cool. I love the Python `ast` module because it allows things like this to happen! I really like the syntax that you chose for declaring variables and types within Python2's native syntax, too. If you ever port to Python3, you'll be able to use function annotations <http://www.python.org/dev/peps/pep-3107/> to make it even slicker. Also, for whatever it's worth, the code looks pretty "professional" to me. --Sean Silva On Thu, Jun 28, 2012 at 4:06 PM, Siu Kwan Lam <michael.lam.sk at gmail.com> wrote:> Dear LLVM, > > I am a young developer who have just uploaded my first opensource project > based on LLVM. I would like to know what professionals think of my project. > > I have started a JIT extension to Python called Pymothoa ( > http://code.google.com/p/pymothoa/). Unlike other similar projects, I did > not modify the interpreter. Pymothoa uses Python decorators to mark function > for JIT compiling. It uses the AST generated by Python; thereby, it uses the > same syntax of Python but works like a low-level programming language (like > C). The goal is to get speedup in compute-intensive code without writing > C-extensions. > > If you are interested, there are two demo applications in the source tree: > matrix-matrix multiplication and reduce-sum. I would appreciate any comment. > > Siu Kwan Lam > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >