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 92 of file TBBSession.h.

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

Definition at line 93 of file TBBSession.h.

Constructor & Destructor Documentation

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

Definition at line 195 of file TBBSession.cc.

References ztail::d, device_mgr_, device_set_, devices_, dqm::qstatus::ERROR, unpackBuffers-CaloStage2::INFO, LOG, session_handle_, btagGenBb_cfi::Status, mps_update::status, and sync_on_finish_.

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

Definition at line 235 of file TBBSession.cc.

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

235  {
236  if (!closed_)
237  Close().IgnoreError();
238  for (auto& it : partial_runs_) {
239  it.second.reset(nullptr);
240  }
241  for (auto& it : executors_) {
242  it.second.reset();
243  }
244  for (auto d : device_mgr_->ListDevices()) {
245  d->op_segment()->RemoveHold(session_handle_);
246  }
247  for (auto d : device_mgr_->ListDevices()) {
248  d->ClearResourceMgr();
249  }
250  functions_.clear();
251  delete cancellation_manager_;
252 
253  execution_state_.reset(nullptr);
254  flib_def_.reset(nullptr);
255  }
std::unique_ptr< FunctionLibraryDefinition > flib_def_
Definition: TBBSession.h:319
::tensorflow::Status Close() override
Definition: TBBSession.cc:1044
CancellationManager * cancellation_manager_
Definition: TBBSession.h:305
d
Definition: ztail.py:151
const std::unique_ptr< const DeviceMgr > device_mgr_
Definition: TBBSession.h:272

Member Function Documentation

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

Definition at line 250 of file TBBSession.h.

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

Referenced by DecorateAndPublishGraphForDebug(), and Extend().

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

Definition at line 1044 of file TBBSession.cc.

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

Referenced by ~TBBSession().

1044  {
1045  cancellation_manager_->StartCancel();
1046  {
1047  mutex_lock l(closed_lock_);
1048  if (closed_)
1050  closed_ = true;
1051  }
1052  if (factory_ != nullptr)
1053  factory_->Deregister(this);
1055  }
void Deregister(const TBBSession *session)
Definition: TBBSession.cc:157
CancellationManager * cancellation_manager_
Definition: TBBSession.h:305
std::pair< int, edm::FunctionWithDict > OK
Definition: findMethod.cc:126
TBBSessionFactory *const factory_
Definition: TBBSession.h:304
Status tensorflow::TBBSession::Create ( const GraphDef &  graph)
override

Definition at line 285 of file TBBSession.cc.

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

285  {
286  TF_RETURN_IF_ERROR(init_error_);
287  if (graph.node_size() > 0) {
288  mutex_lock l(graph_def_lock_);
289  if (graph_created_) {
290  return errors::AlreadyExists("A Graph has already been created for this session.");
291  }
292  return ExtendLocked(graph);
293  }
294  return Status::OK();
295  }
std::pair< int, edm::FunctionWithDict > OK
Definition: findMethod.cc:126
::tensorflow::Status ExtendLocked(const GraphDef &graph) EXCLUSIVE_LOCKS_REQUIRED(graph_def_lock_)
Definition: TBBSession.cc:303
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 325 of file TBBSession.cc.

References pfDeepBoostedJetPreprocessParams_cfi::input_names.

Referenced by DecorateAndPublishGraphForDebug().

331  {
332  TF_RETURN_IF_ERROR(DebuggerStateRegistry::CreateState(debug_options, debugger_state));
333  TF_RETURN_IF_ERROR(debugger_state->get()->PublishDebugMetadata(
334  debug_options.global_step(), session_run_index, executor_step_index, input_names, output_names, target_names));
335  return Status::OK();
336  }
std::pair< int, edm::FunctionWithDict > OK
Definition: findMethod.cc:126
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 877 of file TBBSession.cc.

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

Referenced by GetOrCreateExecutors().

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

Definition at line 338 of file TBBSession.cc.

References writedatasetfile::args, HltBtagPostValidation_cff::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, PixelMapPlotter::inputs, B2GTnPMonitor_cfi::item, tensorflow::TBBSession::ExecutorsAndKeys::items, dqmiolumiharvest::j, cmsLHEtoEOSManager::l, eostools::move(), operation_timeout_in_ms_, options_, tensorflow::TBBSession::ExecutorsAndKeys::output_types, PatBasicFWLiteJetAnalyzer_Selector_cfg::outputs, tensorflow::TBBSession::RunState::rendez, ResourceHandleToInputTensor(), runTheMatrix::ret, 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().

