colesbury
uv: https://docs.astral.sh/uv/getting-started/installation/
py-free-threading: https://py-free-threading.github.io/installing-cpython/
docker: docker run -it quay.io/pypa/manylinux_2_28_x86_64 python3.13t
I think the performance benefit would also be small. Many objects are only accessed by a single thread, some objects are accessed by many threads, but few objects are exclusively accessed by one thread and then exclusively accessed by a different thread.
Part of the integration work will be to better document the thread-safety guarantees, but there is still a lot of work to do before we get there.
"...each read of a single-word-sized or sub-word-sized memory location must observe a value actually written to that location"
`mov` can be "free" in two ways:
- the compiler can frequently avoid emitting the `mov` when part of a larger operation
- modern CPUs handle `mov` instructions earlier in the pipeline
Neither of those are true for `movsx`.
Th autograd library was inspired by Chainer's design and took a lot of concepts (but not code) directly from Chainer. The neural network API is a bit of a hybrid. It's built on top of the autograd library but the layer names, implementations, and some conventions were inherited from Torch 7's NN and cuNN libraries.
(EDIT: and the name "autograd" originates from HIPS autograd library, which I think predates Chainer)
Python multiprocessing doesn't work well with a lot of external libraries. For example, CUDA doesn't work across forks and many system resources can be shared across threads but not processes. Python objects must be pickled to be sent to another process, but not all objects can be pickled (including some built-in objects like tracebacks).
A lot of different parallel programming models can be built on top of threads (shared memory, fork-join, message passing), and to a certain extent they can be mixed. That's not true of Python multiprocessing, which only allows a narrow form of message passing. (It's also buggy, has internal race conditions, and easily leaks resources.)
The problem for CPython is that it may not be possible to remove the GIL without breaking the C API, and a lot of the benefit of Python is the huge number of high-quality packages, many of which use the C API.