Make "share_cluster_devices_in_session" non experimental.
PiperOrigin-RevId: 294773227 Change-Id: Ib71d36f09e7e0fde3b5afe6710b9011d39445ede
This commit is contained in:
parent
057e8630bc
commit
a94839d791
@ -1280,8 +1280,7 @@ Status ColocationGraph::InitializeMemberWithAssignedDevice(
|
|||||||
"available on this machine: [",
|
"available on this machine: [",
|
||||||
absl::StrJoin(DevicesToString(device_set_.devices()), ", "), "].",
|
absl::StrJoin(DevicesToString(device_set_.devices()), ", "), "].",
|
||||||
"If you are seeing this error when running using a tf.Session, set "
|
"If you are seeing this error when running using a tf.Session, set "
|
||||||
"experimental.share_cluster_devices_in_session to true in the "
|
"share_cluster_devices_in_session to true in the tf.ConfigProto.");
|
||||||
"tf.ConfigProto.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto& d : member->supported_device_types()) {
|
for (const auto& d : member->supported_device_types()) {
|
||||||
|
@ -1319,12 +1319,23 @@ Status MasterSession::CreateWorkerSessions(
|
|||||||
workers[i].name = &worker_names[i];
|
workers[i].name = &worker_names[i];
|
||||||
workers[i].worker = worker_cache->GetOrCreateWorker(worker_names[i]);
|
workers[i].worker = worker_cache->GetOrCreateWorker(worker_names[i]);
|
||||||
workers[i].request.set_session_handle(handle_);
|
workers[i].request.set_session_handle(handle_);
|
||||||
if (session_opts_.config.experimental()
|
if (session_opts_.config.share_cluster_devices_in_session() ||
|
||||||
|
session_opts_.config.experimental()
|
||||||
.share_cluster_devices_in_session()) {
|
.share_cluster_devices_in_session()) {
|
||||||
for (const auto& remote_dev : devices_->devices()) {
|
for (const auto& remote_dev : devices_->devices()) {
|
||||||
*workers[i].request.add_cluster_device_attributes() =
|
*workers[i].request.add_cluster_device_attributes() =
|
||||||
remote_dev->attributes();
|
remote_dev->attributes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!session_opts_.config.share_cluster_devices_in_session() &&
|
||||||
|
session_opts_.config.experimental()
|
||||||
|
.share_cluster_devices_in_session()) {
|
||||||
|
LOG(WARNING)
|
||||||
|
<< "ConfigProto.Experimental.share_cluster_devices_in_session has "
|
||||||
|
"been promoted to a non-experimental API. Please use "
|
||||||
|
"ConfigProto.share_cluster_devices_in_session instead. The "
|
||||||
|
"experimental option will be removed in the future.";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceNameUtils::ParsedName name;
|
DeviceNameUtils::ParsedName name;
|
||||||
|
@ -467,6 +467,12 @@ message ConfigProto {
|
|||||||
// enabled, this field is ignored and sessions are always isolated.
|
// enabled, this field is ignored and sessions are always isolated.
|
||||||
bool isolate_session_state = 15;
|
bool isolate_session_state = 15;
|
||||||
|
|
||||||
|
// When true, WorkerSessions are created with device attributes from the
|
||||||
|
// full cluster.
|
||||||
|
// This is helpful when a worker wants to partition a graph
|
||||||
|
// (for example during a PartitionedCallOp).
|
||||||
|
bool share_cluster_devices_in_session = 17;
|
||||||
|
|
||||||
// Everything inside Experimental is subject to change and is not subject
|
// Everything inside Experimental is subject to change and is not subject
|
||||||
// to API stability guarantees in
|
// to API stability guarantees in
|
||||||
// https://www.tensorflow.org/guide/version_compat.
|
// https://www.tensorflow.org/guide/version_compat.
|
||||||
@ -530,10 +536,8 @@ message ConfigProto {
|
|||||||
// CPU usage.
|
// CPU usage.
|
||||||
bool disable_thread_spinning = 9;
|
bool disable_thread_spinning = 9;
|
||||||
|
|
||||||
// When true, WorkerSessions are created with device attributes from the
|
// This was promoted to a non-experimental API. Please use
|
||||||
// full cluster.
|
// ConfigProto.share_cluster_devices_in_session instead.
|
||||||
// This is helpful when a worker wants to partition a graph
|
|
||||||
// (for example during a PartitionedCallOp).
|
|
||||||
bool share_cluster_devices_in_session = 10;
|
bool share_cluster_devices_in_session = 10;
|
||||||
|
|
||||||
// Metadata about the session.
|
// Metadata about the session.
|
||||||
@ -582,7 +586,7 @@ message ConfigProto {
|
|||||||
|
|
||||||
Experimental experimental = 16;
|
Experimental experimental = 16;
|
||||||
|
|
||||||
// Next: 17
|
// Next: 18
|
||||||
}
|
}
|
||||||
|
|
||||||
// Options for a single Run() call.
|
// Options for a single Run() call.
|
||||||
|
@ -993,7 +993,7 @@ class PartitionedCallTest(test.TestCase):
|
|||||||
sess.run(variables.global_variables_initializer())
|
sess.run(variables.global_variables_initializer())
|
||||||
|
|
||||||
config = config_pb2.ConfigProto()
|
config = config_pb2.ConfigProto()
|
||||||
config.experimental.share_cluster_devices_in_session = True
|
config.share_cluster_devices_in_session = True
|
||||||
|
|
||||||
with session.Session(workers[0].target, config=config) as sess:
|
with session.Session(workers[0].target, config=config) as sess:
|
||||||
res = sess.run(f(a, b))
|
res = sess.run(f(a, b))
|
||||||
|
@ -98,6 +98,12 @@ tf_proto {
|
|||||||
label: LABEL_OPTIONAL
|
label: LABEL_OPTIONAL
|
||||||
type: TYPE_BOOL
|
type: TYPE_BOOL
|
||||||
}
|
}
|
||||||
|
field {
|
||||||
|
name: "share_cluster_devices_in_session"
|
||||||
|
number: 17
|
||||||
|
label: LABEL_OPTIONAL
|
||||||
|
type: TYPE_BOOL
|
||||||
|
}
|
||||||
field {
|
field {
|
||||||
name: "experimental"
|
name: "experimental"
|
||||||
number: 16
|
number: 16
|
||||||
|
Loading…
Reference in New Issue
Block a user