Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

[Numpy] softmax, logsoftmax failed on empty ndarray #18569

@stu1130

Description

@stu1130

Description

latest mxnet pip wheel

import mxnet as mx
from mxnet import npx
npx.set_np()
a = mx.np.array([]).reshape(2, 1, 0)
b = mx.npx.softmax(a)
b.wait_to_read()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/.local/lib/python3.5/site-packages/mxnet/ndarray/ndarray.py", line 2353, in wait_to_read
    check_call(_LIB.MXNDArrayWaitToRead(self.handle))
  File "/home/ubuntu/.local/lib/python3.5/site-packages/mxnet/base.py", line 255, in check_call
    raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: [20:43:29] src/ndarray/ndarray.cc:507: Check failed: delay_alloc:
Stack trace:
  [bt] (0) /home/ubuntu/.local/lib/python3.5/site-packages/mxnet/libmxnet.so(+0x6d554b) [0x7efe143bd54b]
  [bt] (1) /home/ubuntu/.local/lib/python3.5/site-packages/mxnet/libmxnet.so(mxnet::NDArray::Chunk::SetMKLMem(mxnet::TShape const&, int)+0x7b2) [0x7efe177b2082]
  [bt] (2) /home/ubuntu/.local/lib/python3.5/site-packages/mxnet/libmxnet.so(mxnet::NDArray::GetMKLDNNData() const+0x70) [0x7efe177b6ae0]
  [bt] (3) /home/ubuntu/.local/lib/python3.5/site-packages/mxnet/libmxnet.so(mxnet::op::MKLDNNSoftmaxForward(nnvm::NodeAttrs const&, mxnet::OpContext const&, mxnet::NDArray const&, mxnet::OpReqType const&, mxnet::NDArray const&)+0x564) [0x7efe14466a24]
  [bt] (4) /home/ubuntu/.local/lib/python3.5/site-packages/mxnet/libmxnet.so(+0x115e4bd) [0x7efe14e464bd]
  [bt] (5) /home/ubuntu/.local/lib/python3.5/site-packages/mxnet/libmxnet.so(mxnet::imperative::PushFComputeEx(std::function<void (nnvm::NodeAttrs const&, mxnet::OpContext const&, std::vector<mxnet::NDArray, std::allocator<mxnet::NDArray> > const&, std::vector<mxnet::OpReqType, std::allocator<mxnet::OpReqType> > const&, std::vector<mxnet::NDArray, std::allocator<mxnet::NDArray> > 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<mxnet::OpReqType, std::allocator<mxnet::OpReqType> > const&)::{lambda(mxnet::RunContext)#1}::operator()(mxnet::RunContext) const+0x3c4) [0x7efe1765e4f4]
  [bt] (6) /home/ubuntu/.local/lib/python3.5/site-packages/mxnet/libmxnet.so(+0x3895c84) [0x7efe1757dc84]
  [bt] (7) /home/ubuntu/.local/lib/python3.5/site-packages/mxnet/libmxnet.so(+0x38a3c31) [0x7efe1758bc31]
  [bt] (8) /home/ubuntu/.local/lib/python3.5/site-packages/mxnet/libmxnet.so(+0x38a6fa4) [0x7efe1758efa4]

The root cause should be missing proper zero-dim ndarray handle on the kernel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions