Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmark: Lossy Floating Point Preprocessing Turbo Razor vs Granular bitround vs libroundfast #94

Open
powturbo opened this issue Mar 18, 2023 · 0 comments

Comments

@powturbo
Copy link
Owner

powturbo commented Mar 18, 2023

Quantization of the floating point mantissa by zeroing the rightmost bits according to a maximum allowed pointwise relative error.

Rounding algorithm benchmark:

Turbo Razor is the fastest (2-10 times) rounding algorithm with better precision according to the maximum allowed relative error. It's the only rounding algorithm supporting the pointwise relative error bound. Other algorithms are simply shaving the mantissa bits even if the values are very small.

option -G3 : Number of significant digits for Granular bitround and libround fast.
option -z : maximum relative error bound allowed for Turbo razor

PSNR: Peak Signal-to-Noise Ratio
NRMSE: Normalized Root Mean Square Error
CTZ: Ratio of mantissa bits set to zero by the rounding algorithm.
libroundfast is setting some mantissa bits to 1 (ctz negative) resulting in worse compression when used in conjunction with general purpose compressors (see iccodec.c)

  • 64-bits:
icapp *.f64 -I15 -e149,150,152 -Fd -v1 -z.005 -G3
  E MB/s     size     ratio   relat. err PSNR    NRMSE       CTZ     
 5258.78  548458560 100.00%   0.005       148  4.18161e-08   2.4% 149:fprazor          Turbo razor         astro_mhd130x514x1026.f64
  579.05  548458560 100.00%   0.00497256  102  8.20064e-06   2.5% 150:gb               granular bitround   astro_mhd130x514x1026.f64
  690.77  548458560 100.00%   0.00485313  103  7.15003e-06 -14.2% 152:libdroundfast    float fast round    astro_mhd130x514x1026.f64
  
 1218.58  671088640 100.00%   0.005        76  0.000151481  69.7% 149:fprazor          Turbo razor         astro_pt512x256x640.f64
  580.57  671088640 100.00%   0.00487795   82  7.62695e-05  68.2% 150:gb               granular bitround   astro_pt512x256x640.f64
  672.15  671088640 100.00%   0.00431012   83  7.42398e-05  64.7% 152:libdroundfast    float fast round    astro_pt512x256x640.f64
  
 1000.58  188563456 100.00%   0.005       191  2.79912e-10  52.0% 149:fprazor          Turbo razor         rsim2048x11509.f64
  748.38  188563456 100.00%   0.00496792  113  2.24649e-06  51.0% 150:gb               granular bitround   rsim2048x11509.f64
  617.11  188563456 100.00%   0.00485028  113  2.25849e-06  44.5% 152:libdroundfast    float fast round    rsim2048x11509.f64
  
  919.95 1073741824 100.00%   0.005        68  0.00040705   69.9% 149:fprazor          Turbo razor         wave512x512x512.f64
  577.63 1073741824 100.00%   0.00487804   78  0.000120339  68.5% 150:gb               granular bitround   wave512x512x512.f64
  668.71 1073741824 100.00%   0.00431019   79  0.000117616  65.1% 152:libdroundfast    float fast round    wave512x512x512.f64
  • 32 bits
icapp *.f32 -I15 -e149,150,152 -Ff -v1 -z.005 -G3
  E MB/s     size     ratio   relat. err PSNR    NRMSE       CTZ  
 2772.92  268435456 100.00%   0.005       148  3.88992e-08   1.3% 149:fprazor          Turbo razor        astro_mhd128x512x1024.f32
  282.54  268435456 100.00%   0.00497253  102  8.21992e-06   1.5% 150:gb               granular bitround  astro_mhd128x512x1024.f32
  341.38  268435456 100.00%   0.0048531   103  7.15148e-06 -32.2% 152:libdroundfast    float fast round   astro_mhd128x512x1024.f32
  
  619.29  335544320 100.00%   0.005        76  0.000151478  48.9% 149:fprazor          Turbo razor        astro_pt512x256x640.f32
  284.69  335544320 100.00%   0.00487797   82  7.62695e-05  45.9% 150:gb               granular bitround  astro_pt512x256x640.f32
  330.96  335544320 100.00%   0.00431015   83  7.42398e-05  38.8% 152:libdroundfast    float fast round   astro_pt512x256x640.f32
  
  608.86    3722080 100.00%   0.00499997   62  0.000792645  31.6% 149:fprazor          Turbo razor        float232630x4.f32
  389.60    3722080 100.00%   0.00467482   82  8.09473e-05  31.3% 150:gb               granular bitround  float232630x4.f32
  291.57    3722080 100.00%   0.00431034   76  0.000167833  17.0% 152:libdroundfast    float fast round   float232630x4.f32
  
 2901.84   11437608 100.00%   0.0049975   130  3.15258e-07  21.4% 149:fprazor          Turbo razor        float953134x3.f32
  284.50   11437608 100.00%   0.00496978   79  0.000110678  46.9% 150:gb               granular bitround  float953134x3.f32
  320.09   11437608 100.00%   0.00479505   79  0.00011031   40.5% 152:libdroundfast    float fast round   float953134x3.f32
  
 1228.49  139497932 100.00%   0.00499999   72  0.000254028  33.9% 149:fprazor          Turbo razor        msg_sppm.f32
  317.21  139497932 100.00%   0.00466576   89  3.35241e-05  34.9% 150:gb               granular bitround  msg_sppm.f32
  326.94  139497932 100.00%   0.00430519   75  0.000171811  22.0% 152:libdroundfast    float fast round   msg_sppm.f32
  
  429.15   62865612 100.00%   0.005        76  0.000160812  48.6% 149:fprazor          Turbo razor        msg_sweep3d.f32
  288.06   62865612 100.00%   0.00482618   85  5.33581e-05  45.3% 150:gb               granular bitround  msg_sweep3d.f32
  320.19   62865612 100.00%   0.00426642   82  7.65017e-05  38.3% 152:libdroundfast    float fast round   msg_sweep3d.f32
  
  503.95   94281728 100.00%   0.005       191  2.79382e-10  36.6% 149:fprazor          Turbo razor        rsim2048x11509.f32
  371.42   94281728 100.00%   0.00496795  113  2.24649e-06  34.5% 150:gb               granular bitround  rsim2048x11509.f32
  299.93   94281728 100.00%   0.00485031  113  2.25849e-06  23.9% 152:libdroundfast    float fast round   rsim2048x11509.f32
  
 2561.73   16777216 100.00%   0.00499999  147  4.47113e-08   2.3% 149:fprazor          Turbo razor        sq1024x1024x4.f32
  858.54   16777216 100.00%   0.00479316   73  0.00023009   12.4% 150:gb               granular bitround  sq1024x1024x4.f32
  356.91   16777216 100.00%   0.00424078   73  0.000217539  -5.6% 152:libdroundfast    float fast round   sq1024x1024x4.f32
  
 1267.69   67108864 100.00%   0.005       117  1.41099e-06  16.1% 149:fprazor          Turbo razor        sq2048x2048x4.f32
  264.77   67108864 100.00%   0.00497512   79  0.000118169  19.3% 150:gb               granular bitround  sq2048x2048x4.f32
  349.99   67108864 100.00%   0.00485415   79  0.000111484   4.4% 152:libdroundfast    float fast round   sq2048x2048x4.f32
  
  464.65  536870912 100.00%   0.005        68  0.000407049  49.4% 149:fprazor          Turbo razor        wave512x512x512.f32
  283.51  536870912 100.00%   0.00487805   78  0.000120339  46.5% 150:gb               granular bitround  wave512x512x512.f32
  325.72  536870912 100.00%   0.00431021   79  0.000117616  39.8% 152:libdroundfast    float fast round   wave512x512x512.f32

how floating point rounding algorithms work using the PI value

Algo              NSD  Error bound   value        Difference to PI  trailling zeros 
PI exact                             3.141592653589793116            3
Turbo Razor            5.000000e-01  3             0.1415926536      51
Granular bitround  1                 3             0.1415926536      51
Bit Grooming       0                 3             0.1415926536      51

Turbo Razor            5.000000e-02  3.125         0.01659265359     48
Granular bitround  2                 3.125         0.01659265359     48
Bit Grooming       1                 3.125         0.01659265359     48

Turbo Razor            5.000000e-03  3.140625      0.0009676535898   45
Granular bitround  3                 3.140625      0.0009676535898   45
Bit Grooming       2                 3.140625      0.0009676535898   45

Turbo Razor            5.000000e-04  3.140625      0.0009676535898   45
Granular bitround  4                 3.141601562   -8.908910207e-06  41
Bit Grooming       3                 3.140625      0.0009676535898   45

Turbo Razor            5.000000e-05  3.141540527   5.212624604e-05   37
Granular bitround  5                 3.141601562   -8.908910207e-06  41
Bit Grooming       4                 3.141540527   5.212624604e-05   37

Turbo Razor            5.000000e-06  3.141586304   6.349878856e-06   35
Granular bitround  6                 3.141593933   -1.279515676e-06  34
Bit Grooming       5                 3.141586304   6.349878856e-06   35

Turbo Razor            5.000000e-07  3.141592026   6.278329572e-07   32
Granular bitround  7                 3.141592979   -3.258413592e-07  31
Bit Grooming       6                 3.141592026   6.278329572e-07   32

Turbo Razor            5.000000e-08  3.141592622   3.178650942e-08   28
Granular bitround  8                 3.141592681   -2.781813535e-08  27
Bit Grooming       7                 3.141592622   3.178650942e-08   28

Turbo Razor            5.000000e-09  3.141592652   1.984187037e-09   26
Granular bitround  9                 3.141592652   1.984187037e-09   26
Bit Grooming       8                 3.141592652   1.984187037e-09   26

Turbo Razor is using the rel. error. NSD is used by Granular bitround and Bit Grooming

@powturbo powturbo pinned this issue Mar 18, 2023
Repository owner locked as off-topic and limited conversation to collaborators Mar 18, 2023
@powturbo powturbo changed the title Lossy Floating Point Preprocessing :Turbo Razor vs Granular bitround vs libroundfast Benchmark: Lossy Floating Point Preprocessing Turbo Razor vs Granular bitround vs libroundfast Mar 23, 2023
@powturbo powturbo unpinned this issue Mar 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant