@@ -351,6 +351,8 @@ public struct Tensorflow_GraphOptions: SwiftProtobuf.Message {
351351 }
352352
353353 /// Options that control the type and amount of graph rewriting.
354+ /// Not currently configurable via the public Python API (i.e. there is no API
355+ /// stability guarantee if you import RewriterConfig explicitly).
354356 public var rewriteOptions : Tensorflow_RewriterConfig {
355357 get { return _storage. _rewriteOptions ?? Tensorflow_RewriterConfig ( ) }
356358 set { _uniqueStorage ( ) . _rewriteOptions = newValue}
@@ -437,6 +439,23 @@ public struct Tensorflow_ThreadPoolOptionProto: SwiftProtobuf.Message {
437439 /// (see the declaration of the specific field for more info).
438440 public var numThreads : Int32 = 0
439441
442+ /// The global name of the threadpool.
443+ ///
444+ /// If empty, then the threadpool is made and used according to the scope it's
445+ /// in - e.g., for a session threadpool, it is used by that session only.
446+ ///
447+ /// If non-empty, then:
448+ /// - a global threadpool associated with this name is looked
449+ /// up or created. This allows, for example, sharing one threadpool across
450+ /// many sessions (e.g., like the default behavior, if
451+ /// inter_op_parallelism_threads is not configured), but still partitioning
452+ /// into a large and small pool.
453+ /// - if the threadpool for this global_name already exists, then it is an
454+ /// error if the existing pool was created using a different num_threads
455+ /// value as is specified on this call.
456+ /// - threadpools created this way are never garbage collected.
457+ public var globalName : String = String ( )
458+
440459 public var unknownFields = SwiftProtobuf . UnknownStorage ( )
441460
442461 public init ( ) { }
@@ -449,6 +468,7 @@ public struct Tensorflow_ThreadPoolOptionProto: SwiftProtobuf.Message {
449468 while let fieldNumber = try decoder. nextFieldNumber ( ) {
450469 switch fieldNumber {
451470 case 1 : try decoder. decodeSingularInt32Field ( value: & self . numThreads)
471+ case 2 : try decoder. decodeSingularStringField ( value: & self . globalName)
452472 default : break
453473 }
454474 }
@@ -462,6 +482,9 @@ public struct Tensorflow_ThreadPoolOptionProto: SwiftProtobuf.Message {
462482 if self . numThreads != 0 {
463483 try visitor. visitSingularInt32Field ( value: self . numThreads, fieldNumber: 1 )
464484 }
485+ if !self . globalName. isEmpty {
486+ try visitor. visitSingularStringField ( value: self . globalName, fieldNumber: 2 )
487+ }
465488 try unknownFields. traverse ( visitor: & visitor)
466489 }
467490}
@@ -555,13 +578,24 @@ public struct Tensorflow_ConfigProto: SwiftProtobuf.Message {
555578 }
556579
557580 /// This option is experimental - it may be replaced with a different mechanism
558- /// in the future. The intended use is for when some session invocations need
559- /// to run in a background pool limited to a small number of threads.
581+ /// in the future.
560582 ///
561583 /// Configures session thread pools. If this is configured, then RunOptions for
562584 /// a Run call can select the thread pool to use.
563585 ///
564- /// If a pool's num_threads is 0, then inter_op_parallelism_threads is used.
586+ /// The intended use is for when some session invocations need to run in a
587+ /// background pool limited to a small number of threads:
588+ /// - For example, a session may be configured to have one large pool (for
589+ /// regular compute) and one small pool (for periodic, low priority work);
590+ /// using the small pool is currently the mechanism for limiting the inter-op
591+ /// parallelism of the low priority work. Note that it does not limit the
592+ /// parallelism of work spawned by a single op kernel implementation.
593+ /// - Using this setting is normally not needed in training, but may help some
594+ /// serving use cases.
595+ /// - It is also generally recommended to set the global_name field of this
596+ /// proto, to avoid creating multiple large pools. It is typically better to
597+ /// run the non-low-priority work, even across sessions, in a single large
598+ /// pool.
565599 public var sessionInterOpThreadPool : [ Tensorflow_ThreadPoolOptionProto ] {
566600 get { return _storage. _sessionInterOpThreadPool}
567601 set { _uniqueStorage ( ) . _sessionInterOpThreadPool = newValue}
@@ -1055,8 +1089,9 @@ extension Tensorflow_GraphOptions: SwiftProtobuf._MessageImplementationBase, Swi
10551089
10561090 public func _protobuf_generated_isEqualTo( other: Tensorflow_GraphOptions ) -> Bool {
10571091 if _storage !== other. _storage {
1058- let storagesAreEqual : Bool = withExtendedLifetime ( ( _storage, other. _storage) ) { ( _args: ( _StorageClass , _StorageClass ) ) -> Bool in
1059- let _storage = _args. 0 ; let other_storage = _args. 1
1092+ let storagesAreEqual : Bool = withExtendedLifetime ( ( _storage, other. _storage) ) { ( _args: ( _StorageClass , _StorageClass ) ) in
1093+ let _storage = _args. 0
1094+ let other_storage = _args. 1
10601095 if _storage. _enableRecvScheduling != other_storage. _enableRecvScheduling { return false }
10611096 if _storage. _optimizerOptions != other_storage. _optimizerOptions { return false }
10621097 if _storage. _buildCostModel != other_storage. _buildCostModel { return false }
@@ -1078,10 +1113,12 @@ extension Tensorflow_GraphOptions: SwiftProtobuf._MessageImplementationBase, Swi
10781113extension Tensorflow_ThreadPoolOptionProto : SwiftProtobuf . _MessageImplementationBase , SwiftProtobuf . _ProtoNameProviding {
10791114 public static let _protobuf_nameMap : SwiftProtobuf . _NameMap = [
10801115 1 : . standard( proto: " num_threads " ) ,
1116+ 2 : . standard( proto: " global_name " ) ,
10811117 ]
10821118
10831119 public func _protobuf_generated_isEqualTo( other: Tensorflow_ThreadPoolOptionProto ) -> Bool {
10841120 if self . numThreads != other. numThreads { return false }
1121+ if self . globalName != other. globalName { return false }
10851122 if unknownFields != other. unknownFields { return false }
10861123 return true
10871124 }
@@ -1164,8 +1201,9 @@ extension Tensorflow_ConfigProto: SwiftProtobuf._MessageImplementationBase, Swif
11641201
11651202 public func _protobuf_generated_isEqualTo( other: Tensorflow_ConfigProto ) -> Bool {
11661203 if _storage !== other. _storage {
1167- let storagesAreEqual : Bool = withExtendedLifetime ( ( _storage, other. _storage) ) { ( _args: ( _StorageClass , _StorageClass ) ) -> Bool in
1168- let _storage = _args. 0 ; let other_storage = _args. 1
1204+ let storagesAreEqual : Bool = withExtendedLifetime ( ( _storage, other. _storage) ) { ( _args: ( _StorageClass , _StorageClass ) ) in
1205+ let _storage = _args. 0
1206+ let other_storage = _args. 1
11691207 if _storage. _deviceCount != other_storage. _deviceCount { return false }
11701208 if _storage. _intraOpParallelismThreads != other_storage. _intraOpParallelismThreads { return false }
11711209 if _storage. _interOpParallelismThreads != other_storage. _interOpParallelismThreads { return false }
@@ -1227,8 +1265,9 @@ extension Tensorflow_RunOptions: SwiftProtobuf._MessageImplementationBase, Swift
12271265
12281266 public func _protobuf_generated_isEqualTo( other: Tensorflow_RunOptions ) -> Bool {
12291267 if _storage !== other. _storage {
1230- let storagesAreEqual : Bool = withExtendedLifetime ( ( _storage, other. _storage) ) { ( _args: ( _StorageClass , _StorageClass ) ) -> Bool in
1231- let _storage = _args. 0 ; let other_storage = _args. 1
1268+ let storagesAreEqual : Bool = withExtendedLifetime ( ( _storage, other. _storage) ) { ( _args: ( _StorageClass , _StorageClass ) ) in
1269+ let _storage = _args. 0
1270+ let other_storage = _args. 1
12321271 if _storage. _traceLevel != other_storage. _traceLevel { return false }
12331272 if _storage. _timeoutInMs != other_storage. _timeoutInMs { return false }
12341273 if _storage. _interOpThreadPool != other_storage. _interOpThreadPool { return false }
@@ -1284,8 +1323,9 @@ extension Tensorflow_RunMetadata: SwiftProtobuf._MessageImplementationBase, Swif
12841323
12851324 public func _protobuf_generated_isEqualTo( other: Tensorflow_RunMetadata ) -> Bool {
12861325 if _storage !== other. _storage {
1287- let storagesAreEqual : Bool = withExtendedLifetime ( ( _storage, other. _storage) ) { ( _args: ( _StorageClass , _StorageClass ) ) -> Bool in
1288- let _storage = _args. 0 ; let other_storage = _args. 1
1326+ let storagesAreEqual : Bool = withExtendedLifetime ( ( _storage, other. _storage) ) { ( _args: ( _StorageClass , _StorageClass ) ) in
1327+ let _storage = _args. 0
1328+ let other_storage = _args. 1
12891329 if _storage. _stepStats != other_storage. _stepStats { return false }
12901330 if _storage. _costGraph != other_storage. _costGraph { return false }
12911331 if _storage. _partitionGraphs != other_storage. _partitionGraphs { return false }
0 commit comments