Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

Commit d8d821c

Browse files
committed
Minor updates
1 parent 28b215f commit d8d821c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

rfcs/20201121-keras-model-fit-ps.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ There are a couple of points worth noting in the above user code:
9696
* The cluster is synced at the end of every epoch. This is an implementation detail users do not necessarily need to be aware of, however is important for the correctness of epoch-level callbacks.
9797
* `run_eagerly=True` case is not supported. This is because `ClusterCoordinator.schedule` requires a `tf.function` to be `schedule`d*, and regular python function cannot.
9898

99-
*There are a couple of reasons why we chose to only support `tf.function` to be scheduled. Primarily, we in general have better control over the behavior of tf.functions, including variable and resource creation. Furthermore, this forces the content of the function to be executed on remote workers, as opposed to possible execution of python code on the coordinator.
99+
*There are a couple of reasons why we chose to only support `tf.function` to be scheduled. Primarily, we in general have better control over the behavior of `tf.functions`, including variable and resource creation. Furthermore, this forces the content of the function to be executed on remote workers, as opposed to possible execution of python code on the coordinator.
100100

101101

102102

@@ -188,7 +188,7 @@ The following discussion is based on option 1, where a simple callable is taken.
188188

189189
##### Implication on no strategy/other strategies
190190

191-
If `model.fit` is allowed to take a `dataset_fn`, use cases for synchronous strategies, and no strategy, can be readily applied. That is, when a dataset is needed, the `callable` is inspected: 1) if the `callable` expects an argument (which is supposed to be the input context), we directly provide it to `distribute_datasets_from_function`, or 2) if the `callable` does not expect an argument, we wrap it in a function which is then provided to `distribute_datasets_from_function`. In either case, we end up obtaining a distributed `dataset`, and the remaining workflow will apply.
191+
If `model.fit` is allowed to take a `dataset_fn`, use cases for synchronous strategies, and no strategy, can be readily applied. That is, when a dataset is needed, the `callable` is inspected: 1) if the `callable` expects an argument (which is supposed to be the input context), we directly provide it to `distribute_datasets_from_function`, or 2) if the `callable` does not expect an argument, we wrap it in a function (whose sole argument is the discarded `input_context`), which is then provided to `distribute_datasets_from_function`. In either case, we end up obtaining a distributed `dataset`, and the remaining workflow will apply.
192192

193193

194194
##### Signature of `dataset_fn`
@@ -423,7 +423,7 @@ For now, we will throw an error if a user provides a `Callback` that overrides `
423423

424424
##### Timing-Based Callbacks
425425

426-
User who wish to create `Callbacks` that execute on a timing interval rather than a step interval can do so via launching a thread in `Callback.on_train_begin`. An example is shown below:
426+
Users who wish to create `Callbacks` that execute on a timing interval rather than a step interval can do so via launching a thread in `Callback.on_train_begin`. An example is shown below:
427427

428428
```
429429
class MyTimingCallback(tf.keras.callbacks.Callback):
@@ -491,6 +491,7 @@ Initially, we aim to have `model.evaluate` and `model.predict` to only be carrie
491491

492492
In the longer term, we seek distributed support for `model.evaluate`, where the evaluate function is scheduled onto the workers to execute. Visitation guarantee cannot be supported currently with the parameter server training API, so we can implement distributed evaluation without it, or wait until that is supported, and integrate it.
493493

494+
Also, see below “Evaluation” section for other proposed evaluation solutions accompanying `model.fit` usage.
494495

495496
### Changes in tf.distribute
496497

0 commit comments

Comments
 (0)