CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends
tensorflow::TBBSession Class Reference

#include <TBBSession.h>

Inheritance diagram for tensorflow::TBBSession:
Session

Classes

struct  ExecutorsAndKeys
 
struct  FunctionInfo
 
struct  PerPartitionExecutorsAndLib
 
struct  RunState
 
struct  RunStateArgs
 

Public Types

typedef std::function< void(Session *)> CloseCallback
 
typedef std::vector< std::pair< string, Tensor > > NamedTensorList
 
typedef std::unordered_map< StringPiece, Node *, StringPieceHasher > NameNodeMap
 

Public Member Functions

::tensorflow::Status Close () override
 
::tensorflow::Status Create (const GraphDef &graph) override
 
void ExportCostModels (CostModelManager::CostModelMap *cost_models)
 
::tensorflow::Status Extend (const GraphDef &graph) override
 
::tensorflow::Status ListDevices (std::vector< DeviceAttributes > *response) override
 
::tensorflow::Status LocalDeviceManager (const DeviceMgr **output) override
 
::tensorflow::Status Reset (const std::vector< string > &containers)
 
::tensorflow::Status Run (const NamedTensorList &inputs, const std::vector< string > &output_names, const std::vector< string > &target_nodes, std::vector< Tensor > *outputs) override
 
::tensorflow::Status Run (const ::tensorflow::RunOptions &run_options, const NamedTensorList &inputs, const std::vector< string > &output_names, const std::vector< string > &target_nodes, std::vector< Tensor > *outputs, RunMetadata *run_metadata) override
 
 TBBSession (const SessionOptions &options, const DeviceMgr *device_mgr, TBBSessionFactory *factory)
 
 ~TBBSession () override
 

Private Member Functions

::tensorflow::Status CheckNotClosed ()
 
::tensorflow::Status CreateDebuggerState (const DebugOptions &debug_options, int64 session_run_index, int64 executor_step_index, const std::vector< string > &input_names, const std::vector< string > &output_names, const std::vector< string > &target_names, std::unique_ptr< DebuggerStateInterface > *debugger_state)
 
::tensorflow::Status CreateGraphs (const BuildGraphOptions &options, std::unordered_map< string, std::unique_ptr< Graph >> *outputs, std::unique_ptr< FunctionLibraryDefinition > *flib_def, RunStateArgs *run_state_args, DataTypeVector *input_types, DataTypeVector *output_types)
 
::tensorflow::Status DecorateAndPublishGraphForDebug (const DebugOptions &debug_options, Graph *graph, Device *device)
 
::tensorflow::Status ExtendLocked (const GraphDef &graph) EXCLUSIVE_LOCKS_REQUIRED(graph_def_lock_)
 
::tensorflow::Status GetOrCreateExecutors (gtl::ArraySlice< string > inputs, gtl::ArraySlice< string > outputs, gtl::ArraySlice< string > target_nodes, ExecutorsAndKeys **executors_and_keys, RunStateArgs *run_state_args)
 
bool graph_created_ GUARDED_BY (graph_def_lock_)
 
GraphDef graph_def_ GUARDED_BY (graph_def_lock_)
 
std::vector< std::unique_ptr< FunctionInfo > > functions_ GUARDED_BY (executor_lock_)
 
std::unordered_map< string, std::shared_ptr< ExecutorsAndKeys > > executors_ GUARDED_BY (executor_lock_)
 
std::unordered_map< string, std::unique_ptr< RunState > > partial_runs_ GUARDED_BY (executor_lock_)
 
std::unordered_map< string, string > stateful_placements_ GUARDED_BY (graph_def_lock_)
 
std::unique_ptr< GraphExecutionState > execution_state_ GUARDED_BY (graph_def_lock_)
 
bool closed_ GUARDED_BY (closed_lock_)
 
Status MaybeInitializeExecutionState (const GraphDef &graph, bool *out_already_initialized) EXCLUSIVE_LOCKS_REQUIRED(graph_def_lock_)
 
::tensorflow::Status ResourceHandleToInputTensor (const Tensor &resource_tensor, Tensor *retrieved_tensor)
 
void SchedClosure (tbb::task_arena &arena, tbb::task_group &g, std::function< void()> c)
 
 TF_DISALLOW_COPY_AND_ASSIGN (TBBSession)
 
::tensorflow::Status WaitForNotification (Notification *n, int64 timeout_in_ms)
 
void WaitForNotification (tbb::task_arena &arena, tbb::task_group &group, RunState *run_state, CancellationManager *cm, int64 timeout_in_ms)
 

Private Attributes

CancellationManager * cancellation_manager_
 
mutex closed_lock_
 
CostModelManager cost_model_manager_
 
const std::unique_ptr< const DeviceMgr > device_mgr_
 
DeviceSet device_set_
 
std::vector< Device * > devices_
 
std::atomic< int64 > edge_name_counter_ = {0}
 
mutex executor_lock_
 
TBBSessionFactory *const factory_
 
std::unique_ptr< FunctionLibraryDefinition > flib_def_
 
mutex graph_def_lock_
 
std::atomic< int64 > handle_name_counter_ = {0}
 
Status init_error_
 
Executor::Args::NodeOutputsCallback node_outputs_callback_ = nullptr
 
const int64 operation_timeout_in_ms_ = 0
 
const SessionOptions options_
 
string session_handle_
 
SessionState session_state_
 
bool sync_on_finish_ = true
 

Static Private Attributes

static std::atomic_int_fast64_t step_id_counter_
 

Friends

class DebugGateway
 

Detailed Description

Definition at line 81 of file TBBSession.h.

Member Typedef Documentation

typedef std::function<void(Session*)> tensorflow::TBBSession::CloseCallback

Definition at line 83 of file TBBSession.h.

typedef std::vector<std::pair<string, Tensor> > tensorflow::TBBSession::NamedTensorList

Definition at line 93 of file TBBSession.h.

typedef std::unordered_map<StringPiece, Node*, StringPieceHasher> tensorflow::TBBSession::NameNodeMap

Definition at line 94 of file TBBSession.h.

Constructor & Destructor Documentation

tensorflow::TBBSession::TBBSession ( const SessionOptions &  options,
const DeviceMgr *  device_mgr,
TBBSessionFactory factory 
)

Definition at line 197 of file TBBSession.cc.

References edmIntegrityCheck::d, device_mgr_, device_set_, devices_, dqm::qstatus::ERROR, MessageLogger_cfi::INFO, LOG, session_handle_, btagGenBb_cfi::Status, mps_update::status, and sync_on_finish_.

200  : options_(options),
201  device_mgr_(device_mgr),
202  factory_(factory),
203  cancellation_manager_(new CancellationManager()),
204  operation_timeout_in_ms_(options_.config.operation_timeout_in_ms()) {
205  // The default value of sync_on_finish will be flipped soon and this
206  // environment variable will be removed as well.
207  const Status status =
208  ReadBoolFromEnvVar("TF_SYNC_ON_FINISH", true, &sync_on_finish_);
209  if (!status.ok()) {
210  LOG(ERROR) << status.error_message();
211  }
212  // NOTE(mrry): We do not need to use a unique string for the session
213  // handle, because TBBSession owns its devices. This may change
214  // in future versions.
215  session_handle_ = "tbb";
216  int devices_added = 0;
217  if (options.config.log_device_placement()) {
218  const string mapping_str = device_mgr_->DeviceMappingString();
219  if (mapping_str.empty()) {
220  printf("Device mapping: no known devices.\n");
221  } else {
222  printf("Device mapping:\n%s", mapping_str.c_str());
223  }
224  LOG(INFO) << "Device mapping:\n" << mapping_str;
225  }
226  for (auto d : device_mgr_->ListDevices()) {
227  devices_.push_back(d);
228  device_set_.AddDevice(d);
229  d->op_segment()->AddHold(session_handle_);
230 
231  // The first device added is special: it is the 'client device' (a
232  // CPU device) from which we feed and fetch Tensors.
233  if (devices_added == 0) {
234  device_set_.set_client_device(d);
235  }
236  ++devices_added;
237  }
238 }
std::vector< Device * > devices_
Definition: TBBSession.h:271
#define LOG(A)
CancellationManager * cancellation_manager_
Definition: TBBSession.h:306
const SessionOptions options_
Definition: TBBSession.h:267
TBBSessionFactory *const factory_
Definition: TBBSession.h:305
const std::unique_ptr< const DeviceMgr > device_mgr_
Definition: TBBSession.h:270
const int64 operation_timeout_in_ms_
Definition: TBBSession.h:336
static const int ERROR
tensorflow::TBBSession::~TBBSession ( )
override

Definition at line 240 of file TBBSession.cc.

References cancellation_manager_, Close(), edmIntegrityCheck::d, device_mgr_, flib_def_, and session_handle_.

240  {
241  if (!closed_) Close().IgnoreError();
242  for (auto& it : partial_runs_) {
243  it.second.reset(nullptr);
244  }
245  for (auto& it : executors_) {
246  it.second.reset();
247  }
248  for (auto d : device_mgr_->ListDevices()) {
249  d->op_segment()->RemoveHold(session_handle_);
250  }
251  for (auto d : device_mgr_->ListDevices()) {
252  d->ClearResourceMgr();
253  }
254  functions_.clear();
255  delete cancellation_manager_;
256 
257  execution_state_.reset(nullptr);
258  flib_def_.reset(nullptr);
259 }
std::unique_ptr< FunctionLibraryDefinition > flib_def_
Definition: TBBSession.h:322
::tensorflow::Status Close() override
Definition: TBBSession.cc:1080
CancellationManager * cancellation_manager_
Definition: TBBSession.h:306
const std::unique_ptr< const DeviceMgr > device_mgr_
Definition: TBBSession.h:270

Member Function Documentation

::tensorflow::Status tensorflow::TBBSession::CheckNotClosed ( )
inlineprivate

Definition at line 251 of file TBBSession.h.

References pfDeepBoostedJetPreprocessParams_cfi::input_names, checklumidiff::l, and btagGenBb_cfi::Status.

Referenced by DecorateAndPublishGraphForDebug(), and Extend().

251  {
252  mutex_lock l(closed_lock_);
253  if (closed_) return errors::Cancelled("Session has been closed.");
255  }
std::pair< int, edm::FunctionWithDict > OK
Definition: findMethod.cc:136
tensorflow::Status tensorflow::TBBSession::Close ( )
override

Definition at line 1080 of file TBBSession.cc.

References cancellation_manager_, closed_lock_, tensorflow::TBBSessionFactory::Deregister(), factory_, and checklumidiff::l.

Referenced by ~TBBSession().

1080  {
1081  cancellation_manager_->StartCancel();
1082  {
1083  mutex_lock l(closed_lock_);
1084  if (closed_) return ::tensorflow::Status::OK();
1085  closed_ = true;
1086  }
1087  if (factory_ != nullptr) factory_->Deregister(this);
1089 }
void Deregister(const TBBSession *session)
Definition: TBBSession.cc:156
CancellationManager * cancellation_manager_
Definition: TBBSession.h:306
std::pair< int, edm::FunctionWithDict > OK
Definition: findMethod.cc:136
TBBSessionFactory *const factory_
Definition: TBBSession.h:305
Status tensorflow::TBBSession::Create ( const GraphDef &  graph)
override

Definition at line 292 of file TBBSession.cc.

References ExtendLocked(), graph_def_lock_, init_error_, and checklumidiff::l.

292  {
293  TF_RETURN_IF_ERROR(init_error_);
294  if (graph.node_size() > 0) {
295  mutex_lock l(graph_def_lock_);
296  if (graph_created_) {
297  return errors::AlreadyExists(
298  "A Graph has already been created for this session.");
299  }
300  return ExtendLocked(graph);
301  }
302  return Status::OK();
303 }
std::pair< int, edm::FunctionWithDict > OK
Definition: findMethod.cc:136
::tensorflow::Status ExtendLocked(const GraphDef &graph) EXCLUSIVE_LOCKS_REQUIRED(graph_def_lock_)
Definition: TBBSession.cc:311
Status tensorflow::TBBSession::CreateDebuggerState ( const DebugOptions &  debug_options,
int64  session_run_index,
int64  executor_step_index,
const std::vector< string > &  input_names,
const std::vector< string > &  output_names,
const std::vector< string > &  target_names,
std::unique_ptr< DebuggerStateInterface > *  debugger_state 
)
private

Definition at line 335 of file TBBSession.cc.

References pfDeepBoostedJetPreprocessParams_cfi::input_names.

Referenced by DecorateAndPublishGraphForDebug().

