On Thu, Mar 3, 2016 at 10:57 AM, Tanu Hari Dixit <[email protected]> wrote: > Thank you, Jason, for the reply. > > I went through the notes put up on the wiki and the optimizations that are > required through code generation. I also looked through the pull request > #10486. > I had a few questions regarding what needs to be done. I'll be glad if you > answer them. > > 1) exp2 is used in pyne because probably radioactive decay analysis requires > a lot of exponentiation. Why would a general code generator generate code > with exp2 (unless the user specifies it or we need to calculate powers of 2 > or we have guessed somehow that the exponentiation is a large one)?
The idea is to have an optimization pipeline, with smart defaults, but which can be customized by the user. For exp2, the code generator should be able to have enough information to look at the expression and make a smart guess if rewriting an expression using exp2 will be faster. > > 2)Do we need to make a specialized polynomial evaluator in C/other languages > that uses horner? Will we be processing polynomials as strings initially? I > found a few references for this---- > > i) http://www.cs.berkeley.edu/~fateman/papers/polyval.pdf > ii) http://cgpe.gforge.inria.fr/index.php?page=home > iii) https://hal.archives-ouvertes.fr/ensl-00531721/document > > Am I in the right direction? I was thinking more along the lines of calling horner() on an expression or subexpression. > > 3)I looked at this: https://github.com/SkidanovAlex/interpreter and I tried > to understand the fast-matrix exponentiation algorithm. I want to try to > implement this. Please provide me with a starting point. In other words, I > want to know about a few examples where implementing this would be worthy so > that I know where the code should be added. My symcc branch has the necessary operators for that algorithm, so I suppose it could be implemented there (say, some function that takes in a CodeBlock and returns an optimized CodeBlock). As to where to put it, that isn't clear yet. I haven't worked out exactly what the optimization pipeline will look like in the codebase yet. > > 4)I tried to look into the code of some of the sources (Stuff outside of > SymPy) available in the notes on the wiki. I found that pycodeexport uses > Mako as the templating engine and PyNE uses jinja2. You mentioned that Aaron > might be exploring different ideas (other than templating). What are those? The alternative to templating is generating AST expressions (see my symcc branch). > > 5)Aaron has added the newly built Assignment and aug_assign and removed > datatype and variables > (https://github.com/asmeurer/sympy/commit/bd0a5e788fa423f1ebf0ef91455e719a4b65803e) > What is the alternative to datatype and variables? I removed those because I haven't thought about them enough to determine if that's the best way to implement them. If you have any thoughts on it feel free to open an issue for discussion. (by the way, I think I just need to push a few more tests to my symcc branch and then it can be reviewed and merged) Aaron Meurer > > Thank you, > Tanu Hari Dixit. > > On Wednesday, March 2, 2016 at 11:55:21 AM UTC+5:30, Tanu Hari Dixit wrote: >> >> Hello all, >> >> I am a GSoC aspirant and I want to work on the Code Generation module as a >> project this year. >> >> I had a few questions in mind and needed help regarding them. >> >> 1) It is mentioned on the ideas page that the codegen module needs an >> overhaul. What kind of an overhaul would that be? Is the change needed in >> the API or friendly functions: codegen and make_routine? >> >> 2) I read this discussion and construed that we need to make efforts to >> include CSE in the codegen module and we are aiming at making an optimizing >> compiler. >> This optimizing compiler should be domain unspecific and work for most >> general cases. Bjorn Dahlgren suggested that we should be using a templating >> engine. Is this the work that is needed to be done in this project? >> >> 3) I read this blog post by Jason K. Moore where he talked about compiler >> optimizations like loop unrolling. Is this project is about finding balance >> between what the code generator should do and what the compiler should do? >> This blog post is a year old. Has this already been implemented? >> >> 4) What is the magnitude and nature of work that is incorporated in this >> idea? Is there some ongoing work that I should be aware of? >> >> 5) Please suggest some reading sources, so that I am able to take this up. >> >> Thank you, >> Tanu Hari Dixit. > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/sympy. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/ac891a0e-4a37-4bdc-bc51-79a8beacf9df%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6JHK1GfyierJUiaHyj4VPNP62_GwYad6SKswZy2MH6xXg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