338  {
339  std::unique_ptr<DebugGraphDecoratorInterface> decorator;
340  TF_RETURN_IF_ERROR(DebugGraphDecoratorRegistry::CreateDecorator(debug_options, &decorator));
341 
342  TF_RETURN_IF_ERROR(decorator->DecorateGraph(graph, device));
343  TF_RETURN_IF_ERROR(decorator->PublishGraph(*graph, device->name()));
344  return Status::OK();
345  }
std::pair< int, edm::FunctionWithDict > OK
Definition: findMethod.cc:126
void tensorflow::TBBSession::ExportCostModels ( CostModelManager::CostModelMap *  cost_models)
inline

Definition at line 121 of file TBBSession.h.

121  {
122  cost_model_manager_.ExportCostModels(cost_models);
123  }
CostModelManager cost_model_manager_
Definition: TBBSession.h:336
Status tensorflow::TBBSession::Extend ( const GraphDef &  graph)
override

Definition at line 297 of file TBBSession.cc.

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

297  {
298  TF_RETURN_IF_ERROR(CheckNotClosed());
299  mutex_lock l(graph_def_lock_);
300  return ExtendLocked(graph);
301  }
::tensorflow::Status CheckNotClosed()
Definition: TBBSession.h:250
::tensorflow::Status ExtendLocked(const GraphDef &graph) EXCLUSIVE_LOCKS_REQUIRED(graph_def_lock_)
Definition: TBBSession.cc:303
Status tensorflow::TBBSession::ExtendLocked ( const GraphDef &  graph)
private

Definition at line 303 of file TBBSession.cc.

References flib_def_, and MaybeInitializeExecutionState().

Referenced by Create(), and Extend().

303  {
304  bool already_initialized;
305  // If this is the first call, we can initialize the execution state
306  // with `graph` and do not need to call `Extend()`.
307  TF_RETURN_IF_ERROR(MaybeInitializeExecutionState(graph, &already_initialized));
308  if (already_initialized) {
309  TF_RETURN_IF_ERROR(flib_def_->AddLibrary(graph.library()));
310  std::unique_ptr<GraphExecutionState> state;
311  TF_RETURN_IF_ERROR(execution_state_->Extend(graph, &state));
312  execution_state_.swap(state);
313  }
314  return Status::OK();
315  }
std::unique_ptr< FunctionLibraryDefinition > flib_def_
Definition: TBBSession.h:319
Status MaybeInitializeExecutionState(const GraphDef &graph, bool *out_already_initialized) EXCLUSIVE_LOCKS_REQUIRED(graph_def_lock_)
Definition: TBBSession.cc:257
std::pair< int, edm::FunctionWithDict > OK
Definition: findMethod.cc:126
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 637 of file TBBSession.cc.

References CreateGraphs(), tensorflow::TBBSession::RunStateArgs::debug_options, DecorateAndPublishGraphForDebug(), device_mgr_, device_set_, executor_lock_, dqmdumpme::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, B2GTnPMonitor_cfi::item, crabWrapper::key, cmsLHEtoEOSManager::l, mps_check::lib, eostools::move(), dqmiodumpmetadata::n, names, node_outputs_callback_, AlcaSiPixelAliHarvester0T_cff::options, options_, convertSQLitetoXML_cfg::output, CalibrationSummaryClient_cfi::params, and session_handle_.

Referenced by DecorateAndPublishGraphForDebug().

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

References ztail::d, and devices_.

1029  {
1030  response->clear();
1031  response->reserve(devices_.size());
1032  for (Device* d : devices_) {
1033  const DeviceAttributes& attrs = d->attributes();
1034  response->emplace_back(attrs);
1035  }
1037  }
std::vector< Device * > devices_
Definition: TBBSession.h:273
d
Definition: ztail.py:151
std::pair< int, edm::FunctionWithDict > OK
Definition: findMethod.cc:126
::tensorflow::Status tensorflow::TBBSession::LocalDeviceManager ( const DeviceMgr **  output)
inlineoverride

Definition at line 116 of file TBBSession.h.

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

Definition at line 257 of file TBBSession.cc.

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

Referenced by ExtendLocked().

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

Definition at line 1039 of file TBBSession.cc.

References device_mgr_.

1039  {
1040  device_mgr_->ClearContainers(containers);
1042  }
std::pair< int, edm::FunctionWithDict > OK
Definition: findMethod.cc:126
const std::unique_ptr< const DeviceMgr > device_mgr_
Definition: TBBSession.h:272
Status tensorflow::TBBSession::ResourceHandleToInputTensor ( const Tensor &  resource_tensor,
Tensor *  retrieved_tensor 
)
private

Definition at line 612 of file TBBSession.cc.

References session_state_.

Referenced by DecorateAndPublishGraphForDebug().

