| 66 | } |
| 67 | |
| 68 | void megray_send_tensor( |
| 69 | std::shared_ptr<MegRay::Communicator> megray_comm, const TensorPtr& src, |
| 70 | uint32_t rank_to) { |
| 71 | auto&& tensor = src->dev_tensor(); |
| 72 | auto&& ishp = src->shape(); |
| 73 | size_t data_size = ishp.total_nr_elems(); |
| 74 | auto megray_ctx = mgb::opr::get_megray_context(src->comp_node()); |
| 75 | auto status = megray_comm->send( |
| 76 | src->dev_tensor().raw_ptr(), data_size, |
| 77 | mgb::opr::get_megray_dtype(src->layout().dtype), rank_to, megray_ctx); |
| 78 | mgb_assert(status == MegRay::MEGRAY_OK, "MegRay send failed"); |
| 79 | } |
| 80 | |
| 81 | TensorLayout create_layout(const std::vector<int32_t>& shape, DType dtype) { |
| 82 | TensorShape tshape; |
no test coverage detected