DeepWok / mase

Machine-Learning Accelerator System Exploration Tools
Other
105 stars 52 forks source link

Group 12 - Hardware Normalisation #85

Closed JoachimSand closed 3 months ago

JoachimSand commented 3 months ago

Overview

This PR implements hardware normalisation for BatchNorm and LayerNorm (which by selecting the appropriate parameters, namely NUM_NORMALIZATION_ZONES, can also act as an InstanceNorm or GroupNorm).

Main Features

Test benches

The test benches for LayerNorm and BatchNorm both utilise their quantized and non-quantized software versions for testing of functional equivalence. For LayerNorm, the test bench is passed if the values are within a certain range of the software versions.

The results from the hardware LayerNorm are usually within 1 fractional bit of the results produced by the functionally equivalent models. Try for yourself!

Auxillary Features

pgimenes commented 3 months ago

Need to reopen since this is actually group 12