14 #ifndef TENSORFLOW_COMPILER_XLA_SERVICE_COMPUTATION_TRACKER_H_ 15 #define TENSORFLOW_COMPILER_XLA_SERVICE_COMPUTATION_TRACKER_H_ 22 #include "tensorflow/compiler/xla/service/hlo_module_config.h" 23 #include "tensorflow/compiler/xla/service/session.pb.h" 26 #include "tensorflow/compiler/xla/statusor.h" 27 #include "tensorflow/compiler/xla/types.h" 28 #include "tensorflow/compiler/xla/xla_data.pb.h" 29 #include "tensorflow/core/platform/macros.h" 30 #include "tensorflow/core/platform/mutex.h" 31 #include "tensorflow/core/platform/thread_annotations.h" 32 #include "tensorflow/core/platform/types.h" 56 StatusOr<ComputationHandle> LoadSessionModule(
57 const SessionModule& session_module);
62 const ComputationHandle& computation);
65 StatusOr<UserComputation*>
Resolve(
66 const ComputationHandle& computation)
const;
78 const HloModuleConfig& config,
79 bool include_unreachable_instructions =
true)
const;
80 string ToString()
const;
84 ComputationHandle AllocateHandle()
85 EXCLUSIVE_LOCKS_REQUIRED(computation_mutex_);
93 StatusOr<ComputationHandle> LoadSessionComputation(
94 const SessionComputation& session_computation,
95 std::map<int64, ComputationHandle>* old_to_new)
96 EXCLUSIVE_LOCKS_REQUIRED(computation_mutex_);
99 StatusOr<UserComputation*> ResolveInternal(
100 const ComputationHandle& computation)
const 101 EXCLUSIVE_LOCKS_REQUIRED(computation_mutex_);
109 void ComputeComputationPostOrder(
111 std::set<VersionedComputationHandle>* visited,
112 std::list<VersionedComputationHandle>* post_order)
const 113 EXCLUSIVE_LOCKS_REQUIRED(computation_mutex_);
114 string ToStringInternal()
const EXCLUSIVE_LOCKS_REQUIRED(computation_mutex_);
118 mutable tensorflow::mutex computation_mutex_;
121 int64 next_computation_ GUARDED_BY(computation_mutex_);
124 std::map<int64, std::unique_ptr<UserComputation>> opaque_to_computation_
125 GUARDED_BY(computation_mutex_);
129 #endif // TENSORFLOW_COMPILER_XLA_SERVICE_COMPUTATION_TRACKER_H_ ComputationHandle NewComputation(const string &computation_name)
Create a new UserComputation object and return the corresponding ComputationHandle for it...
Definition: computation_tracker.cc:32
StatusOr< std::unique_ptr< HloModule > > BuildHloModule(const VersionedComputationHandle &entry_handle, const HloModuleConfig &config, bool include_unreachable_instructions=true) const
Build a HLO module (which is basically a set of HLO instructions) using the specified computation as ...
Definition: computation_tracker.cc:169
Definition: versioned_computation_handle.h:37
StatusOr< std::unique_ptr< SessionModule > > SnapshotComputation(const ComputationHandle &computation)
Definition: computation_tracker.cc:84
StatusOr< UserComputation * > Resolve(const ComputationHandle &computation) const
Definition: computation_tracker.cc:110
Tracks computations for the XLA service. Registered with a xla::UserComputation instance and can be r...
Definition: computation_tracker.h:46
namespace for xla
Definition: client_library.cc:26