How Google Uses PyTorch
31 engineering articles about PyTorch from Google's engineering team
Other Google Technologies
Other Companies Using PyTorch
Articles
Filter:
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.
13 min read
Includes Code
--
Tunix is Google’s new JAX-native post-training library designed to eliminate TPU idling bottlenecks when training multi-turn, tool-using LLM reasoning agents. It maximizes hardware throughput by combining highly concurrent, asynchronous rollouts with a decoupled producer-consumer pipeline, ensuring the trainer is constantly fed even while agents wait on network I/O or environment steps. Additionally, Tunix provides plug-and-play abstractions and continuous macro-level profiling, allowing developers to easily integrate custom open-source environments and optimize complex distributed workflows without massive code rewrites.
Haoyu Gao, Lance Wang, Shadi Noghabi, Tianshu Bao, Weiren Yu
10 min read
Includes Code
--
We're excited to introduce LiteRT.js, the newest member of the LiteRT family! LiteRT.js is our powerful solution for running machine learning models directly in the browser, extending Google's cross-platform edge AI runtime to the web. Built for JavaScript developers, LiteRT.js delivers state-of-the-art ML model inference performance on WebGPU and upcoming WebNN, with a fallback to WebAssembly for CPU. This post provides a quick tour of LiteRT.js and gives web developers everything they need to get started.
Ping Yu, Marko Ristić, Matthew Soulanille, Chintan Parikh
6 min read
Includes Code
--
Distributed AI training is notoriously fragile because losing a single machine typically crashes the entire multi-node job, forcing a time-consuming, full-workload infrastructure restart. To address this, Google’s JAX ecosystem utilizes elastic training via Pathways, which converts a hardware failure into a catchable Python exception so the running process can survive. When an unplanned failure occurs, the system automatically replaces only the broken worker, restores the last viable checkpoint from Cloud Storage, and resumes training in place—minimizing total downtime to under two minutes without ever restarting the main controller process.
Google has officially launched the TPU Developer Hub, a centralized educational resource designed to help model builders and developers maximize the performance of Google Cloud TPUs. The hub offers code-first resources, open-source recipes, and deep-dive documentation covering hardware architecture, software optimization, debugging, parallelism, and networking. These materials are tailored for both human developers and AI-assisted tools to streamline everything from large-scale training to low-latency inference workloads.
Keelin McDonell
3 min read
--
The Google Tensor ML SDK is graduating to its Beta phase, allowing developers to build and deploy high-performance machine learning models directly onto the TPU of Google Pixel 10 devices. By integrating with LiteRT, Google's edge deployment framework, the SDK provides a unified workflow for developers to convert, compile, and run PyTorch or TFLite models with robust fallback options. Additionally, a new model garden offers over 100 classic and generative AI models, including Gemma 3, enabling low-latency, private features like speech recognition, computer vision, and text generation.
Priya Patel, Himangshu Roy
5 min read
--
Integration of Arm Scalable Matrix Extension 2 (SME2) and the Google AI Edge software stack enables high-performance, on-device generative AI by turning the CPU into a powerful matrix-compute accelerator. Using Stability AI’s "stable-audio-open-small" model as a case study, it outlines a streamlined "Convert, Optimize, and Deploy" pipeline that utilizes LiteRT, XNNPACK, and KleidiAI to automate hardware acceleration. The resulting implementation achieves over a 2x speedup in audio generation and a 4x reduction in memory usage while maintaining high audio quality on Arm-powered mobile devices and laptops.
Chintan Parikh, Dillon Sharlet, Na Li, Gian Marco Iodice
8 min read
Includes Code
--
Researchers at UCSD have successfully implemented DFlash, a block-diffusion speculative decoding method, on Google TPUs to bypass the sequential bottlenecks of traditional autoregressive drafting. By "painting" entire blocks of candidate tokens in a single forward pass rather than predicting them one-by-one, the system achieved average speedups of 3.13x, with peak performance nearly doubling that of existing methods like EAGLE-3. This open-source integration into the vLLM ecosystem optimizes TPU hardware by leveraging "free" parallel verification and high-quality draft predictions for complex reasoning tasks.
Weiren Yu, Yarong Mu, Lihao Ran, Zhaoxiang Feng, Yiming Zhao, Hao Zhang
11 min read
--
Google Cloud has introduced a high-performance integration that connects Rapid Storage directly to PyTorch via the fsspec interface to eliminate AI training bottlenecks. By utilizing Google’s Colossus architecture and bidirectional gRPC streaming, the solution offers up to 15 TiB/s aggregate throughput and significant reductions in latency. These improvements allow developers to speed up total training time by 23% with zero code changes required beyond updating the storage bucket type.
Trinadh Kotturu, Martin Durant
4 min read
Includes Code
--
TorchTPU is a new engineering stack designed to provide a native, high-performance experience for running PyTorch workloads on Google’s TPU infrastructure with minimal code changes. It features an "Eager First" approach with multiple execution modes and utilizes the XLA compiler to optimize distributed training across massive clusters. Moving into 2026, the project aims to further reduce compilation overhead and expand support for dynamic shapes and custom kernels to ensure seamless scalability for the next generation of AI.
Claudio Basile, Kat Ko, Ben Wilson, Lee Howes, Bill Jia, Joe Pamer, Michael Voznesensky, Robert Hundt
8 min read
--
Google has officially launched LiteRT, the successor to TFLite, which offers significantly faster GPU and NPU acceleration alongside seamless support for PyTorch and JAX. The update also introduces lower-precision data type support for increased efficiency and a commitment to more frequent security and dependency updates across the TensorFlow ecosystem. This transition solidifies LiteRT as Google's primary high-performance framework for deploying GenAI and advanced on-device inference.
Pradeep Kuppala, Rodney Witcher
2 min read
--
LiteRT has evolved from its TensorFlow Lite foundation into a universal on-device AI inference framework, now offering production-ready GPU acceleration across six platforms and streamlined NPU int...
Lu Wang, Chintan Parikh, Jingjiang Li, Terry Heo
9 min read
Includes Code
Has Summary
--
The article introduces Coral NPU, a full-stack, open-source platform designed to enhance Edge AI capabilities on low-power devices.
Billy Rutledge
8 min read
Has Summary
--
This article provides a comprehensive guide on how to train a GPT-2 model using JAX on TPU, highlighting the ease of leveraging Google TPUs for free.
Wei Wei
8 min read
Includes Code
Has Summary
--
The article discusses the increasing adoption of JAX in robotics, highlighting its efficiency in optimal control and simulation. It features insights from Max Muchen Sun, a Robotics Ph. D.
The article discusses how to use KerasHub for loading model weights from SafeTensors into Keras, enabling flexible end-to-end machine learning workflows across different frameworks like JAX, PyTorc...
Yufeng Guo, Divyashree Sreepathihalli, Monica Song
8 min read
Includes Code
Has Summary
--
The article introduces Keras Recommenders, a new library designed to simplify the creation of state-of-the-art recommendation systems using Keras with JAX, TensorFlow, or PyTorch.
PaliGemma 2 mix is an advanced vision-language model designed for multiple tasks, allowing developers to utilize a single model for various applications such as image captioning, object detection, ...
Omar Sanseviero, Andreas Steiner
3 min read
Includes Code
Has Summary
--
PaliGemma 2 is the latest vision-language model from Google, designed to simplify the process of building advanced AI that can interpret visual inputs.
Daniel Keysers, Andreas Steiner
3 min read
Has Summary
--
The article announces that Francois Chollet, the creator of Keras, is leaving Google to pursue new opportunities.
Bill Jia, Xavi Amatriain
2 min read
Has Summary
--
The article introduces Keras Hub, a unified library for pretrained models that simplifies access to both natural language processing (NLP) and computer vision (CV) architectures.
LiteRT, formerly known as TensorFlow Lite, is a high-performance runtime for on-device AI that now supports models from multiple frameworks including PyTorch, JAX, and Keras.
Google AI Edge team
4 min read
Has Summary
--
This article provides a comprehensive guide on using Gemma with Ray on Vertex AI, detailing the steps to set up, fine-tune, and deploy machine learning models.
Ju-yeong Ji, Ivan Nardini
12 min read
Includes Code
Has Summary
--
The article discusses the release of the Gemma 2 model with 27 billion parameters, highlighting its capabilities in Keras and integration with JAX for efficient model training.
Martin Görner
5 min read
Includes Code
Has Summary
--
Model Explorer is a powerful graph visualization tool designed to simplify the development and optimization of machine learning models for edge devices.
Kristen Wright, Eric Yang
6 min read
Includes Code
Has Summary
--
The article introduces the AI Edge Torch Generative API, designed to enable developers to create high-performance LLMs in PyTorch for deployment on edge devices using the TensorFlow Lite runtime.
Cormac Brick, Haoliang Zhang
10 min read
Includes Code
Has Summary
--
Google AI Edge Torch provides a seamless integration from PyTorch to TensorFlow Lite (TFLite), enhancing model coverage and CPU performance for mobile devices.
Cormac Brick, Advait Jain, Haoliang Zhang
5 min read
Includes Code
Has Summary
--
The article recaps the Google I/O 2024 event, highlighting advancements in AI technologies aimed at making AI accessible for developers.
CachingDartFirebaseGeminiGenerative AIGoogle CloudJAXKerasKotlinOllamaPostgreSQLPyTorchTensorFlowWebAssembly
Jeanine Banks
8 min read
Has Summary
--
This article discusses how to publish Keras models on Kaggle and Hugging Face, highlighting the ease of sharing fine-tuned models with the community.
Martin Görner
4 min read
Includes Code
Has Summary
--
The article introduces the expansion of the Gemma family with two new models, CodeGemma and RecurrentGemma, designed specifically for developers and researchers.
Tris Warkentin, Jane Fine
4 min read
Has Summary
--
The article introduces Gemma models in Keras, a family of lightweight, state-of-the-art open models that leverage the same technology as the Gemini models.
Martin Görner
5 min read
Includes Code
Has Summary
--
You've reached the end! All 31 articles loaded.