You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 10, 2025. It is now read-only.
model.compile(optimizer=..., loss=...) # `ClusterCoordinator` is created
100
-
dataset = tf.data.Dataset.X... # Make use of `preproc_stage` for transformation
101
-
102
-
# `model.fit` serializes and deserializes dataset onto workers
103
-
history = model.fit(dataset, epochs=..., steps_per_epoch=..., callbacks=[...])
104
-
logging.info("result: %r", history)
105
-
```
106
-
107
90
#### Notable differences of user code between PS and other strategies
108
91
109
92
There are a couple of points worth noting in the above user code:
@@ -715,3 +698,20 @@ Asynchronous `Callback`s might be worth exploring in a future extension to the f
715
698
### Support of `dataset` in `ClusterCoordinator`
716
699
717
700
Previously, we have considered the possibility to support `dataset` instance in `model.fit` to keep the existing API contract. In this case, it should be preferred that `ClusterCoordinator` provides native `dataset` support, which `model.fit` can readily use, rather than `model.fit` implementing replication logic to accommodate that. Similar to `experimental_distribute_dataset` API, `ClusterCoordinator` can use `tf.data`’s `replicate` API to serialize the dataset graph, and unserialize onto workers.
0 commit comments