LSTM on FPGA with HLS4ML

343 views
Skip to first unread message

Föry Sami

unread,
Oct 9, 2021, 12:48:49 PM10/9/21
to hls4m...@gmail.com
Hi!

I work in a project where I need to implement an LSTM network on an FPGA for time series forcasting that allows to detect predictive defaults. I need a solution and I want to try with HLS4ML. I saw that LSTM networks are in prototyping phase. However, I found this project : https://github.com/fastmachinelearning/hls4ml/tree/recursive2 with lstm example. I tryed to generate HLS code from the example and it works. I just want to know if I can to use that method for my lstm nwtwork and if the HLS generated is really implementable on FPGA or not. Have you another solution available for me ? I need to work actively on it for my thesis.

Thanks in advance and best regards!
Sami
Machine learning in FPGAs using HLS. Contribute to fastmachinelearning/hls4ml development by creating an account on GitHub.

Elham E Khoda

unread,
Oct 12, 2021, 12:43:49 PM10/12/21
to hls4ml help
Hi Sami,

Thanks for your interest.

Currently, we are working on the RNN support for hls4ml. So, we do not have the finalized version of the code yet. The branch you pointed out is an old one. More updated code could be found in one of our forks:

Github - https://github.com/chaitanyaPaikara/hls4ml/tree/keras-rnn

 Can you please try it out? The implementation in this fork should be able to successfully convert TensorFlow models to hls models. It works mostly fine for small RNN (LSTM and GRU) models. We are still in the process of creating a finalized version and add the RNN support to the official tool.  

Regrading PyTorch support: Until now we have not tested/explored the PyTorch implementations in the context of RNN layers. We have been working with TensorFlow models. So, PyTorch models are not supported yet. 

Thanks,
Elham
Reply all
Reply to author
Forward
0 new messages