finn icon indicating copy to clipboard operation
finn copied to clipboard

Implement IP caching

Open quetric opened this issue 4 years ago • 0 comments

This PR addresses #174

I added the following features:

  • two node attributes, ip_cache_key to store a key in an IP cache and 'disable_ip_synth' to instruct HLSSynthIP to skip a node
  • an additional hlscustomop function , get_structural_parameters() which is meant to return a dict of the parameters which affect the generated hls; this dict can be hashed and turned into a cache key
  • an additional hlscustomop function, set_synth_enablement() which the custom op can redefine if it wants to tell the HLSSynthIP to skip it for synthesis (for example for nodes which have HLS and RTL/Vivado implementations but are currently not configured to use the HLS)
  • a new transform CacheIP which identifies unique IPs, synthesizes them, stores the relevant parameters into the cache, and adds a model attribute pointing to the cache file (a JSON)
  • a test for the above

The test is by no means exhaustive but it does pass - graph is stitched in IPI with no issues. To be able to use the cache, each custom op should define the get_structural_parameters as appropriate for itself. By default nodes return no parameters and are therefore always synthesized from scratch. I implemented get_structural_parameters for FC layers only for this test.

quetric avatar Jun 16 '21 15:06 quetric