340  {
341  TF_RETURN_IF_ERROR(
342  DebuggerStateRegistry::CreateState(debug_options, debugger_state));
343  TF_RETURN_IF_ERROR(debugger_state->get()->PublishDebugMetadata(
344  debug_options.global_step(), session_run_index, executor_step_index,
345  input_names, output_names, target_names));
346  return Status::OK();
347 }
std::pair< int, edm::FunctionWithDict > OK
Definition: findMethod.cc:136
Status tensorflow::TBBSession::CreateGraphs ( const BuildGraphOptions &  options,
std::unordered_map< string, std::unique_ptr< Graph >> *  outputs,
std::unique_ptr< FunctionLibraryDefinition > *  flib_def,
RunStateArgs run_state_args,
DataTypeVector *  input_types,
DataTypeVector *  output_types 
)
private

Definition at line 908 of file TBBSession.cc.

References KineDebug3::count(), edmIntegrityCheck::d, device_mgr_, device_set_, devices_, edge_name_counter_, flib_def_, tensorflow::TBBSession::RunStateArgs::graph, graph_def_lock_, tensorflow::TBBSession::RunStateArgs::is_partial_run, checklumidiff::l, eostools::move(), dataset::name, options_, PatBasicFWLiteJetAnalyzer_Selector_cfg::outputs, tablePrinter::prefix, alignCSCRings::s, btagGenBb_cfi::Status, and std::swap().

Referenced by GetOrCreateExecutors().

913  {
914  mutex_lock l(graph_def_lock_);
915  std::unique_ptr<ClientGraph> client_graph;
916 
917  std::unique_ptr<GraphExecutionState> temp_exec_state_holder;
918  GraphExecutionState* execution_state = nullptr;
919  if (options_.config.graph_options().place_pruned_graph()) {
920  // Because we are placing pruned graphs, we need to create a
921  // new GraphExecutionState for every new unseen graph,
922  // and then place it.
923  GraphExecutionStateOptions prune_options;
924  prune_options.device_set = &device_set_;
925  prune_options.session_options = &options_;
926  prune_options.stateful_placements = stateful_placements_;
927  TF_RETURN_IF_ERROR(GraphExecutionState::MakeForPrunedGraph(
928  execution_state_->original_graph_def().library(), prune_options,
929  execution_state_->original_graph_def(), subgraph_options,
930  &temp_exec_state_holder, &client_graph));
931  execution_state = temp_exec_state_holder.get();
932  } else {
933  execution_state = execution_state_.get();
934  TF_RETURN_IF_ERROR(
935  execution_state->BuildGraph(subgraph_options, &client_graph));
936  }
937 
938  if (subgraph_options.feed_endpoints.size() !=
939  client_graph->feed_types.size()) {
940  return errors::Internal(
941  "Graph pruning failed: requested number of feed endpoints = ",
942  subgraph_options.feed_endpoints.size(),
943  " versus number of pruned feed endpoints = ",
944  client_graph->feed_types.size());
945  }
946  if (subgraph_options.fetch_endpoints.size() !=
947  client_graph->fetch_types.size()) {
948  return errors::Internal(
949  "Graph pruning failed: requested number of fetch endpoints = ",
950  subgraph_options.fetch_endpoints.size(),
951  " versus number of pruned fetch endpoints = ",
952  client_graph->fetch_types.size());
953  }
954 
955  auto current_stateful_placements = execution_state->GetStatefulPlacements();
956  // Update our current state based on the execution_state's
957  // placements. If there are any mismatches for a node,
958  // we should fail, as this should never happen.
959  for (auto placement_pair : current_stateful_placements) {
960  const string& node_name = placement_pair.first;
961  const string& placement = placement_pair.second;
962  auto iter = stateful_placements_.find(node_name);
963  if (iter == stateful_placements_.end()) {
964  stateful_placements_.insert(std::make_pair(node_name, placement));
965  } else if (iter->second != placement) {
966  return errors::Internal(
967  "Stateful placement mismatch. "
968  "Current assignment of ",
969  node_name, " to ", iter->second, " does not match ", placement);
970  }
971  }
972 
973  stateful_placements_ = execution_state->GetStatefulPlacements();
974 
975  // Remember the graph in run state if this is a partial run.
976  if (run_state_args->is_partial_run) {
977  run_state_args->graph.reset(new Graph(flib_def_.get()));
978  CopyGraph(*execution_state->full_graph(), run_state_args->graph.get());
979  }
980 
981  // Partition the graph across devices.
982  PartitionOptions popts;
983  popts.node_to_loc = [](const Node* node) {
984  assert(node != nullptr);
985  return node->assigned_device_name();
986  };
987  popts.new_name = [this](const string& prefix) {
988  return strings::StrCat(prefix, "/_", edge_name_counter_.fetch_add(1));
989  };
990  popts.get_incarnation = [](const string& name) {
991  // The direct session does not have changing incarnation numbers.
992  // Just return '1'.
993  return 1;
994  };
995  popts.flib_def = &client_graph->graph.flib_def();
996  popts.control_flow_added = false;
997 
998  std::unordered_map<string, GraphDef> partitions;
999  TF_RETURN_IF_ERROR(Partition(popts, &client_graph->graph, &partitions));
1000 
1001  std::vector<string> device_names;
1002  for (auto device : devices_) {
1003  // Extract the LocalName from the device.
1004  device_names.push_back(DeviceNameUtils::LocalName(device->name()));
1005  }
1006 
1007  // Check for valid partitions.
1008  for (const auto& partition : partitions) {
1009  const string local_partition_name =
1010  DeviceNameUtils::LocalName(partition.first);
1011  if (std::count(device_names.begin(), device_names.end(),
1012  local_partition_name) == 0) {
1013  return errors::InvalidArgument(
1014  "Creating a partition for ", local_partition_name,
1015  " which doesn't exist in the list of available devices. Available "
1016  "devices: ",
1017  str_util::Join(device_names, ","));
1018  }
1019  }
1020 
1021  for (const auto& partition : partitions) {
1022  std::unique_ptr<Graph> device_graph(
1023  new Graph(client_graph->flib_def.get()));
1024  GraphConstructorOptions device_opts;
1025  // There are internal operations (e.g., send/recv) that we now allow.
1026  device_opts.allow_internal_ops = true;
1027  device_opts.expect_device_spec = true;
1028  TF_RETURN_IF_ERROR(ConvertGraphDefToGraph(device_opts, partition.second,
1029  device_graph.get()));
1030  outputs->emplace(partition.first, std::move(device_graph));
1031  }
1032 
1033  GraphOptimizationPassOptions optimization_options;
1034  optimization_options.session_options = &options_;
1035  optimization_options.flib_def = client_graph->flib_def.get();
1036  optimization_options.partition_graphs = outputs;
1037  TF_RETURN_IF_ERROR(OptimizationPassRegistry::Global()->RunGrouping(
1038  OptimizationPassRegistry::POST_PARTITIONING, optimization_options));
1039 
1040  Status s;
1041  for (auto& partition : *outputs) {
1042  const string& partition_name = partition.first;
1043  std::unique_ptr<Graph>* graph = &partition.second;
1044 
1045  VLOG(2) << "Created " << DebugString(graph->get()) << " for "
1046  << partition_name;
1047 
1048  // Give the device an opportunity to rewrite its subgraph.
1049  Device* d;
1050  s = device_mgr_->LookupDevice(partition_name, &d);
1051  if (!s.ok()) break;
1052  s = d->MaybeRewriteGraph(graph);
1053  if (!s.ok()) {
1054  break;
1055  }
1056  }
1057  *flib_def = std::move(client_graph->flib_def);
1058  std::swap(*input_types, client_graph->feed_types);
1059  std::swap(*output_types, client_graph->fetch_types);
1060  return s;
1061 }
std::unique_ptr< FunctionLibraryDefinition > flib_def_
Definition: TBBSession.h:322
std::vector< Device * > devices_
Definition: TBBSession.h:271
std::atomic< int64 > edge_name_counter_
Definition: TBBSession.h:329
Partition
Definition: HLTHPDFilter.cc:32
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
const SessionOptions options_
Definition: TBBSession.h:267
const std::unique_ptr< const DeviceMgr > device_mgr_
Definition: TBBSession.h:270
DDCompactView::Graph Graph
def move(src, dest)
Definition: eostools.py:510
Status tensorflow::TBBSession::DecorateAndPublishGraphForDebug ( const DebugOptions &  debug_options,
Graph graph,
Device *  device 
)
private

Definition at line 349 of file TBBSession.cc.

References createfilelist::args, EnergyCorrector::c, cancellation_manager_, CheckNotClosed(), cost_model_manager_, CreateDebuggerState(), device_mgr_, devices_, executor_lock_, tensorflow::TBBSession::RunState::executors_done, tensorflow::TBBSession::PerPartitionExecutorsAndLib::flib, GetOrCreateExecutors(), tensorflow::TBBSession::PerPartitionExecutorsAndLib::graph, graph_def_lock_, mps_fire::i, tensorflow::TBBSession::ExecutorsAndKeys::input_name_to_index, tensorflow::TBBSession::ExecutorsAndKeys::input_types, PatBasicFWLiteJetAnalyzer_Selector_cfg::inputs, tensorflow::TBBSession::ExecutorsAndKeys::items, checklumidiff::l, eostools::move(), operation_timeout_in_ms_, options_, tensorflow::TBBSession::ExecutorsAndKeys::output_types, PatBasicFWLiteJetAnalyzer_Selector_cfg::outputs, tensorflow::TBBSession::RunState::rendez, ResourceHandleToInputTensor(), Run(), alignCSCRings::s, SchedClosure(), session_state_, btagGenBb_cfi::Status, tensorflow::TBBSession::ExecutorsAndKeys::step_count, step_id_counter_, sync_on_finish_, and WaitForNotification().

Referenced by GetOrCreateExecutors().

350  {
351  std::unique_ptr<DebugGraphDecoratorInterface> decorator;
352  TF_RETURN_IF_ERROR(
353  DebugGraphDecoratorRegistry::CreateDecorator(debug_options, &decorator));
354 
355  TF_RETURN_IF_ERROR(decorator->DecorateGraph(graph, device));
356  TF_RETURN_IF_ERROR(decorator->PublishGraph(*graph, device->name()));
357  return Status::OK();
358 }
std::pair< int, edm::FunctionWithDict > OK
Definition: findMethod.cc:136
void tensorflow::TBBSession::ExportCostModels ( CostModelManager::CostModelMap *  cost_models)
inline

Definition at line 123 of file TBBSession.h.

123  {
124  cost_model_manager_.ExportCostModels(cost_models);
125  }
CostModelManager cost_model_manager_
Definition: TBBSession.h:339
Status tensorflow::TBBSession::Extend ( const GraphDef &  graph)
override

Definition at line 305 of file TBBSession.cc.

References CheckNotClosed(), ExtendLocked(), graph_def_lock_, and checklumidiff::l.

305  {
306  TF_RETURN_IF_ERROR(CheckNotClosed());
307  mutex_lock l(graph_def_lock_);
308  return ExtendLocked(graph);
309 }
::tensorflow::Status CheckNotClosed()
Definition: TBBSession.h:251
::tensorflow::Status ExtendLocked(const GraphDef &graph) EXCLUSIVE_LOCKS_REQUIRED(graph_def_lock_)
Definition: TBBSession.cc:311
Status tensorflow::TBBSession::ExtendLocked ( const GraphDef &  graph)
private

Definition at line 311 of file TBBSession.cc.

References flib_def_, and MaybeInitializeExecutionState().

Referenced by Create(), and Extend().

311  {
312  bool already_initialized;
313  // If this is the first call, we can initialize the execution state
314  // with `graph` and do not need to call `Extend()`.
315  TF_RETURN_IF_ERROR(
316  MaybeInitializeExecutionState(graph, &already_initialized));
317  if (already_initialized) {
318  TF_RETURN_IF_ERROR(flib_def_->AddLibrary(graph.library()));
319  std::unique_ptr<GraphExecutionState> state;
320  TF_RETURN_IF_ERROR(execution_state_->Extend(graph, &state));
321  execution_state_.swap(state);
322  }
323  return Status::OK();
324 }
std::unique_ptr< FunctionLibraryDefinition > flib_def_
Definition: TBBSession.h:322
Status MaybeInitializeExecutionState(const GraphDef &graph, bool *out_already_initialized) EXCLUSIVE_LOCKS_REQUIRED(graph_def_lock_)
Definition: TBBSession.cc:261
std::pair< int, edm::FunctionWithDict > OK
Definition: findMethod.cc:136
Status tensorflow::TBBSession::GetOrCreateExecutors ( gtl::ArraySlice< string >  inputs,
gtl::ArraySlice< string >  outputs,
gtl::ArraySlice< string >  target_nodes,
ExecutorsAndKeys **  executors_and_keys,
RunStateArgs run_state_args 
)
private

