Re: Short discussion about pypy overview

"Clack, Trevor" <[email protected]>
Newsgroups gmane.comp.python.pypy
Message-ID <CY1P110MB056535BB2050208C5D622840EB330@CY1P110MB0565.NAMP110.PROD.OUTLOOK.COM>
Hi Matti, thank you for your response.

It will be proprietary in the sense that it will belong within the company as part of a training presentation, but we will not be making money from it. These training presentations go into a growing archive of high performance computing, ranging from instructions on how to parallelize code on GPUs to specific tools that will help code run faster (ex. cython, numba and hopefully pypy).

 The training will not have anything enlightening on it. It's intended as a general introduction to the tool and when to use it (as you know it's slow when calling C extension modules and performing very short, simple tasks compared to python) Just that sort of stuff.

Here is what I'm specifically looking for:

A high level overview of how pypy works starting from source code up through the end of execution. I'd like something analogous to this description and diagram of cpython:

The cpython interpreter (written in C) parses the syntax and creates bytecode. This bytecode is then executed by the python virtual machine (also written in C).

[cid:c0457197-8bba-4e57-a906-d3b9e5412dcb]

So I'm not going into details like garbage collection, the GIL, or even details of the comiler. Similarly I'd like something that doesn't go too deeply into the innerworkings of pypy, but gives a good idea of how the code is handled at each stage during the execution. I've found several diagrams and charts but they don't seem to include the whole picture or are too detailed and I can't seem to make sense of it.

Here are some diagrams or flowcharts I've found:
[cid:c3777ff1-e1e0-4f1c-bce9-c709d93401df][cid:0fc18619-9475-4f5d-8d8c-3256276825b2][cid:5e604678-8ce5-4031-94fd-0df620bfbd77][cid:7aa29236-d0a1-4ab8-8d47-18f683931ad4]

For pypy, I'm uncertain for example if source code is converted into analogous rpython then that's converted to C, or if it's converted to bytecode then C. I'm not certain where the jit kicks in, I know it's provided by rpython and it kicks in on hot (>1031 loops). If a guard fails, I'm uncertain where the code returns to being interpreted. I feel it would be quicker if we could chat on zoom or other platform to share screens, it may be the fastest.

I feel a good high level overview would be a good blog post for pypy or be included in the introductory documentation.


Trevor Clack

HPCMP PET Computational Scientist

Mobile  949.412.9902

[email protected]<mailto:[email protected]>

3909 Halls Ferry Road

Vicksburg, MS 39180

www.gdit.com<http://www.gdit.com/>

[cid:[email protected]]

________________________________
From: Matti Picus <[email protected]>
Sent: Wednesday, September 30, 2020 12:42 AM
To: Clack, Trevor <[email protected]>; [email protected] <[email protected]>
Subject: Re: [pypy-dev] Short discussion about pypy overview



 [External: Use caution with links & attachments]

On 9/30/20 2:15 AM, Clack, Trevor wrote:

> Hello, I'm working on giving a presentation to a high performance
> computing community on pypy. I've got a good deal of content developed
> except for a high level overview of how pypy in fact works. Several
> days of YouTube, searching stack overflow, and searching the docs
> haven't clarified much. I was hoping to get in contact with a
> developer if it's not too much trouble
>
> Trevor Clack
>
> HPCMP PET Computational Scientist
>
> Mobile  949.412.9902
>
> [email protected] <mailto:[email protected]>
>
> 3909 Halls Ferry Road
>
> Vicksburg, MS 39180
>
> www.gdit.com<http://www.gdit.com> <http://www.gdit.com/>
>
> cid:[email protected]
>
>

Hi and welcome. Could you be a little more specific: do you mean "how
the RPython tool chain can compile a Python interpreter", "how is PyPy
fast?", "what optimizations can the JIT do", "how does a tracing JIT
work, "why doesn't PyPy use refcount semantics", or something else?


Matti

_______________________________________________
pypy-dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-dev
cpython_flowchart.png (image/png, 23.5 KB) - not displayed
pypy_chart1.png (image/png, 53.5 KB) - not displayed
pypy_chart2.png (image/png, 22 KB) - not displayed
pypy_chart3.png (image/png, 77.6 KB) - not displayed
pypy_chart4.png (image/png, 84.5 KB) - not displayed
Outlook-cid_image0.png (image/png, 7.5 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.