Zha0q1 opened a new issue #19265:
URL: https://github.com/apache/incubator-mxnet/issues/19265
A customer is experiencing seg fault when feeding in a large input to MKL
LSTM. I have reduced the code to this:
```
import mxnet as mx
from mxnet import gluon, nd, autograd
from mxnet.gluon import nn, rnn, Trainer
hidden_size = 30
num_embed = 100
vocab_size = 13028#len(vocab.token_to_idx.keys())
inp = nd.random.uniform(0, vocab_size, (16758,500))
print(inp)
context = mx.cpu()
model = nn.Sequential()
model.add(nn.Embedding(vocab_size, num_embed), # Embedding layer
rnn.LSTM(hidden_size, num_layers=1,bidirectional=True), #
Recurrent layer ,bidirectional=True
nn.Dense(3)) # Output layer
model.collect_params().initialize(mx.init.Xavier(), ctx=context)
val_predictions = model(inp)
nd.waitall()
print(val_predictions)
```
I think this is some sort of out of memory issue because if we shrink the
input (first dim of `inp`) then there will not be a seg fault, but still, shall
we add some error message here so that users will be notified to reduce the
input size?
I also noticed the same input will run fine with `export
MXNET_USE_MKLDNN_RNN=0` but that is 3x slower than the mkldnn implementation
@PatricZhao
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]