Testing np.equal using TVM_OP=1 failed
reminisce opened this issue · 0 comments
reminisce commented
Branch: https://github.com/reminisce/mxnet/tree/add_boolean_ndarray
from mxnet import np, npx
npx.set_np()
a = np.ones((2, 1))
b = np.ones((1, 3))
c = (a == b)
print(c)
ubuntu@ip-172-31-94-39:~/sandbox$ MXNET_ENGINE_TYPE=NaiveEngine python test.py
[04:13:24] src/engine/engine.cc:55: MXNet start using engine: NaiveEngine
Traceback (most recent call last):
File "test.py", line 9, in <module>
c = (a == b)
File "/home/ubuntu/unison/mxnet4/cpu/python/mxnet/numpy/multiarray.py", line 271, in __eq__
return _npi.equal(self, other)
File "<string>", line 33, in equal
File "/home/ubuntu/unison/mxnet4/cpu/python/mxnet/_ctypes/ndarray.py", line 100, in _imperative_invoke
ctypes.byref(out_stypes)))
File "/home/ubuntu/unison/mxnet4/cpu/python/mxnet/base.py", line 254, in check_call
raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: [04:13:25] /home/ubuntu/unison/mxnet4/cpu/3rdparty/tvm/src/runtime/module_util.cc:73: Check failed: ret == 0 (-1 vs. 0) : Assert fail: (((tvm_struct_get(arg2, 0, 5) == (uint8)1) && (tvm_struct_get(arg2, 0, 6) == (uint8)1)) && (tvm_struct_get(arg2, 0, 7) == (uint16)1)), arg2.dtype is expected to be bool
Stack trace:
[bt] (0) /home/ubuntu/unison/mxnet4/cpu/lib/libtvm_runtime.so(+0x22d1c) [0x7fcfe20a3d1c]
[bt] (1) /home/ubuntu/unison/mxnet4/cpu/lib/libmxnet.so(std::function<void (tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)>::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) const+0x5a) [0x7fcfbfa6aa86]
[bt] (2) /home/ubuntu/unison/mxnet4/cpu/lib/libmxnet.so(tvm::runtime::PackedFunc::CallPacked(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) const+0x30) [0x7fcfbfa6a46a]
[bt] (3) /home/ubuntu/unison/mxnet4/cpu/lib/libmxnet.so(tvm::runtime::TVMOpModule::Call(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mxnet::OpContext const&, std::vector<mxnet::TBlob, std::allocator<mxnet::TBlob> > const&)+0x1d0) [0x7fcfbfa69a9a]
[bt] (4) /home/ubuntu/unison/mxnet4/cpu/lib/libmxnet.so(+0x1c873c3) [0x7fcfbcfea3c3]
[bt] (5) /home/ubuntu/unison/mxnet4/cpu/lib/libmxnet.so(std::_Function_handler<void (nnvm::NodeAttrs const&, mxnet::OpContext const&, std::vector<mxnet::TBlob, std::allocator<mxnet::TBlob> > const&, std::vector<mxnet::OpReqType, std::allocator<mxnet::OpReqType> > const&, std::vector<mxnet::TBlob, std::allocator<mxnet::TBlob> > const&), void (*)(nnvm::NodeAttrs const&, mxnet::OpContext const&, std::vector<mxnet::TBlob, std::allocator<mxnet::TBlob> > const&, std::vector<mxnet::OpReqType, std::allocator<mxnet::OpReqType> > const&, std::vector<mxnet::TBlob, std::allocator<mxnet::TBlob> > const&)>::_M_invoke(std::_Any_data const&, nnvm::NodeAttrs const&, mxnet::OpContext const&, std::vector<mxnet::TBlob, std::allocator<mxnet::TBlob> > const&, std::vector<mxnet::OpReqType, std::allocator<mxnet::OpReqType> > const&, std::vector<mxnet::TBlob, std::allocator<mxnet::TBlob> > const&)+0x91) [0x7fcfbcbb6e82]
[bt] (6) /home/ubuntu/unison/mxnet4/cpu/lib/libmxnet.so(std::function<void (nnvm::NodeAttrs const&, mxnet::OpContext const&, std::vector<mxnet::TBlob, std::allocator<mxnet::TBlob> > const&, std::vector<mxnet::OpReqType, std::allocator<mxnet::OpReqType> > const&, std::vector<mxnet::TBlob, std::allocator<mxnet::TBlob> > const&)>::operator()(nnvm::NodeAttrs const&, mxnet::OpContext const&, std::vector<mxnet::TBlob, std::allocator<mxnet::TBlob> > const&, std::vector<mxnet::OpReqType, std::allocator<mxnet::OpReqType> > const&, std::vector<mxnet::TBlob, std::allocator<mxnet::TBlob> > const&) const+0xa6) [0x7fcfc0268ad4]
[bt] (7) /home/ubuntu/unison/mxnet4/cpu/lib/libmxnet.so(mxnet::imperative::PushFCompute(std::function<void (nnvm::NodeAttrs const&, mxnet::OpContext const&, std::vector<mxnet::TBlob, std::allocator<mxnet::TBlob> > const&, std::vector<mxnet::OpReqType, std::allocator<mxnet::OpReqType> > const&, std::vector<mxnet::TBlob, std::allocator<mxnet::TBlob> > const&)> const&, nnvm::Op const*, nnvm::NodeAttrs const&, mxnet::Context const&, std::vector<mxnet::engine::Var*, std::allocator<mxnet::engine::Var*> > const&, std::vector<mxnet::engine::Var*, std::allocator<mxnet::engine::Var*> > const&, std::vector<mxnet::Resource, std::allocator<mxnet::Resource> > const&, std::vector<mxnet::NDArray*, std::allocator<mxnet::NDArray*> > const&, std::vector<mxnet::NDArray*, std::allocator<mxnet::NDArray*> > const&, std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<mxnet::OpReqType, std::allocator<mxnet::OpReqType> > const&)::{lambda(mxnet::RunContext)#1}::operator()(mxnet::RunContext) const+0x215) [0x7fcfc03de32f]
[bt] (8) /home/ubuntu/unison/mxnet4/cpu/lib/libmxnet.so(std::_Function_handler<void (mxnet::RunContext), mxnet::imperative::PushFCompute(std::function<void (nnvm::NodeAttrs const&, mxnet::OpContext const&, std::vector<mxnet::TBlob, std::allocator<mxnet::TBlob> > const&, std::vector<mxnet::OpReqType, std::allocator<mxnet::OpReqType> > const&, std::vector<mxnet::TBlob, std::allocator<mxnet::TBlob> > const&)> const&, nnvm::Op const*, nnvm::NodeAttrs const&, mxnet::Context const&, std::vector<mxnet::engine::Var*, std::allocator<mxnet::engine::Var*> > const&, std::vector<mxnet::engine::Var*, std::allocator<mxnet::engine::Var*> > const&, std::vector<mxnet::Resource, std::allocator<mxnet::Resource> > const&, std::vector<mxnet::NDArray*, std::allocator<mxnet::NDArray*> > const&, std::vector<mxnet::NDArray*, std::allocator<mxnet::NDArray*> > const&, std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<mxnet::OpReqType, std::allocator<mxnet::OpReqType> > const&)::{lambda(mxnet::RunContext)#1}>::_M_invoke(std::_Any_data const&, mxnet::RunContext&&)+0x3f) [0x7fcfc03e3496]