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/22 11:42:32 UTC

[GitHub] [tvm] FrozenGene commented on a change in pull request #7495: [Relay VM] VM Profiler Supports Profiling Instruction Stats

FrozenGene commented on a change in pull request #7495:
URL: https://github.com/apache/tvm/pull/7495#discussion_r580182673



##########
File path: include/tvm/runtime/vm/bytecode.h
##########
@@ -26,6 +26,7 @@
 
 #include <tvm/runtime/data_type.h>
 #include <tvm/support/logging.h>
+#include <string>

Review comment:
       Consider using `tvm/runtime/container.h`'s `class String`, as in the runtime we want to use our TVM's object system like other runtime's components.

##########
File path: include/tvm/runtime/vm/bytecode.h
##########
@@ -392,6 +393,8 @@ struct Instruction {
   friend std::ostream& operator<<(std::ostream& os, const Instruction&);
 };
 
+std::string InstructionStrRepr(const Opcode op);

Review comment:
       ditto

##########
File path: src/runtime/vm/bytecode.cc
##########
@@ -632,6 +632,77 @@ void InstructionPrint(std::ostream& os, const Instruction& instr) {
   }
 }
 
+std::string InstructionStrRepr(const Opcode op) {

Review comment:
       ditto

##########
File path: src/runtime/vm/vm.cc
##########
@@ -567,7 +590,7 @@ void VirtualMachine::RunLoop() {
         auto caller_return_register = frames_.back().caller_return_register;
 
         if (PopFrame() == frame_start) {
-          return;
+          goto vm_completed;

Review comment:
       i think you could just simply move the sentence of `vm_completed` here and could avoid `goto`.




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