You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/07/12 18:22:46 UTC

[GitHub] [tvm] guberti opened a new pull request, #12074: [microTVM] Make Arduino API server obey timeout

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

   This change makes the Arduino `read_transport` and `write_transport` methods obey the timeout parameters passed into them. This change is required if we wish to run large models multiple times to get a better average runtime. It also adds an optional `timeout_override` parameter to `create_aot_session`, allowing this function to be used to evaluate large models.


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


[GitHub] [tvm] areusch merged pull request #12074: [microTVM] Make Arduino API server obey timeout

Posted by GitBox <gi...@apache.org>.
areusch merged PR #12074:
URL: https://github.com/apache/tvm/pull/12074


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


[GitHub] [tvm] guberti commented on a diff in pull request #12074: [microTVM] Make Arduino API server obey timeout

Posted by GitBox <gi...@apache.org>.
guberti commented on code in PR #12074:
URL: https://github.com/apache/tvm/pull/12074#discussion_r921722137


##########
python/tvm/micro/testing/evaluation.py:
##########
@@ -83,6 +83,7 @@ def create_aot_session(
     params,
     build_dir=Path(tempfile.mkdtemp()),
     tune_logs=None,
+    timeout_override=None,

Review Comment:
   This isn't a float - this should be a `tvm.micro.project_api.server.TransportTimeouts` object (`timeout_override` is always this type in our codebase). We could add typing hints to this file, but I think that's OOS for this PR.



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


[GitHub] [tvm] guberti commented on a diff in pull request #12074: [microTVM] Make Arduino API server obey timeout

Posted by GitBox <gi...@apache.org>.
guberti commented on code in PR #12074:
URL: https://github.com/apache/tvm/pull/12074#discussion_r921714313


##########
apps/microtvm/arduino/template_project/microtvm_api_server.py:
##########
@@ -522,13 +522,13 @@ def close_transport(self):
         self._serial = None
 
     def read_transport(self, n, timeout_sec):
-        # It's hard to set timeout_sec, so we just throw it away
-        # TODO fix this
+        self._serial.timeout = timeout_sec
         if self._serial is None:
             raise server.TransportClosedError()
         return self._serial.read(n)
 
     def write_transport(self, data, timeout_sec):
+        self._serial.timeout = timeout_sec

Review Comment:
   Nice catch!



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


[GitHub] [tvm] areusch commented on a diff in pull request #12074: [microTVM] Make Arduino API server obey timeout

Posted by GitBox <gi...@apache.org>.
areusch commented on code in PR #12074:
URL: https://github.com/apache/tvm/pull/12074#discussion_r921707838


##########
apps/microtvm/arduino/template_project/microtvm_api_server.py:
##########
@@ -522,13 +522,13 @@ def close_transport(self):
         self._serial = None
 
     def read_transport(self, n, timeout_sec):
-        # It's hard to set timeout_sec, so we just throw it away
-        # TODO fix this
+        self._serial.timeout = timeout_sec
         if self._serial is None:
             raise server.TransportClosedError()
         return self._serial.read(n)
 
     def write_transport(self, data, timeout_sec):
+        self._serial.timeout = timeout_sec

Review Comment:
   i think you should be setting write_timeout, right?



##########
python/tvm/micro/testing/evaluation.py:
##########
@@ -83,6 +83,7 @@ def create_aot_session(
     params,
     build_dir=Path(tempfile.mkdtemp()),
     tune_logs=None,
+    timeout_override=None,

Review Comment:
   nit: units e.g. timeout_sec_override



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