torch-mlir
torch-mlir copied to clipboard
LSTM supporting
When we convert a model containing LSTM op to torch-mlir, this op is converted to be "torch.operator "aten.lstm.data"".
Do you have any plan to support LSTM operation in Torch_Op? If not, would you like to give me a guide that i can do it by myself? Or, whether "torch.operator" is okay for further pass and other processsing?
I would recommend that we decompose the op -- @vivekkhandelwal1 do you know if there is a decomposition in functorch for this?
Hi @silvasean, I don't think that the decomposition for this op exists in functorch.
@vivekkhandelwal1 -- can you point MissyDu how to add the decomposition?
Hi @MissyDu, the decomposition has now moved to the PyTorch core from functorch. You can also add the decomposition for the LSTM op directly in the PyTorch core. Please follow this PR (https://github.com/pytorch/pytorch/pull/79001) to know how to add the decomposition.
@vivekkhandelwal1 @silvasean, thank you so much for you quick and nice answers! I also think decomposition solution is better than to define a LSTM op for backend. I will try decomposition according to your above guide. Besides, I have tried to register a LSTM op according to(PR888) and it works well for now. Thank you again for great work!
It looks like this was resolved to use a decomposition.
@vivekkhandelwal1 @silvasean, thank you so much for you quick and nice answers! I also think decomposition solution is better than to define a LSTM op for backend. I will try decomposition according to your above guide. Besides, I have tried to register a LSTM op according to(PR888) and it works well for now. Thank you again for great work!
can you please give a hint how did you registered LSTM? I'm kinda lost in this code and LSTM conversion still doesn't work in torch_mlir