MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / ForwardDataContent

Method ForwardDataContent

oneflow/core/kernel/collective_boxing_kernels.cpp:65–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65void CollectiveBoxingGenericKernel::ForwardDataContent(KernelContext* ctx) const {
66 RequestHandle* request_handle =
67 CHECK_NOTNULL(dynamic_cast<CollectiveBoxingKernelState*>(ctx->state().get()))
68 ->request_handle();
69 const void* send_buff = nullptr;
70 void* recv_buff = nullptr;
71 const RankDesc& rank_desc = this->op_conf().collective_boxing_generic_conf().rank_desc();
72 const DataType data_type = rank_desc.op_desc().data_type();
73 if (GenericOpHasInput(rank_desc)) {
74 const Blob* in = ctx->BnInOp2Blob("in");
75 CHECK_EQ(in->data_type(), data_type);
76 CHECK(in->shape() == ShapeView(GenericOpGetInputShape(rank_desc)));
77 send_buff = in->dptr();
78 }
79 if (GenericOpHasOutput(rank_desc)) {
80 Blob* out = ctx->BnInOp2Blob("out");
81 CHECK_EQ(out->data_type(), data_type);
82 CHECK(out->shape() == ShapeView(GenericOpGetOutputShape(rank_desc)));
83 recv_buff = out->mut_dptr();
84 }
85 auto* actor_ctx = GetCollectiveBoxingActorContext(ctx);
86 actor_ctx->Schedule(request_handle, send_buff, recv_buff);
87}
88
89REGISTER_KERNEL(OperatorConf::kCollectiveBoxingGenericConf, CollectiveBoxingGenericKernel);
90

Callers

nothing calls this directly

Calls 15

GenericOpHasInputFunction · 0.85
GenericOpGetInputShapeFunction · 0.85
GenericOpHasOutputFunction · 0.85
GenericOpGetOutputShapeFunction · 0.85
request_handleMethod · 0.80
stateMethod · 0.80
ShapeViewClass · 0.50
getMethod · 0.45
data_typeMethod · 0.45
BnInOp2BlobMethod · 0.45
shapeMethod · 0.45

Tested by

no test coverage detected