quic / aimet

AIMET is a library that provides advanced quantization and compression techniques for trained neural network models.
https://quic.github.io/aimet-pages/index.html
Other
2.08k stars 373 forks source link

How to quant lstm in keras model? #2027

Open sunzhe09 opened 1 year ago

sunzhe09 commented 1 year ago

I found tf2 not support this feature

quic-mangal commented 1 year ago

@sunzhe09, currently we don't have explicit supports for LSTM added for Keras. We support Transformer models though. Let us know if you would like to contribute towards it. Thanks

stncil commented 1 year ago

Hi @quic-mangal, I would like to contribute towards supporting the LSTM model. Please point me toward any helpful resource to get started with it.

Thank you.

quic-mangal commented 1 year ago

@stncil, sounds great. I can help you with the task breakdown. A good starting point would be looking at the LSTM implementation for PyTorch under aimet_torch. Once you have some good understanding of it, we can work towards fine-tuning the tasks

stncil commented 1 year ago

thank you for replying @quic-mangal, do you mean that I understand the code in the Pytorch repo https://pytorch.org/docs/stable/_modules/torch/nn/modules/rnn.html#LSTM

or is there a source code inside the aimet repo concerning LSTM?

I looked inside the aimet repo and it uses LSTM from PyTorch when testing it. https://github.com/quic/aimet/blob/329cd1ce984267f470014e855355edbde260cdf1/TrainingExtensions/torch/src/python/aimet_torch/examples/test_models.py#L785

quic-mangal commented 1 year ago

My bad, just to clarify more, I meant LSTM quantization under AIMET torch