Fast-pull api used by kvstore. Parameters ---------- name : str data name id_tensor : tensor data ID part_id : tensor partition ID of id_tensor service_id : int service_id of pull request machine_count : int total number of machine
(
name,
id_tensor,
part_id,
service_id,
machine_count,
group_count,
machine_id,
client_id,
local_data,
policy,
)
| 1112 | |
| 1113 | |
| 1114 | def fast_pull( |
| 1115 | name, |
| 1116 | id_tensor, |
| 1117 | part_id, |
| 1118 | service_id, |
| 1119 | machine_count, |
| 1120 | group_count, |
| 1121 | machine_id, |
| 1122 | client_id, |
| 1123 | local_data, |
| 1124 | policy, |
| 1125 | ): |
| 1126 | """Fast-pull api used by kvstore. |
| 1127 | |
| 1128 | Parameters |
| 1129 | ---------- |
| 1130 | name : str |
| 1131 | data name |
| 1132 | id_tensor : tensor |
| 1133 | data ID |
| 1134 | part_id : tensor |
| 1135 | partition ID of id_tensor |
| 1136 | service_id : int |
| 1137 | service_id of pull request |
| 1138 | machine_count : int |
| 1139 | total number of machine |
| 1140 | group_count : int |
| 1141 | total number of server inside machine |
| 1142 | machine_id : int |
| 1143 | current machine ID |
| 1144 | client_id : int |
| 1145 | current client ID |
| 1146 | local_data : tensor |
| 1147 | local data tensor |
| 1148 | policy : PartitionPolicy |
| 1149 | store the partition information |
| 1150 | """ |
| 1151 | msg_seq = incr_msg_seq() |
| 1152 | pickle_data = bytearray(pickle.dumps(([0], [name]))) |
| 1153 | global_id = _CAPI_DGLRPCGetGlobalIDFromLocalPartition( |
| 1154 | F.zerocopy_to_dgl_ndarray(id_tensor), |
| 1155 | F.zerocopy_to_dgl_ndarray(part_id), |
| 1156 | machine_id, |
| 1157 | ) |
| 1158 | global_id = F.zerocopy_from_dgl_ndarray(global_id) |
| 1159 | g2l_id = policy.to_local(global_id) |
| 1160 | res_tensor = _CAPI_DGLRPCFastPull( |
| 1161 | name, |
| 1162 | int(machine_id), |
| 1163 | int(machine_count), |
| 1164 | int(group_count), |
| 1165 | int(client_id), |
| 1166 | int(service_id), |
| 1167 | int(msg_seq), |
| 1168 | pickle_data, |
| 1169 | F.zerocopy_to_dgl_ndarray(id_tensor), |
| 1170 | F.zerocopy_to_dgl_ndarray(part_id), |
| 1171 | F.zerocopy_to_dgl_ndarray(g2l_id), |
nothing calls this directly
no test coverage detected