After running the case following:
import copy
import tvm
test_dict = {"abc": tvm.runtime.String("abc")}
dict_deepcopy = copy.deepcopy(test_dict)
I got stack trace and Check failed message below:
TypeError: runtime.String is not registered via TVM_REGISTER_NODE_TYPE
complete stack trace:
Traceback (most recent call last):
File "/home/hujun/workspace/code_all/tbe_code_4/llt/tensor_engine/ut/testcase_python/tvm_utest_pass_all/tvm_utest_phase0/test_cce_codegen.py", line 91, in test_cce_codegen_case1
dict_deepcopy = copy.deepcopy(test_dict)
File "/home/hujun/workspace/program/python3.8.13/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/hujun/workspace/program/python3.8.13/lib/python3.8/copy.py", line 230, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/home/hujun/workspace/program/python3.8.13/lib/python3.8/copy.py", line 172, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/home/hujun/workspace/program/python3.8.13/lib/python3.8/copy.py", line 270, in _reconstruct
state = deepcopy(state, memo)
File "/home/hujun/workspace/program/python3.8.13/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/hujun/workspace/program/python3.8.13/lib/python3.8/copy.py", line 210, in _deepcopy_tuple
y = [deepcopy(a, memo) for a in x]
File "/home/hujun/workspace/program/python3.8.13/lib/python3.8/copy.py", line 210, in <listcomp>
y = [deepcopy(a, memo) for a in x]
File "/home/hujun/workspace/program/python3.8.13/lib/python3.8/copy.py", line 146, in deepcopy
y = copier(x, memo)
File "/home/hujun/workspace/program/python3.8.13/lib/python3.8/copy.py", line 230, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/home/hujun/workspace/program/python3.8.13/lib/python3.8/copy.py", line 151, in deepcopy
copier = getattr(x, "__deepcopy__", None)
File "/home/hujun/workspace/code_all/tbe_code_4/open_source/tvm/python/tbe/tvm/runtime/object.py", line 65, in __getattr__
return _ffi_node_api.NodeGetAttr(self, name)
File "/home/hujun/workspace/code_all/tbe_code_4/open_source/tvm/python/tbe/tvm/_ffi/_ctypes/packed_func.py", line 239, in __call__
raise get_last_ffi_error()
TypeError: Traceback (most recent call last):
4: TVMFuncCall
3: _ZNSt17_Function_handlerI
2: tvm::NodeGetAttr(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)
1: tvm::ReflectionVTable::GetAttr(tvm::runtime::Object*, tvm::runtime::String const&) const
0: tvm::ReflectionVTable::VisitAttrs(tvm::runtime::Object*, tvm::AttrVisitor*) const
File "compiler_depend.ts", line 391
TypeError: runtime.String is not registered via TVM_REGISTER_NODE_TYPE
There are scenarios that user would use runtime.String returned from backend in python deepcopy.
Can TVM support runtime.String for python deepcopy in later version ?
Or need user try TVM_REGISTER_NODE_TYPE runtime.StringObj to support python deepcopy?
Thanks a lot.