
Welcome to this course on JAX!
We are going to learn one of the best and most powerful Python libraries ever created: we will see how JAX can speed up our Python code by orders of magnitude if we use it properly!
This course is not simply a tour of the JAX API. The official documentation already does that well.
Here we go one level deeper.
What we do together
We follow a Python function all the way down, and then we climb back up:
Tracing and the Jaxpr: the one mechanism every JAX feature is built on
Just-in-time compilation: what gets cached, what triggers a recompile, and how to time JAX code correctly
The XLA backend: StableHLO, operator fusion and layout assignment, observed on real code
Asking the compiler what a function costs before running it, and exporting a model
Defining a new primitive from scratch, with its evaluation, lowering, differentiation, and batching rules
Automatic differentiation: grad, Jacobians, Hessians, forward mode, and gradients through control flow
Vectorization with vmap, including per-sample gradients
Parallel computation with pmap and the modern sharding API
Numerical computing: immutable arrays, explicit random keys and the silent differences from NumPy
Neural networks, first in pure JAX and then with Flax NNX and Optax
By the end, you can follow a Python function down to a compiled kernel and say what happened at every step. That is a different skill from knowing the API, and it is the one that makes JAX predictable.
How each chapter is built
An introduction that frames the problem. Notebooks where every line of code is written on screen as it is explained. A conclusion that connects to the next chapter. A short quiz with the reasoning behind each answer. The notebooks are in a public GitHub repository, linked in the lecture resources.
What you should know before buying
You need Python and NumPy. We do not review either one.
No compiler background is assumed, and no GPU is needed. Everything runs on an ordinary laptop CPU, and the parallel computation chapter simulates multiple devices on that CPU.
Machine learning is not the goal of this course. One chapter builds a neural network, and it is easier if you already know what a loss function and a gradient step are.
The chapters build on each other. This is a course to follow in order, not a reference to dip into.
The lectures were recorded against pinned library versions (JAX 0.10.0). JAX changes quickly, so the notebooks in the repository are kept up to date, while the videos are not re-recorded at every release. The concepts do not change.
Who is teaching
I am Pietropaolo Frisoni, a computational scientist working as a Quantum Software Engineer, with a background in theoretical physics and scientific computing. I have used JAX for several years, applying tracing and just-in-time compilation to quantum computing. This is the course I wish I had when I started with JAX.
Take a look at the curriculum and the free preview lectures.
If going one level deeper sounds like your kind of fun, I will see you inside!