Types for Google Cloud Tpu v2 API¶
- class google.cloud.tpu_v2.types.AcceleratorConfig(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A TPU accelerator configuration.
- type_¶
Required. Type of TPU.
- class Type(value)[source]¶
Bases:
proto.enums.Enum
TPU type.
- Values:
- TYPE_UNSPECIFIED (0):
Unspecified version.
- V2 (2):
TPU v2.
- V3 (4):
TPU v3.
- V4 (7):
TPU v4.
- class google.cloud.tpu_v2.types.AcceleratorType(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A accelerator type that a Node can be configured with.
- accelerator_configs¶
The accelerator config.
- Type
MutableSequence[google.cloud.tpu_v2.types.AcceleratorConfig]
- class google.cloud.tpu_v2.types.AccessConfig(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
An access config attached to the TPU worker.
- class google.cloud.tpu_v2.types.AttachedDisk(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A node-attached disk resource. Next ID: 8;
- source_disk¶
Specifies the full path to an existing disk. For example: “projects/my-project/zones/us-central1-c/disks/my-disk”.
- Type
- mode¶
The mode in which to attach this disk. If not specified, the default is READ_WRITE mode. Only applicable to data_disks.
- class DiskMode(value)[source]¶
Bases:
proto.enums.Enum
The different mode of the attached disk.
- Values:
- DISK_MODE_UNSPECIFIED (0):
The disk mode is not known/set.
- READ_WRITE (1):
Attaches the disk in read-write mode. Only one TPU node can attach a disk in read-write mode at a time.
- READ_ONLY (2):
Attaches the disk in read-only mode. Multiple TPU nodes can attach a disk in read-only mode at a time.
- class google.cloud.tpu_v2.types.CreateNodeRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request for [CreateNode][google.cloud.tpu.v2.Tpu.CreateNode].
- node¶
Required. The node.
- class google.cloud.tpu_v2.types.DeleteNodeRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request for [DeleteNode][google.cloud.tpu.v2.Tpu.DeleteNode].
- class google.cloud.tpu_v2.types.GenerateServiceIdentityRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request for [GenerateServiceIdentity][google.cloud.tpu.v2.Tpu.GenerateServiceIdentity].
- class google.cloud.tpu_v2.types.GenerateServiceIdentityResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Response for [GenerateServiceIdentity][google.cloud.tpu.v2.Tpu.GenerateServiceIdentity].
- identity¶
ServiceIdentity that was created or retrieved.
- class google.cloud.tpu_v2.types.GetAcceleratorTypeRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request for [GetAcceleratorType][google.cloud.tpu.v2.Tpu.GetAcceleratorType].
- class google.cloud.tpu_v2.types.GetGuestAttributesRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request for [GetGuestAttributes][google.cloud.tpu.v2.Tpu.GetGuestAttributes].
- class google.cloud.tpu_v2.types.GetGuestAttributesResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Response for [GetGuestAttributes][google.cloud.tpu.v2.Tpu.GetGuestAttributes].
- guest_attributes¶
The guest attributes for the TPU workers.
- Type
MutableSequence[google.cloud.tpu_v2.types.GuestAttributes]
- class google.cloud.tpu_v2.types.GetNodeRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request for [GetNode][google.cloud.tpu.v2.Tpu.GetNode].
- class google.cloud.tpu_v2.types.GetRuntimeVersionRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request for [GetRuntimeVersion][google.cloud.tpu.v2.Tpu.GetRuntimeVersion].
- class google.cloud.tpu_v2.types.GuestAttributes(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A guest attributes.
- query_path¶
The path to be queried. This can be the default namespace (‘/’) or a nested namespace (‘/<namespace>/’) or a specified key (‘/<namespace>/<key>’)
- Type
- query_value¶
The value of the requested queried path.
- class google.cloud.tpu_v2.types.GuestAttributesEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A guest attributes namespace/key/value entry.
- class google.cloud.tpu_v2.types.GuestAttributesValue(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Array of guest attribute namespace/key/value tuples.
- items¶
The list of guest attributes entries.
- Type
MutableSequence[google.cloud.tpu_v2.types.GuestAttributesEntry]
- class google.cloud.tpu_v2.types.ListAcceleratorTypesRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request for [ListAcceleratorTypes][google.cloud.tpu.v2.Tpu.ListAcceleratorTypes].
- class google.cloud.tpu_v2.types.ListAcceleratorTypesResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Response for [ListAcceleratorTypes][google.cloud.tpu.v2.Tpu.ListAcceleratorTypes].
- accelerator_types¶
The listed nodes.
- Type
MutableSequence[google.cloud.tpu_v2.types.AcceleratorType]
- class google.cloud.tpu_v2.types.ListNodesRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request for [ListNodes][google.cloud.tpu.v2.Tpu.ListNodes].
- class google.cloud.tpu_v2.types.ListNodesResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Response for [ListNodes][google.cloud.tpu.v2.Tpu.ListNodes].
- nodes¶
The listed nodes.
- Type
MutableSequence[google.cloud.tpu_v2.types.Node]
- class google.cloud.tpu_v2.types.ListRuntimeVersionsRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request for [ListRuntimeVersions][google.cloud.tpu.v2.Tpu.ListRuntimeVersions].
- class google.cloud.tpu_v2.types.ListRuntimeVersionsResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Response for [ListRuntimeVersions][google.cloud.tpu.v2.Tpu.ListRuntimeVersions].
- runtime_versions¶
The listed nodes.
- Type
MutableSequence[google.cloud.tpu_v2.types.RuntimeVersion]
- class google.cloud.tpu_v2.types.NetworkConfig(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Network related configurations.
- network¶
The name of the network for the TPU node. It must be a preexisting Google Compute Engine network. If none is provided, “default” will be used.
- Type
- subnetwork¶
The name of the subnetwork for the TPU node. It must be a preexisting Google Compute Engine subnetwork. If none is provided, “default” will be used.
- Type
- enable_external_ips¶
Indicates that external IP addresses would be associated with the TPU workers. If set to false, the specified subnetwork or network should have Private Google Access enabled.
- Type
- class google.cloud.tpu_v2.types.NetworkEndpoint(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A network endpoint over which a TPU worker can be reached.
- access_config¶
The access config for the TPU worker.
- class google.cloud.tpu_v2.types.Node(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A TPU instance.
- state¶
Output only. The current state for the TPU Node.
- health_description¶
Output only. If this field is populated, it contains a description of why the TPU Node is unhealthy.
- Type
- network_config¶
Network configurations for the TPU node.
- cidr_block¶
The CIDR block that the TPU node will use when selecting an IP address. This CIDR block must be a /29 block; the Compute Engine networks API forbids a smaller block, and using a larger block would be wasteful (a node can only consume one IP address). Errors will occur if the CIDR block has already been used for a currently existing TPU node, the CIDR block conflicts with any subnetworks in the user’s provided network, or the provided network is peered with another network that is using that CIDR block.
- Type
- service_account¶
The Google Cloud Platform Service Account to be used by the TPU node VMs. If None is specified, the default compute service account will be used.
- create_time¶
Output only. The time when the node was created.
- scheduling_config¶
The scheduling options for this node.
- network_endpoints¶
Output only. The network endpoints where TPU workers can be accessed and sent work. It is recommended that runtime clients of the node reach out to the 0th entry in this map first.
- Type
MutableSequence[google.cloud.tpu_v2.types.NetworkEndpoint]
- health¶
The health status of the TPU node.
- metadata¶
Custom metadata to apply to the TPU Node. Can set startup-script and shutdown-script
- tags¶
Tags to apply to the TPU Node. Tags are used to identify valid sources or targets for network firewalls.
- Type
MutableSequence[str]
- data_disks¶
The additional data disks for the Node.
- Type
MutableSequence[google.cloud.tpu_v2.types.AttachedDisk]
- api_version¶
Output only. The API version that created this Node.
- symptoms¶
Output only. The Symptoms that have occurred to the TPU Node.
- Type
MutableSequence[google.cloud.tpu_v2.types.Symptom]
- shielded_instance_config¶
Shielded Instance options.
- accelerator_config¶
The AccleratorConfig for the TPU Node.
- queued_resource¶
Output only. The qualified name of the QueuedResource that requested this Node.
- Type
- class ApiVersion(value)[source]¶
Bases:
proto.enums.Enum
TPU API Version.
- Values:
- API_VERSION_UNSPECIFIED (0):
API version is unknown.
- V1_ALPHA1 (1):
TPU API V1Alpha1 version.
- V1 (2):
TPU API V1 version.
- V2_ALPHA1 (3):
TPU API V2Alpha1 version.
- V2 (4):
TPU API V2 version.
- class Health(value)[source]¶
Bases:
proto.enums.Enum
Health defines the status of a TPU node as reported by Health Monitor.
- Values:
- HEALTH_UNSPECIFIED (0):
Health status is unknown: not initialized or failed to retrieve.
- HEALTHY (1):
The resource is healthy.
- TIMEOUT (3):
The resource is unresponsive.
- UNHEALTHY_TENSORFLOW (4):
The in-guest ML stack is unhealthy.
- UNHEALTHY_MAINTENANCE (5):
The node is under maintenance/priority boost caused rescheduling and will resume running once rescheduled.
- class LabelsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)¶
Bases:
proto.message.Message
- class MetadataEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)¶
Bases:
proto.message.Message
- class State(value)[source]¶
Bases:
proto.enums.Enum
Represents the different states of a TPU node during its lifecycle.
- Values:
- STATE_UNSPECIFIED (0):
TPU node state is not known/set.
- CREATING (1):
TPU node is being created.
- READY (2):
TPU node has been created.
- RESTARTING (3):
TPU node is restarting.
- REIMAGING (4):
TPU node is undergoing reimaging.
- DELETING (5):
TPU node is being deleted.
- REPAIRING (6):
TPU node is being repaired and may be unusable. Details can be found in the ‘help_description’ field.
- STOPPED (8):
TPU node is stopped.
- STOPPING (9):
TPU node is currently stopping.
- STARTING (10):
TPU node is currently starting.
- PREEMPTED (11):
TPU node has been preempted. Only applies to Preemptible TPU Nodes.
- TERMINATED (12):
TPU node has been terminated due to maintenance or has reached the end of its life cycle (for preemptible nodes).
- HIDING (13):
TPU node is currently hiding.
- HIDDEN (14):
TPU node has been hidden.
- UNHIDING (15):
TPU node is currently unhiding.
- class google.cloud.tpu_v2.types.OperationMetadata(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Metadata describing an [Operation][google.longrunning.Operation]
- create_time¶
The time the operation was created.
- end_time¶
The time the operation finished running.
- class google.cloud.tpu_v2.types.RuntimeVersion(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A runtime version that a Node can be configured with.
- class google.cloud.tpu_v2.types.SchedulingConfig(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Sets the scheduling options for this node.
- class google.cloud.tpu_v2.types.ServiceAccount(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A service account.
- email¶
Email address of the service account. If empty, default Compute service account will be used.
- Type
- class google.cloud.tpu_v2.types.ServiceIdentity(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The per-product per-project service identity for Cloud TPU service.
- class google.cloud.tpu_v2.types.ShieldedInstanceConfig(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A set of Shielded Instance options.
- class google.cloud.tpu_v2.types.StartNodeRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request for [StartNode][google.cloud.tpu.v2.Tpu.StartNode].
- class google.cloud.tpu_v2.types.StopNodeRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request for [StopNode][google.cloud.tpu.v2.Tpu.StopNode].
- class google.cloud.tpu_v2.types.Symptom(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A Symptom instance.
- create_time¶
Timestamp when the Symptom is created.
- symptom_type¶
Type of the Symptom.
- class SymptomType(value)[source]¶
Bases:
proto.enums.Enum
SymptomType represents the different types of Symptoms that a TPU can be at.
- Values:
- SYMPTOM_TYPE_UNSPECIFIED (0):
Unspecified symptom.
- LOW_MEMORY (1):
TPU VM memory is low.
- OUT_OF_MEMORY (2):
TPU runtime is out of memory.
- EXECUTE_TIMED_OUT (3):
TPU runtime execution has timed out.
- MESH_BUILD_FAIL (4):
TPU runtime fails to construct a mesh that recognizes each TPU device’s neighbors.
- HBM_OUT_OF_MEMORY (5):
TPU HBM is out of memory.
- PROJECT_ABUSE (6):
Abusive behaviors have been identified on the current project.
- class google.cloud.tpu_v2.types.UpdateNodeRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request for [UpdateNode][google.cloud.tpu.v2.Tpu.UpdateNode].
- update_mask¶
Required. Mask of fields from [Node][Tpu.Node] to update. Supported fields: [description, tags, labels, metadata, network_config.enable_external_ips].
- node¶
Required. The node. Only fields specified in update_mask are updated.