This tutorial shows you how to deploy and serve
Qwen3.5-397B (Qwen/Qwen3.5-397B-A17B-FP8),
a Mixture-of-Experts model, on Google Kubernetes Engine (GKE). The deployment uses
multi-host TPU7x (Ironwood) accelerators and the
vLLM TPU serving framework
with TorchTPU (torchtpu) and prefill-decode (PD) disaggregation.
In this configuration, you provision two multi-host tpu7x-standard-4t node
pools, each arranged in a 2x2x2 topology (eight TPU7x chips across two nodes
per node pool, for a total of 16 TPU7x chips). You use the Kubernetes JobSet
API and Ray to run disaggregated multi-host prefill and decode servers on
separate TPU7x slices with data parallelism and expert parallelism enabled, and
route requests through a disaggregation proxy.
Objectives
- Set up your GKE cluster and multi-host TPU7x node pools.
- Stage the model weights in a Cloud Storage bucket.
- Deploy the multi-host vLLM TorchTPU prefill, decode, and proxy servers with JobSet.
- Run a serving benchmark workload and analyze the results.
- Clean up.
Costs
In this document, you use the following billable components of Google Cloud:
To generate a cost estimate based on your projected usage, use the pricing calculator.
When you finish the tasks that are described in this document, you can avoid continued billing by deleting the resources that you created. For more information, see Clean up.
Before you begin
You need a Hugging Face access token to use this tutorial. You can sign up for a free account at Hugging Face. After you have an account, generate an access token:
- On the Welcome to Hugging Face page, click your account avatar and select Access tokens.
- On the Access tokens page, click Create new token.
- Select the Read token type and enter a name for your token.
- Your access token is displayed. Save the token in a safe place.
Enable the Kubernetes Engine API in your Google Cloud project:
Install and initialize the Google Cloud CLI, and install
kubectl. If you use Cloud Shell, both tools are preinstalled.Ensure that your project has sufficient SSD quota and external IP address quota in the region where your TPU capacity is located:
In the Google Cloud console, go to the Quotas & System Limits page.
Filter by Persistent Disk SSD (GB) and verify that you have sufficient available SSD quota in your target region.
Filter by In-use regional external IPv4 addresses and verify that you have sufficient IP address quota in your target region.
To get the permissions that you need to complete this tutorial, ask your administrator to grant you the following IAM roles on your project:
- Kubernetes Engine Admin (
roles/container.admin) - Compute Admin (
roles/compute.admin) - Storage Admin (
roles/storage.admin) - Service Account User (
roles/iam.serviceAccountUser)
For more information about granting roles, see Manage access to projects, folders, and organizations.
You might also be able to get the required permissions through custom roles or other predefined roles.
Set up your environment variables
Set up your authentication:
Export the environment variables that you use throughout this tutorial:
Replace the following:
YOUR_PROJECT_ID: the ID of your Google Cloud project.YOUR_REGION: the region where you want to deploy your cluster, such asus-central1.YOUR_ZONE: the zone where you want to deploy your TPU7x node pools, such asus-central1-c.YOUR_CLUSTER_NAME: the name of your GKE cluster.YOUR_RESERVATION_NAME: the name of your TPU reservation, if you're using a reservation.YOUR_GCS_BUCKET: the name of the Cloud Storage bucket that you use to stage the model weights.YOUR_HF_TOKEN: your Hugging Face access token.YOUR_VLLM_IMAGE: the vLLM TorchTPU image to use. For public images, refer to the vLLM TorchTPU repository.
Create the GKE cluster
To create a GKE cluster in Standard mode and attach two multi-host TPU7x node pools for prefill and decode disaggregation, complete the following steps:
Create a regional GKE cluster with Workload Identity Federation for GKE enabled:
The output is similar to the following:
NAME LOCATION MASTER_VERSION MASTER_IP MACHINE_TYPE NODE_VERSION NUM_NODES STATUS STACK_TYPE asq-v7x us-central1 1.35.7-gke.1027000 35.226.172.84 e2-standard-4 1.35.7-gke.1027000 3 RUNNING IPV4Create a high-throughput workload placement policy with a
2x2x2accelerator topology, which is required for multi-host TPU7x node pools:Create two multi-host TPU7x node pools (
np-0andnp-1), each containing twotpu7x-standard-4tnodes (eight TPU7x chips in a2x2x2topology per node pool, for a total of 16 TPU7x chips):This tutorial uses Spot capacity (
--spot). Instances using Spot capacity might take time to be created after the node pool is created, and they might be preempted during workload runs. You can also create the node pools using a reservation or Flex-start VMs by passing the following flags:- Specific reservation: replace the
--spotflag with the--reservation-affinity=specificand--reservation=RESERVATION_NAMEflags, whereRESERVATION_NAMEis the name of the reservation that GKE uses when creating the node pool. To learn more about TPU reservations, see About Cloud TPU reservations. - Flex-start VMs: replace the
--spotand--num-nodes=2flags with the--flex-start,--reservation-affinity=none,--enable-autoscaling,--num-nodes=0,--min-nodes=0, and--max-nodes=2flags to provision the node pool using the Flex-start consumption option. For more information, see Run a small batch workload with TPUs and Flex-start VMs.
The output for each node pool is similar to the following:
NAME MACHINE_TYPE DISK_SIZE_GB NODE_VERSION np-0 tpu7x-standard-4t 100 1.35.7-gke.1027000- Specific reservation: replace the
Configure
kubectlcredentials to communicate with your cluster:
Stage the model weights in Cloud Storage
Stage the model weights in a Cloud Storage bucket for your workload runs:
Create a Cloud Storage bucket with uniform bucket-level access:
Grant Identity and Access Management (IAM) permissions on the bucket to your default Compute Engine service account and the default Kubernetes service account:
Create a Kubernetes secret named
hf-secretto store your Hugging Face access token:Fetch the
download_model.yamlconfig:Alternatively, you can choose to create a file named
download_model.yamlwith the following content:Download the model weights to the staging volume and transfer them to your Cloud Storage bucket:
This step takes approximately 30 to 40 minutes to complete.
After the job finishes, verify that all 163
.safetensorsshards are in your Cloud Storage bucket:Delete the completed staging Job:
Wait until the Pod starts and monitor the download Job logs:
Deploy the multi-host vLLM TorchTPU server
The workload manifest (v7x_qwen3_5_server_multihost_slice.yaml) defines a
Kubernetes JobSet resource (vllm-qwen3-5-397b-pd-disagg-v7x) with three
replicated jobs that coordinate disaggregated prefill and decode serving across
the two 2x2x2 TPU7x node pools:
- Prefill server (
prefill): runs two replicas across one2x2x2TPU7x node pool (twotpu7x-standard-4tnodes with four dual-core chips per host, for 16 TPU cores total). The Pods form a two-node Ray cluster and launch vLLM TorchTPU on port8000forQwen/Qwen3.5-397B-A17B-FP8with--data-parallel-size=16,--tensor-parallel-size=1,--enable-expert-parallel,--load-format=runai_streamer, andTPURaidenConnectorconfigured askv_producer. - Decode server (
decode): runs two replicas across the second2x2x2TPU7x node pool (16 TPU cores total), using Pod affinity and anti-affinity rules oncloud.google.com/gke-nodepoolto isolate prefill and decode onto separate node pools. The Pods form a two-node Ray cluster and launch vLLM TorchTPU on port7200with TPURaidenConnector configured askv_consumer. - Disaggregation proxy (
proxy): runstoy_proxy_server.pyon port10000to coordinate request routing and KV cache transfer between the prefill server (port8000) and the decode server (port7200).
To deploy and monitor the disaggregated vLLM servers, complete the following steps:
Install the Kubernetes JobSet CustomResourceDefinition and controller on your cluster:
Fetch the server manifest:
Alternatively, you can create a file named
v7x_qwen3_5_server_multihost_slice.yamlwith the following content:Substitute your Cloud Storage bucket name into
v7x_qwen3_5_server_multihost_slice.yamland apply the manifest:This configuration uses one
2x2x2TPU7x slice (two nodes) for prefill and one2x2x2TPU7x slice (two nodes) for decode. To scale the number of nodes in either pool, update thereplicasfield (replicas: NUM_NODES).Monitor the prefill and decode Pod logs until application startup completes:
Initial model loading and compilation take approximately 30 to 45 minutes on the first run.
If you're using preemptible capacity such as Spot or Flex-start VMs, it might take longer after node pool creation for your TPU slice nodes to be created, and they can be preempted during workload runs. For more details, see Preemptible VM instances. To check whether your TPU slice nodes have been created, see Check the node's status and conditions.
Wait until both the prefill and decode server logs report
Application startup completebefore running the benchmark:(APIServer pid=1) INFO: Started server process [1] (APIServer pid=1) INFO: Waiting for application startup. (APIServer pid=1) INFO: Application startup complete.
Run a benchmark workload
To benchmark the deployed Qwen3.5-397B model using an 8,192-token input and
1,024-token output (8k/1k) workload against the disaggregation proxy, complete
the following steps:
Fetch the benchmark manifest:
Alternatively, you can create a file named
v7x_qwen3_5_benchmark_multihost_slice.yamlwith the following content:Apply the benchmark Job manifest and wait for the benchmark Pod to be ready:
Monitor the benchmark Job logs:
Clean up
To avoid incurring charges to your Google Cloud account for the resources used in this tutorial, delete the Kubernetes workloads, the TPU7x node pools, the GKE cluster, and your Cloud Storage bucket:
Delete the Kubernetes workloads:
Delete the TPU7x node pools, the workload placement policy, and the GKE cluster:
Optionally, delete the Cloud Storage bucket that stores the staged model weights:
What's next
- Learn more about vLLM on Cloud TPU.
- Learn more about TPU7x (Ironwood).
- Learn more about Cloud TPU.