llvm-project/mlir
Eugene Zhulenev f99ccf6516 [mlir] Add math polynomial approximation pass
This gives ~30x speedup compared to expanding Tanh into exp operations:

```
name                  old cpu/op  new cpu/op  delta
BM_mlir_Tanh_f32/10    253ns ± 3%    55ns ± 7%  -78.35%  (p=0.000 n=44+41)
BM_mlir_Tanh_f32/100  2.21µs ± 4%  0.14µs ± 8%  -93.85%  (p=0.000 n=48+49)
BM_mlir_Tanh_f32/1k   22.6µs ± 4%   0.7µs ± 5%  -96.68%  (p=0.000 n=32+42)
BM_mlir_Tanh_f32/10k   225µs ± 5%     7µs ± 6%  -96.88%  (p=0.000 n=49+55)

name                  old time/op             new time/op             delta
BM_mlir_Tanh_f32/10    259ns ± 1%               56ns ± 2%  -78.31%        (p=0.000 n=41+39)
BM_mlir_Tanh_f32/100  2.27µs ± 1%             0.14µs ± 5%  -93.89%        (p=0.000 n=46+49)
BM_mlir_Tanh_f32/1k   22.9µs ± 1%              0.8µs ± 4%  -96.67%        (p=0.000 n=30+42)
BM_mlir_Tanh_f32/10k   230µs ± 0%                7µs ± 3%  -96.88%        (p=0.000 n=37+55)
```

This approximations is based on Eigen::generic_fast_tanh function

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D96739
2021-02-19 12:43:36 -08:00
..
cmake/modules [MLIR] [CMake] Support building MLIR standalone 2021-02-02 13:10:21 -06:00
docs Revert "[MLIR] Create memref dialect and move several dialect-specific ops from std." 2021-02-18 12:49:52 +01:00
examples Fix MLIR Toy tutorial JIT example and add a test to cover it 2021-02-19 01:53:36 +00:00
include [mlir] Add math polynomial approximation pass 2021-02-19 12:43:36 -08:00
integration_test [mlir][sparse] generalize sparse storage format to many more types 2021-02-17 18:20:23 -08:00
lib [mlir] Add math polynomial approximation pass 2021-02-19 12:43:36 -08:00
test [mlir] Add math polynomial approximation pass 2021-02-19 12:43:36 -08:00
tools [mlir] Add math polynomial approximation pass 2021-02-19 12:43:36 -08:00
unittests Reland "[MLIR] Make structured op tests permutation invariant" 2021-02-18 18:09:49 -08:00
utils [mlir][spirv] Fix script for availability autogen and refresh ops 2021-01-22 13:07:36 -05:00
.clang-format
.clang-tidy Fix MLIR clang-tidy: when tweaking it does not inherit from the parent 2020-03-07 17:44:21 +00:00
CMakeLists.txt Fix CMake configuration for MLIR unittests 2021-02-11 01:17:49 +00:00
LICENSE.TXT Add the Apache2 with LLVM exceptions license to MLIR 2019-12-24 00:58:06 -08:00
README.md mlir README.md: Fix the syntax 2019-12-24 13:31:07 +01:00

README.md

Multi-Level Intermediate Representation

See https://mlir.llvm.org/ for more information.