---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
Cell In[4], line 32
22 model = Layer().jit(
23 spec={
24 "forward": {
(...)
29 debug=True,
30 )
31 x = torch.rand((10, 5), dtype=torch.float32) # pylint: disable=invalid-name
---> 32 y = model["forward"](x, 8) # pylint: disable=invalid-name
33 assert isinstance(y, torch.Tensor)
File /media/pc/data/lxw/ai/tvm/python/tvm/relax/frontend/nn/torch.py:78, in TorchModule.__getitem__.<locals>._closure(*args)
71 args = [
72 _torch_to_tvm(arg_name, arg_spec, arg)
73 for arg_name, arg_spec, arg in zip(
74 method_spec.arg_names, method_spec.arg_specs, args
75 )
76 ]
77 if self.effects is not None:
---> 78 outputs, self.effects = method(*args, *self.effects, *self.params)
79 else:
80 outputs = method(*args, *self.params)
File /media/pc/data/lxw/ai/tvm/python/tvm/_ffi/_cython/packed_func.pxi:339, in tvm._ffi._cy3.core.PackedFuncBase.__call__()
File /media/pc/data/lxw/ai/tvm/python/tvm/_ffi/_cython/packed_func.pxi:270, in tvm._ffi._cy3.core.FuncCall()
File /media/pc/data/lxw/ai/tvm/python/tvm/_ffi/_cython/packed_func.pxi:259, in tvm._ffi._cy3.core.FuncCall3()
File /media/pc/data/lxw/ai/tvm/python/tvm/_ffi/_cython/base.pxi:185, in tvm._ffi._cy3.core.CHECK_CALL()
File /media/pc/data/lxw/ai/tvm/python/tvm/_ffi/base.py:468, in raise_last_ffi_error()
462 # The exception PyObject may contain a large amount of state,
463 # including all stack frames that may be inspected in a later
464 # PDB post-mortem. Therefore, we must make sure to remove the
465 # underlying PyObject* from the C++ side after we retrieve it.
466 _LIB.TVMDropLastPythonError()
--> 468 raise py_err
File /media/pc/data/lxw/ai/tvm/src/runtime/relax_vm/vm.cc:558, in tvm::runtime::relax_vm::VirtualMachineImpl::InvokeClosurePacked(tvm::runtime::ObjectRef const&, tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)()
556 {
557 NVTXScopedRange scope("RelaxVM: " + clo->func_name);
--> 558 clo->impl.CallPacked(TVMArgs(values.data(), tcodes.data(), args.size() + 1), rv);
559 }
560 }
File /media/pc/data/lxw/ai/tvm/src/runtime/relax_vm/vm.cc:632, in operator()()
630 inputs[i] = args[i + 1];
631 }
--> 632 *rv = static_cast<VirtualMachineImpl*>(ctx_ptr)->InvokeBytecode(gf_idx, inputs);
633 });
634 return VMClosure(func_name, impl);
File /media/pc/data/lxw/ai/tvm/src/runtime/relax_vm/vm.cc:703, in tvm::runtime::relax_vm::VirtualMachineImpl::InvokeBytecode(long, std::vector<tvm::runtime::TVMRetValue, std::allocator<tvm::runtime::TVMRetValue> > const&)()
701 // set program counter
702 pc_ = gfunc.start_instr;
--> 703 RunLoop();
704 return return_value_;
705 }
File /media/pc/data/lxw/ai/tvm/src/runtime/relax_vm/vm.cc:828, in tvm::runtime::relax_vm::VirtualMachineImpl::RunLoop()()
826 switch (instr.op) {
827 case Opcode::Call: {
--> 828 this->RunInstrCall(curr_frame, instr);
829 break;
830 }
File /media/pc/data/lxw/ai/tvm/src/runtime/relax_vm/vm.cc:781, in tvm::runtime::relax_vm::VirtualMachineImpl::RunInstrCall(tvm::runtime::relax_vm::VMFrame*, tvm::runtime::relax_vm::Instruction)()
779
780 if (instrument_ == nullptr) {
--> 781 this->InvokeClosurePacked(func_pool_[instr.func_idx], args, &ret);
782 } else {
783 // insert light-weight instrument callback
File /media/pc/data/lxw/ai/tvm/src/runtime/relax_vm/builtin.cc:497, in operator()()
495 }
496 }
--> 497 debug_func->CallPacked(TVMArgs(call_args.data(), call_type_codes.data(), num_args + 1), rv);
498 *rv = io_effect;
499 });
File /media/pc/data/lxw/ai/tvm/python/tvm/_ffi/_cython/packed_func.pxi:56, in tvm._ffi._cy3.core.tvm_callback()
Cell In[4], line 10, in _debug(lineno, tensor, const_int, const_float, const_str, var_int)
1 @tvm.register_func("testing.relax.frontend.nn.test_debug_func")
2 def _debug( # pylint: disable=too-many-arguments
3 lineno: str,
(...)
8 var_int: int,
9 ) -> None:
---> 10 assert "test_frontend_nn_debug.py" in lineno
11 assert tensor.shape == (10, 5)
12 assert const_int == 1
AssertionError: