AI Cloud Architect

Run Ray on TPU, Part 2: Ray AI libraries

GoogleHow-to by Ivan Nardini and Spencer PetersonGoogle Developers Blog

Read the original (opens the source's page in a new tab)

AI: Summary

What it is

Ray Serve, Ray Data and Ray Train each run on TPU slices with a topology declaration, so one whole slice is reserved for multi-host models.

Who it is for

Teams running multi-host LLMs or JAX training on GKE with Ray who need TPU slice placement to avoid hung workers.

Key points

  • Ray Serve needs accelerator_config topology set for multi-host models; without it workers can split across slices and hang in DEPLOYING.
  • Ray Data iter_jax_batches() yields device-sharded JAX arrays and handles the final ragged batch with drop, pad or raise.
  • JaxTrainer takes a topology in ScalingConfig with use_tpu=True and launches one worker per host.
  • Ray publishes rayproject/ray:*-tpu images with the JAX/TPU stack installed.

The same at other vendors

Timeline

  1. Read firstRun Ray on TPU, Part 1: The foundations · Google · How-to
  2. This postRun Ray on TPU, Part 2: Ray AI libraries

Go deeper