tf.distribute strategy utils for Ranking pipeline in tfr.keras.
In TF2, the distributed training can be easily handled with Strategy offered in
tf.distribute. Depending on device and MapReduce technique, there are four
strategies are currently supported. They are:
MirroredStrategy: synchronous strategy on a single CPU/GPU worker.
MultiWorkerMirroredStrategy: synchronous strategy on multiple CPU/GPU workers.
TPUStrategy: distributed strategy working on TPU.
ParameterServerStrategy: asynchronous distributed strategy on CPU/GPU workers.
[null,null,["Last updated 2023-08-18 UTC."],[],[],null,["# Module: tfr.keras.strategy_utils\n\n\u003cbr /\u003e\n\n|------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/ranking/blob/v0.5.3/tensorflow_ranking/python/keras/strategy_utils.py) |\n\ntf.distribute strategy utils for Ranking pipeline in tfr.keras.\n\nIn TF2, the distributed training can be easily handled with Strategy offered in\ntf.distribute. Depending on device and MapReduce technique, there are four\nstrategies are currently supported. They are:\nMirroredStrategy: synchronous strategy on a single CPU/GPU worker.\nMultiWorkerMirroredStrategy: synchronous strategy on multiple CPU/GPU workers.\nTPUStrategy: distributed strategy working on TPU.\nParameterServerStrategy: asynchronous distributed strategy on CPU/GPU workers.\n| **Note:** ParameterServerStrategy is not fully compatible with `model.fit` in current version of tensorflow, thus not supported.\n\nPlease check \u003chttps://www.tensorflow.org/guide/distributed_training\u003e for more\ninformation.\n\nClasses\n-------\n\n[`class NullContextManager`](../../tfr/keras/strategy_utils/NullContextManager): A null context manager for local training.\n\nFunctions\n---------\n\n[`get_output_filepath(...)`](../../tfr/keras/strategy_utils/get_output_filepath): Gets filepaths for different workers to resolve conflict of MWMS.\n\n[`get_strategy(...)`](../../tfr/keras/strategy_utils/get_strategy): Creates and initializes the requested tf.distribute strategy.\n\n[`strategy_scope(...)`](../../tfr/keras/strategy_utils/strategy_scope): Gets the strategy.scope() for training with strategy.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Other Members ------------- ||\n|-------------------|---------------------------------|\n| MIRRORED_STRATEGY | `'MirroredStrategy'` |\n| MWMS_STRATEGY | `'MultiWorkerMirroredStrategy'` |\n| PS_STRATEGY | `'ParameterServerStrategy'` |\n| TPU_STRATEGY | `'TPUStrategy'` |\n\n\u003cbr /\u003e"]]