diff --git a/imperative/src/impl/ops/io_remote.cpp b/imperative/src/impl/ops/io_remote.cpp index 03e4d58a..255e65d7 100644 --- a/imperative/src/impl/ops/io_remote.cpp +++ b/imperative/src/impl/ops/io_remote.cpp @@ -47,8 +47,13 @@ cg::OperatorNodeBase* apply_on_var_node_remote_recv( auto group_client = std::make_shared( ssprintf("%s:%d", recv.addr.data(), recv.port)); auto&& graph = inputs[0]->owner_graph(); + mgb_assert(!recv.shape.empty()); + TensorShape shape; + for (auto&& dim : recv.shape) { + shape[shape.ndim++] = dim; + } return graph->insert_opr(std::make_unique( - recv.key, inputs[0], *graph, group_client, config, recv.shape, recv.dtype, + recv.key, inputs[0], *graph, group_client, config, shape, recv.dtype, recv.backend)); } diff --git a/imperative/src/test/io_remote.cpp b/imperative/src/test/io_remote.cpp index 97a7b62d..fa3a0a21 100644 --- a/imperative/src/test/io_remote.cpp +++ b/imperative/src/test/io_remote.cpp @@ -42,7 +42,7 @@ TEST(TestImperative, IORemote) { auto run_recv = [&](std::shared_ptr hnd) { auto def = imperative::RemoteRecv::make( "io_remote_test", server_addr, port, 0, CompNode::load("gpu1"), - TensorShape{vector_size}, dtype::Float32(), "nccl"); + std::vector{(int32_t)vector_size}, dtype::Float32(), "nccl"); auto inp = Tensor::make(*hnd); auto oup = OpDef::apply_on_physical_tensor(*def, {inp}); HostTensorND host_v; diff --git a/src/core/include/megbrain/ir/ops.td b/src/core/include/megbrain/ir/ops.td index 30c795ad..75eb7e3e 100644 --- a/src/core/include/megbrain/ir/ops.td +++ b/src/core/include/megbrain/ir/ops.td @@ -284,7 +284,7 @@ def RemoteRecv : MgbHashableOp<"RemoteRecv"> { MgbUI32Attr:$port, MgbUI32Attr:$rank_from, MgbCompNodeAttr:$cn, - MgbTensorShapeAttr:$shape, + MgbArrayAttr:$shape, MgbDTypeAttr:$dtype, MgbStringAttr:$backend );