Live data from Hacker News

PyPy 1.6 Released - Full Python 2.7.1 Implementation

morepypy.blogspot.com

31–40 of 57 posts

Re: PyPy 1.6 Released - Full Python 2.7.1 Implementation

#31
post #28

Earlier quoted context omitted.

LLVM? I don't have much experience with runtime code generation but you might find it useful.

LLVM would seem to (maybe? possibly!?) be a good solution, but I was never able to convincingly determine if it was likely to solve my problems, and the documentation seemed to be quite sparse for doing what I wanted to do. (This was a couple years ago, however, and I've love to be proven wrong.)

Instead of generating C code you might be able to generate LLVM IR and have it execute immediately, saved to disk, or both. I don't know how it will perform for you or how high level your generated C is though, it may not be realistic.

Or use it to compile your C as it is pretty quick. It's not going to speed things up by orders of magnitude but every bit helps.

Re: PyPy 1.6 Released - Full Python 2.7.1 Implementation

#32
post #31

Earlier quoted context omitted.

LLVM would seem to (maybe? possibly!?) be a good solution, but I was never able to convincingly determine if it was likely to solve my problems, and the documentation seemed to be quite sparse for doing what I wanted to do. (This was a couple years ago, however, and I've love to be proven wrong.)

Instead of generating C code you might be able to generate LLVM IR and have it execute immediately, saved to disk, or both. I don't know how it will perform for you or how high level your generated C is though, it may not be realistic. Or use it to compile your C as it is pretty quick. It's not going to speed things up by orders of magnitude but every bit helps.

Awesome. Am I right in understanding that LLVM IR should be LLVM IF or LLVM assembly? The generated code is most extremely simplistic. An example would be:

  A[12800]=A[0] * A[6400];
  A[12801]=A[1] * A[6480];
  A[12802]=A[12800] + A[12801];
  A[12803]=A[2] * A[6560];
  A[12804]=A[12802] + A[12803];
  A[12805]=A[3] * A[6640];
Which would be very easy to deal with. The only problem is that I sometimes call out to libraries for exp, log, sin, cos, etc.

Re: PyPy 1.6 Released - Full Python 2.7.1 Implementation

#34

Are there production users of PyPy? I feel like PyPy has always been the most academically interesting Python implementation. But has it taken away mindshare from CPython?

Yes, there are.

Recently Quora announced it was running on PyPy[1]. Some other disclosures were made (a Django project[2], LWN internal processing[3], tweets about speedups in production, etc.), but the PyPy team is thinking about officially asking for success stories in the near future[4].

[1]: http://www.quora.com/Alex-Gaynor/Quora-product/Quora-is-now-...

[2]: https://convore.com/python/whos-using-pypy-in-production/

[3]: http://lwn.net/Articles/442268/

[4]: https://bitbucket.org/pypy/extradoc/src/tip/blog/draft/succe...

Re: PyPy 1.6 Released - Full Python 2.7.1 Implementation

#35
post #15

Earlier quoted context omitted.

Maybe rubinius will fill this need? http://rubini.us/ Also, this could be an interesting read: http://www.engineyard.com/blog/2010/making-ruby-fast-the-rub...

but what is the status of rubinius? is it nearly as far along as pypy? I would think that the metaprogramming features of ruby which make it so much fun would also make it n times harder to build a JIT for.

The dynamic features of ruby are not so different than those of python, lua, or javascript. Actually in terms of reasonable memory consumption I think rubinius is quite a bit better than pypy.

Re: PyPy 1.6 Released - Full Python 2.7.1 Implementation

#36

Earlier quoted context omitted.

Off hand and guessing about the problem: You might want to look at approaches that use dual numbers. Likewise, in instead of inlining the procedures, generate a differentiated version of each procedure with a new name. If those don't cover your problems, perhaps look at how other autodiff tools for C do it?

For being offhand, those are very good guesses! Dual numbers won't be efficient, as I want reverse-mode autodiff. As to the multiple procedures: Well, as I was doing it, even a single procedure can be many hundreds of megabytes large. Even for very very simple code, however, I noticed that GCC was superlinear in code size. I suppose I could somewhat arbitrarily break up the code into arbitrary functions. I wonder if…

it sounds like you're getting lots of code duplication. 1) try running a common subexpression elimination process on your code before doing the autodiffing, and create a procedure for each shared expression 2) for prim ops, again, have a procedure created for the diffed version instead of inlining, and sub in the procedure instead.

perhaps something like these ideas would help

If you want an example of a nice high level Auto diff lib, a nice one that works via operator overloading is http://hackage.haskell.org/package/ad , which seems quite nice though I've not had the opportunity to use it myself.

yes, optimizing compilers such as gcc use algorithms that are superlinear in code size when they're optimizing. Perhaps you should instead try out the operator overloading approach (and see if you can )?

gl :-)

Aside: When I hear the phrase execution trace in the context of program analysis, i think abstract interpretation, though I'm not sure if thats relevant for you.

cheers!

Re: PyPy 1.6 Released - Full Python 2.7.1 Implementation

#37
post #34

Are there production users of PyPy? I feel like PyPy has always been the most academically interesting Python implementation. But has it taken away mindshare from CPython?

Yes, there are. Recently Quora announced it was running on PyPy[1]. Some other disclosures were made (a Django project[2], LWN internal processing[3], tweets about speedups in production, etc.), but the PyPy team is thinking about officially asking for success stories in the near future[4]. [1]: http://www.quora.com/Alex-Gaynor/Quora-product/Quora-is-now-... [2]: https://convore.com/python/whos-using-pypy-in-producti…

To me, this list seems to suggest the opposite actually.

[1] is the company where one of the main developers of PyPy works. [2] appears to be a discussion where they are looking for anyone using PyPy in production. [3] seems to be an article about someone experimenting with PyPy for git processing. [4] is the developers looking for non-toy examples of production use so that they can get more funding.

Re: PyPy 1.6 Released - Full Python 2.7.1 Implementation

#38

Earlier quoted context omitted.

For being offhand, those are very good guesses! Dual numbers won't be efficient, as I want reverse-mode autodiff. As to the multiple procedures: Well, as I was doing it, even a single procedure can be many hundreds of megabytes large. Even for very very simple code, however, I noticed that GCC was superlinear in code size. I suppose I could somewhat arbitrarily break up the code into arbitrary functions. I wonder if…

it sounds like you're getting lots of code duplication. 1) try running a common subexpression elimination process on your code before doing the autodiffing, and create a procedure for each shared expression 2) for prim ops, again, have a procedure created for the diffed version instead of inlining, and sub in the procedure instead. perhaps something like these ideas would help If you want an example of a nice high le…

It isn't exactly common subexpressions. Basically the problem is things like matrix multiplies always get unrolled.

I've used lots of operator overloading based autodiff packages for C++. They are great, but the issue is not how the function is recorded (I used operator overloading myself in my python package) but how it gets executed at runtime. Unless a compiler (or JIT) is called sometime between when the operator overloading happens and execution happens, the function is basically being interpreted at runtime. This is what happens in, e.g. ADOL-C, SACADE, and CPPAD, all of which come with a significant (e.g. 20x) performance penalty as compared with hand-written derivatives.

Re: PyPy 1.6 Released - Full Python 2.7.1 Implementation

#39
post #34

Earlier quoted context omitted.

Yes, there are. Recently Quora announced it was running on PyPy[1]. Some other disclosures were made (a Django project[2], LWN internal processing[3], tweets about speedups in production, etc.), but the PyPy team is thinking about officially asking for success stories in the near future[4]. [1]: http://www.quora.com/Alex-Gaynor/Quora-product/Quora-is-now-... [2]: https://convore.com/python/whos-using-pypy-in-producti…

To me, this list seems to suggest the opposite actually. [1] is the company where one of the main developers of PyPy works. [2] appears to be a discussion where they are looking for anyone using PyPy in production. [3] seems to be an article about someone experimenting with PyPy for git processing. [4] is the developers looking for non-toy examples of production use so that they can get more funding.

It suggests that there aren't many production users, true. But it does prove that there are some.

Re: PyPy 1.6 Released - Full Python 2.7.1 Implementation

#40
post #39

Earlier quoted context omitted.

To me, this list seems to suggest the opposite actually. [1] is the company where one of the main developers of PyPy works. [2] appears to be a discussion where they are looking for anyone using PyPy in production. [3] seems to be an article about someone experimenting with PyPy for git processing. [4] is the developers looking for non-toy examples of production use so that they can get more funding.

It suggests that there aren't many production users, true. But it does prove that there are some.

Indeed. Though two-ish production users after 7 years of development hardly seems like a success.

By way of contrast, (1) in the Ruby world, YARV went from an alternative implementation to the official implementation within two years, and (2) in the JavaScript world, node.js is similarly being used in production in tons of places after only two years. (Though I realize that those examples aren't exact parallels.)

This isn't meant to criticize your response, rather, I find it interesting that the Python world seems to have so many alternative implementations (PyPy, IronPython, Jython, Cython) despite what appears to be really minority mindshare compared to CPython.

Post reply on HN