diff --git a/src/relay/backend/vm/compiler.cc b/src/relay/backend/vm/compiler.cc index ad23e132c486..9a1c61b708e4 100644 --- a/src/relay/backend/vm/compiler.cc +++ b/src/relay/backend/vm/compiler.cc @@ -490,6 +490,9 @@ class VMFunctionCompiler : ExprFunctor { argument_registers.push_back(reg->second); } + // Extract functions attrs + op_attrs[op_index] = func->attrs->dict; + Emit(Instruction::InvokePacked(op_index, argument_registers.size(), outputs.size(), argument_registers)); } diff --git a/src/runtime/vm/profiler/vm.cc b/src/runtime/vm/profiler/vm.cc index 99126b159143..0a7795d600fe 100644 --- a/src/runtime/vm/profiler/vm.cc +++ b/src/runtime/vm/profiler/vm.cc @@ -105,6 +105,10 @@ void VirtualMachineDebug::InvokePacked(Index packed_index, const PackedFunc& fun } std::unordered_map metrics; + + ICHECK(exec_->op_attrs.find(packed_index) != exec_->op_attrs.end()) + << packed_index_map_[packed_index] << " not found in op attrs"; + auto& op_attrs = exec_->op_attrs.at(packed_index); for (auto p : op_attrs) { if (std::string(p.first).find("layout") != std::string::npos) {