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 2021/02/08 03:08:16 UTC

[GitHub] [tvm] yhj050806 opened a new pull request #7419: [fix] fix func_index_ update in VirtualMachine

yhj050806 opened a new pull request #7419:
URL: https://github.com/apache/tvm/pull/7419


   I think there's problem dealing with func_index_ in VirtualMachine class.
   
   func_index_ should be updated the same way as pc_ and code_ in the function VirtualMachine::InvokeGlobal.


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

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



[GitHub] [tvm] jroesch commented on a change in pull request #7419: [fix] fix func_index_ update in VirtualMachine

Posted by GitBox <gi...@apache.org>.
jroesch commented on a change in pull request #7419:
URL: https://github.com/apache/tvm/pull/7419#discussion_r572458833



##########
File path: include/tvm/runtime/vm/vm.h
##########
@@ -256,7 +256,7 @@ class VirtualMachine : public runtime::ModuleNode {
    *
    * This does not begin execution of the VM.
    */
-  void InvokeGlobal(const VMFunction& func, const std::vector<ObjectRef>& args);
+  void InvokeGlobal(const VMFunction& func, Index func_index, const std::vector<ObjectRef>& args);

Review comment:
       I see the code has been refactored, I think we should store the function index in the function itself so we don't have to pass extra state around and the VMFunctions are sufficient to construct local state. 




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

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



[GitHub] [tvm] yhj050806 commented on a change in pull request #7419: [fix] fix func_index_ update in VirtualMachine

Posted by GitBox <gi...@apache.org>.
yhj050806 commented on a change in pull request #7419:
URL: https://github.com/apache/tvm/pull/7419#discussion_r572509697



##########
File path: include/tvm/runtime/vm/vm.h
##########
@@ -256,7 +256,7 @@ class VirtualMachine : public runtime::ModuleNode {
    *
    * This does not begin execution of the VM.
    */
-  void InvokeGlobal(const VMFunction& func, const std::vector<ObjectRef>& args);
+  void InvokeGlobal(const VMFunction& func, Index func_index, const std::vector<ObjectRef>& args);

Review comment:
       Because VirtualMachine::func_index_ is not updated in the function VirtualMachine::InvokeGlobal like VirtualMachine::pc_ does。
   or VirtualMachine::func_index_  should be deleted, I'm not seeing any place that use VirtualMachine::func_index_ in current code。
   If VirtualMachine::func_index_ will be used in future。 then VirtualMachine::func_index_ should be updated in VirtualMachine::InvokeGlobal. otherwise, the logic is not right.




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

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



[GitHub] [tvm] yhj050806 commented on a change in pull request #7419: [fix] fix func_index_ update in VirtualMachine

Posted by GitBox <gi...@apache.org>.
yhj050806 commented on a change in pull request #7419:
URL: https://github.com/apache/tvm/pull/7419#discussion_r572513171



##########
File path: include/tvm/runtime/vm/vm.h
##########
@@ -256,7 +256,7 @@ class VirtualMachine : public runtime::ModuleNode {
    *
    * This does not begin execution of the VM.
    */
-  void InvokeGlobal(const VMFunction& func, const std::vector<ObjectRef>& args);
+  void InvokeGlobal(const VMFunction& func, Index func_index, const std::vector<ObjectRef>& args);

Review comment:
       in VirtualMachine::InvokeGlobal , function PushFrame is pushing a frame which include curernt's code_ ,pc_, func_idx_  into  VirtualMachine::frames_.  current's code_, pc_ is updated in  VirtualMachine::InvokeGlobal. but current func_idx_ is updated in the entire code . I think func_idx_ should be updated in VirtualMachine::InvokeGlobal the same way as pc_ and code_.  So I pass the func_idx to the function VirtualMachine::InvokeGlobal




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

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



[GitHub] [tvm] yhj050806 closed pull request #7419: [fix] fix func_index_ update in VirtualMachine

Posted by GitBox <gi...@apache.org>.
yhj050806 closed pull request #7419:
URL: https://github.com/apache/tvm/pull/7419


   


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

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



[GitHub] [tvm] jroesch commented on a change in pull request #7419: [fix] fix func_index_ update in VirtualMachine

Posted by GitBox <gi...@apache.org>.
jroesch commented on a change in pull request #7419:
URL: https://github.com/apache/tvm/pull/7419#discussion_r572456469



##########
File path: include/tvm/runtime/vm/vm.h
##########
@@ -256,7 +256,7 @@ class VirtualMachine : public runtime::ModuleNode {
    *
    * This does not begin execution of the VM.
    */
-  void InvokeGlobal(const VMFunction& func, const std::vector<ObjectRef>& args);
+  void InvokeGlobal(const VMFunction& func, Index func_index, const std::vector<ObjectRef>& args);

Review comment:
       Why do we need to pass the function index here?




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

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



[GitHub] [tvm] yhj050806 commented on a change in pull request #7419: [fix] fix func_index_ update in VirtualMachine

Posted by GitBox <gi...@apache.org>.
yhj050806 commented on a change in pull request #7419:
URL: https://github.com/apache/tvm/pull/7419#discussion_r572513171



##########
File path: include/tvm/runtime/vm/vm.h
##########
@@ -256,7 +256,7 @@ class VirtualMachine : public runtime::ModuleNode {
    *
    * This does not begin execution of the VM.
    */
-  void InvokeGlobal(const VMFunction& func, const std::vector<ObjectRef>& args);
+  void InvokeGlobal(const VMFunction& func, Index func_index, const std::vector<ObjectRef>& args);

Review comment:
       in VirtualMachine::InvokeGlobal , function PushFrame is pushing a frame which include curernt's code_ ,pc_, func_idx_  into  VirtualMachine::frames_.  current's code_, pc_ is updated in  VirtualMachine::InvokeGlobal. but current func_idx_ isn't updated in the entire code . I think func_idx_ should be updated in VirtualMachine::InvokeGlobal the same way as pc_ and code_.  So I pass the func_idx to the function VirtualMachine::InvokeGlobal




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

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