View source on GitHub
|
Describes a set of TPU devices.
tf.tpu.experimental.Topology(
serialized=None, mesh_shape=None, device_coordinates=None
)
Represents both the shape of the physical mesh, and the mapping between TensorFlow TPU devices to physical mesh coordinates.
serialized
TopologyProto, or None. If not None, the
serialized proto is parsed to discover the topology.
mesh_shape
None. If not None,
the shape of the TPU topology, in number of cores. Ignored if
serialized is not None.
device_coordinates
None. If
specified, array is a rank 3 int32 array with shape
[tasks, devices, axis]. tasks is the number of tasks in the TPU
cluster, devices is the number of TPU devices per task, and axis is
the number of axes in the TPU cluster topology. Each entry gives the
axis-th coordinate in the topology of a task/device pair. TPU
topologies are 4-dimensional, with dimensions (x, y, z, core number).
This arg is ignored if serialized is notNone`.
ValueError
serialized does not describe a well-formed topology.
ValueError
serialized is None and mesh_shape is not a sequence
of 4 positive integers.
ValueError
serialized is None and device_coordinates is not a
rank 3 numpy int32 array that describes a valid coordinate mapping.
device_coordinates
mesh_rank
mesh_shape
missing_devices
num_tasks
num_tpus_per_task
cpu_device_name_at_coordinatescpu_device_name_at_coordinates(
device_coordinates, job=None
)
Returns the CPU device attached to a logical core.
serializedserialized()
Returns the serialized form of the topology.
task_ordinal_at_coordinatestask_ordinal_at_coordinates(
device_coordinates
)
Returns the TensorFlow task number attached to device_coordinates.
device_coordinates
tpu_device_name_at_coordinatestpu_device_name_at_coordinates(
device_coordinates, job=None
)
Returns the name of the TPU device assigned to a logical core.
tpu_device_ordinal_at_coordinatestpu_device_ordinal_at_coordinates(
device_coordinates
)
Returns the TensorFlow device number at device_coordinates.
device_coordinates
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-04-26 UTC.