pfk-beta commented on issue #10167:
URL: https://github.com/apache/tvm/issues/10167#issuecomment-1034954439
@driazati I have changed code according to your suggestion (nice trick), and
I'm getting huge traceback:
```
TVM_LIBRARY_PATH=/tvm/build-llvm12 python3 \
-m tvm.driver.tvmc tune \
--number 10 \
--repeat 10 \
--target "llvm" \
--timeout 60 \
--trials 47 \
--output module_resnet.tar \
/tvm/resnet50.pb
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner
self.run()
File "/usr/lib/python3.9/threading.py", line 910, in run
self._target(*self._args, **self._kwargs)
File "/tvm/python/tvm/autotvm/task/relay_integration.py", line 58, in
_lower
compiler.lower(mod, target=target)
File "/tvm/python/tvm/relay/backend/vm.py", line 155, in lower
self._lower(mod, target, target_host)
File "/tvm/python/tvm/_ffi/_ctypes/packed_func.py", line 237, in __call__
raise get_last_ffi_error()
TypeError: Traceback (most recent call last):
48: TVMFuncCall
47:
tvm::runtime::PackedFuncObj::Extractor<tvm::runtime::PackedFuncSubObj<tvm::relay::vm::VMCompiler::GetFunction(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&,
tvm::runtime::ObjectPtr<tvm::runtime::Object>
const&)::{lambda(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)#1}>
>::Call(tvm::runtime::PackedFuncObj const*, tvm::runtime::TVMArgs,
tvm::runtime::TVMRetValue*)
46: tvm::relay::vm::VMCompiler::Lower(tvm::IRModule,
tvm::runtime::Map<tvm::Integer, tvm::Target, void, void>, tvm::Target)
45: tvm::relay::vm::VMCompiler::OptimizeModuleImpl(tvm::IRModule)
44: tvm::transform::Pass::operator()(tvm::IRModule) const
43: tvm::transform::Pass::operator()(tvm::IRModule,
tvm::transform::PassContext const&) const
42: tvm::transform::SequentialNode::operator()(tvm::IRModule,
tvm::transform::PassContext const&) const
41: tvm::transform::Pass::operator()(tvm::IRModule,
tvm::transform::PassContext const&) const
40: tvm::transform::SequentialNode::operator()(tvm::IRModule,
tvm::transform::PassContext const&) const
39: tvm::transform::Pass::operator()(tvm::IRModule,
tvm::transform::PassContext const&) const
38: tvm::transform::ModulePassNode::operator()(tvm::IRModule,
tvm::transform::PassContext const&) const
37:
tvm::runtime::PackedFuncObj::Extractor<tvm::runtime::PackedFuncSubObj<tvm::runtime::TypedPackedFunc<tvm::IRModule
(tvm::IRModule,
tvm::transform::PassContext)>::AssignTypedLambda<tvm::relay::tec::LowerTEPass(tvm::runtime::String
const&, std::function<void (tvm::BaseFunc)>,
tvm::VirtualDevice)::{lambda(tvm::IRModule,
tvm::transform::PassContext)#1}>(tvm::relay::tec::LowerTEPass(tvm::runtime::String
const&, std::function<void (tvm::BaseFunc)>,
tvm::VirtualDevice)::{lambda(tvm::IRModule,
tvm::transform::PassContext)#1})::{lambda(tvm::runtime::TVMArgs const&,
tvm::runtime::TVMRetValue*)#1}> >::Call(tvm::runtime::PackedFuncObj const*,
tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)
36: tvm::relay::tec::LowerTE(tvm::IRModule const&, tvm::runtime::String
const&, std::function<void (tvm::BaseFunc)>, tvm::VirtualDevice)
35: tvm::transform::Pass::operator()(tvm::IRModule) const
34: tvm::transform::Pass::operator()(tvm::IRModule,
tvm::transform::PassContext const&) const
33: tvm::relay::transform::FunctionPassNode::operator()(tvm::IRModule,
tvm::transform::PassContext const&) const
32: _ZN3tvm7runtime13PackedFuncObj
31: tvm::runtime::TypedPackedFunc<tvm::relay::Function
(tvm::relay::Function, tvm::IRModule,
tvm::transform::PassContext)>::AssignTypedLambda<tvm::relay::tec::LowerTensorExpr(tvm::runtime::String
const&, tvm::relay::tec::TECompiler, std::function<void (tvm::BaseFunc)>,
tvm::VirtualDevice)::{lambda(tvm::relay::Function, tvm::IRModule,
tvm::transform::PassContext)#1}>(tvm::relay::tec::LowerTensorExpr(tvm::runtime::String
const&, tvm::relay::tec::TECompiler, std::function<void (tvm::BaseFunc)>,
tvm::VirtualDevice)::{lambda(tvm::relay::Function, tvm::IRModule,
tvm::transform::PassContext)#1})::{lambda(tvm::runtime::TVMArgs const&,
tvm::runtime::TVMRetValue*)#1}::operator()(tvm::runtime::TVMArgs const&,
tvm::runtime::TVMRetValue*) const
30: tvm::relay::ExprMutator::VisitExpr(tvm::RelayExpr const&)
29: tvm::relay::ExprFunctor<tvm::RelayExpr (tvm::RelayExpr
const&)>::VisitExpr(tvm::RelayExpr const&)
28:
_ZZN3tvm5relay11ExprFunctorIFNS_9RelayExprERKS2_EE10InitVTableEvENUlRKNS_
27:
tvm::relay::transform::DeviceAwareExprMutator::VisitExpr_(tvm::relay::FunctionNode
const*)
26:
tvm::relay::tec::LowerTensorExprMutator::DeviceAwareVisitExpr_(tvm::relay::FunctionNode
const*)
25: _ZN3tvm5relay9transform22DeviceAwareExprMutator21DeviceAwareVisit
24: tvm::relay::ExprMutator::VisitExpr_(tvm::relay::FunctionNode const*)
23: tvm::relay::ExprMutator::VisitExpr(tvm::RelayExpr const&)
22: tvm::relay::ExprFunctor<tvm::RelayExpr (tvm::RelayExpr
const&)>::VisitExpr(tvm::RelayExpr const&)
21:
_ZZN3tvm5relay11ExprFunctorIFNS_9RelayExprERKS2_EE10InitVTableEvENUlRKNS_
20:
tvm::relay::transform::DeviceAwareExprMutator::VisitExpr_(tvm::relay::LetNode
const*)
19:
tvm::relay::tec::LowerTensorExprMutator::PreVisitLetBinding_(tvm::relay::Var
const&, tvm::RelayExpr const&)
18: tvm::relay::ExprMutator::VisitExpr(tvm::RelayExpr const&)
17: tvm::relay::ExprFunctor<tvm::RelayExpr (tvm::RelayExpr
const&)>::VisitExpr(tvm::RelayExpr const&)
16:
_ZZN3tvm5relay11ExprFunctorIFNS_9RelayExprERKS2_EE10InitVTableEvENUlRKNS_
15:
tvm::relay::transform::DeviceAwareExprMutator::VisitExpr_(tvm::relay::CallNode
const*)
14: tvm::relay::ExprMutator::VisitExpr(tvm::RelayExpr const&)
13: tvm::relay::ExprFunctor<tvm::RelayExpr (tvm::RelayExpr
const&)>::VisitExpr(tvm::RelayExpr const&)
12:
_ZZN3tvm5relay11ExprFunctorIFNS_9RelayExprERKS2_EE10InitVTableEvENUlRKNS_
11:
tvm::relay::transform::DeviceAwareExprMutator::VisitExpr_(tvm::relay::CallNode
const*)
10:
tvm::relay::tec::LowerTensorExprMutator::DeviceAwareVisitExpr_(tvm::relay::CallNode
const*)
9:
tvm::relay::tec::LowerTensorExprMutator::MakeLoweredCall(tvm::relay::Function,
tvm::runtime::Array<tvm::RelayExpr, void>, tvm::Span, tvm::Target)
8:
tvm::relay::tec::TECompilerImpl::LowerShapeFuncInternal(tvm::relay::tec::CCacheKey
const&)
7: tvm::relay::tec::ShapeFuncFor(tvm::relay::Function const&, tvm::Target
const&, std::function<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > (std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >)>)
6: tvm::relay::tec::MakeShapeFunc::Create(tvm::relay::Function const&,
tvm::Target const&, std::function<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >
(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>
>)>)
5: tvm::relay::tec::MakeShapeFunc::VisitExpr(tvm::RelayExpr const&)
4:
tvm::relay::backend::MemoizedExprTranslator<tvm::runtime::Array<tvm::te::Tensor,
void> >::VisitExpr(tvm::RelayExpr const&)
3: tvm::relay::ExprFunctor<tvm::runtime::Array<tvm::te::Tensor, void>
(tvm::RelayExpr const&)>::VisitExpr(tvm::RelayExpr const&)
2:
_ZZN3tvm5relay11ExprFunctorIFNS_7runtime5ArrayINS_2te6TensorEvEERKNS_9Rel
1: tvm::relay::tec::MakeShapeFunc::VisitExpr_(tvm::relay::CallNode const*)
0:
tvm::runtime::PackedFuncObj::Extractor<tvm::runtime::PackedFuncSubObj<TVMFuncCreateFromCFunc::{lambda(tvm::runtime::TVMArgs,
tvm::runtime::TVMRetValue*)#2}> >::Call(tvm::runtime::PackedFuncObj const*,
tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) [clone .cold]
File "/tvm/python/tvm/_ffi/_ctypes/packed_func.py", line 81, in cfun
rv = local_pyfunc(*pyargs)
File "/tvm/python/tvm/relay/op/nn/_nn.py", line 1556, in pad_shape_func
return [_pad_shape_func(inputs[0], convert(pad_width))]
File "/tvm/.venv/tvm/lib/python3.9/site-packages/decorator.py", line 232,
in fun
return caller(func, *(extras + args), **kw)
File "/tvm/python/tvm/te/hybrid/__init__.py", line 60, in wrapped_func
return source_to_op(src, args, func.__globals__, closure_vars)
File "/tvm/python/tvm/te/hybrid/parser.py", line 634, in source_to_op
parser = parse_python(src, args, symbols, closure_vars)
File "/tvm/python/tvm/te/hybrid/parser.py", line 604, in parse_python
parser.parsed_body = parser.visit(root)
File "/usr/lib/python3.9/ast.py", line 407, in visit
return visitor(node)
File "/tvm/python/tvm/te/hybrid/parser.py", line 229, in visit_Module
return self.visit(node.body[0])
File "/usr/lib/python3.9/ast.py", line 407, in visit
return visitor(node)
File "/tvm/python/tvm/te/hybrid/parser.py", line 242, in visit_FunctionDef
res = visit_list_to_block(self.visit, node.body)
File "/tvm/python/tvm/te/hybrid/parser.py", line 58, in visit_list_to_block
lst = [visit(stmt) for stmt in lst if not utils.is_docstring(stmt)]
File "/tvm/python/tvm/te/hybrid/parser.py", line 58, in <listcomp>
lst = [visit(stmt) for stmt in lst if not utils.is_docstring(stmt)]
File "/usr/lib/python3.9/ast.py", line 407, in visit
return visitor(node)
File "/tvm/python/tvm/te/hybrid/parser.py", line 303, in visit_Assign
rhs = self.visit(node.value)
File "/usr/lib/python3.9/ast.py", line 407, in visit
return visitor(node)
File "/tvm/python/tvm/te/hybrid/parser.py", line 466, in visit_Call
args = [self.visit(i) for i in node.args]
File "/tvm/python/tvm/te/hybrid/parser.py", line 466, in <listcomp>
args = [self.visit(i) for i in node.args]
File "/usr/lib/python3.9/ast.py", line 407, in visit
return visitor(node)
File "/tvm/python/tvm/te/hybrid/parser.py", line 564, in visit_Tuple
return tuple(self.visit(i) for i in node.elts)
File "/tvm/python/tvm/te/hybrid/parser.py", line 564, in <genexpr>
return tuple(self.visit(i) for i in node.elts)
File "/usr/lib/python3.9/ast.py", line 407, in visit
return visitor(node)
File "/tvm/python/tvm/te/hybrid/parser.py", line 379, in visit_Subscript
for i in args:
TypeError: 'IntImm' object is not iterable
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]