Definition at line 667 of file TBBSession.cc.

References CreateGraphs(), tensorflow::TBBSession::RunStateArgs::debug_options, DecorateAndPublishGraphForDebug(), device_mgr_, device_set_, executor_lock_, plotBeamSpotDB::first, tensorflow::TBBSession::RunStateArgs::graph, graph_def_lock_, cuy::graphs, tensorflow::TBBSession::RunStateArgs::handle, handle_name_counter_, mps_fire::i, triggerObjects_cff::id, input, tensorflow::TBBSession::RunStateArgs::is_partial_run, crabWrapper::key, checklumidiff::l, mps_check::lib, eostools::move(), gen::n, names, node_outputs_callback_, AlcaSiPixelAliHarvester0T_cff::options, options_, convertSQLitetoXML_cfg::output, and session_handle_.

Referenced by DecorateAndPublishGraphForDebug().

670  {
671  int64 handle_name_counter_value = -1;
672  if (LogMemory::IsEnabled() || run_state_args->is_partial_run) {
673  handle_name_counter_value = handle_name_counter_.fetch_add(1);
674  }
675 
676  string debug_tensor_watches_summary;
677  if (!run_state_args->debug_options.debug_tensor_watch_opts().empty()) {
678  debug_tensor_watches_summary = SummarizeDebugTensorWatches(
679  run_state_args->debug_options.debug_tensor_watch_opts());
680  }
681 
682  // Fast lookup path, no sorting.
683  const string key = strings::StrCat(
684  str_util::Join(inputs, ","), "->", str_util::Join(outputs, ","), "/",
685  str_util::Join(target_nodes, ","), "/", run_state_args->is_partial_run,
686  "/", debug_tensor_watches_summary);
687  // Set the handle, if it's needed to log memory or for partial run.
688  if (handle_name_counter_value >= 0) {
689  run_state_args->handle =
690  strings::StrCat(key, ";", handle_name_counter_value);
691  }
692 
693  // See if we already have the executors for this run.
694  {
695  mutex_lock l(executor_lock_); // could use reader lock
696  auto it = executors_.find(key);
697  if (it != executors_.end()) {
698  *executors_and_keys = it->second.get();
699  return Status::OK();
700  }
701  }
702 
703  // Slow lookup path, the unsorted key missed the cache.
704  // Sort the inputs and outputs, and look up with the sorted key in case an
705  // earlier call used a different order of inputs and outputs.
706  //
707  // We could consider some other signature instead of sorting that
708  // preserves the same property to avoid the sort in the future.
709  std::vector<string> inputs_sorted(inputs.begin(), inputs.end());
710  std::sort(inputs_sorted.begin(), inputs_sorted.end());
711  std::vector<string> outputs_sorted(outputs.begin(), outputs.end());
712  std::sort(outputs_sorted.begin(), outputs_sorted.end());
713  std::vector<string> tn_sorted(target_nodes.begin(), target_nodes.end());
714  std::sort(tn_sorted.begin(), tn_sorted.end());
715 
716  const string sorted_key = strings::StrCat(
717  str_util::Join(inputs_sorted, ","), "->",
718  str_util::Join(outputs_sorted, ","), "/", str_util::Join(tn_sorted, ","),
719  "/", run_state_args->is_partial_run, "/", debug_tensor_watches_summary);
720  // Set the handle, if its needed to log memory or for partial run.
721  if (handle_name_counter_value >= 0) {
722  run_state_args->handle =
723  strings::StrCat(sorted_key, ";", handle_name_counter_value);
724  }
725 
726  // See if we already have the executors for this run.
727  {
728  mutex_lock l(executor_lock_);
729  auto it = executors_.find(sorted_key);
730  if (it != executors_.end()) {
731  *executors_and_keys = it->second.get();
732  // Insert this under the original key.
733  executors_.emplace(key, it->second);
734  return Status::OK();
735  }
736  }
737 
738  // Nothing found, so create the executors and store in the cache.
739  BuildGraphOptions options;
740  options.feed_endpoints = inputs_sorted;
741  options.fetch_endpoints = outputs_sorted;
742  options.target_nodes = tn_sorted;
743  options.use_function_convention = !run_state_args->is_partial_run;
744  if (!run_state_args->debug_options.debug_tensor_watch_opts().empty()) {
745  options.debug_options = run_state_args->debug_options;
746  }
747 
748  std::unique_ptr<FunctionInfo> func_info(new FunctionInfo);
749  std::shared_ptr<ExecutorsAndKeys> ek(new ExecutorsAndKeys);
750 
751  // The executor_lock_ is intentionally released while executor is
752  // being created.
753  std::unordered_map<string, std::unique_ptr<Graph>> graphs;
754  TF_RETURN_IF_ERROR(CreateGraphs(options, &graphs, &func_info->flib_def,
755  run_state_args, &ek->input_types,
756  &ek->output_types));
757 
758  if (run_state_args->is_partial_run) {
759  ek->graph = std::move(run_state_args->graph);
760  std::unordered_set<StringPiece, StringPieceHasher> names;
761  for (const string& input : inputs) {
762  TensorId id(ParseTensorName(input));
763  names.emplace(id.first);
764  }
765  for (const string& output : outputs) {
766  TensorId id(ParseTensorName(output));
767  names.emplace(id.first);
768  }
769  for (Node* n : ek->graph->nodes()) {
770  if (names.count(n->name()) > 0) {
771  ek->name_to_node.insert({n->name(), n});
772  }
773  }
774  }
775  ek->items.reserve(graphs.size());
776  const auto& optimizer_opts =
777  options_.config.graph_options().optimizer_options();
778 
779  int graph_def_version;
780  {
781  mutex_lock l(graph_def_lock_);
782  graph_def_version =
783  execution_state_->original_graph_def().versions().producer();
784  }
785  func_info->proc_flr.reset(new ProcessFunctionLibraryRuntime(
786  device_mgr_.get(), options_.env, graph_def_version,
787  func_info->flib_def.get(), optimizer_opts));
788 
789  GraphOptimizer optimizer(optimizer_opts);
790  for (auto iter = graphs.begin(); iter != graphs.end(); ++iter) {
791  const string& partition_name = iter->first;
792  std::unique_ptr<Graph>& partition_graph = iter->second;
793 
794  Device* device;
795  TF_RETURN_IF_ERROR(device_mgr_->LookupDevice(partition_name, &device));
796 
797  ek->items.resize(ek->items.size() + 1);
798  auto* item = &(ek->items.back());
799  auto lib = func_info->proc_flr->GetFLR(partition_name);
800  if (lib == nullptr) {
801  return errors::Internal("Could not find device: ", partition_name);
802  }
803  item->flib = lib;
804 
805  LocalExecutorParams params;
806  params.device = device;
807  params.function_library = lib;
808  auto opseg = device->op_segment();
809  params.create_kernel = [this, lib, opseg](const NodeDef& ndef,
810  OpKernel** kernel) {
811  // We do not share the kernel via the OpSegment if the node is
812  // stateless, or a function.
813  // NOTE(mrry): We must not share function kernels (implemented
814  // using `CallOp`) between subgraphs, because `CallOp::handle_`
815  // is tied to a particular subgraph. Even if the function itself
816  // is stateful, the `CallOp` that invokes it is not.
817  if (!lib->IsStateful(ndef.op()) ||
818  lib->GetFunctionLibraryDefinition()->Find(ndef.op()) != nullptr) {
819  return lib->CreateKernel(ndef, kernel);
820  }
821  auto create_fn = [lib, &ndef](OpKernel** kernel) {
822  return lib->CreateKernel(ndef, kernel);
823  };
824  // Kernels created for subgraph nodes need to be cached. On
825  // cache miss, create_fn() is invoked to create a kernel based
826  // on the function library here + global op registry.
827  return opseg->FindOrCreate(session_handle_, ndef.name(), kernel,
828  create_fn);
829  };
830  params.delete_kernel = [lib](OpKernel* kernel) {
831  // If the node is stateful, opseg owns it. Otherwise, delete it.
832  if (kernel && !lib->IsStateful(kernel->type_string())) {
833  delete kernel;
834  }
835  };
836  params.node_outputs_cb = node_outputs_callback_;
837 
838  optimizer.Optimize(lib, options_.env, device, &iter->second,
839  /*shape_map=*/nullptr);
840 
841  // EXPERIMENTAL: tfdbg inserts debug nodes in the graph.
842  if (!options.debug_options.debug_tensor_watch_opts().empty()) {
843  TF_RETURN_IF_ERROR(DecorateAndPublishGraphForDebug(
844  options.debug_options, partition_graph.get(), params.device));
845  }
846 
847  TF_RETURN_IF_ERROR(EnsureMemoryTypes(DeviceType(device->device_type()),
848  device->name(),
849  partition_graph.get()));
850  // NewLocalExecutor takes ownership of partition_graph.
851  item->graph = partition_graph.get();
852  item->executor = nullptr;
853  item->device = device;
854  Executor* executor;
855  TF_RETURN_IF_ERROR(
856  NewLocalExecutor(params, partition_graph.release(), &executor));
857  item->executor.reset(executor);
858  }
859 
860  // Cache the mapping from input/output names to graph elements to
861  // avoid recomputing it every time.
862  if (!run_state_args->is_partial_run) {
863  // For regular `Run()`, we use the function calling convention, and so
864  // maintain a mapping from input/output names to
865  // argument/return-value ordinal index.
866  for (size_t i = 0; i < inputs_sorted.size(); ++i) {
867  const string& input = inputs_sorted[i];
868  ek->input_name_to_index[input] = i;
869  }
870  for (size_t i = 0; i < outputs_sorted.size(); ++i) {
871  const string& output = outputs_sorted[i];
872  ek->output_name_to_index[output] = i;
873  }
874  } else {
875  // For `PRun()`, we use the rendezvous calling convention, and so
876  // maintain a mapping from input/output names to rendezvous keys.
877  //
878  // We always use the first device as the device name portion of the
879  // key, even if we're feeding another graph.
880  for (size_t i = 0; i < inputs_sorted.size(); ++i) {
881  const string& input = inputs_sorted[i];
882  ek->input_name_to_rendezvous_key[input] = GetRendezvousKey(
883  input, device_set_.client_device()->attributes(), FrameAndIter(0, 0));
884  }
885  for (size_t i = 0; i < outputs_sorted.size(); ++i) {
886  const string& output = outputs_sorted[i];
887  ek->output_name_to_rendezvous_key[output] =
888  GetRendezvousKey(output, device_set_.client_device()->attributes(),
889  FrameAndIter(0, 0));
890  }
891  }
892 
893  // Reacquire the lock, try to insert into the map.
894  mutex_lock l(executor_lock_);
895  functions_.push_back(std::move(func_info));
896 
897  // Another thread may have created the entry before us, in which case we will
898  // reuse the already created one.
899  auto insert_result = executors_.emplace(sorted_key, ek);
900  // Insert the value under the original key, so the fast path lookup will work
901  // if the user uses the same order of inputs, outputs, and targets again.
902  executors_.emplace(key, insert_result.first->second);
903  *executors_and_keys = insert_result.first->second.get();
904 
905  return Status::OK();
906 }
std::atomic< int64 > handle_name_counter_
Definition: TBBSession.h:330
::tensorflow::Status DecorateAndPublishGraphForDebug(const DebugOptions &debug_options, Graph *graph, Device *device)
Definition: TBBSession.cc:349
const std::string names[nVars_]
static std::string const input
Definition: EdmProvDump.cc:44
::tensorflow::Status CreateGraphs(const BuildGraphOptions &options, std::unordered_map< string, std::unique_ptr< Graph >> *outputs, std::unique_ptr< FunctionLibraryDefinition > *flib_def, RunStateArgs *run_state_args, DataTypeVector *input_types, DataTypeVector *output_types)
Definition: TBBSession.cc:908
std::pair< int, edm::FunctionWithDict > OK
Definition: findMethod.cc:136
const SessionOptions options_
Definition: TBBSession.h:267
const std::unique_ptr< const DeviceMgr > device_mgr_
Definition: TBBSession.h:270
Executor::Args::NodeOutputsCallback node_outputs_callback_
Definition: TBBSession.h:341
graphs
Definition: cuy.py:961
def move(src, dest)
Definition: eostools.py:510
bool graph_created_ tensorflow::TBBSession::GUARDED_BY ( graph_def_lock_  )
private
GraphDef graph_def_ tensorflow::TBBSession::GUARDED_BY ( graph_def_lock_  )
private
std::vector<std::unique_ptr<FunctionInfo> > functions_ tensorflow::TBBSession::GUARDED_BY ( executor_lock_  )
private
std::unordered_map<string, std::shared_ptr<ExecutorsAndKeys> > executors_ tensorflow::TBBSession::GUARDED_BY ( executor_lock_  )
private
std::unordered_map<string, std::unique_ptr<RunState> > partial_runs_ tensorflow::TBBSession::GUARDED_BY ( executor_lock_  )
private
std::unordered_map<string, string> stateful_placements_ tensorflow::TBBSession::GUARDED_BY ( graph_def_lock_  )
private
std::unique_ptr<GraphExecutionState> execution_state_ tensorflow::TBBSession::GUARDED_BY ( graph_def_lock_  )
private
bool closed_ tensorflow::TBBSession::GUARDED_BY ( closed_lock_  )
private
tensorflow::Status tensorflow::TBBSession::ListDevices ( std::vector< DeviceAttributes > *  response)
override

