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

Method FuseRecvOp

tensorflow/core/kernels/fuserecv_ops.cc:54–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54FuseRecvOp::FuseRecvOp(OpKernelConstruction* ctx) : AsyncOpKernel(ctx), fuse_count_(0) {
55 // send devices are not single
56 std::vector<string> tensor_names;
57 OP_REQUIRES_OK(ctx, ctx->GetAttr("tensor_names", &tensor_names));
58
59 std::vector<string> send_devices;
60 OP_REQUIRES_OK(ctx, ctx->GetAttr("send_devices", &send_devices));
61
62 std::vector<int64> send_device_incarnations;
63 OP_REQUIRES_OK(ctx, ctx->GetAttr("send_device_incarnations",
64 &send_device_incarnations));
65
66 std::vector<string> recv_devices;
67 OP_REQUIRES_OK(ctx, ctx->GetAttr("recv_devices", &recv_devices));
68
69 fuse_count_ = tensor_names.size();
70 key_prefixs_.resize(fuse_count_);
71 parsed_keys_.resize(fuse_count_);
72
73 for (int i = 0; i < fuse_count_; ++i) {
74 key_prefixs_[i] = GetRendezvousKeyPrefix(
75 send_devices[i], recv_devices[i],
76 static_cast<uint64>(send_device_incarnations[i]),
77 tensor_names[i]);
78 // The vast majority of Recv nodes are outside any loop context, so
79 // proactively cache the rendezvous key for the top-level.
80 GetRendezvousKey(key_prefixs_[i], {0, 0}, &parsed_keys_[i].buf_);
81 OP_REQUIRES_OK(ctx, Rendezvous::ParseKey(parsed_keys_[i].buf_, &parsed_keys_[i]));
82 }
83
84 if (!ctx->GetAttr("_hostmem_sendrecv", &hostmem_sendrecv_).ok()) {
85 hostmem_sendrecv_ = false;
86 }
87}
88
89void FuseRecvOp::ComputeAsync(OpKernelContext* ctx, DoneCallback done) {
90 //LOG(INFO) << "FuseRecvOp::ComputeAsync";

Callers

nothing calls this directly

Calls 6

GetRendezvousKeyPrefixFunction · 0.70
GetRendezvousKeyFunction · 0.70
GetAttrMethod · 0.45
sizeMethod · 0.45
resizeMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected