Google Open-Sources TorchTPU, a Native PyTorch Backend for Cloud TPUs

2026年10月20日 15:22
站內 AI 整理稿

Google has open-sourced TorchTPU, a native PyTorch backend for Cloud TPUs.It was co-developed with the PyTorch team at Meta and announced at PyTorch Conference 2026 on October 20, 2026.Existing PyTorch code targets a TPU through a standard torch.device("tpu").

TPUs now sit beside GPUs and CPUs as a native PyTorch device.Google team states that TorchTPU replaces PyTorch/XLA and recommends it for all new workloads.TL;DR Size: A software stack, not a model.4 open repos: TorchTPU, vLLM-TorchTPU, SGLang-TorchTPU, TorchTitan.TorchTPU is v0.2.

0 on PyPI, Python 3.11+, Apache 2.0.Runs on: Google Cloud TPUs.Tested on generations from v5e, scaled to 8,192 Ironwood (TPU7x) chips.Serving supports FP8, MXFP4 and NVFP4 checkpoints.Performance: Eager mode for debugging, torch.compile for production-level throughput.

Best: 52% MFU training Qwen 3 8B with TorchTitan on Ironwood (self-reported).Worst: Out-of-box eager took 11.49s per step in a fine-tuning case, versus 2.78s fully tuned.What is TorchTPU?TorchTPU is an open-source PyTorch backend from Google and Meta that runs PyTorch models natively on TPUs.

It plugs in through PyTorch’s PrivateUse1 interface.Tensors are ordinary PyTorch tensors, with no subclasses or wrappers.It runs one process per device and preserves tensor views and in-place mutations.The predecessor, PyTorch/XLA, recorded lazy-tensor graphs.

Developers often added code to mark compilable regions.PyTorch/XLA also only supported pure SPMD code.TorchTPU also handles divergent MPMD execution.How does TorchTPU execute PyTorch code?

TorchTPU ships 3 eager modes: Strict (default): dispatches each operator asynchronously with standard PyTorch semantics.Debug: runs synchronously with tensor bounds checking.DeferAndFuse: fuses runs of eager operators to cut HBM traffic.

The TorchTPU paper says it can be 50% or more faster than Strict.For peak speed, torch.compile(backend="tpu") captures the graph with TorchDynamo.It lowers through StableHLO to OpenXLA, which emits TPU machine code.Compiled executables are cached across processes, hosts and job restarts.

Custom Pallas kernels are callable as standard PyTorch functions.Prebuilt Tokamax kernels and Helion tile kernels also work.Distribution uses the tpudist process group.It supports DDP, FSDP2 and DTensor, along with a topology-aware mesh for TPU interconnects.How fast is TorchTPU?

All figures below are self-reported by Google and partners.Training scale: TorchTitan reached up to 52% MFU on Qwen 3 8B.Google reports near-linear scaling up to 8,192 Ironwood TPUs.Tuning ladder: In a TorchTitan fine-tuning case, step time fell from 11.49s to 2.78s.DeferAndFuse alone gave 1.15x.

Full torch.compile gave 3.80x.Model coverage: Google continuously tests about 5,000 Hugging Face models in eager and compiled modes.Fleet serving: Zenteiq grew daily output from 1.47B to 5.97B tokens per 1,000 TPU v6e chips.That gain came from llm-d routing on GKE, not TorchTPU alone.

#mtp-ttpu-wrap iframe{width:100%!important;border:0!important;display:block!important;background:transparent!important}#mtp-ttpu-wrap p:empty,#mtp-ttpu-wrap hr{display:none!important} window.addEventListener("message",function(e){if(e.data&&e.data.mtpTorchTPU){var f=document.

getElementById("mtp-ttpu-frame");if(f&&e.source===f.contentWindow){f.style.height=e.data.h+"px";}}}); What integrations ship with TorchTPU?Hugging Face: Transformers v5 deploys to TPU with devicemap="tpu".Diffusers supports eager, torch.compile and tensor parallelism.

vLLM-TorchTPU: built with Inferact.Keeps upstream schedulers and API servers, with custom Pallas kernels.SGLang-TorchTPU: built with RadixArk.Keeps RadixAttention prefix reuse.Serving features: FP8 KV caches, FP8, MXFP4 and NVFP4 checkpoints.Speculative decoding includes MTP and EAGLE-3.

TorchTitan: recipes for Llama 3 70B/405B, Qwen 3 8B/32B, Qwen 3 235B MoE and FLUX.1 12B.Also: llm-d 1.0, Ray, TorchRec, VeRL (preview) and LiteRT-Torch for on-device export.How does TorchTPU compare with PyTorch/XLA, TorchNeuron and JAX?

FeatureTorchTPU (repo)PyTorch/XLA (repo)TorchNeuron (AWS docs)JAX on TPU (Google docs)VendorGoogle + MetaGoogle / PyTorchAWSGoogleHardwareCloud TPU (v5e and later tested)Cloud TPUTrainium 2, Trainium 3Cloud TPUPyTorch devicetpuxlaneuronNot PyTorchBackend mechanismPrivateUse1Lazy-tensor graph recordingPrivateUse1Not applicableDefault executionEager (Strict, Debug, DeferAndFuse)Lazy tensorsEager plus torch.