Definition at line 1063 of file TBBSession.cc.

References edmIntegrityCheck::d, and devices_.

1064  {
1065  response->clear();
1066  response->reserve(devices_.size());
1067  for (Device* d : devices_) {
1068  const DeviceAttributes& attrs = d->attributes();
1069  response->emplace_back(attrs);
1070  }
1072 }
std::vector< Device * > devices_
Definition: TBBSession.h:271
std::pair< int, edm::FunctionWithDict > OK
Definition: findMethod.cc:136
::tensorflow::Status tensorflow::TBBSession::LocalDeviceManager ( const DeviceMgr **  output)
inlineoverride

Definition at line 118 of file TBBSession.h.

118  {
119  *output = device_mgr_.get();
121  }
std::pair< int, edm::FunctionWithDict > OK
Definition: findMethod.cc:136
const std::unique_ptr< const DeviceMgr > device_mgr_
Definition: TBBSession.h:270
Status tensorflow::TBBSession::MaybeInitializeExecutionState ( const GraphDef &  graph,
bool *  out_already_initialized 
)
private

Definition at line 261 of file TBBSession.cc.

References device_set_, flib_def_, AlcaSiPixelAliHarvester0T_cff::options, options_, and groupFilesInBlocks::temp.

Referenced by ExtendLocked().

