AI Cloud Architect

Run Ray on TPU, Part 1: The foundations

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 2.55 treats Google Cloud TPUs as a first-class accelerator, and GKE with the Ray Operator add-on provisions TPU slices that Ray Core reserves whole via slice_placement_group().

Who it is for

Teams already running Ray on GPUs who want to move Python workloads to TPU slices on GKE without writing custom placement code.

Key points

  • Requires Ray 2.55 or later, with official pre-built images per the post.
  • Ray Core API ray.util.tpu.slice_placement_group() is marked alpha and may change between releases.
  • A multi-host TPU slice must be reserved as one unit, otherwise workers cannot communicate and the job hangs.
  • Example uses a v6e 4x4 slice (16 chips across 4 hosts) on GKE.

The same at other vendors

Timeline

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

Go deeper