Home
last modified time | relevance | path

Searched refs:HloValue (Results 1 – 25 of 42) sorted by relevance

12

/external/tensorflow/tensorflow/compiler/xla/service/
Dhlo_phi_graph.h44 void RegisterPhi(const HloValue& value,
45 absl::Span<const HloValue* const> inputs);
47 HloValue::Id GetOptimizedId(const HloValue& value);
50 bool InputsEqualTo(const HloValue& value,
51 absl::Span<const HloValue* const> inputs);
55 HloValue::Id FindOptimizedValue(const HloValue::Id id);
71 HloValue::Id value_id;
79 Node* CreateOrReuseNode(const HloValue& value);
91 absl::flat_hash_map<Node*, std::vector<HloValue::Id>> node_to_value_id_;
94 absl::flat_hash_map<HloValue::Id, Node*> value_id_to_node_;
Dhlo_phi_graph_test.cc25 HloValue NewHloValue(bool is_phi) { in NewHloValue()
27 return HloValue(id++, dummy_inst_.get(), {}, is_phi); in NewHloValue()
45 HloValue A = NewHloValue(false); in TEST_F()
46 HloValue B = NewHloValue(true); in TEST_F()
58 HloValue A = NewHloValue(false); in TEST_F()
59 HloValue B = NewHloValue(true); in TEST_F()
72 HloValue A = NewHloValue(true); in TEST_F()
73 HloValue B = NewHloValue(true); in TEST_F()
74 HloValue C = NewHloValue(true); in TEST_F()
75 HloValue D = NewHloValue(false); in TEST_F()
[all …]
Dhlo_dataflow_analysis.h110 const HloValue& GetValueDefinedAt(const HloInstruction* instruction,
112 HloValue& GetValueDefinedAt(const HloInstruction* instruction,
136 const HloValue& GetUniqueValueAt(const HloInstruction* instruction,
140 HloValue& GetUniqueValueAt(const HloInstruction* instruction,
146 const HloValue& GetValue(HloValue::Id value_id) const;
147 HloValue& GetValue(HloValue::Id value_id);
153 const std::vector<HloValue*>& values() const { return values_vector_; } in values()
230 HloValue* NewHloValue(HloInstruction* instruction, const ShapeIndex& index,
234 void MarkValueForDeletion(HloValue::Id value_id);
323 absl::flat_hash_map<HloValue::Id, std::unique_ptr<HloValue>> values_;
[all …]
Dheap_simulator.h115 const absl::flat_hash_set<const HloValue*>* buffers_to_assign;
149 static StatusOr<Result<HloValue>> Run(
150 std::unique_ptr<HeapAlgorithm<HloValue>> algorithm,
160 static StatusOr<Result<HloValue>> Run(
161 std::unique_ptr<HeapAlgorithm<HloValue>> algorithm,
172 static StatusOr<Result<HloValue>> Run(
173 std::unique_ptr<HeapAlgorithm<HloValue>> algorithm,
184 HeapSimulator(std::unique_ptr<HeapAlgorithm<HloValue>> algorithm,
196 bool IgnoreBuffer(const HloValue* buffer) const;
197 void Alloc(const HloValue* buffer, const HloInstruction* instruction);
[all …]
Dbuffer_assignment.cc219 const HloValue& buffer) const { in GetSlice()
224 void BufferAllocation::AddAssignment(const HloValue& buffer, int64_t offset, in AddAssignment()
286 static bool CompareHloValuesById(const HloValue* a, const HloValue* b) { in CompareHloValuesById()
294 const HloValue* value = p.first; in GetEntryParameterInstruction()
309 const HloValue* value = p.first; in GetOutputInstruction()
353 std::vector<const HloValue*> sorted_buffers; in ToString()
358 for (const HloValue* buffer : sorted_buffers) { in ToString()
379 bool BufferAssignment::HasAllocation(const HloValue& value) const { in HasAllocation()
388 const HloValue& value) const { in GetAssignedAllocation()
406 for (const HloValue* value : in GetAllSlices()
[all …]
Dhlo_value.h101 class HloValue : public BufferValue {
104 static bool IdLessThan(const HloValue* a, const HloValue* b) { in IdLessThan()
112 HloValue(Id id, HloInstruction* instruction, const ShapeIndex& index,
163 bool operator==(const HloValue& other) const { return this == &other; }
164 bool operator!=(const HloValue& other) const { return !(*this == other); }
206 std::ostream& operator<<(std::ostream& out, const HloValue& hlo_value);
220 explicit HloValueSet(absl::Span<const HloValue* const> values);
221 explicit HloValueSet(const absl::flat_hash_set<const HloValue*>& values);
229 const std::vector<const HloValue*>& values() const { return values_; } in values()
233 bool AddValue(const HloValue* value);
[all …]
Dhlo_alias_analysis.cc47 using FlatValueSet = absl::flat_hash_set<const HloValue*>;
49 void ComputeInputOutputAliasedValues(const HloValue& value, in ComputeInputOutputAliasedValues()
73 void ComputeWhileAliasedValues(const HloValue& value, in ComputeWhileAliasedValues()
81 const HloValue& while_value = in ComputeWhileAliasedValues()
99 const HloValue& while_value = dataflow.GetUniqueValueAt( in ComputeWhileAliasedValues()
123 const HloValue& while_value = in ComputeWhileAliasedValues()
136 void ComputeConditionalAliasedValues(const HloValue& value, in ComputeConditionalAliasedValues()
153 const HloValue& cond_value = in ComputeConditionalAliasedValues()
165 void ComputeInPlaceOperationAliasedValues(const HloValue& value, in ComputeInPlaceOperationAliasedValues()
176 const HloValue& operand_value = dataflow.GetUniqueValueAt( in ComputeInPlaceOperationAliasedValues()
[all …]
Dhlo_value.cc72 HloValue::HloValue(HloValue::Id id, HloInstruction* instruction, in HloValue() function in xla::HloValue
79 std::string HloValue::ToShortString() const { in ToShortString()
86 std::string HloValue::ToString(int indent) const { in ToString()
136 void HloValue::SetPositions(absl::Span<const HloPosition> positions) { in SetPositions()
156 void HloValue::ComputeUses(std::vector<HloUse>& uses) const { in ComputeUses()
191 bool HloValue::IsRootOf(const HloComputation* computation) const { in IsRootOf()
198 std::ostream& operator<<(std::ostream& out, const HloValue& value) { in operator <<()
203 HloValueSet::HloValueSet(absl::Span<const HloValue* const> values) in HloValueSet()
208 HloValueSet::HloValueSet(const absl::flat_hash_set<const HloValue*>& values) in HloValueSet()
211 absl::c_sort(values_, HloValue::IdLessThan); in HloValueSet()
[all …]
Dheap_simulator.cc65 HeapSimulator::Result<HloValue> result, in MinimumMemoryForModule()
66 HeapSimulator::Run(std::make_unique<NoFragmentationStatsHeap<HloValue>>(), in MinimumMemoryForModule()
79 HeapSimulator::Result<HloValue> result, in MinimumMemoryForComputation()
80 HeapSimulator::Run(std::make_unique<NoFragmentationStatsHeap<HloValue>>(), in MinimumMemoryForComputation()
92 HeapSimulator::Result<HloValue> result, in MinimumMemoryForComputation()
93 HeapSimulator::Run(std::make_unique<NoFragmentationStatsHeap<HloValue>>(), in MinimumMemoryForComputation()
100 StatusOr<HeapSimulator::Result<HloValue>> HeapSimulator::Run( in Run()
101 std::unique_ptr<HeapAlgorithm<HloValue>> algorithm, const HloModule& module, in Run()
118 StatusOr<HeapSimulator::Result<HloValue>> HeapSimulator::Run( in Run()
119 std::unique_ptr<HeapAlgorithm<HloValue>> algorithm, in Run()
[all …]
Dhlo_phi_graph.cc21 HloValue::Id PhiGraph::GetOptimizedId(const HloValue& value) { in GetOptimizedId()
28 bool PhiGraph::InputsEqualTo(const HloValue& value, in InputsEqualTo()
29 absl::Span<const HloValue* const> inputs) { in InputsEqualTo()
32 absl::flat_hash_set<HloValue::Id> existing_set; in InputsEqualTo()
36 absl::flat_hash_set<HloValue::Id> new_set; in InputsEqualTo()
37 for (const HloValue* input : inputs) { in InputsEqualTo()
43 HloValue::Id PhiGraph::FindOptimizedValue(const HloValue::Id id) { in FindOptimizedValue()
50 PhiGraph::Node* PhiGraph::CreateOrReuseNode(const HloValue& value) { in CreateOrReuseNode()
91 for (HloValue::Id value_id : node_to_value_id_[node]) { in ReplaceNodeWith()
102 void PhiGraph::RegisterPhi(const HloValue& value, in RegisterPhi()
[all …]
Dbuffer_assignment.h158 const absl::flat_hash_map<const HloValue*, OffsetSize>& assigned_buffers() in assigned_buffers()
212 Slice GetSlice(const HloValue& buffer) const;
257 const std::vector<const HloValue*>& PeakMemoryLogicalBuffers() const { in PeakMemoryLogicalBuffers()
293 void AddAssignment(const HloValue& buffer, int64_t offset, int64_t size);
340 absl::flat_hash_map<const HloValue*, OffsetSize> assigned_buffers_;
346 std::vector<const HloValue*> peak_buffers_;
380 bool HasAllocation(const HloValue& value) const;
386 const BufferAllocation& GetAssignedAllocation(const HloValue& value) const;
430 const std::vector<const HloValue*>& GetSourceBuffers( in GetSourceBuffers()
533 void AddAssignment(BufferAllocation* allocation, const HloValue& value,
[all …]
Dhlo_ordering.h73 bool IsDefinedBefore(const HloValue& a, const HloValue& b) const;
82 absl::Span<const HloUse* const> uses, const HloValue& value,
87 bool MayInterfere(const HloValue& a, const HloValue& b,
93 const HloValue& a, const HloValue& b, const HloDataflowAnalysis& dataflow,
Dheap_simulator_test.cc227 using CallSequence = std::vector<std::pair<std::string, const HloValue*>>;
230 class HeapCallRecorder : public HeapAlgorithm<HloValue> {
235 void Alloc(const HloValue* buffer, int64_t size) override { in Alloc()
244 void ShareWith(const HloValue* buffer, const HloValue* shared, in ShareWith()
253 void Free(const HloValue* buffer, int64_t size) override { in Free()
258 HeapSimulator::Result<HloValue> result; in Finish()
266 HeapSimulator::HeapResult<HloValue> result_;
333 const HloValue* BufferAt(const HloInstruction* instruction, in BufferAt()
340 const HloValue* buffer = BufferAt(instruction, index); in OffsetAt()
403 HeapSimulator::Result<HloValue> result_;
[all …]
Dhlo_buffer.h87 HloBuffer(Id id, std::vector<const HloValue*> values) in HloBuffer()
94 const std::vector<const HloValue*>& values() const { return values_; } in values()
101 for (const HloValue* value : values()) { in color()
109 const HloValue& GetUniqueValue() const { in GetUniqueValue()
127 std::vector<const HloValue*> values_;
Dhlo_live_range.h84 const absl::flat_hash_map<const HloValue*, TimeBound>& buffer_live_ranges() in buffer_live_ranges()
89 absl::flat_hash_map<const HloValue*, TimeBound>& buffer_live_ranges() { in buffer_live_ranges()
128 TimeBound GetLastPosition(const HloValue& value,
132 LogicalTime GetLastUsageTime(const HloValue& value) const;
227 absl::flat_hash_map<const HloValue*, TimeBound> buffer_live_ranges_;
Dhlo_dataflow_analysis.cc300 const HloValue& HloDataflowAnalysis::GetValueDefinedAt( in GetValueDefinedAt()
306 HloValue& HloDataflowAnalysis::GetValueDefinedAt( in GetValueDefinedAt()
312 HloValue* HloDataflowAnalysis::NewHloValue(HloInstruction* instruction, in NewHloValue()
317 values_.insert({value_id, std::make_unique<HloValue>( in NewHloValue()
326 void HloDataflowAnalysis::MarkValueForDeletion(HloValue::Id value_id) { in MarkValueForDeletion()
327 const HloValue& value = *values_.at(value_id); in MarkValueForDeletion()
335 absl::flat_hash_set<HloValue::Id> id_set(value_ids_to_delete_.begin(), in DeleteMarkedValues()
344 for (const HloValue* value : value_set.values()) { in DeleteMarkedValues()
355 for (HloValue::Id value_id : id_set) { in DeleteMarkedValues()
374 for (const HloValue* value : value_set.values()) { in ToString()
[all …]
Dhlo_live_range.cc48 const HloValue& value = *entry.first; in NormalizeAliasedBuffers()
123 const HloValue& value, in GetLastPosition()
151 const HloValue& value) const { in GetLastUsageTime()
219 for (const HloValue* value : entry.second.values()) { in CalculateBufferStartEndMap()
246 std::vector<std::tuple<int64_t /*time*/, bool /*is_end*/, const HloValue*>> in ComputePeakMemoryMoment()
248 for (const HloValue* value : alias_analysis_.dataflow_analysis().values()) { in ComputePeakMemoryMoment()
263 const HloValue* value; in ComputePeakMemoryMoment()
291 for (const HloValue* value : alias_analysis_.dataflow_analysis().values()) { in ToString()
304 for (const HloValue* value : alias_analysis_.dataflow_analysis().values()) { in ToString()
Dhlo_alias_analysis.h49 const HloBuffer& GetBufferContainingValue(const HloValue& value) const { in GetBufferContainingValue()
52 HloBuffer& GetBufferContainingValue(const HloValue& value) { in GetBufferContainingValue()
91 bool ValueLivesOut(const HloValue& value) const { in ValueLivesOut()
117 absl::flat_hash_map<const HloValue*, HloBuffer*> value_to_buffer_;
Dhlo_ordering.cc144 bool HloOrdering::IsDefinedBefore(const HloValue& a, const HloValue& b) const { in IsDefinedBefore()
172 auto is_body_or_condition_phi = [](const HloValue& v) { in IsDefinedBefore()
214 absl::Span<const HloUse* const> uses, const HloValue& value, in UsesBeforeValueDefinition()
390 const HloValue& a, const HloValue& b, const HloDataflowAnalysis& dataflow, in LiveRangeStrictlyBefore()
442 bool HloOrdering::MayInterfere(const HloValue& a, const HloValue& b, in MayInterfere()
Dmemory_space_assignment_utils.h29 const GlobalDecreasingSizeBestFitHeap<HloValue>::BufferInterval&
33 static bool IsValueAllowedInAlternateMemory(const HloValue* value);
Dmemory_space_assignment.h149 const GlobalDecreasingSizeBestFitHeap<HloValue>::BufferInterval& interval,
309 const GlobalDecreasingSizeBestFitHeap<HloValue>::BufferInterval& interval) in BufferIntervalAlternateMemoryBenefit()
438 const GlobalDecreasingSizeBestFitHeap<HloValue>::BufferInterval& interval)
488 GlobalDecreasingSizeBestFitHeap<HloValue>::BufferInterval;
490 GlobalDecreasingSizeBestFitHeap<HloValue>::BufferIntervalCompare;
492 std::function<bool(const HloValue&)>;
849 AllocationValue(const HloValue* value, const HloPosition& position, in AllocationValue()
863 const HloValue* value() const { return value_; } in value()
887 const HloValue* value_;
1215 : public GlobalDecreasingSizeBestFitHeap<HloValue> {
[all …]
Dhlo_buffer.cc47 for (const HloValue* value : values_) { in ComputePositions()
62 [](std::string* result, const HloValue* value) { in ToString()
Dcopy_insertion.cc53 bool IsReadonlyEntryParameterValue(const HloValue& value) { in IsReadonlyEntryParameterValue()
61 bool IsConstantValue(const HloValue& value) { in IsConstantValue()
65 bool ValueIsReadOnly(const HloValue& value) { in ValueIsReadOnly()
91 bool ShouldCopyRootValue(const HloValue& value, in ShouldCopyRootValue()
1131 explicit ValueNode(const HloValue* v) : value(v) {} in ValueNode()
1133 const HloValue* value;
1152 absl::flat_hash_map<const HloValue*, ValueNode*> value_to_node; in CopyRemover()
1167 for (const HloValue* value_a : buffer.values()) { in CopyRemover()
1172 for (const HloValue* value_b : buffer.values()) { in CopyRemover()
1187 std::vector<const HloValue*> values = buffer.values(); in CopyRemover()
[all …]
Dmemory_space_assignment_utils.cc24 const HloValue* value) { in IsValueAllowedInAlternateMemory()
85 const GlobalDecreasingSizeBestFitHeap<HloValue>::BufferInterval& interval) { in IsIntervalAllowedInAlternateMemory()
/external/tensorflow/tensorflow/compiler/xla/service/llvm_ir/
Dalias_analysis.cc137 std::vector<const HloValue*> worklist; in GetNoaliasMetadataForBuffer()
152 for (const HloValue* buffer : in GetNoaliasMetadataForBuffer()
174 for (const HloValue* buffer : worklist) { in GetNoaliasMetadataForBuffer()

12