hls4ml icon indicating copy to clipboard operation
hls4ml copied to clipboard

Unrolled implementation for latency dense/conv layers

Open calad0i opened this issue 1 year ago • 0 comments

Description

Implement manually unrolled dense/conv layers for latency models. Switch to enable this optimization is not implemented.

Currently, by importing import hls4ml.optimization.fused_dotp.optimizer_pass.vitis, all Dense, Conv1/2D are unrolled for vivado/vitis backends.

Breaking changes

As this feature also resides in hls4ml/optimization, the #768 at that path is moved to a subdirectory.

  • Code added by #768 moved from hls4ml/optimization to hls4ml/optimization/dsp_aware_pruning.
  • np_config.enable_numpy_behavior() is removed as it silently changes tensorflow's global behavior which may cause issue in other codes (e.g., a < b, where a, b are tf.Tensors, may no longer work with that option (tested tf2.13).

As a result, compatibility with #809 is to be checked.

Type of change

  • [x] New feature (non-breaking change which adds functionality)

Tests

Pending, will be added to HGQ tests.

Checklist

  • [x] I have read the guidelines for contributing.
  • [x] I have commented my code, particularly in hard-to-understand areas.
  • [ ] I have made corresponding changes to the documentation.
  • [x] My changes generate no new warnings.
  • [x] I have installed and run pre-commit on the files I edited or added.
  • [ ] I have added tests that prove my fix is effective or that my feature works.

calad0i avatar May 14 '24 23:05 calad0i