stephenrawls commented on issue #14208: Add support for fast variable-length LSTM URL: https://github.com/apache/incubator-mxnet/pull/14208#issuecomment-465408946 @szha maybe this deserves another PR but I also noticed that cuDNN supports both sequence-major and batch-major sequences: From: https://docs.nvidia.com/deeplearning/sdk/cudnn-developer-guide/index.html#cudnnRNNForwardInferenceEx ``` With unpacked layout, both sequence major (i.e. time major) and batch major are supported ``` Currently gluon is supporting batch-major sequences by calling swapaxes: https://github.com/apache/incubator-mxnet/blob/master/python/mxnet/gluon/rnn/rnn_layer.py#L241-L242 This ends up calling mshadow's swapaxis function, which I *assume* must be doing a copy (?) but to be honest I couldn't totally follow what the code is doing at a quick glance: https://github.com/dmlc/mshadow/blob/3dc80815d965b56b9a975dc27229361955bf66fe/mshadow/extension/swapaxis.h If it *is* doing a copy for swapaxes, it would be preferable for Gluon to just let cudnn handle the batch-major layout directly w/o calling swapaxes.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services