Skip to content

Commit fe1ff3c

Browse files
mrrytensorflower-gardener
authored andcommitted
[tf.data] Apply single-device multi component function optimization in RunSync().
Previously, `RunSync()` was missing the optimization from e5c6881 that enables a single-component multi-device function from being executed as a local function. When 624f1a0 switched all tf.data functions to be considered as multi-device functions, the optimization became load-bearing, because occasionally it will dispatch a function to a ProcessFunctionLibraryRuntime that does not actually support multi-device functions, because it has no rendezvous factory. The fix is simple: update the call to `GetHandleOnDevice()` in `PrepareRunSync()` to pass the optional `include_multi_device = true` argument. PiperOrigin-RevId: 309481098 Change-Id: Id12d01cffc50399bab5711c7de4756c542873ec2
1 parent 412b12e commit fe1ff3c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎tensorflow/core/common_runtime/function.cc‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1235,7 +1235,8 @@ Status FunctionLibraryRuntimeImpl::PrepareRunSync(
12351235
run_opts->create_rendezvous = false;
12361236
}
12371237

1238-
LocalHandle local_handle = parent_->GetHandleOnDevice(device_name_, handle);
1238+
LocalHandle local_handle = parent_->GetHandleOnDevice(
1239+
device_name_, handle, /*include_multi_device=*/true);
12391240
if (local_handle == kInvalidLocalHandle) {
12401241
*out_item = nullptr;
12411242
return Status::OK();

0 commit comments

Comments
 (0)