tf.tpu.experimental.DeviceAssignment

View source on GitHub

Mapping from logical cores in a computation to the physical TPU topology.

tf.tpu.experimental.DeviceAssignment(
    topology, core_assignment
)

Prefer to use the DeviceAssignment.build() helper to construct a DeviceAssignment; it is easier if less flexible than constructing a DeviceAssignment directly.

Args:

Attributes:

Raises:

Methods

build

View source

@staticmethod
build(
    topology, computation_shape=None, computation_stride=None, num_replicas=1
)

coordinates

View source

coordinates(
    replica, logical_core
)

Returns the physical topology coordinates of a logical core.

host_device

View source

host_device(
    replica=0, logical_core=0, job=None
)

Returns the CPU device attached to a logical core.

lookup_replicas

View source

lookup_replicas(
    task_id, logical_core
)

Lookup replica ids by task number and logical core.

Args:

Returns:

A sorted list of the replicas that are attached to that task and logical_core.

Raises:

tpu_device

View source

tpu_device(
    replica=0, logical_core=0, job=None
)

Returns the name of the TPU device assigned to a logical core.

tpu_ordinal

View source

tpu_ordinal(
    replica=0, logical_core=0
)

Returns the ordinal of the TPU device assigned to a logical core.