Skip to content
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

Communication about faster-cpython after 3.13 release? #701

Open
paugier opened this issue Oct 8, 2024 · 1 comment
Open

Communication about faster-cpython after 3.13 release? #701

paugier opened this issue Oct 8, 2024 · 1 comment

Comments

@paugier
Copy link

paugier commented Oct 8, 2024

I'm teaching Python for sciences and try to understand what happens with the different projects to improve Python performance.

I tried to follow faster-cpython but I have to admit that I feel a bit lost with the current state.

I read https://docs.python.org/3.13/whatsnew/3.13.html#an-experimental-just-in-time-jit-compiler, which seems quite clear.

However, I also see that 3.13, even with Tier 2 and JIT enabled (and free-threaded mode disabled), is only marginally faster than 3.12 (https://github.com/faster-cpython/benchmarking-public), and clearly still much slower than PyPy.

I think it would be useful to have few communications (at different technical levels) to explain where is the project and what are the next steps for 3.14 and 3.15. Also about the consequences of the GIL removal for faster-cpython.

@Fidget-Spinner
Copy link
Collaborator

Fidget-Spinner commented Oct 10, 2024

FTR, what I say here is not representative of the team. It's just my personal opinion.

Mike is working on a 3.14 plan document that you should look out for soon. In my view, there's a few things going on:

IMO, we (ie the core developers, faster CPython team, and other contributors) laid the foundations in 3.13 for the JIT and free-threading. The 3.13 JIT speeds up non-generator workloads right now, and slows down generator stuff. So that explains why it has no overall speedups right now. (To see what I mean, you can look at the breakdown of each benchmark by clicking around the link you provided).

At a very high level in 3.14:

  • We're working on making the JIT faster.
  • We're working on making the JIT produce better code.
  • We're working on making the interpreter faster.
  • We're working on making the GC faster.
  • Python runtime team at Meta are making free-threaded single-threaded perf faster.

More technical details in 3.14:

  • JIT:
    • Brandt is working on traces and considering hosting the JIT so that the clang build-dependency might be removed on some platforms.
    • Savannah and Diego are working on making the JIT more memory efficient, and faster as well. They have some preliminary experiments, but I'm not sharing them here because I don't know how comfortable they are with extra attention on those parts.
    • I'm working on partial evaluation --- optimizing the JIT's traces with stuff like function inlining.
  • Interpreter:
    • Mark is working on virtual/embedded reference counting, which will cut down the overhead of refcounting.
    • Mark is working on tuning the incremental GC, that was put in 3.13 but then removed at the last minute.
    • Mike is experimenting with cross-module quickening, which cuts overhead when calling out to C extensions.
  • Free-threading:
    • The core dev team know that single-threaded perf is down for free-threading. This is expected and we're working on it.
    • Matt is working re-enabling the specializing interpreter for free-threading. This should get us a nice boost of 20-30% single-threaded perf if we're lucky on free-threaded builds.
    • We had some discussions on how to get the JIT working on free-threading as well.

Hope this answer helps. If you have any more questions do let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants