junrushao1994 commented on a change in pull request #8789:
URL: https://github.com/apache/tvm/pull/8789#discussion_r691691524
##########
File path: python/tvm/contrib/popen_pool.py
##########
@@ -153,6 +160,11 @@ def _start(self):
self._reader = os.fdopen(main_read, "rb")
self._writer = os.fdopen(main_write, "wb")
+ # init
+ if self._initializer is not None:
+ self.send(self._initializer, self._initargs)
+ self.recv()
Review comment:
I am not sure about the logic here. Looks like the workflow is:
* `PopenWorker.send` is the entry point, which calls `PopenWorker._start` if
the worker is not available
* with this logic, the `PopenWorker._start` method will call back to
`PopenWorker.send` to send the initializer to the worker process.
I didn't see any problem with the workflow itself, but the cyclic call is a
bit indirect. Would you mind if we move these 4 lines into the `if self._proc
is None` check?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]