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

Method PrepareRecvTensor

tensorflow/core/distributed_runtime/worker.cc:452–471  ·  view source on GitHub ↗

Helper for RecvTensor. Validates "key" and returns the source device in "*src_dev".

Source from the content-addressed store, hash-verified

450// Helper for RecvTensor. Validates "key" and returns the source
451// device in "*src_dev".
452Status Worker::PrepareRecvTensor(const Rendezvous::ParsedKey& parsed,
453 Device** src_dev) {
454 // Figures out which device the tensor is hosted on.
455 string local_name = DeviceNameUtils::LocalName(parsed.src_device);
456 TF_RETURN_IF_ERROR(env_->device_mgr->LookupDevice(local_name, src_dev));
457
458 // Does the device have the right incarnation number we expect?
459 if (0 != parsed.src_incarnation &&
460 (*src_dev)->attributes().incarnation() != parsed.src_incarnation) {
461 return errors::Aborted(
462 "RecvTensor expects a different device incarnation: ",
463 parsed.src_incarnation, " vs. ", (*src_dev)->attributes().incarnation(),
464 ". Your worker job (\"",
465 env_->session_mgr->LegacySession()->worker_name,
466 "\") was probably restarted. Check your "
467 "worker job for the reason why it was restarted.");
468 }
469
470 return Status::OK();
471}
472
473void Worker::RecvTensorAsync(CallOptions* opts,
474 const RecvTensorRequest* request,

Callers

nothing calls this directly

Calls 3

LookupDeviceMethod · 0.80
incarnationMethod · 0.80
LegacySessionMethod · 0.45

Tested by

no test coverage detected