MCPcopy Index your code
hub / github.com/apache/tvm / recv

Method recv

python/tvm/support/popen_pool.py:273–311  ·  view source on GitHub ↗

Receive the result of the last send. Returns ------- result: object The result of the last send. Raises ------ ChildProcessError: if the child process exited abnormally. TimeoutError: if timeout happens Exception: if other

(self)

Source from the content-addressed store, hash-verified

271 return ChildProcessError("Subprocess terminated")
272
273 def recv(self):
274 """Receive the result of the last send.
275
276 Returns
277 -------
278 result: object
279 The result of the last send.
280
281 Raises
282 ------
283 ChildProcessError: if the child process exited abnormally.
284 TimeoutError: if timeout happens
285 Exception: if other exception happens during the execution.
286 """
287 # pylint: disable=import-outside-toplevel
288 import cloudpickle
289
290 try:
291 len_data = self._reader.read(4)
292 except OSError:
293 raise self._child_process_error()
294
295 if len(len_data) == 0:
296 raise self._child_process_error()
297
298 try:
299 recv_bytes = struct.unpack("<i", len_data)[0]
300 status, value = cloudpickle.loads(self._reader.read(recv_bytes))
301 except OSError:
302 raise self._child_process_error()
303
304 if status == StatusKind.COMPLETE:
305 return value
306 if status == StatusKind.EXCEPTION:
307 raise value
308 assert status == StatusKind.TIMEOUT
309 # kill and lazily restart the process in the next send.
310 self.kill()
311 raise TimeoutError()
312
313
314class PopenPoolExecutor:

Callers 15

sendMethod · 0.95
_worker_runMethod · 0.95
test_codegen_nvshmemFunction · 0.95
check_deviceFunction · 0.95
check_system_libFunction · 0.95
test_cuda_multi_libFunction · 0.95
test_popen_workerFunction · 0.95
test_popen_worker_reusesFunction · 0.95
test_popen_initializerFunction · 0.95
test_popen_ffiFunction · 0.95

Calls 4

_child_process_errorMethod · 0.95
killMethod · 0.95
unpackMethod · 0.80
readMethod · 0.65

Tested by 11

test_codegen_nvshmemFunction · 0.76
check_deviceFunction · 0.76
check_system_libFunction · 0.76
test_cuda_multi_libFunction · 0.76
test_popen_workerFunction · 0.76
test_popen_worker_reusesFunction · 0.76
test_popen_initializerFunction · 0.76
test_popen_ffiFunction · 0.76