-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conv layer changes other layers to Resource unless specifically set #759
Comments
Hi, Is this a bug? If not: why can't I use |
You can get rid of that warning by having hls_config["Model"]["Strategy"] = "Resource"
for layer in hls_config['LayerName'].keys():
hls_config['LayerName'][layer]['Strategy'] = "Latency" Then you can use Latency for the layers but there needs to be a dataflow construct at the top level. Dataflow has traditionally been associated with Resource. We will make this less confusing in the future. It is a bug that you cannot just say |
Thanks for the reply @jmitrevs!
Is dataformat = channels_first no longer supported in the conv2d layer? I noticed that the nnet files have been changed recently. |
Hi, |
Generally channels-first is not recommended. With pytorch parsing via onnx (currently in a PR that will be revised before merging, but still usable), we convert to channels-last as a part of the parsing step, and I believe direct pytorch in the future (also in a PR) will also do the same. (The pytorch and onnx parsers in main are fairly old.) Nevertheless, I will look into the capitalization issue. |
Quick summary
If you have a conv layer in your network, setting the Strategy at the top level is overwritten after the first Conv layer. If you want to have all the nodes be implemented with the Latency strategy,
is not enough. You have to have:
Details
I believe this is because Conv requires the dataflow style at the top level. The Conv layer changes the setup to dataflow but inadvertently changes all the layers not explicitly configured to "Resource". The cleanest solution may be to split the dataflow style from layer Resource/Latency strategies.
Steps to Reproduce
A simple setup is to look at
test_binary_cnn.py
(from #749) and change the strategy to Latency. You can see that only the first CNN is Latency, the others are Resource, in the parameters.h.Optional
Possible fix
The cleanest solution may be to split the dataflow style from layer Resource/Latency strategies.
The text was updated successfully, but these errors were encountered: