Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Inferensi Cloud TPU
Penayangan mengacu pada proses deployment model machine learning terlatih ke
lingkungan produksi, yang dapat digunakan untuk inferensi. Inferensi
didukung pada TPU v5e dan versi yang lebih baru. SLO Latensi merupakan prioritas untuk inferensi.
Dokumen ini membahas cara menyajikan model pada TPU host tunggal. Slice TPU dengan
8 chip atau kurang memiliki satu VM atau host TPU dan disebut TPU host tunggal.
Mulai
Anda memerlukan Google Cloud akun dan project untuk menggunakan Cloud TPU. Untuk mengetahui informasi
selengkapnya, lihat Menyiapkan lingkungan Cloud TPU.
Anda perlu meminta kuota berikut untuk menayangkan iklan di TPU:
Resource v5e on-demand: TPUv5 lite pod cores for serving per project per zone
Resource v5e yang dapat dihentikan: Preemptible TPU v5 lite pod cores for serving per project per zone
Resource v6e on-demand: TPUv6 cores per project per zone
Resource v6e yang dapat dihentikan: Preemptible TPUv6 cores per project per zone
Untuk mengetahui informasi selengkapnya tentang kuota TPU, lihat kuota TPU.
Menyajikan LLM menggunakan JetStream
JetStream adalah mesin yang dioptimalkan untuk memori dan throughput untuk inferensi model bahasa besar
(LLM) pada perangkat XLA (TPU). Anda dapat menggunakan JetStream dengan
model JAX dan PyTorch/XLA. Untuk contoh penggunaan JetStream guna menayangkan JAX LLM, lihat
Inferensi JetStream MaxText pada TPU v6e.
Melayani model LLM dengan vLLM
vLLM adalah library open source yang dirancang untuk inferensi dan penyajian model
bahasa besar (LLM) dengan cepat. Anda dapat menggunakan vLLM dengan PyTorch/XLA. Untuk contoh
penggunaan vLLM guna menyalurkan LLM PyTorch, lihat Melayani LLM menggunakan TPU Trillium di GKE dengan vLLM.
Pembuatan profil
Setelah menyiapkan inferensi, Anda dapat menggunakan profiler untuk menganalisis performa dan
penggunaan TPU. Untuk mengetahui informasi selengkapnya tentang pembuatan profil, lihat:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-18 UTC."],[],[],null,["# Cloud TPU inference\n===================\n\n| **Note:** If you are new to Cloud TPUs, see [Introduction to Cloud TPU](/tpu/docs/intro-to-tpu).\n\nServing refers to the process of deploying a trained machine learning model to a\nproduction environment, where it can be used for inference. Inference is\nsupported on TPU v5e and newer versions. Latency SLOs are a priority for serving.\n\nThis document discusses serving a model on a *single-host* TPU. TPU slices with\n8 or less chips have one TPU VM or host and are called *single-host* TPUs.\n\nGet started\n-----------\n\nYou will need a Google Cloud account and project to use Cloud TPU. For more\ninformation, see [Set up a Cloud TPU environment](/tpu/docs/setup-gcp-account).\n\nYou need to request the following quota for serving on TPUs:\n\n- On-demand v5e resources: `TPUv5 lite pod cores for serving per project per zone`\n- Preemptible v5e resources: `Preemptible TPU v5 lite pod cores for serving per project per zone`\n- On-demand v6e resources: `TPUv6 cores per project per zone`\n- Preemptible v6e resources: `Preemptible TPUv6 cores per project per zone`\n\n| **Note:** There is no v6e quota specific to serving.\n\nFor more information about TPU quota, see [TPU quota](/tpu/docs/quota).\n\nServe LLMs using JetStream\n--------------------------\n\nJetStream is a throughput and memory optimized engine for large language model\n(LLM) inference on XLA devices (TPUs). You can use JetStream with JAX and\nPyTorch/XLA models. For an example of using JetStream to serve a JAX LLM, see\n[JetStream MaxText inference on v6e TPU](/tpu/docs/tutorials/LLM/jetstream-maxtext-inference-v6e).\n\nServe LLM models with vLLM\n--------------------------\n\nvLLM is an open-source library designed for fast inference and serving of large\nlanguage models (LLMs). You can use vLLM with PyTorch/XLA. For an example of\nusing vLLM to serve a PyTorch LLM, see [Serve an LLM using TPU Trillium on GKE with vLLM](/kubernetes-engine/docs/tutorials/serve-vllm-tpu).\n\nProfiling\n---------\n\nAfter setting up inference, you can use profilers to analyze the performance and\nTPU utilization. For more information about profiling, see:\n\n- [Profiling on Cloud TPU](/tpu/docs/profile-tpu-vm)\n\n- [TensorFlow profiling](https://www.tensorflow.org/guide/profiler)\n\n- [PyTorch profiling](/tpu/docs/pytorch-xla-performance-profiling-tpu-vm)\n\n- [JAX profiling](https://jax.readthedocs.io/en/latest/profiling.html#profiling-jax-programs)"]]