Enable lazy_remote_inputs_copy by default.
PiperOrigin-RevId: 285468401 Change-Id: I49f7477dad816de3f4986c01c35e2121bfb00539
This commit is contained in:
parent
a3783f4716
commit
913e50445b
@ -58,7 +58,7 @@ struct TFE_ContextOptions {
|
|||||||
TFE_DEVICE_PLACEMENT_SILENT};
|
TFE_DEVICE_PLACEMENT_SILENT};
|
||||||
TFE_ContextMirroringPolicy mirroring_policy{TFE_MIRRORING_NONE};
|
TFE_ContextMirroringPolicy mirroring_policy{TFE_MIRRORING_NONE};
|
||||||
// If true, lazily copy the remote inputs of a function to the target devices.
|
// If true, lazily copy the remote inputs of a function to the target devices.
|
||||||
bool lazy_remote_inputs_copy = false;
|
bool lazy_remote_inputs_copy = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TFE_Context {
|
struct TFE_Context {
|
||||||
|
@ -405,7 +405,7 @@ class Context(object):
|
|||||||
if execution_mode is None:
|
if execution_mode is None:
|
||||||
execution_mode = SYNC
|
execution_mode = SYNC
|
||||||
self._default_is_async = execution_mode == ASYNC
|
self._default_is_async = execution_mode == ASYNC
|
||||||
self._lazy_remote_inputs_copy = False
|
self._lazy_remote_inputs_copy = None
|
||||||
self._server_def = server_def
|
self._server_def = server_def
|
||||||
self._collective_ops_server_def = None
|
self._collective_ops_server_def = None
|
||||||
self._collective_leader = None
|
self._collective_leader = None
|
||||||
@ -506,9 +506,9 @@ class Context(object):
|
|||||||
opts, self._mirroring_policy)
|
opts, self._mirroring_policy)
|
||||||
if self._default_is_async == ASYNC:
|
if self._default_is_async == ASYNC:
|
||||||
pywrap_tensorflow.TFE_ContextOptionsSetAsync(opts, True)
|
pywrap_tensorflow.TFE_ContextOptionsSetAsync(opts, True)
|
||||||
if self._lazy_remote_inputs_copy:
|
if self._lazy_remote_inputs_copy is not None:
|
||||||
pywrap_tensorflow.TFE_ContextOptionsSetLazyRemoteInputsCopy(
|
pywrap_tensorflow.TFE_ContextOptionsSetLazyRemoteInputsCopy(
|
||||||
opts, True)
|
opts, self._lazy_remote_inputs_copy)
|
||||||
context_handle = pywrap_tensorflow.TFE_NewContext(opts)
|
context_handle = pywrap_tensorflow.TFE_NewContext(opts)
|
||||||
finally:
|
finally:
|
||||||
pywrap_tensorflow.TFE_DeleteContextOptions(opts)
|
pywrap_tensorflow.TFE_DeleteContextOptions(opts)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user