# HeyGen x Google Cloud: Bringing Avatar IV to TPUs

DevFeed: [HeyGen x Google Cloud: Bringing Avatar IV to TPUs](<https://devfeed.tech/articles/heygen-x-google-cloud-bringing-avatar-iv-to-tpus-4211.md>)

Original publisher: [Read original article](<https://developers.googleblog.com/heygen-x-google-cloud-bringing-avatar-iv-to-tpus/>)

Published: 2026-09-12T11:04:33.891311Z

Content type: article

Language: en

Sources: [Google Developers Blog](<https://devfeed.tech/sources/google-developers-blog.md>)

Topics: [Google](<https://devfeed.tech/topics/google.md>), [Cloud](<https://devfeed.tech/topics/cloud.md>), [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>), [Optimization](<https://devfeed.tech/topics/optimization.md>), [AI Infrastructure](<https://devfeed.tech/topics/ai-infrastructure.md>), [Transformer](<https://devfeed.tech/topics/transformer.md>), [PyTorch](<https://devfeed.tech/topics/pytorch.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [Streaming](<https://devfeed.tech/topics/streaming.md>), [real-time](<https://devfeed.tech/topics/real-time.md>), [Hardware](<https://devfeed.tech/topics/hardware.md>), [API](<https://devfeed.tech/topics/api.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [ai-infrastructure](<https://devfeed.tech/tags/ai-infrastructure.md>), [api](<https://devfeed.tech/tags/api.md>), [cloud](<https://devfeed.tech/tags/cloud.md>), [code](<https://devfeed.tech/tags/code.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [generation](<https://devfeed.tech/tags/generation.md>), [google](<https://devfeed.tech/tags/google.md>), [hardware](<https://devfeed.tech/tags/hardware.md>), [model](<https://devfeed.tech/tags/model.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [performance](<https://devfeed.tech/tags/performance.md>), [pytorch](<https://devfeed.tech/tags/pytorch.md>), [real-time](<https://devfeed.tech/tags/real-time.md>), [streaming](<https://devfeed.tech/tags/streaming.md>), [time](<https://devfeed.tech/tags/time.md>), [tpu](<https://devfeed.tech/tags/tpu.md>), [transformers](<https://devfeed.tech/tags/transformers.md>), [video](<https://devfeed.tech/tags/video.md>)

## AI overview

HeyGen and Google Cloud describe porting the 18B+ parameter Avatar IV talking-head video generation pipeline to an eight-chip Trillium TPU host. Using torchax, JAX, XLA, FSDP sharding, Ulysses sequence parallelism, and custom Pallas kernels, the team improved performance by 1.86x for real-time chunked streaming while preserving output quality through strict quality gates.

## Source excerpt

HeyGen ported their 18B+ parameter Avatar IV video generation model to Google Cloud's Trillium (v6e) TPUs via torchax and XLA, utilizing FSDP and Ulysses sequence parallelism across an eight-chip mesh. To achieve a 1.86x speedup for real-time streaming, the engineering team pipelined exposed all-to-all collectives, aligned sparse attention block sizes to eliminate mask padding, and bypassed softmax serial dependencies using a precomputed Cauchy-Schwarz upper bound. These custom Pallas kernel and compiler optimizations were deployed only after passing rigorous two-tier quality gates to guarantee byte-identical or mathematically equivalent pixel outputs.