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

Method AdvanceToSecondPass

tensorflow/core/common_runtime/ring_alg.cc:352–367  ·  view source on GitHub ↗

When a RingField transitions from first to second recompute the do_send and do_recv values.

Source from the content-addressed store, hash-verified

350// When a RingField transitions from first to second recompute the
351// do_send and do_recv values.
352void RingAlg::AdvanceToSecondPass(RingField* rf) {
353 VLOG(3) << "IncrRingField old value " << rf->DebugString();
354 DCHECK(!rf->second_pass);
355 rf->second_pass = true;
356 rf->action = RF_INIT;
357 if (ca_->ChunkBytes(rf->sc_idx) > 0) {
358 // In pass 1 the send/no-send boundary moves down 1 place.
359 rf->do_recv =
360 (rf->rank != ((rf->chunk_idx + (group_size_ - 1)) % group_size_));
361 rf->do_send =
362 (rf->rank != ((rf->chunk_idx + (group_size_ - 2)) % group_size_));
363 }
364 rf->is_final =
365 (rf->rank == ((rf->chunk_idx + (group_size_ - 2)) % group_size_));
366 VLOG(3) << "IncrRingField new value " << rf->DebugString();
367}
368
369string RingAlg::RingField::DebugString() const {
370 string rv = strings::StrCat("RingField rank=", rank, " chunk_idx=", chunk_idx,

Callers

nothing calls this directly

Calls 2

ChunkBytesMethod · 0.80
DebugStringMethod · 0.45

Tested by

no test coverage detected