{
  "id": 4069749,
  "title": "Gemma 4 in Pure JAX: What Ports from TPU to GPU, and What Doesn't",
  "url": "https://urgent.news/2026/08/29/gemma-4-in-pure-jax-what-ports-from-tpu-to-gpu-and-what-doesnt",
  "topic": "ai",
  "section": "AI",
  "published": "2026-08-29T00:39:38.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/gde/gemma-4-in-pure-jax-what-ports-from-tpu-to-gpu-and-what-doesnt-3m09"
  },
  "original_language": "en",
  "account": "This article discusses running a hand-written Gemma 4 port in pure JAX on three different accelerators, and the limitations of JAX when porting the model across devices. The code is available at github.com/xbill9/gemma4-dev. The project aims to test the port across various hardware configurations to determine which parts of JAX are truly portable. The Gemma 4 model has irregularities such as different attention geometries, MQA (Multi-Query Attention) settings, KV-share mapping, and a 4.70 GB quantized table. These irregularities make the port challenging, as other stacks are not designed to handle them. The project found that JAX handles attention differently compared to other stacks, and it can handle the irregularities without issues. However, there are two main limitations: the heterogeneous head dimensions and the Pallas kernel's memory model not being portable to GPUs. The article highlights how JAX can handle the irregularities without issues, but there are still limitations when it comes to memory modeling and kernel design.",
  "summary": "This article is about running a hand-written Gemma 4 port in pure JAX on three different accelerators, and about the two places the abstraction leaks. The code is here: github.com/xbill9/gemma4-dev What is this project trying to Do? This project aims to serve one Gemma 4 checkpoint from one JAX port across every accelerator I can rent, and to find out — by measurement, not by reading docs — which…",
  "key_points": [
    "Gemma 4 port tested in pure JAX on TPU, GPU, and CPU",
    "JAX handles irregularities like attention geometry and MQA settings well",
    "Heterogeneous head dimensions and Pallas kernel memory model limit JAX portability"
  ],
  "editors_take": "Running Gemma 4 in pure JAX on multiple accelerators reveals that while JAX can handle model irregularities, its limitations in memory modeling and kernel design hinder portability to GPUs.",
  "illustration": null,
  "coverage": {
    "outlets": 2,
    "also_reported_by": [
      {
        "outlet": "Dev.to",
        "title": "Pure JAX on G5g: Serving Gemma 4 on Graviton and a T4G",
        "url": "https://urgent.news/2026/08/29/pure-jax-on-g5g-serving-gemma-4-on-graviton-and-a-t4g",
        "published": "2026-08-29T00:38:39.000Z"
      }
    ]
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}