You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "gmeeker (via GitHub)" <gi...@apache.org> on 2024/01/06 00:50:10 UTC

[PR] [RPC] Fix tuning on macOS and Windows (#15771) [tvm]

gmeeker opened a new pull request, #16357:
URL: https://github.com/apache/tvm/pull/16357

   Fix regression in (#15187) when multiprocessing start method is not 'fork', which prevented tuning from working. This affects macOS and Windows. Also in python 3.14 the default start method will be 'spawn'.


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [RPC] Fix tuning on macOS and Windows (#15771) [tvm]

Posted by "Johnson9009 (via GitHub)" <gi...@apache.org>.
Johnson9009 merged PR #16357:
URL: https://github.com/apache/tvm/pull/16357


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [RPC] Fix tuning on macOS and Windows (#15771) [tvm]

Posted by "Johnson9009 (via GitHub)" <gi...@apache.org>.
Johnson9009 commented on code in PR #16357:
URL: https://github.com/apache/tvm/pull/16357#discussion_r1448670941


##########
python/tvm/rpc/server.py:
##########
@@ -119,6 +119,15 @@ def download_linked_module(file_name):
     return temp
 
 
+def _serve_loop(sock, load_library, work_path=None):

Review Comment:
   even though the earlier code, there is only 1 function _serve_loop, the type of its 1st parameter is socket, we can only use 1 name "sock" or "conn", there is 2 caller of the function _serve_loop, just as you said, 1 caller's argument is a original socket, and another caller's argument is a result object from accept(), actually the type of the result object from accept still is socket, so I use the name "sock", because it closer with the type.



##########
python/tvm/rpc/server.py:
##########
@@ -119,6 +119,15 @@ def download_linked_module(file_name):
     return temp
 
 
+def _serve_loop(sock, load_library, work_path=None):
+    """Server loop"""
+    sockfd = sock.fileno()
+    temp = _server_env(load_library, work_path)
+    _ffi_api.ServerLoop(sockfd)
+    if not work_path:
+        temp.remove()

Review Comment:
   Thanks for your explanation, I think just move the closure out of the function _serving will fix the issue, so from my side, it is better to keep the code simple, so please keep it as same as possible with the current implementation if there isn't reasonable requirement, thanks.



-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [RPC] Fix tuning on macOS and Windows (#15771) [tvm]

Posted by "gmeeker (via GitHub)" <gi...@apache.org>.
gmeeker commented on code in PR #16357:
URL: https://github.com/apache/tvm/pull/16357#discussion_r1448231582


##########
python/tvm/rpc/server.py:
##########
@@ -119,6 +119,15 @@ def download_linked_module(file_name):
     return temp
 
 
+def _serve_loop(sock, load_library, work_path=None):
+    """Server loop"""
+    sockfd = sock.fileno()
+    temp = _server_env(load_library, work_path)
+    _ffi_api.ServerLoop(sockfd)
+    if not work_path:
+        temp.remove()

Review Comment:
   The answer to most of your comments is that I reverted part of (https://github.com/apache/tvm/pull/15187) so that _server_loop can be pickled. The code here comes from the code before that commit, and I didn't simplify it. I assumed there was a reason for its style, but I'll take another pass at this.



-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [RPC] Fix tuning on macOS and Windows (#15771) [tvm]

Posted by "Johnson9009 (via GitHub)" <gi...@apache.org>.
Johnson9009 commented on code in PR #16357:
URL: https://github.com/apache/tvm/pull/16357#discussion_r1448172941


##########
python/tvm/rpc/server.py:
##########
@@ -119,6 +119,15 @@ def download_linked_module(file_name):
     return temp
 
 
+def _serve_loop(sock, load_library, work_path=None):
+    """Server loop"""
+    sockfd = sock.fileno()
+    temp = _server_env(load_library, work_path)
+    _ffi_api.ServerLoop(sockfd)

Review Comment:
   can the sockfd be inline?



##########
python/tvm/rpc/server.py:
##########
@@ -119,6 +119,15 @@ def download_linked_module(file_name):
     return temp
 
 
+def _serve_loop(sock, load_library, work_path=None):

Review Comment:
   can we keep the parameter name consistent, like use " conn" all or use " sock" all? 
   Is there requirements let work_path be a optional parameter?



##########
python/tvm/rpc/server.py:
##########
@@ -119,6 +119,15 @@ def download_linked_module(file_name):
     return temp
 
 
+def _serve_loop(sock, load_library, work_path=None):
+    """Server loop"""

Review Comment:
   del the meaningless comment because it  give no more information beyond the function name, or write a meaning one.



##########
python/tvm/rpc/server.py:
##########
@@ -119,6 +119,15 @@ def download_linked_module(file_name):
     return temp
 
 
+def _serve_loop(sock, load_library, work_path=None):
+    """Server loop"""
+    sockfd = sock.fileno()
+    temp = _server_env(load_library, work_path)
+    _ffi_api.ServerLoop(sockfd)
+    if not work_path:
+        temp.remove()

Review Comment:
   curious, why need the temp? it seems this function only have one caller, and it will give the work_path.



-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [RPC] Fix tuning on macOS and Windows (#15771) [tvm]

Posted by "gmeeker (via GitHub)" <gi...@apache.org>.
gmeeker commented on code in PR #16357:
URL: https://github.com/apache/tvm/pull/16357#discussion_r1448236114


##########
python/tvm/rpc/server.py:
##########
@@ -119,6 +119,15 @@ def download_linked_module(file_name):
     return temp
 
 
+def _serve_loop(sock, load_library, work_path=None):

Review Comment:
   The earlier code that I copied from used "sock" to refer to the socket and "conn" to refer to the resulting object from accept(). The current code uses "sock" everywhere, as in "socket object" but not the same object throughout. It sounds like you prefer that?
   No, I'm not sure why work_path was optional.



-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [RPC] Fix tuning on macOS and Windows (#15771) [tvm]

Posted by "junrushao (via GitHub)" <gi...@apache.org>.
junrushao commented on PR #16357:
URL: https://github.com/apache/tvm/pull/16357#issuecomment-1880132654

   CC @Johnson9009 


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [RPC] Fix tuning on macOS and Windows (#15771) [tvm]

Posted by "gmeeker (via GitHub)" <gi...@apache.org>.
gmeeker commented on PR #16357:
URL: https://github.com/apache/tvm/pull/16357#issuecomment-1887944828

   The changes from the original code are now minimal, just removing the closure.


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org