TPUs: float64 without float64 hardware, and QuantEcon's JAX workloads on Google Cloud
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- google-cloud, python
- Área
- performance
Línea de trabajo
Start with the precision/ probe for Question 1 and the existing W1–W3 benchmarks in precision/; read the method and results referenced in #1 before comparing measurements. Phase 0 can run as a diagnostic on Colab's free v5e; Phase 1 requires TPU quota and approval to spend on Google Cloud. Done when Question 1 is answered, any Phase 1 results are saved under results/<host>/<date>.jsonl, and a summary is posted here.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Google's TPUs have no float64 hardware. This issue records what is known about float64 on a TPU, and sets out a comparison to run on Google Cloud later: what JAX does with float64 there, what each precision costs, and how QuantEcon's JAX workloads run on a TPU against the CPUs and GPUs measured in #1. It is not scheduled: Phase 1 needs a Google Cloud project with TPU quota, and a yes on spend.
What is known (read 2026-11-03)
| Source | |
|---|---|
| "TPUs have no true float64 hardware." JAX's float64 accuracy tables cover CPUs and NVIDIA GPUs only, though its platform list includes TPU v2 to v5e, v5p, v6e and TPU7x | JAX: accuracy of operations |
| The matrix unit (MXU) multiplies bfloat16 inputs, with int8 on v5e and v6e and FP8 on v5p and TPU7x, and accumulates in float32 | Cloud TPU system architecture |
A float32 matmul in JAX runs in bfloat16 on a TPU by default. Full float32 takes precision=jax.lax.Precision.HIGHEST, or jax_default_matmul_precision set to it |
A JAX maintainer on jax-ml/jax#9973 (2022) |
| For float64 FFTs, "you may need to use CPU or GPU implementations for now" | A JAX maintainer on jax-ml/jax#9881 (2022, still open) |
Not documented: what JAX does with a float64 array on a TPU when jax_enable_x64 is on. It could raise an error, compute in float32 behind a float64 dtype, or emulate float64 in software, possibly short of IEEE float64 in precision or range. Question 1 finds out.
Why
- Readers can pick a TPU. Colab's free tier offers a single v5e chip when one is available (MaxText's guide), beside its free T4, and Colab has added a v6e chip (release notes), though not necessarily on the free tier. A reader who opens a lecture in Colab and picks the TPU runtime gets whatever JAX does there, and for a float64 lecture we don't know what that is.
- Both precisions are in question. A float64 lecture on a TPU meets the unknown above. A float32 lecture meets bfloat16 matrix products by default, so its printed answers could change although it never asks for float64.
- Most of lecture-jax's float64 lectures may not need float64. Of the 13, only
arellano_jaxneeds it for its answer (Part 1's summary on #11). That was measured on CPUs and GPUs, where a float32 matrix product is full float32, so it doesn't yet carry over to a TPU. - It is the far end of QuantEcon/project-econ-on-ai-hardware's question: hardware built for AI, with no float64 at all.
Questions
- What float64 does on a TPU. With
jax_enable_x64on: an error, float32 behind a float64 dtype, or emulation; and the accuracy against CPU float64 of elementwise arithmetic, transcendentals, a matmul,linalg.solve,eighand an FFT. - What each precision costs, on #1's workloads W1 to W3: float64 if it runs, float32 at
HIGHEST, and float32 at the default. - Whether the default changes answers: lecture-jax's float32 lectures, and its float64 lectures run in float32, at the default and at
HIGHEST, against their float64 answers on a CPU. - As used: lecture-jax's lectures on a TPU in a fresh process, compile time counted, against the T4 and the M6 from #4. That is the comparison a Colab reader faces: CPU, T4 or TPU.
Workloads
| Question | Workload |
|---|---|
| 1 | A short probe, new, under precision/: the cases in question 1, each result's dtype printed and its error against CPU float64 recorded in ULPs |
| 2 | precision/'s W1 to W3 (#1), with matmul precision as an added axis |
| 3 and 4 | lectures/whole/'s runner (#4), recording each lecture's answers as #11's method does |
Platforms
| Device | Where | Why |
|---|---|---|
| TPU v5e, one chip, 16 GB | Google Cloud; Colab's free tier for Phase 0 | The chip a Colab reader gets |
| TPU v6e (Trillium), one chip, 32 GB | Google Cloud | The next generation, with twice the memory |
| TPU7x (Ironwood) | Google Cloud, optional | The newest, with FP8 |
| The TPU VM's own CPU | The same VM | The same-box baseline, as on qe-wharton1-gpu |
The comparison points are already in results/: the M6, the T4 and its Xeon, the TITAN RTX, and Phase 2's rented cards. They need no re-run if the JAX release matches.
Method
#1's method holds: one fresh process per cell, cold and warm times apart, the same JAX release everywhere. On a TPU, also:
- A float64 dtype proves nothing. #1 asserts the result dtype so that a silent float32 can't pass as float64. On a TPU the dtype could say float64 whatever the hardware did, so every float64 cell is checked against CPU float64 as well.
- Matmul precision is an axis. Run float32 at the default and at
HIGHEST, and recordjax_default_matmul_precisionin each cell's environment block. - The environment block adds the TPU generation, the chip count and the
libtpuversion. Installjax[tpu]at the pinned 0.12.0.1 iflibtpuhas a matching release; otherwise record the version used. - Colab runs are diagnostics, not measurements. The runtime is shared and its JAX comes preinstalled. Question 1's answer can come from Colab; the timings can't.
Phases
- Phase 0, free: question 1's probe on Colab's free v5e, as a diagnostic. It takes minutes, and its answer decides how much of Phase 1 is worth running.
- Phase 1, needs a yes on spend: questions 2 to 4 on one v5e chip and one v6e chip on Google Cloud. v5e lists at about USD 1.20 a chip-hour on demand in us-central1 (pricing, 2026-11-03); v6e's price wasn't confirmed. Request TPU quota in the project's region first.
- Longer term: the TPU Research Cloud gives researchers TPU time free, by application. It is worth applying if TPUs become a platform we re-run on.
What the results would change
| If | Then |
|---|---|
| float64 raises an error on a TPU | float64 lectures can't run there. A lecture could say so, or choose its device |
| float64 runs as float32 behind a float64 dtype | A silent wrong answer, the worst case. arellano_jax, and any lecture that needs float64, should refuse a TPU |
| float64 is emulated close to IEEE accuracy | It becomes a cost question by kernel type, as on the GPUs, and question 2 answers it |
| The default matmul precision changes a lecture's printed answers | That lecture sets HIGHEST, or says why a TPU's answers differ |
| A v5e chip beats Colab's T4 on lectures as used | Readers could be pointed to Colab's TPU runtime |
Done when
Question 1 is answered, from Colab if need be; questions 2 to 4 have results in results/<host>/<date>.jsonl, if Phase 1 runs; and a summary is posted here.
- Lenguaje dominante
- Python
- Estrellas
- 0
- Forks
- 1
- Merge medio
- 3 h 29 min
- PR fusionados (30 d)
- 64
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de QuantEcon/benchmarks
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
QuantEcon/benchmarks#78 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
QuantEcon/benchmarks#72 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
P5: Markov chains, starting with the stationary distribution of a savings policy (aiyagari_jax)Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 45/100
QuantEcon/benchmarks#47 ·
Los mantenedores suelen responder en 1 día
-
Float32 fidelity: which float64 lectures need float64, and can the heaviest step drop to float32?Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
QuantEcon/benchmarks#11 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 32/100
QuantEcon/benchmarks#5 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de QuantEcon/benchmarks
Issues similares
-
needs-triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
flashinfer-ai/flashinfer#9803 ·
Los mantenedores suelen responder en 1 día
-
bug frontend good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
oscarbol09/thesisforge#61 ·
-
api bug performance
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
oscarbol09/audiobard#159 ·
-
area:web p2 product:business triage:active type:bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 89/100
cuadrao-ai/argus#2328 ·
Los mantenedores suelen responder en 1 día
-
bug frontend good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
nikhilb2/simple_invoicing#907 ·