Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Mengelola VM Spot TPU
Spot VM menyediakan kapasitas yang tidak digunakan dengan tarif yang sangat diskon.
Spot VM dapat dihentikan (dimatikan) kapan saja, tetapi tidak seperti TPU preemptible, tidak ada batasan durasi runtime. Anda tidak dapat memulai ulang VM Spot TPU, dan Anda harus membuatnya ulang setelah preemption. Untuk mengetahui informasi selengkapnya tentang Spot VM secara umum, lihat dokumentasi Compute Engine tentang Spot VM.
Membuat Spot VM TPU
Anda dapat membuat TPU Spot VM menggunakan resource yang diantrekan, yang menambahkan permintaan pembuatan ke antrean dan memungkinkan Anda menerima kapasitas setelah tersedia. Membuat TPU sebagai resource yang diantrekan adalah praktik terbaik. Untuk informasi
selengkapnya, lihat Panduan pengguna resource dalam antrean.
Contoh berikut menunjukkan cara membuat VM Spot TPU menggunakan resource
yang diantrekan:
gcloud
Tambahkan flag --spot ke perintah gcloud compute tpus queued-resources:
Di kotak Zone, pilih zona tempat Anda ingin membuat TPU.
Di kotak TPU type, pilih jenis akselerator. Jenis akselerator menentukan versi dan ukuran Cloud TPU yang ingin Anda buat. Untuk mengetahui informasi selengkapnya tentang jenis akselerator yang didukung untuk setiap
versi TPU, lihat versi
TPU.
Di kotak Versi software TPU, pilih versi software. Saat membuat VM Cloud TPU, versi software TPU menentukan versi runtime TPU yang akan diinstal. Untuk mengetahui informasi selengkapnya, lihat versi
software TPU.
Klik tombol Aktifkan antrean.
Di kolom Queued resource name, masukkan nama untuk permintaan resource
yang diantrekan.
Luaskan bagian Management.
Centang kotak Make this a TPU Spot VM.
Klik Buat.
Anda juga dapat membuat Spot VM TPU tanpa menggunakan resource yang diantrekan:
gcloud
Tambahkan flag --spot ke perintah gcloud compute tpus tpu-vm:
Di kotak Zone, pilih zona tempat Anda ingin membuat TPU.
Di kotak TPU type, pilih jenis akselerator. Jenis akselerator menentukan versi dan ukuran Cloud TPU yang ingin Anda buat. Untuk mengetahui informasi selengkapnya tentang jenis akselerator yang didukung untuk setiap
versi TPU, lihat versi
TPU.
Di kotak Versi software TPU, pilih versi software. Saat membuat VM Cloud TPU, versi software TPU menentukan versi runtime TPU yang akan diinstal. Untuk mengetahui informasi selengkapnya, lihat versi
software TPU.
Luaskan bagian Management.
Centang kotak Make this a TPU Spot VM.
Klik Buat.
Memeriksa apakah VM TPU adalah Spot VM
gcloud
Untuk mengonfirmasi apakah VM TPU Anda adalah Spot VM, gunakan perintah deskripsi:
Jika VM TPU adalah Spot VM, Tingkat akan menjadi
Spot VM.
Harga dan kuota
Harga untuk Spot VM TPU jauh lebih rendah daripada untuk TPU on-demand dan
yang direservasi. Untuk mengetahui informasi selengkapnya tentang harga, lihat harga Cloud TPU.
Anda memerlukan kuota preemptible untuk menggunakan Spot VM TPU. Untuk mengetahui informasi selengkapnya,
lihat Kuota.
[[["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,["# Manage TPU Spot VMs\n===================\n\nSpot VMs make unused capacity available at highly-discounted rates.\nSpot VMs can be preempted (shut down) at any time, but unlike [preemptible\nTPUs](/tpu/docs/preemptible), there is no limit on runtime duration. You can't\nrestart TPU Spot VMs, and you must recreate them after preemption. For\nmore information about Spot VMs in general, see the [Compute Engine\ndocumentation about Spot VMs](/compute/docs/instances/spot).\n| **Note:** TPU Spot VMs only support the [TPU VM architecture](/tpu/docs/system-architecture-tpu-vm#tpu-vm-arch).\n\nCreate TPU Spot VMs\n-------------------\n\nYou can create TPU Spot VMs using queued resources, which adds your\ncreate request to a queue and lets you receive capacity once it becomes\navailable. Creating TPUs as queued resources is a best practice. For more\ninformation, see [Queued resources user guide](/tpu/docs/queued-resources).\n\nThe following example shows how to create TPU Spot VMs using queued\nresources: \n\n### gcloud\n\nAdd the `--spot` flag to the `gcloud compute tpus queued-resources` command: \n\n```bash\ngcloud compute tpus queued-resources create QUEUED_RESOURCE_ID \\\n --node-id=NODE_ID \\\n --zone=europe-west4-a \\\n --accelerator-type=v3-8 \\\n --runtime-version=tpu-vm-tf-2.17.1-pod-pjrt \\\n --spot\n```\n\n### curl\n\nAdd `spot: {}` to the request body: \n\n```bash\ncurl -X POST https://tpu.googleapis.com/v2alpha1/projects/PROJECT_ID/locations/europe-west4-a/queuedResources?queued_resource_id=QUEUED_RESOURCE_ID \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n tpu: {\n node_spec: {\n parent: \"projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/locations/\u003cvar translate=\"no\"\u003eeurope-west4-a\u003c/var\u003e\",\n node_id: \"\u003cvar translate=\"no\"\u003eNODE_ID\u003c/var\u003e\",\n node: {\n accelerator_type: \"\u003cvar translate=\"no\"\u003ev3-8\u003c/var\u003e\",\n runtime_version: \"\u003cvar translate=\"no\"\u003etpu-vm-tf-2.17.1-pod-pjrt\u003c/var\u003e\"\n }\n }\n },\n spot: {}\n }'\n```\n\n### Console\n\n1. In the Google Cloud console, go to the **TPUs** page:\n\n [Go to TPUs](https://console.cloud.google.com/compute/tpus)\n2. Click **Create TPU**.\n\n3. In the **Name** field, enter a name for your TPU.\n\n4. In the **Zone** box, select the zone where you want to create the TPU.\n\n5. In the **TPU type** box, select an accelerator type. The accelerator\n type specifies the version and size of the Cloud TPU you want to\n create. For more information about supported accelerator types for each\n TPU version, see [TPU\n versions](/tpu/docs/system-architecture-tpu-vm#versions).\n\n6. In the **TPU software version** box, select a software version. When\n creating a Cloud TPU VM, the TPU software version specifies the\n version of the TPU runtime to install. For more information, see [TPU\n software versions](/tpu/docs/runtimes).\n\n7. Click the **Enable queueing** toggle.\n\n8. In the **Queued resource name** field, enter a name for your queued\n resource request.\n\n9. Expand the **Management** section.\n\n10. Select the **Make this a TPU Spot VM** checkbox.\n\n11. Click **Create**.\n\nYou can also create TPU Spot VMs without using queued resources: \n\n### gcloud\n\nAdd the `--spot` flag to the `gcloud compute tpus tpu-vm` command: \n\n```bash\ngcloud compute tpus tpu-vm create TPU_NAME \\\n --zone=europe-west4-a \\\n --accelerator-type=v3-8 \\\n --version=tpu-vm-tf-2.17.1-pod-pjrt \\\n --spot\n```\n\n### curl\n\nAdd `scheduling_config: {spot: true}` to the request body: \n\n```bash\ncurl -X POST https://tpu.googleapis.com/v2/projects/PROJECT_ID/locations/europe-west4-a/nodes?node_id=TPU_NAME \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n accelerator_type: \"\u003cvar translate=\"no\"\u003ev3-8\u003c/var\u003e\",\n runtime_version: \"\u003cvar translate=\"no\"\u003etpu-vm-tf-2.17.1-pod-pjrt\u003c/var\u003e\",\n network_config: {enable_external_ips: true},\n scheduling_config: {spot: true}\n }'\n```\n\n### Console\n\n1. In the Google Cloud console, go to the **TPUs** page:\n\n [Go to TPUs](https://console.cloud.google.com/compute/tpus)\n2. Click **Create TPU**.\n\n3. In the **Name** field, enter a name for your TPU.\n\n4. In the **Zone** box, select the zone where you want to create the TPU.\n\n5. In the **TPU type** box, select an accelerator type. The accelerator\n type specifies the version and size of the Cloud TPU you want to\n create. For more information about supported accelerator types for each\n TPU version, see [TPU\n versions](/tpu/docs/system-architecture-tpu-vm#versions).\n\n6. In the **TPU software version** box, select a software version. When\n creating a Cloud TPU VM, the TPU software version specifies the\n version of the TPU runtime to install. For more information, see [TPU\n software versions](/tpu/docs/runtimes).\n\n7. Expand the **Management** section.\n\n8. Select the **Make this a TPU Spot VM** checkbox.\n\n9. Click **Create**.\n\nCheck if a TPU VM is a Spot VM\n------------------------------\n\n### gcloud\n\nTo confirm if your TPU VM is a Spot VM, use the describe command: \n\n```bash\ngcloud compute tpus tpu-vm describe TPU_NAME --zone=europe-west4-a\n```\n\nIf the TPU VM is a Spot VM, then the output will include the\n`spot` field set to `true`, similar to the following: \n\n ...\n schedulingConfig:\n spot: true\n ...\n\n### Console\n\n1. In the Google Cloud console, go to the **TPUs** page:\n\n [Go to TPUs](https://console.cloud.google.com/compute/tpus)\n2. Click the name of your Cloud TPU.\n\n If the TPU VM is a Spot VM, then the **Tier** will be\n **Spot VM**.\n\nPricing and quota\n-----------------\n\nPricing for TPU Spot VMs is significantly lower than for on-demand and\nreserved TPUs. For more information about pricing, see [Cloud TPU\npricing](/tpu/pricing).\n\nYou need preemptible quota to use TPU Spot VMs. For more information,\nsee [Quotas](/tpu/docs/quota)."]]