tf.experimental.dtensor.create_distributed_mesh
Stay organized with collections
Save and categorize content based on your preferences.
Creates a single- or multi-client mesh.
tf.experimental.dtensor.create_distributed_mesh(
mesh_dims: List[Tuple[str, int]],
mesh_name: str = '',
num_global_devices: Optional[int] = None,
num_clients: Optional[int] = None,
client_id: Optional[int] = None,
device_type: str = 'CPU'
) -> tf.experimental.dtensor.Mesh
For CPU and GPU meshes, users can choose to use fewer local devices than what
is available. If any argument is missing, it will be extracted from
environment variables. The default values for these environment variables
create a mesh using all devices (common for unit tests).
For TPU meshes, users should not specify any of the nullable arguments. The
DTensor runtime will set these arguments automatically, using all TPU cores
available in the entire cluster.
Args |
mesh_dims
|
A list of (dim_name, dim_size) tuples.
|
mesh_name
|
Name of the created mesh. Defaults to ''.
|
num_global_devices
|
Number of devices in the DTensor cluster. Defaults to
the corresponding environment variable.
|
num_clients
|
Number of clients in the DTensor cluster. Defaults to the
corresponding environment variable, DTENSOR_NUM_CLIENTS.
|
client_id
|
This client's ID. Defaults to the corresponding environment
variable, DTENSOR_CLIENT_ID.
|
device_type
|
Type of device to build the mesh for. Defaults to 'CPU'.
|
Returns |
A mesh created from specified or default arguments.
|
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 2023-03-17 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-03-17 UTC."],[],[]]