Possible to convert a GRU Classifier into HLS? #1290
Replies: 2 comments
-
Hi Iain, this should be supported. Looking at your model, I do get this error when trying to parse it:
This is actually not an issue of the Linear layer, but the first two lines of the
You see that these assignments get rendered as |
Beta Was this translation helpful? Give feedback.
-
Hi Iain, taking a closer look now I realized that you are applying the Linear layer to the hidden state of the GRU. Unfortunately, returning the hidden state from the calculation is not something we support at the moment, we only return the output. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello hls4ml team,
I'm working on implementing a GRU-based classifier for FPGA deployment using hls4ml. I've been able to successfully convert simple GRU models based on your test examples, but I'm encountering issues when adding a classification layer on top of the GRU.
My model structure is as follows:
I see from your tests that GRU models return the sequence output, but when I try to convert the classifier, I typically get symbolic tracing problems.
Is it currently possible to implement a GRU + classification layer using hls4ml?
If so, are there any specific modifications I should make to my model structure to improve compatibility?
Should I be using streaming (no explicit h0) or non-streaming (with h0) architecture for better results?
I couldn't see any examples of RNN-based classifiers that have been successfully converted, so I'm just wondering if this is even possible with RNN
My target is a sequence length of 500 with 32 input features and 128 hidden features, but I can adjust these parameters if needed for better FPGA implementation.
Thank for your time,
Iain Barkley
Beta Was this translation helpful? Give feedback.
All reactions