Tag: python

Python 3.14 - Threading Unbound

Wed 08 October 2025

Python 3.14 is released and I’m extremely exited that free-threading is now officially supported! Finally no more GIL, finally able to use all the hundreds of cores on modern servers! Or at least in theory, we'll see how it holds up in practice.

I'm also quite excited for template string literals (t-strings). Better HTML templates? Direct SQL interpolation? I'm looking forward to what the community comes up with.

Many packages already provide free-threaded wheels, including core ML libraries such as numpy, jax and torch. This means it's now easy to parallelize your data pipeline, without any multiprocessing!

...


Free-threading Update - 3.14.0a7

Mon 05 May 2025

I mentioned in my previous post a lock contention issue when accessing the same list from different threads, leading to worse performance the more threads were used. Turns out this is fixed in Python 3.14.0a7 already!

Unfortunately this version doesn't (yet) seem available from uv (which is why I hadn't originally tried it), but it can be downloaded and installed manually from the Python website (click Customize at the installation step and check the free-threading box). On Mac OS, the interpreter binaries can then be found at:

  • /Library/Frameworks/Python.framework/Versions/3.14/bin/python3
  • /Library/Frameworks/PythonT.framework/Versions/3.14/bin/python3t

With this version we observe much ...


Experimenting with free threaded Python

Sun 04 May 2025

As of version 3.13, Python is finally getting support for real multi-threading that is not hobbled by the GIL: experimental support for free threading! This means multiple Python threads can now execute at the same time, without needing to compete for the global interpreter lock. In modern machines with hundreds of cores this can speed up CPU-bound programs by two orders of magnitude! Even in ML workloads that only use Python as a DSL with all heavy computation in numpy, JAX etc it is very easy to accidentally be Python interpreter bound - especially in RL algorithms that require more ...

© Julian Schrittwieser. Built using 開板. Theme by Giulio Fidente on github. .