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 2022/05/18 00:42:21 UTC

[GitHub] [tvm] mehrdadh opened a new issue, #11351: [conv2d][DSP][ARM] conv2d_nhwc_dsp.arm_cpu has error with input float32 and output float32 type

mehrdadh opened a new issue, #11351:
URL: https://github.com/apache/tvm/issues/11351

   relay operator to reproduce the error:
   
   ```
       data_shape = (1, 16, 16, 3)
       weight_shape = (5, 5, 8, 3)
       data = relay.var("data", relay.TensorType(data_shape, "float32"))
       weight = relay.var("weight", relay.TensorType(weight_shape, "float32"))
       y = relay.nn.conv2d(
           data,
           weight,
           padding=(2, 2),
           kernel_size=(5, 5),
           data_layout="NHWC",
           kernel_layout="HWOI",
           out_dtype="float32",
       )
       f = relay.Function([data, weight], y)
       mod = tvm.IRModule.from_expr(f)
       mod = relay.transform.InferType()(mod)
   ```
   
   Error:
   
   ```
   tests/micro/zephyr/test_zephyr.py:538: 
   _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
   python/tvm/relay/build_module.py:477: in build
       mod_name=mod_name,
   python/tvm/relay/build_module.py:194: in build
       self._build(mod, raw_targets, executor, runtime, workspace_memory_pools, mod_name)
   tvm/_ffi/_cython/./packed_func.pxi:323: in tvm._ffi._cy3.core.PackedFuncBase.__call__
       ???
   tvm/_ffi/_cython/./packed_func.pxi:267: in tvm._ffi._cy3.core.FuncCall
       ???
   _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
   
   >   ???
   E   AttributeError: Traceback (most recent call last):
   E     34: TVMFuncCall
   E     33: tvm::relay::backend::RelayBuildModule::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*)#3}::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) const
   E     32: tvm::relay::backend::RelayBuildModule::BuildRelay(tvm::IRModule, tvm::runtime::String const&)
   E     31: tvm::runtime::PackedFuncObj::Extractor<tvm::runtime::PackedFuncSubObj<tvm::relay::backend::GraphExecutorCodegenModule::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*)#2}> >::Call(tvm::runtime::PackedFuncObj const*, tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)
   E     30: tvm::relay::backend::GraphExecutorCodegen::Codegen(tvm::IRModule, tvm::relay::Function, tvm::runtime::String)
   E     29: tvm::transform::Pass::operator()(tvm::IRModule) const
   E     28: tvm::transform::Pass::operator()(tvm::IRModule, tvm::transform::PassContext const&) const
   E     27: tvm::transform::SequentialNode::operator()(tvm::IRModule, tvm::transform::PassContext const&) const
   E     26: tvm::transform::Pass::operator()(tvm::IRModule, tvm::transform::PassContext const&) const
   E     25: tvm::transform::ModulePassNode::operator()(tvm::IRModule, tvm::transform::PassContext const&) const
   E     24: _ZN3tvm7runtime13PackedFuncObj9ExtractorINS0_16PackedFuncSubObjIZNS0_15TypedPackedFuncIFNS_8IRModuleES5_NS_9transform11PassContextEEE17AssignTypedLambdaIZNS_5relay3tec11LowerTEPassERKNS0_6StringESt8functionIFvNS_8BaseFuncEEENS_13VirtualDeviceEEUlS5_S7_E_EEvT_EUlRKNS0_7TVMArgsEPNS0_11TVMRetValueEE_EEE4CallEPKS1_SN_SR_
   E     23: tvm::relay::tec::LowerTE(tvm::IRModule const&, tvm::runtime::String const&, std::function<void (tvm::BaseFunc)>, tvm::VirtualDevice)
   E     22: tvm::transform::Pass::operator()(tvm::IRModule) const
   E     21: tvm::transform::Pass::operator()(tvm::IRModule, tvm::transform::PassContext const&) const
   E     20: tvm::relay::transform::FunctionPassNode::operator()(tvm::IRModule, tvm::transform::PassContext const&) const
   E     19: _ZN3tvm7runtime13PackedFuncObj9ExtractorINS0_16PackedFuncSubObjIZNS0_15TypedPackedFuncIFNS_5relay8FunctionES6_NS_8IRModuleENS_9transform11PassContextEEE17AssignTypedLambdaIZNS5_3tec15LowerTensorExprERKNS0_6StringENSD_10TECompilerESt8functionIFvNS_8BaseFuncEEENS_13VirtualDeviceEEUlS6_S7_S9_E_EEvT_EUlRKNS0_7TVMArgsEPNS0_11TVMRetValueEE_EEE4CallEPKS1_SP_ST_
   E     18: tvm::relay::ExprMutator::VisitExpr(tvm::RelayExpr const&)
   E     17: tvm::relay::ExprFunctor<tvm::RelayExpr (tvm::RelayExpr const&)>::VisitExpr(tvm::RelayExpr const&)
   E     16: _ZZN3tvm5relay11ExprFunctorIFNS_9RelayExprERKS2_EE10InitVTableEvENUlR
   E     15: tvm::relay::transform::DeviceAwareExprMutator::VisitExpr_(tvm::relay::FunctionNode const*)
   E     14: tvm::relay::tec::LowerTensorExprMutator::DeviceAwareVisitExpr_(tvm::relay::FunctionNode const*)
   E     13: _ZN3tvm5relay9transform22DeviceAwareExprMutator21DeviceAwar
   E     12: tvm::relay::ExprMutator::VisitExpr_(tvm::relay::FunctionNode const*)
   E     11: tvm::relay::ExprMutator::VisitExpr(tvm::RelayExpr const&)
   E     10: tvm::relay::ExprFunctor<tvm::RelayExpr (tvm::RelayExpr const&)>::VisitExpr(tvm::RelayExpr const&)
   E     9: _ZZN3tvm5relay11ExprFunctorIFNS_9RelayExprERKS2_EE10InitVTableEvENUlR
   E     8: tvm::relay::transform::DeviceAwareExprMutator::VisitExpr_(tvm::relay::CallNode const*)
   E     7: tvm::relay::tec::LowerTensorExprMutator::DeviceAwareVisitExpr_(tvm::relay::CallNode const*)
   E     6: tvm::relay::tec::LowerTensorExprMutator::MakeLoweredCall(tvm::relay::Function, tvm::runtime::Array<tvm::RelayExpr, void>, tvm::Span, tvm::Target)
   E     5: tvm::relay::tec::TECompilerImpl::Lower(tvm::relay::tec::CCacheKey const&, tvm::runtime::String)
   E     4: tvm::relay::tec::TECompilerImpl::LowerInternal(tvm::relay::tec::CCacheKey const&, std::function<tvm::runtime::String (tvm::runtime::String)>)
   E     3: tvm::relay::tec::PrimFuncFor(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> >)>)
   E     2: tvm::relay::tec::ScheduleBuilder::Create(tvm::relay::Function 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> >)>)
   E     1: tvm::relay::OpImplementation::Schedule(tvm::Attrs const&, tvm::runtime::Array<tvm::te::Tensor, void> const&, tvm::Target const&)
   E     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*)
   E     File "tvm/_ffi/_cython/./packed_func.pxi", line 56, in tvm._ffi._cy3.core.tvm_callback
   E     File "/home/mhessar/work/tvm/python/tvm/relay/op/strategy/generic.py", line 51, in wrapper
   E       return topi_schedule(outs)
   E     File "/home/mhessar/work/tvm/python/tvm/autotvm/task/topi_integration.py", line 242, in wrapper
   E       return topi_schedule(cfg, outs, *args, **kwargs)
   E     File "/home/mhessar/work/tvm/python/tvm/topi/arm_cpu/conv2d.py", line 520, in schedule_conv2d_nhwc_dsp
   E       return conv2d_nhwc_dsp_schedule(cfg, outs)
   E     File "/home/mhessar/work/tvm/python/tvm/topi/arm_cpu/mprofile/dsp/conv2d.py", line 193, in conv2d_nhwc_dsp_schedule
   E       traverse_inline(sched, outs[-1].op, _callback)
   E     File "/home/mhessar/work/tvm/python/tvm/topi/utils.py", line 81, in traverse_inline
   E       _traverse(final_op)
   E     File "/home/mhessar/work/tvm/python/tvm/topi/utils.py", line 79, in _traverse
   E       callback(op)
   E     File "/home/mhessar/work/tvm/python/tvm/topi/arm_cpu/mprofile/dsp/conv2d.py", line 165, in _callback
   E       source_index_w = output.op.body[0].source[0].a.value.indices[2].a
   E     File "/home/mhessar/work/tvm/python/tvm/runtime/object.py", line 67, in __getattr__
   E       raise AttributeError("%s has no attribute %s" % (str(type(self)), name)) from None
   E   AttributeError: <class 'tvm.tir.expr.ProducerLoad'> has no attribute value
   ```


-- 
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: commits-unsubscribe@tvm.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org