262  {
263  // If already initialized, do nothing.
264  if (flib_def_ && execution_state_) {
265  *out_already_initialized = true;
266  return Status::OK();
267  }
268  // Set up the per-session execution state.
269  // NOTE(mrry): The function library created here will be used for
270  // all subsequent extensions of the graph.
271  flib_def_.reset(
272  new FunctionLibraryDefinition(OpRegistry::Global(), graph.library()));
273  GraphExecutionStateOptions options;
274  options.device_set = &device_set_;
275  options.session_options = &options_;
276  // TODO(mrry,suharshs): We explicitly copy `graph` so that
277  // `MakeForBaseGraph()` can take ownership of its
278  // contents. Previously this happened implicitly in calls to the
279  // `GraphExecutionState`. Other sessions call
280  // `MakeForBaseGraph` in such a way that we can destructively read
281  // the passed-in `GraphDef`. In principle we could do the same here,
282  // with a wider refactoring; we might revise the direct session so
283  // that it copies the graph fewer times.
284  GraphDef temp(graph);
285  TF_RETURN_IF_ERROR(
286  GraphExecutionState::MakeForBaseGraph(&temp, options, &execution_state_));
287  graph_created_ = true;
288  *out_already_initialized = false;
289  return Status::OK();
290 }
std::unique_ptr< FunctionLibraryDefinition > flib_def_
Definition: TBBSession.h:322
std::pair< int, edm::FunctionWithDict > OK
Definition: findMethod.cc:136
const SessionOptions options_
Definition: TBBSession.h:267
tensorflow::Status tensorflow::TBBSession::Reset ( const std::vector< string > &  containers)

Definition at line 1074 of file TBBSession.cc.

References device_mgr_.

1075  {
1076  device_mgr_->ClearContainers(containers);
1078 }
std::pair< int, edm::FunctionWithDict > OK
Definition: findMethod.cc:136
const std::unique_ptr< const DeviceMgr > device_mgr_
Definition: TBBSession.h:270
Status tensorflow::TBBSession::ResourceHandleToInputTensor ( const Tensor &  resource_tensor,
Tensor *  retrieved_tensor 
)
private

Definition at line 641 of file TBBSession.cc.

References session_state_.

Referenced by DecorateAndPublishGraphForDebug().

642  {
643  if (resource_tensor.dtype() != DT_RESOURCE) {
644  return errors::InvalidArgument(strings::StrCat(
645  "ResourceHandleToInputTensor() received non-DT_RESOURCE Tensor: ",
646  resource_tensor.dtype()));
647  }
648 
649  const ResourceHandle& resource_handle =
650  resource_tensor.scalar<ResourceHandle>()();
651 
652  if (resource_handle.container() ==
653  SessionState::kTensorHandleResourceTypeName) {
654  return session_state_.GetTensor(resource_handle.name(), retrieved_tensor);
655  } else {
656  return errors::InvalidArgument(strings::StrCat(
657  "Invalid resource type hash code: ", resource_handle.hash_code(),
658  "(name: ", resource_handle.name(),
659  " type: ", resource_handle.maybe_type_name(),
660  "). Perhaps a resource tensor was being provided as a feed? That is "
661  "not currently allowed. Please file an issue at "
662  "https://github.com/tensorflow/tensorflow/issues/new, ideally with a "
663  "short code snippet that leads to this error message."));
664  }
665 }
SessionState session_state_
Definition: TBBSession.h:303
Status tensorflow::TBBSession::Run ( const NamedTensorList inputs,
const std::vector< string > &  output_names,
const std::vector< string > &  target_nodes,
std::vector< Tensor > *  outputs 
)
override

Definition at line 326 of file TBBSession.cc.

Referenced by DecorateAndPublishGraphForDebug().

