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

Method Done

tensorflow/contrib/verbs/rdma.cc:1496–1517  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1494RdmaTensorRequest::~RdmaTensorRequest() { DeallocateTensors(); }
1495
1496void RdmaTensorRequest::Done(const Status& s) {
1497 Tensor val = std::move(*result_tensor_);
1498
1499#ifdef RDMA_DATA_VALIDATION
1500 // Validate checksum
1501 // Unfortunately we can't always do a Checksum directly on the result tensor.
1502 // If the result tensor is on GPU, then we need to copy it back to CPU. If
1503 // we happen to be in the midst of a proxy callback, then the copying will
1504 // get stuck.
1505 uint64_t checksum = (proxy_tensor_ != nullptr)
1506 ? Checksum(nullptr, nullptr, *proxy_tensor_)
1507 : Checksum(dst_dev_, recv_args_.device_context, val);
1508 ValidateChecksum(checksum_, checksum, val, index_, key_, "RDMA");
1509#endif
1510
1511 Rendezvous::Args recv_args = std::move(recv_args_);
1512 bool is_dead = (meta_data_ == nullptr) ? false : meta_data_->is_dead_;
1513 RecvDoneCallback done = done_;
1514 DeallocateTensors();
1515 channel_->RemoveTensorRequest(index_);
1516 done(s, Rendezvous::Args(), recv_args, val, is_dead);
1517}
1518
1519void RdmaTensorRequest::DeallocateTensors() {
1520 if (result_tensor_ != nullptr) {

Callers 4

RunMethod · 0.45
RunMethod · 0.45
NewPartialRunMethod · 0.45
sync_threadpoolMethod · 0.45

Calls 4

ChecksumFunction · 0.85
ValidateChecksumFunction · 0.85
RemoveTensorRequestMethod · 0.80
ArgsClass · 0.50

Tested by

no test coverage detected