Towards Multi-Level Arithmetic Optimizations
Résumé
Programmers of numerical code often think with real numbers, ignoring the specifics of machine encodings. However, existing MLIR arithmetic operations are currently constrained to machine formats (integers and floats) that inherently define their encoding schemes and computational rules. These limitations restrict the extent of legal optimizations on a program, for instance, addition is associative on real numbers, but not on floats. Besides, the set of supported operations is limited to those found in mainstream hardware, which is limiting in the context of High-Level Synthesis. Such issues can be addressed by introducing multiple arithmetic abstraction levels in MLIR. We present the real_arith dialect, which represents operations on real numbers and defines optimizations legal at this level. This dialect also captures the notions of approximation and approximation error. Additionally, we extend the arith dialect to support mixed-precision operations on arbitrary precision fixed-point types. These dialects are combined in an end-to-end flow, and we discuss its potential for arithmetic optimizations beyond those found in current compilers. Such optimisations are particularly relevant when compiling a high-level mathematical description to application-specific hardware, for instance in signal processing and AI acceleration.
| Origine | Fichiers produits par l'(les) auteur(s) |
|---|---|
| Licence |