mehrdadh commented on code in PR #13161:
URL: https://github.com/apache/tvm/pull/13161#discussion_r1002210184


##########
python/tvm/contrib/hexagon/session.py:
##########
@@ -393,3 +394,37 @@ def _aot_executor_from_factory(
             remote_file_path = self.upload(binary_path, binary_name)
 
         return self.get_aot_executor(remote_file_path)
+
+
+def create_session(
+    workspace: Union[str, pathlib.Path], rpc_info: dict, session_name: str = 
"hexagon-rpc"
+) -> Session:
+    """Create an RPC session.
+
+    Parameters
+    ----------
+    workspace : Union[str, pathlib.Path]
+        Workspace path on remote device.
+
+    rpc_info : dict
+        RPC tracker information.
+
+    session_name : str
+        RPC session name.
+
+    Returns
+    -------
+    Session :
+        The session object.
+    """
+    assert "rpc_tracker_host" in rpc_info.keys()
+    assert "rpc_tracker_port" in rpc_info.keys()
+
+    hexagon_remote_kw = {
+        "host": rpc_info["rpc_tracker_host"],
+        "port": rpc_info["rpc_tracker_port"],
+        "priority": 0,
+        "timeout": 0,
+        "key": rpc_info["device_key"],
+    }
+    return Session(workspace, hexagon_remote_kw, session_name=session_name)

Review Comment:
   that makes sense. I will change that



-- 
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]

Reply via email to