612  {
613  if (resource_tensor.dtype() != DT_RESOURCE) {
614  return errors::InvalidArgument(
615  strings::StrCat("ResourceHandleToInputTensor() received non-DT_RESOURCE Tensor: ", resource_tensor.dtype()));
616  }
617 
618  const ResourceHandle& resource_handle = resource_tensor.scalar<ResourceHandle>()();
619 
620  if (resource_handle.container() == SessionState::kTensorHandleResourceTypeName) {
621  return session_state_.GetTensor(resource_handle.name(), retrieved_tensor);
622  } else {
623  return errors::InvalidArgument(
624  strings::StrCat("Invalid resource type hash code: ",
625  resource_handle.hash_code(),
626  "(name: ",
627  resource_handle.name(),
628  " type: ",
629  resource_handle.maybe_type_name(),
630  "). Perhaps a resource tensor was being provided as a feed? That is "
631  "not currently allowed. Please file an issue at "
632  "https://github.com/tensorflow/tensorflow/issues/new, ideally with a "
633  "short code snippet that leads to this error message."));
634  }
635  }
SessionState session_state_
Definition: TBBSession.h:302
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 317 of file TBBSession.cc.

Referenced by DecorateAndPublishGraphForDebug().

320  {
321  RunMetadata run_metadata;
322  return Run(RunOptions(), inputs, output_names, target_nodes, outputs, &run_metadata);
323  }
::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:317
::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 191 of file TBBSession.cc.

References HltBtagPostValidation_cff::c.

Referenced by DecorateAndPublishGraphForDebug().

191  {
192  arena.execute([&g, &c]() { g.run(c); });
193  }
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 1125 of file TBBSession.cc.

References btagGenBb_cfi::Status.

Referenced by DecorateAndPublishGraphForDebug(), and WaitForNotification().

1125  {
1126  if (timeout_in_ms > 0) {
1127  const int64 timeout_in_us = timeout_in_ms * 1000;
1128  const bool notified = WaitForNotificationWithTimeout(notification, timeout_in_us);
1129  if (!notified) {
1130  return Status(error::DEADLINE_EXCEEDED, "Timed out waiting for notification");
1131  }
1132  } else {
1133  notification->WaitForNotification();
1134  }
1135  return Status::OK();
1136  }
std::pair< int, edm::FunctionWithDict > OK
Definition: findMethod.cc:126
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 1102 of file TBBSession.cc.

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

1106  {
1107  // Doing the wait in the arena adds this thread to the arena
1108  // and therefore tasks associated to the group can run on this thread
1109  arena.execute([&taskGroup]() { taskGroup.wait(); });
1110 
1111  const Status status = WaitForNotification(&run_state->executors_done, timeout_in_ms);
1112  if (!status.ok()) {
1113  {
1114  mutex_lock l(run_state->mu_);
1115  run_state->status.Update(status);
1116  }
1117  cm->StartCancel();
1118  // We must wait for the executors to complete, because they have borrowed
1119  // references to `cm` and other per-step state. After this notification, it
1120  // is safe to clean up the step.
1121  run_state->executors_done.WaitForNotification();
1122  }
1123  }
::tensorflow::Status WaitForNotification(Notification *n, int64 timeout_in_ms)
Definition: TBBSession.cc:1125

Friends And Related Function Documentation

friend class DebugGateway
friend

Definition at line 343 of file TBBSession.h.

Member Data Documentation

CancellationManager* tensorflow::TBBSession::cancellation_manager_
private

Definition at line 305 of file TBBSession.h.

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

mutex tensorflow::TBBSession::closed_lock_
private

Definition at line 322 of file TBBSession.h.

Referenced by Close().

CostModelManager tensorflow::TBBSession::cost_model_manager_
private

Definition at line 336 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 326 of file TBBSession.h.

Referenced by CreateGraphs().

mutex tensorflow::TBBSession::executor_lock_
private

Definition at line 290 of file TBBSession.h.

Referenced by DecorateAndPublishGraphForDebug(), and GetOrCreateExecutors().

TBBSessionFactory* const tensorflow::TBBSession::factory_
private

Definition at line 304 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 327 of file TBBSession.h.

Referenced by GetOrCreateExecutors().

Status tensorflow::TBBSession::init_error_
private

Definition at line 282 of file TBBSession.h.

Referenced by Create().

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

Definition at line 338 of file TBBSession.h.

Referenced by GetOrCreateExecutors().

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

Definition at line 333 of file TBBSession.h.

Referenced by DecorateAndPublishGraphForDebug().

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

Definition at line 276 of file TBBSession.h.

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

SessionState tensorflow::TBBSession::session_state_
private

Definition at line 302 of file TBBSession.h.

Referenced by DecorateAndPublishGraphForDebug(), and ResourceHandleToInputTensor().

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

Definition at line 330 of file TBBSession.h.

Referenced by DecorateAndPublishGraphForDebug().

bool tensorflow::TBBSession::sync_on_finish_ = true
private

Definition at line 285 of file TBBSession.h.

Referenced by DecorateAndPublishGraphForDebug(), and TBBSession().