vinx13 commented on code in PR #13623:
URL: https://github.com/apache/tvm/pull/13623#discussion_r1050014668
##########
python/tvm/contrib/graph_executor.py:
##########
@@ -212,7 +212,17 @@ def set_input_zero_copy(self, key, value, **params):
Additional arguments
"""
self._set_input_zero_copy(key, value)
- self.set_input(None, None, **params)
+ if params:
+ # upload big arrays first to avoid memory issue in rpc mode
+ keys = list(params.keys())
+ keys.sort(key=lambda x: -np.prod(params[x].shape))
Review Comment:
probably not needed as there is no data copy
##########
python/tvm/contrib/graph_executor.py:
##########
@@ -212,7 +212,17 @@ def set_input_zero_copy(self, key, value, **params):
Additional arguments
"""
self._set_input_zero_copy(key, value)
- self.set_input(None, None, **params)
+ if params:
Review Comment:
`key, value` vs `params` are basically two ways to specify the input. if
`params` is supported, `key, value` should be by default None (similar to
`set_input`)
--
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]