HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
jax-ml
jax
Python2018–2026
jax-ml / jax

jax

Composable transformations of Python+NumPy programs: differentiate, vectorize, JIT to GPU/TPU, and more

61Distinct people
82Mentions
3Explicit recommenders
36.6KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Composable transformations of Python+NumPy programs: differentiate, vectorize, JIT to GPU/TPU, and more

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

> I love their JAX For those out of loop: https://github.com/google/jax See also: https://news.ycombinator.com/item?id=29682507

ignoramous used a recommendation phrase. 4 indexed comments match. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 9–Nov 16 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/16/2026, 4:59:52 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year82 dated mentions

Observed mentions: 2018-11-21 07:26:40 UTC to 2026-04-05 21:15:24 UTC.

0510152018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 4 mentions; 2 submissions, 2 comments20182019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 14 mentions; 1 submissions, 13 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 8 mentions; 1 submissions, 7 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 17 mentions; 4 submissions, 13 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 9 mentions; 1 submissions, 8 comments20222023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 17 mentions; 0 submissions, 17 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 7 mentions; 1 submissions, 6 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC422
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC14113
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC817
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC17413
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC918
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC17017
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC505
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC716
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC110

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
Transformable numerical computing at scale Transformations | Scaling | Install guide | Change logs | Reference docs What is JAX? JAX is a Python library for accelerator-oriented array computation and program transformation, designed for high-performance numerical computing and large-scale machine learning. JAX can automatically differentiate native Python and NumPy functions. It can differentiate through loops, branches, recursion, and closures, and it can take derivatives of derivatives of derivatives. It supports reverse-mode differentiation (a.k.a. backpropagation) via jax.grad as well as forward-mode differentiation, and the two can be composed arbitrarily to any order. JAX uses XLA to compile and scale your NumPy programs on TPUs, GPUs, and other hardware accelerators. You can compile your own pure functions with jax.jit. Compilation and automatic differentiation can be composed arbitrarily. Dig a little deeper, and you'll see that JAX is really an extensible system for composable function transformations at scale. This is a research project, not an official Google product. Expect sharp edges. Please help by trying it out, reporting bugs, and letting us know what you think! import jax import jax.numpy as jnp def predict(params, inputs): for W, b in params: outputs = jnp.dot(inputs, W) + b inputs = jnp.tanh(outputs) # inputs to the next layer return outputs # no activation on last layer def loss(params, inputs, targets): preds = predict(params, inputs) return jnp.sum((preds - targets)**2) grad_loss = jax.jit(jax.grad(loss)) # compiled gradient evaluation function perex_grads = jax.jit(jax.vmap(grad_loss, in_axes=(None, 0, 0))) # fast per-example grads Contents Transformations Scaling Current gotchas Installation Citing JAX Reference documentation Transformations At its core, JAX is an extensible system for transforming numerical functions. Here are three: jax.grad, jax.jit, and jax.vmap. Automatic differentiation with grad Use jax.grad to efficiently compute reverse-mode gradients: import jax import jax.numpy as jnp def tanh(x): y = jnp.exp(-2.0 * x) return (1.0 - y) / (1.0 + y) grad_tanh = jax.grad(tanh) print(grad_tanh(1.0)) # prints 0.4199743 You can differentiate to any order with grad: print(jax.grad(jax.grad(jax.grad(tanh)))(1.0)) # prints 0.62162673 You're free to use differentiation with Python control flow: def abs_val(x): if x > 0: return x else: return -x abs_val_grad = jax.grad(abs_val) print(abs_val_grad(1.0)) # prints 1.0 print(abs_val_grad(-1.0)) # prints -1.0 (abs_val is re-evaluated) See the JAX Autodiff Cookbook and the reference docs on automatic differentiation for more. Compilation with jit Use XLA to compile your functions end-to-end with jit, used either as an @jit decorator or as a higher-order function. import jax import jax.numpy as jnp def slow_f(x): # Element-wise ops see a large benefit from fusion return x * x + x * 2.0 x = jnp.ones((5000, 5000)) fast_f = jax.jit(slow_f) %timeit -n10 -r3 fast_f(x) %timeit -n10 -r3 slow_f(x) Using jax.jit constrains the kind of Python control flow the function can use; see the tutorial on Control Flow and Logical Operators with JIT for more. Auto-vectorization with vmap vmap maps a function along array axes. But instead of just looping over function applications, it pushes the loop down onto the function’s primitive operations, e.g. turning matrix-vector multiplies into matrix-matrix multiplies for better performance. Using vmap can save you from having to carry around batch dimensions in your code: import jax import jax.numpy as jnp def l1_distance(x, y): assert x.ndim == y.ndim == 1 # only works on 1D inputs return jnp.sum(jnp.abs(x - y)) def pairwise_distances(dist1D, xs): return jax.vmap(jax.vmap(dist1D, (0, None)), (None, 0))(xs, xs) xs = jax.random.normal(jax.random.key(0), (100, 3)) dists = pairwise_distances(l1_distance, xs) dists.shape # (100, 100) By composing jax.vmap with jax.grad and jax.jit, we can get efficient Jacobian matrices, or per-example gradients: per_example_grads = jax.jit(jax.vmap(jax.grad(loss), in_axes=(None, 0, 0))) Scaling To scale your computations across thousands of devices, you can use any composition of these: Compiler-based automatic parallelization where you program as if using a single global machine, and the compiler chooses how to shard data and partition computation (with some user-provided constraints); Explicit sharding and automatic partitioning where you still have a global view but data shardings are explicit in JAX types, inspectable using jax.typeof; Manual per-device programming where you have a per-device view of data and computation, and can communicate with explicit collectives. Mode View? Explicit sharding? Explicit Collectives? Auto Global ❌ ❌ Explicit Global ✅ ❌ Manual Per-device ✅ ✅ from jax.sharding import set_mesh, AxisType, PartitionSpec as P mesh = jax.make_mesh((8,), ('data',), axis_types=(AxisType.Explicit,)) set_mesh(mesh) # parameters are sharded for FSDP: for W, b in params: print(f'{jax.typeof(W)}') # f32[512@data,512] print(f'{jax.typeof(b)}') # f32[512] # shard data for batch parallelism: inputs, targets = jax.device_put((inputs, targets), P('data')) # evaluate gradients, automatically parallelized! gradfun = jax.jit(jax.grad(loss)) param_grads = gradfun(params, (inputs, targets)) See the tutorial and advanced guides for more. Gotchas and sharp bits See the Gotchas Notebook. Installation Supported platforms Linux x86_64 Linux aarch64 Mac aarch64 Windows x86_64 Windows WSL2 x86_64 CPU yes yes yes yes yes NVIDIA GPU yes yes n/a no experimental Google TPU yes n/a n/a n/a n/a AMD GPU yes no n/a no experimental Apple GPU n/a no experimental n/a n/a Intel GPU experimental n/a n/a no no Instructions Platform Instructions CPU pip install -U jax NVIDIA GPU pip install -U "jax[cuda13]" Google TPU pip install -U "jax[tpu]" AMD GP
Read the full README on GitHub

