diff options
author | Derek Murray <mrry@google.com> | 2016-10-10 01:44:17 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-10-10 02:54:26 -0700 |
commit | 24dedaf72ae86d3daf173cb539a18ea5ed09dd5c (patch) | |
tree | 15d15ef909a67bdb7d42b78bd9598f19ba36fe38 /WORKSPACE | |
parent | 81fab8a90f4e6d38e667bfec45b404030b5c0601 (diff) |
Simplify locking in SimpleGraphExecutionState.
This change removes lazy initialization of the base graph in
SimpleGraphExecutionState, and instead initializes the base graph when
the object is constructed. This allows us to access the (read only
once written) graph without acquiring a mutex, which improves
performance for concurrent read operations on the graph.
In particular, this change optimizes the statistics processing code in
`master_session.cc`, which resolves node types and other details using
the Graph* in a SimpleGraphExecutionState. When many steps
concurrently compute timelines (as might happen during a profiling
session), there can be massive contention on this shared read-only
structure, leading to inaccurate timing results. (In addition to
relieving the contention, this change avoids copying each `NodeDef` to
generate its profiling information.)
To simplify the locking, we need to combine the unfailing existing
constructor for SimpleGraphExecutionState with some methods that can
fail due to invalid input. Therefore the construction of a
SimpleGraphExecutionState now uses static constructors, so that
construction can return an error status.
**N.B.** If you use the C++ Session API, you may notice that many
errors are now raised earlier (i.e. on Session::Create or
Session::Extend) rather than the first Session::Run call.
Change: 135654905
Diffstat (limited to 'WORKSPACE')
0 files changed, 0 insertions, 0 deletions