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

Method Run

tensorflow/core/distributed_runtime/eager/remote_execute_node.cc:21–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19namespace eager {
20
21Status RemoteExecuteNode::Run() {
22 EnqueueResponse* response = new EnqueueResponse;
23
24 const gtl::InlinedVector<TensorHandle*, 4>& inputs = inputs_;
25 const gtl::InlinedVector<TensorHandle*, 2>& retvals = retvals_;
26 Device* device = device_;
27
28 // Filled and used only when VLOG(3) is on.
29 string rpc_description;
30 if (VLOG_IS_ON(3)) {
31 std::vector<string> ops;
32 ops.reserve(request_->queue_size());
33 for (const QueueItem& item : request_->queue()) {
34 if (item.has_operation()) {
35 ops.push_back(item.operation().name());
36 } else {
37 ops.push_back(absl::StrCat("DeleteHandle(",
38 item.handle_to_decref().op_id(), ":",
39 item.handle_to_decref().output_num(), ")"));
40 }
41 }
42 rpc_description =
43 absl::StrCat("RemoteOperation(", absl::StrJoin(ops, ", "), ")");
44 }
45 VLOG(3) << "Issuing: " << rpc_description;
46
47 return eager_client_->StreamingEnqueueAsync(
48 request_.get(), response,
49 [inputs, retvals, response, device,
50 rpc_description](const Status& status) {
51 for (auto handle : inputs) {
52 handle->Unref();
53 }
54 if (status.ok()) {
55 VLOG(3) << "Completed successfully: " << rpc_description;
56 } else {
57 VLOG(3) << "Failed: " << rpc_description << " with status "
58 << status.ToString();
59 }
60 for (size_t i = 0; i < retvals.size(); ++i) {
61 if (status.ok()) {
62 Status s = retvals[i]->SetRemoteShape(
63 response->queue_response(0).shape(i), device);
64 if (!s.ok()) {
65 LOG(ERROR) << "Ignoring an error encountered when setting "
66 "remote shape of tensor handle: "
67 << retvals[i] << " with status: " << status.ToString()
68 << "\nThis should never happen. "
69 "Please file an issue with the TensorFlow Team.";
70 }
71 } else {
72 retvals[i]->Poison(status);
73 }
74 retvals[i]->Unref();
75 }
76 delete response;
77 });
78}

Callers

nothing calls this directly

Calls 15

queue_sizeMethod · 0.80
operationMethod · 0.80
SetRemoteShapeMethod · 0.80
PoisonMethod · 0.80
nameMethod · 0.65
StrCatFunction · 0.50
reserveMethod · 0.45
queueMethod · 0.45
push_backMethod · 0.45
op_idMethod · 0.45
output_numMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected