| 1494 | RdmaTensorRequest::~RdmaTensorRequest() { DeallocateTensors(); } |
| 1495 | |
| 1496 | void 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 | |
| 1519 | void RdmaTensorRequest::DeallocateTensors() { |
| 1520 | if (result_tensor_ != nullptr) { |
no test coverage detected