Using the Whole Slice: AlphaFold2 Inference on an Eight-Chip TPU v5e

Pazienza, Lorenzo, Bani, Ihab El

–arXiv.org Artificial Intelligence 

AlphaFold2 is written in JAX, a framework that treats each chip of a tensor processing unit (TPU) slice as a separate device. A JAX program does not spread its work over the chips by itself, so a user who runs AlphaFold2 on a slice can pay for chips that do nothing. We found no published measurement of how AlphaFold2 inference uses a multi-chip TPU slice. Our goal was to measure whether AlphaFold2 inference uses all eight chips of a TPU v5e slice and to find which way of mapping the work in JAX puts every chip to work. All 12 experiments used random weights and a multiple sequence alignment that contains only the input sequence, so we studied execution and not prediction quality. Ten experiments ran model_3 with no recycling, and the other two varied the model and the number of recycles. By default, only one chip held data. We call each input sequence a query. We batched up to eight queries of 118 residues on one chip with JAX's vmap, and the throughput did not rise. With JAX's pmap, the eight chips ran eight independent queries in parallel. On a grid of 1 to 8 chips and 100 to 1000 residues, the full slice gave 6.5 to 7.9 times the throughput of one chip. Without sharding annotations, JAX's automatic partitioning did not make one query run faster. Most settings ran once, and the logs of the TPU runs were not kept.