What Hacker News says

8 sources
>I started looking for benchmarks (because it sounds like the kind of thing JAX would do well) Currently Jax has an in-progress stiff ODE solver that's about 200x slower than SciPy https://github.com/google/jax/issues/3686#issuecomment-65709... and SciPy (with JIT) is about 50x-100x slower than the pure Julia methods https://benchmarks.sciml.ai/html/MultiLanguage/wrapper_packa... so Jax has more than a little bit of a way to go.
In Fast.ai and why Python is not the future of ML with Jeremy Howard
Rematerialization in autodiff is super interesting! XLA does rematerialization optimizations, so you get those automatically under jax.jit. There's also the jax.checkpoint decorator (https://github.com/google/jax/pull/1749) which lets you control reverse-mode checkpointing yourself; you can use it recursively to implement sophisticated checkpointing strategies (see Example 5 in that PR, which is the classic strategy for getting memory cost to scale like log(N) for iteration count N but requiring log(N) times as much computational work). It'd be interesting to experiment with heuristics for deploying those strategies automatically (e.g. given a program in JAX's jaxpr IR) but one of JAX's core philosophies is to keep things explicit and give users control through composable APIs. Automatic heuristics can be built on top. Another goal is to
Read the rest
make JAX a great system for playing with things like this!
In Using JAX, numpy, and optimization techniques to improve separable image filters
I was recently surprised to discover that Jax can't use a TPU's CPU, and that there are no plans to add this to Jax. https://github.com/google/jax/issues/2108#issuecomment-58154... A TPU's CPU is the only reason that TPUs are able to get such high performance on MLPerf benchmarks like imagenet resnet training. https://mlperf.org/training-results-0-6 They do infeed processing (image transforms, etc) on the TPU's CPU. Then the results are fed to each TPU core. Without this capability, I don't know how you'd feed the TPUs with data in a timely fashion. It seems like your input will be starved. Hopefully they'll bring jax to parity with tensorflow in this regard soon. Otherwise, given that jax is a serious tensorflow competitor, I'm not sure how the future of TPUs will play out. (If it sounds like this is just a minor feature, consider how it
Read the rest
would sound to say "We're selling this car, and it can go fast, but it has no seats." Kind of a crucial feature of a car.) Still, I think this is just a passing issue. There's no way that Google is going to let their TPU fleet languish. Not when they bring in >$1M/yr per TPU pod commitment.
In Google/Trax – Understand and explore advanced deep learning
Defining a loss function comes to mind. Checkout JAX[1] or Autograd[2]. As this is essentially a different programming paradigm there are a ton of opportunities, but it is fresh enough such that there is little to no history of software engineering differentiable programs. Design patterns, rules of thumb, and standard practices have yet to be defined. [1] https://github.com/google/jax [2] https://github.com/HIPS/autograd
In Demystifying Differentiable Programming (2018)
Do these help? https://github.com/google/jax/tree/master/cloud_tpu_colabs The ODE solver might be close to what you want. I use Tensorflow 1.15. The world has been steadily pushing for Tensorflow 2.0 or Jax, but I like the simplicity of the Session model. It's so simple you can explain it in one sentence: it's an object that runs commands. Tell the session to connect to the TPU, and it will run all those commands on the TPU. Jax is new to me (and to everyone; they just released it). But it looks like Google is pouring some serious R&D into it. Two things help a lot. One, twitter. You can get a direct line to the people who actually make these beasts. Exploit it when you can. Like you, I dislike using a black box, and I'm intensely interested in the details of how to communicate with a TPU at a low level. I recently asked someone on the ja
Read the rest
x team about it here: https://twitter.com/theshawwn/status/1213221594052599808 Two, TFRC support has been incredibly helpful. https://www.tensorflow.org/tfrc I don't know who they have working the support channels, but those guys and gals are some of the most helpful and cheerful people I've come across. I often asked them very technical questions and to my surprise, they followed up with an A+ response almost every time, usually the next day. Pytorch is giving TF a real run for its money, and to be honest I once felt it was a mistake to invest so much time into Tensorflow. But it turned out to be a big advantage due to Google's investment in the overall ecosystem. TPUs are something that only Google has the resources to pull off. Note that the traditional path towards "just get a TPU up and running and start playing with it" is to use one of their Colab notebooks on the topic. https://cloud.google.com/tpu/docs/colabs I've been implicitly steering you away from these because you seem (like me) to want to know more of the low-level details. Those notebooks are designed to let ML researchers get results quickly, not for hardware enthusiasts to exploit heavy metal. The jax notebooks felt much more satisfying in that regard.
In AMD’s 64-Core Threadripper 3990X, only $3990 Coming February 7th

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.