Tag: python

Free-threading Update - 3.14.0a7

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

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. .