tf.experimental.dtensor.sharded_save
Stay organized with collections
Save and categorize content based on your preferences.
Saves given named tensor slices in a sharded, multi-client safe fashion.
tf.experimental.dtensor.sharded_save(
mesh: tf.experimental.dtensor.Mesh
,
file_prefix: Union[str, tf.Tensor
],
tensor_names: Union[List[str], tf.Tensor
],
shape_and_slices: Union[List[str], tf.Tensor
],
tensors: List[Union[tensor_lib.Tensor, tf_variables.Variable]]
)
The method makes sure the checkpoint directory state is correct in a sharded
mutli-client saving. Namely, we place a barrier after SaveV2 to make sure
every client has done writing the files. And another one after
MergeV2Checkpoints to make sure all Metadata is properly merged.
Upon existing, the checkpoint is completed and the all directory operations
are done.
Args |
mesh
|
The Mesh that contains the Tensors to save.
|
file_prefix
|
The prefix of checkpoint.
|
tensor_names
|
a list of tensor names used in save op.
|
shape_and_slices
|
a list of shape and slice specification used in save op.
The only supported value is "" as we don't support distributed saving with
slices yet.
|
tensors
|
a list of tensors used in save op. The order should match
tensor_names.
|
Returns |
A MergeV2Checkpoints op that merged all Metadata.
|
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-10-06 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-10-06 UTC."],[],[]]