329  {
330  RunMetadata run_metadata;
331  return Run(RunOptions(), inputs, output_names, target_nodes, outputs,
332  &run_metadata);
333 }
::tensorflow::Status Run(const NamedTensorList &inputs, const std::vector< string > &output_names, const std::vector< string > &target_nodes, std::vector< Tensor > *outputs) override
Definition: TBBSession.cc:326
::tensorflow::Status tensorflow::TBBSession::Run ( const ::tensorflow::RunOptions &  run_options,
const NamedTensorList inputs,
const std::vector< string > &  output_names,
const std::vector< string > &  target_nodes,
std::vector< Tensor > *  outputs,
RunMetadata *  run_metadata 
)
override
void tensorflow::TBBSession::SchedClosure ( tbb::task_arena &  arena,
tbb::task_group &  g,
std::function< void()>  c 
)
private

Definition at line 193 of file TBBSession.cc.

References EnergyCorrector::c.

Referenced by DecorateAndPublishGraphForDebug().

193  {
194  arena.execute( [&g, &c] () {g.run( c ); } );
195 }
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
tensorflow::TBBSession::TF_DISALLOW_COPY_AND_ASSIGN ( TBBSession  )
private
tensorflow::Status tensorflow::TBBSession::WaitForNotification ( Notification *  n,
int64  timeout_in_ms 
)
private

Definition at line 1156 of file TBBSession.cc.

References btagGenBb_cfi::Status.

Referenced by DecorateAndPublishGraphForDebug(), and WaitForNotification().

1157  {
1158  if (timeout_in_ms > 0) {
1159  const int64 timeout_in_us = timeout_in_ms * 1000;
1160  const bool notified =
1161  WaitForNotificationWithTimeout(notification, timeout_in_us);
1162  if (!notified) {
1163  return Status(error::DEADLINE_EXCEEDED,
1164  "Timed out waiting for notification");
1165  }
1166  } else {
1167  notification->WaitForNotification();
1168  }
1169  return Status::OK();
1170 }
std::pair< int, edm::FunctionWithDict > OK
Definition: findMethod.cc:136
void tensorflow::TBBSession::WaitForNotification ( tbb::task_arena &  arena,
tbb::task_group &  group,
RunState run_state,
CancellationManager *  cm,
int64  timeout_in_ms 
)
private

Definition at line 1135 of file TBBSession.cc.

References tensorflow::TBBSession::RunState::executors_done, checklumidiff::l, tensorflow::TBBSession::RunState::mu_, btagGenBb_cfi::Status, mps_update::status, and WaitForNotification().

1136  {
1137  // Doing the wait in the arena adds this thread to the arena
1138  // and therefore tasks associated to the group can run on this thread
1139  arena.execute([&taskGroup]() { taskGroup.wait();} );
1140 
1141  const Status status =
1142  WaitForNotification(&run_state->executors_done, timeout_in_ms);
1143  if (!status.ok()) {
1144  {
1145  mutex_lock l(run_state->mu_);
1146  run_state->status.Update(status);
1147  }
1148  cm->StartCancel();
1149  // We must wait for the executors to complete, because they have borrowed
1150  // references to `cm` and other per-step state. After this notification, it
1151  // is safe to clean up the step.
1152  run_state->executors_done.WaitForNotification();
1153  }
1154 }
::tensorflow::Status WaitForNotification(Notification *n, int64 timeout_in_ms)
Definition: TBBSession.cc:1156

Friends And Related Function Documentation

friend class DebugGateway
friend

Definition at line 346 of file TBBSession.h.

Member Data Documentation

CancellationManager* tensorflow::TBBSession::cancellation_manager_
private

Definition at line 306 of file TBBSession.h.

Referenced by Close(), DecorateAndPublishGraphForDebug(), and ~TBBSession().

mutex tensorflow::TBBSession::closed_lock_
private

Definition at line 325 of file TBBSession.h.

Referenced by Close().

CostModelManager tensorflow::TBBSession::cost_model_manager_
private

Definition at line 339 of file TBBSession.h.

Referenced by DecorateAndPublishGraphForDebug().

const std::unique_ptr<const DeviceMgr> tensorflow::TBBSession::device_mgr_
private
DeviceSet tensorflow::TBBSession::device_set_
private
std::vector<Device*> tensorflow::TBBSession::devices_
private
std::atomic<int64> tensorflow::TBBSession::edge_name_counter_ = {0}
private

Definition at line 329 of file TBBSession.h.

Referenced by CreateGraphs().

mutex tensorflow::TBBSession::executor_lock_
private

Definition at line 289 of file TBBSession.h.

Referenced by DecorateAndPublishGraphForDebug(), and GetOrCreateExecutors().

TBBSessionFactory* const tensorflow::TBBSession::factory_
private

Definition at line 305 of file TBBSession.h.

Referenced by Close().

std::unique_ptr<FunctionLibraryDefinition> tensorflow::TBBSession::flib_def_
private
mutex tensorflow::TBBSession::graph_def_lock_
private
std::atomic<int64> tensorflow::TBBSession::handle_name_counter_ = {0}
private

Definition at line 330 of file TBBSession.h.

Referenced by GetOrCreateExecutors().

Status tensorflow::TBBSession::init_error_
private

Definition at line 280 of file TBBSession.h.

Referenced by Create().

Executor::Args::NodeOutputsCallback tensorflow::TBBSession::node_outputs_callback_ = nullptr
private

Definition at line 341 of file TBBSession.h.

Referenced by GetOrCreateExecutors().

const int64 tensorflow::TBBSession::operation_timeout_in_ms_ = 0
private

Definition at line 336 of file TBBSession.h.

Referenced by DecorateAndPublishGraphForDebug().

const SessionOptions tensorflow::TBBSession::options_
private
string tensorflow::TBBSession::session_handle_
private

Definition at line 274 of file TBBSession.h.

Referenced by GetOrCreateExecutors(), TBBSession(), and ~TBBSession().

SessionState tensorflow::TBBSession::session_state_
private

Definition at line 303 of file TBBSession.h.

Referenced by DecorateAndPublishGraphForDebug(), and ResourceHandleToInputTensor().

std::atomic_int_fast64_t tensorflow::TBBSession::step_id_counter_
staticprivate

Definition at line 333 of file TBBSession.h.

Referenced by DecorateAndPublishGraphForDebug().

bool tensorflow::TBBSession::sync_on_finish_ = true
private

Definition at line 283 of file TBBSession.h.

Referenced by DecorateAndPublishGraphForDebug(), and TBBSession().