八芯片TPU v5e切片上AlphaFold2推理实测:pmap映射可获6.5-7.9倍吞吐提升
Using the Whole Slice: AlphaFold2 Inference on an Eight-Chip TPU v5e
针对AlphaFold2在八芯片TPU v5e切片上的推理,实测发现JAX默认仅用单芯片,用vmap将最多8条118残基序列批量放在单芯片上并未提升吞吐。改用pmap把独立查询映射到各芯片后,8芯片吞吐为单芯片的6.5至7.9倍;JAX自动分区未能缩短单条查询的调用时间。
arXiv:2609.34818v3 Announce Type: replace-cross Abstract: AlphaFold2 is written in JAX. JAX 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 how much of an eight-chip TPU v5e slice AlphaFold2 inference uses, and which way of mapping the work in JAX uses all of it. Across 12 experiments, the model used random weights, so we studied execution, not prediction quality. By default, only one chip held data. Batching up to eight input sequences (queries) of 118 residues on one chip with JAX's vmap did not raise throughput. Mapping independent queries to the chips with JAX's pmap ran them in parallel on all eight chips. On a grid of 1 to 8 chips and 100 to 1000 residues, eight chips gave 6.5 to 7.9 times the throughput of one chip. JAX's automatic partitioning did not shorten the call for one query. Our program did not tell the partitioner how to split any array across the chips.
来源:arXiv (AI + Vision + Imaging) · arxiv.org