Files
2026-07-13 13:17:40 +08:00

55 lines
1.9 KiB
YAML

# A unique identifier for the head node and workers of this cluster.
cluster_name: tpupodtest
max_workers: 2
available_node_types:
ray_head_default:
min_workers: 0
max_workers: 0
resources: {"CPU": 0}
# Provider-specific config for this node type, e.g. instance type. By default
# Ray will auto-configure unspecified fields such as subnets and ssh-keys.
# For more documentation on available fields, see:
# https://cloud.google.com/compute/docs/reference/rest/v1/instances/insert
node_config:
machineType: n1-standard-4
disks:
- boot: true
autoDelete: true
type: PERSISTENT
initializeParams:
diskSizeGb: 50
# See https://cloud.google.com/compute/docs/images for more images
sourceImage: projects/ubuntu-os-cloud/global/images/family/ubuntu-2004-lts
ray_tpu:
min_workers: 1
max_workers: 1
resources: {"TPU": 1} # use TPU custom resource in your code
node_config:
# Note: A v4-16 will have 2 hosts.
# While the cluster launcher can create multiple TPU pods, note that
# "proper" autoscaling currently does not work as expected as all hosts
# in a TPU pod need to execute the same program.
acceleratorType: v4-16
runtimeVersion: tpu-vm-v4-base
provider:
type: gcp
region: us-central2
availability_zone: us-central2-b
project_id: null # Replace this with your GCP project ID.
initialization_commands:
- sudo apt-get update
- sudo apt-get install -y python3-pip python-is-python3
setup_commands:
- pip install 'ray[default]'
head_setup_commands:
- pip install google-api-python-client
# Specify the node type of the head node (as configured above).
head_node_type: ray_head_default