Page MenuHomePhabricator

[mlir] Add polynomial approximation for math::Log1p
ClosedPublic

Authored by cota on Mon, May 3, 9:51 AM.

Details

Summary

This approximation matches the one in Eigen.

name                      old cpu/op  new cpu/op  delta
BM_mlir_Log1p_f32/10      83.2ns ± 7%  34.8ns ± 5%  -58.19%    (p=0.000 n=84+71)
BM_mlir_Log1p_f32/100      664ns ± 4%   129ns ± 4%  -80.57%    (p=0.000 n=82+82)
BM_mlir_Log1p_f32/1k      6.75µs ± 4%  0.81µs ± 3%  -88.07%    (p=0.000 n=88+79)
BM_mlir_Log1p_f32/10k     76.5µs ± 3%   7.8µs ± 4%  -89.84%    (p=0.000 n=80+80)
BM_eigen_s_Log1p_f32/10   70.1ns ±14%  72.6ns ±14%   +3.49%  (p=0.000 n=116+112)
BM_eigen_s_Log1p_f32/100   706ns ± 9%   717ns ± 3%   +1.60%   (p=0.018 n=117+80)
BM_eigen_s_Log1p_f32/1k   8.26µs ± 1%  8.26µs ± 1%     ~       (p=0.567 n=84+86)
BM_eigen_s_Log1p_f32/10k  92.1µs ± 5%  92.6µs ± 6%   +0.60%  (p=0.047 n=115+115)
BM_eigen_v_Log1p_f32/10   31.8ns ±24%  34.9ns ±17%   +9.72%    (p=0.000 n=98+96)
BM_eigen_v_Log1p_f32/100   169ns ±10%   177ns ± 5%   +4.66%   (p=0.000 n=119+81)
BM_eigen_v_Log1p_f32/1k   1.42µs ± 4%  1.46µs ± 8%   +2.70%   (p=0.000 n=93+113)
BM_eigen_v_Log1p_f32/10k  14.4µs ± 5%  14.9µs ± 8%   +3.61%  (p=0.000 n=115+110)

Diff Detail

Event Timeline

cota created this revision.Mon, May 3, 9:51 AM
cota requested review of this revision.Mon, May 3, 9:51 AM
cota retitled this revision from BEGIN_PUBLIC [mlir] Add polynomial approximation for math::Log1p to [mlir] Add polynomial approximation for math::Log1p.Mon, May 3, 9:52 AM
cota edited the summary of this revision. (Show Details)
ftynse accepted this revision.Mon, May 3, 9:54 AM
This revision is now accepted and ready to land.Mon, May 3, 9:54 AM
ezhulenev accepted this revision.Mon, May 3, 12:17 PM
cota updated this revision to Diff 342524.Mon, May 3, 1:17 PM

mention inf in the comment

This revision was landed with ongoing or failed builds.Mon, May 3, 3:11 PM
This revision was automatically updated to reflect the committed changes.