mllite/ml2cpp

Experiments with Small Devices : Floating Point Issues

Closed this issue · 7 comments

See #25

ml2cp uses float64 in all computations by default. This is not always a limitation.

For each device, Check the availability of major floating point types (float64, float32, float16, bfloat16, ...)

  1. Allow using float32, float16 or bfloat16 when available.
  2. Allow using hardware FPU when available.
  3. Adapt the code, when needed, according to floating point capabilities.
Chip Arch Bits Cores Speed FPU
K210 riscv (IMAFDC) 64 2 400 2
ESP32D0WDQ6 xtensa 32 2 240 1
STM32F103C8T6 ARM Cortex-M3 32 1 72 0
  1. K210 has 2 64-bit cores and one FPU per core.
  2. ESP32 has 2 32-bit cores and one FPU common to all cores.
  3. STM32 has 1 32-bit core and no FPU
Chip INT32 INT64 Float-64 Float-32 Float-16 BFloat16
K210 Y Y Y Y N N
ESP32D0WDQ6 Y N N Y N N
STM32F103C8T6 Y N N Y N N

No controller has a support for 16bit and like floats.

No special need to adapt the code.

bfloat-16 is not yet supported in our compilers (g++, as of 2020)

Closing