compileNot disclosedCompile pathTorchDynamo to StableHLO to XLAXLANeuron CompilerXLADistributed APIsDDP, FSDP2, DTensor, SPMD and MPMDPure SPMD onlyFSDP, DTensor, DDP, TPNot disclosedCustom kernelsPallas, Tokamax, HelionNot disclosedNKIPallasvLLM / SGLang servingvLLM-TorchTPU, SGLang-TorchTPUNot disclosedvLLM NeuronvLLM-JAX, SGLang-JAXStatusOpen source, v0.

2.0Being replaced by TorchTPUPublic beta (Neuron 2.33)MaintainedLicenseApache 2.0Not disclosedNot disclosedNot disclosed How do you install TorchTPU?Install the package on a TPU VM, then pick the tpu device: Copy CodeCopiedUse a different Browser# pip install torchtpu import torch device = torch.

device("tpu") x = torch.randn((4, 4), device=device) The repo’s README pins torchtpu==0.2.0 with the CPU PyTorch wheel index.Without it, pip pulls the CUDA build of torch.Full guides live at torchtpu.readthedocs.io.Key Takeaways TorchTPU is open source under Apache 2.0, co-built with Meta.

It replaces PyTorch/XLA with eager-first, PrivateUse1-based execution.torch.compile(backend="tpu") lowers through StableHLO and XLA.TorchTitan hit 52% MFU on Qwen 3 8B, scaling to 8,192 Ironwood chips.vLLM, SGLang and Hugging Face now run on TPU through standard PyTorch.

Check out the GitHub repo, paper, docs and Google Cloud announcement.All credit goes to the researcher of this project.Also, feel free to follow us on Twitter and don’t forget to join our 150k+ML SubReddit and Subscribe to our Newsletter.Wait!are you on telegram?

now you can join us on telegram as well.The post Google Open-Sources TorchTPU, a Native PyTorch Backend for Cloud TPUs appeared first on MarkTechPost.

Related

相關文章

Hugging Face Blog生成式AI

FairStress: A deeper evaluation of fairness in LLM decision-making

Back to Articles FairStress: A deeper evaluation of fairness in LLM decision-making Enterprise Article Published October 20, 2026 Upvote - Kyle Wiggers Ai2Comms Follow allenai 📄 Tech Report | 🤗 Data | 💻 Code Today we’re introducing FairStress, a benchmark for measuring demographic fairness in LLMs beyond the choice a model ultimately makes in decisions impacting people.

1 小時前
Hugging Face Blog生成式AI

ALTK-Evolve: How learned memory tops the τ²-bench leaderboard on customer service tasks without a frontier model

Back to Articles ALTK-Evolve: How learned memory tops the τ²-bench leaderboard on customer service tasks without a frontier model Enterprise Article Published October 20, 2026 Upvote 2 Ashwath Vaithinathan Aravindan ashwath-vaithina Follow ibm-research Vatche Isahagian Vatche Follow ibm-research Vinod Muthusamy vinodmut Follow ibm-research Jayaram Radhakrishnan jayaramkr Follow ibm-research Evelyn Duesterwald evduester Follow ibm-research Gaodan Fang gaodan-fang Follow ibm-research Punleuk Oum illeatmyhat Follow ibm-research G Thomas gsthomasx Follow ibm-research Michał Ulewicz Michal Follow ibm-research Merve Unuvar mrvnvr Follow ibm-research Ayhan Sebin ayhansebin Follow ibm-research ALTK-Evolve learns and applies a playbook using GPT-4.

2 小時前
智東西生成式AI

梁聖大氣!DeepSeek推理框架全開源,公佈日均吞吐和毛利,真正的OpenAI來了

作者 | 王涵 編輯 | 心緣 梁聖又來送福利了! 10月20日報道,剛剛,DeepSeek開源了其內部使用的、大規模雲服務推理框架DeepInfer和生產級token編解碼組件deepseek-recipe。 DeepInfer框架集成了高性能算子和深度優化的推理引擎,支持分佈式推理、推測解碼、SWA Bounded Replay、結構化輸出等能力,可在英偉達與華為昇騰平臺上運行。 據DeepSeek團隊公佈,DeepSeek V4.1 Flash的高吞吐、低延遲大規模推理服務就是基於該框架實現的。

7 小時前

DeepSeek 再掀開源浪潮:內部推理框架 DeepInfer 全面公開,劍指"大模型普惠"

這家公司想補上的,是一個長期躲在聚光燈之外的環節——推理框架。在 DeepSeek 的定義裡,模型的能力上限由模型本身決定,但"怎樣以合理成本把超大規模模型供出去",靠的是這層中間架構。訓練讓模型學有所成,推理才讓它為人所用。當海量用戶同時調用,推理框架負責統籌調度龐雜的算力集群,其效率高低,直接撬動著 AI 服務的算力開銷與耗電——它既不像模型權重那樣吸睛,卻是把實驗室能力搬進現實的關鍵閘口。

8 小時前6200

DeepSeek 開源內部推理框架 DeepInfer,要把大模型服務的成本打下來

這家公司點明瞭一個長期被公眾忽視的中間層:大模型的能力上限由模型本身劃定,但如何以合理成本撐起超大規模的模型服務,真正取決於推理框架。訓練讓模型"學有所成",推理則讓模型"為人所用"。面對如今海量的用戶調用,推理框架負責統籌調度龐大的算力集群,它的效率直接決定了 AI 服務的算力成本與電力消耗。

8 小時前