MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Update

Method Update

tensorflow/compiler/xla/service/hlo_schedule.cc:200–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200Status HloSchedule::Update() {
201 // The schedule must contain a sequence for every non-fusion computation in
202 // the module, but can have sequences for computations which no longer exist
203 // (these are removed).
204 std::vector<HloComputation*> nonfusion_computations =
205 module_->MakeNonfusionComputations();
206 for (const HloComputation* computation : nonfusion_computations) {
207 TF_RET_CHECK(sequences_.contains(computation->unique_id()))
208 << "Computation " << computation->name() << " not in HloSchedule.";
209 }
210 if (sequences_.size() > nonfusion_computations.size()) {
211 // Schedule contains some computations which have been removed from the
212 // HloModule. Remove them from the schedule as well.
213 absl::flat_hash_set<int64> nonfusion_computations_ids;
214 for (const HloComputation* computation : nonfusion_computations) {
215 nonfusion_computations_ids.insert(computation->unique_id());
216 }
217 for (auto it = sequences_.begin(); it != sequences_.end();) {
218 if (!nonfusion_computations_ids.contains(it->first)) {
219 sequences_.erase(it++);
220 } else {
221 ++it;
222 }
223 }
224 }
225 CHECK_EQ(sequences_.size(), nonfusion_computations.size());
226
227 for (const HloComputation* computation : nonfusion_computations) {
228 TF_RETURN_IF_ERROR(UpdateComputationSchedule(computation));
229 }
230
231 TF_RETURN_IF_ERROR(Verify());
232 return Status::OK();
233}
234
235Status HloSchedule::Verify() const {
236 VLOG(2) << "VerifySchedule()";

Callers 10

ReleaseAllHandlesMethod · 0.45
CopyDeviceTensorToCPUMethod · 0.45
EqualFunction · 0.45
EqualHelperFunction · 0.45
TEST_FFunction · 0.45
RunMethod · 0.45

Calls 10

containsMethod · 0.80
nameMethod · 0.65
VerifyFunction · 0.50
unique_idMethod · 0.45
sizeMethod · 0.45
insertMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by 1

TEST_FFunction · 0.36