You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The tool does not correctly handle strided pointwise convolution with rectangular feature maps anymore. With the previous build, I would use the RTL variant of ConvInpGen which supports this config, but now the transformation is trying to infer a DownSampler node because it detects a strided pointwise Im2Col, but the DownSampler node does not work with rectangular input.
Details
Steps to Reproduce
Use main branch with release 0.10.0
Have a model with a Convolution having stride>1 and kernel_size=1 but with non-square feature maps.
Decompose into Im2Col + MatMul in the streamlining step.
warnings.warn(f"Couldn't infer Downsample from {n.name},check config.")
Optional
Possible fix
Is it still relevant to have a DownSampler node for the specific case of strided pointwise convolutions? Does it work better than a ConvInpGen in this specific scenario?
If yes, a possible fix would be, in the case of a rectangular input, to move to normal ConvInpGen in the InferConvInpGen transformation rather than skipping the conversion. This node would need to be rewired to the RTL variant in the SpecializeLayers transformation, which shouldn't be a problem because the _swg_hls_possible function verifies that the input is square.
Hi @hleblevec,
Thanks for pointing that out! I actually think we could integrate the functionality of the DownSampler into the ConvolutionInputGenerator custom op structure as one additional variant. This would make this extra node obsolete. Let me know if that would be something you would like to contribute to the repo yourself!
Yes, so it requires a little bit of refactoring work. But the idea would be to delete DownSampler + DownSampler_hls and convert for the previous cases also to ConvolutionInputGenerator in convert_to_hw_layers and then in SpecializeLayers you would default to the RTL variant but with a square or 1D input, you could also specialize to HLS if the user wants that.
That would mean that the functionality of DownSampler_hls needs to be integrated into ConvolutionInputGenerator_hls as an additional variant. It is similar to the integration of the previous custom op ConvolutionInputGenerator1D that was summarized with ConvolutionInputGenerator into ConvolutionInputGenerator_hls. If you need additional pointers, you can reach out via email and we can schedule a meeting to discuss the details.
Quick summary
The tool does not correctly handle strided pointwise convolution with rectangular feature maps anymore. With the previous build, I would use the RTL variant of ConvInpGen which supports this config, but now the transformation is trying to infer a DownSampler node because it detects a strided pointwise Im2Col, but the DownSampler node does not work with rectangular input.
Details
Steps to Reproduce
step_convert_to_hw_layers
.Expected behavior
ConvInpGen node created with this configuration.
Actual behavior
Triggers a warning:
finn/src/finn/transformation/fpgadataflow/convert_to_hw_layers.py
Line 133 in e3087ad
Optional
Possible fix
InferConvInpGen
transformation rather than skipping the conversion. This node would need to be rewired to the RTL variant in theSpecializeLayers
transformation, which shouldn't be a problem because the_swg_hls_possible
function verifies that the input is square.finn/src/finn/transformation/fpgadataflow/specialize_layers.py
Lines 201 to 233 in e3087ad
The text was updated successfully, but these errors were encountered: