[gambit-list] Some floating-point benchmarks

Marc Feeley feeley at iro.umontreal.ca
Mon Apr 16 09:28:56 EDT 2018


Nice!  I assume it is much faster than the fft algorithm in the fft.scm Gambit benchmark.  So lets add this to the benchmarks (with an appropriate name), and perhaps propose it as a new R7RS benchmark.

Marc



> On Apr 13, 2018, at 3:15 PM, Bradley Lucier <lucier at math.purdue.edu> wrote:
> 
> I isolated the complex double-precision floating-point fft code from bignum.* to compile it with various compilation options.
> 
> Bottom line: this page
> 
> https://asteroidsathome.net/boinc/cpu_list.php
> 
> claims that this cpu gets 4.42 Whetstone GFLOPS per core, and we get a maximum of 5.24 GFLOPS on this fft code.  Not bad.
> 
> This is with
> 
> heine:~/Downloads> gsc -v
> v4.8.9 20170203122653 x86_64-unknown-linux-gnu "./configure 'CC=gcc -march=native -D___CAN_IMPORT_CLIB_DYNAMICALLY' '--enable-single-host' '--enable-multiple-versions' '--enable-shared'"
> 
> So the default compilation options are -O1 -fno-strict-aliasing (for correctness concerns).
> 
> I tried it on arrays of 2^n complex numbers---direct fft, inverse fft, and normalization pass, with input arrays of double-precision floats a[i]=i for i=0,...,2*2^n.  So the largest input element is 2*2^n-1.
> 
> on my workstation
> 
> model name	: Intel(R) Xeon(R) CPU E3-1271 v3 @ 3.60GHz
> 
> I get with the default:
> 
> heine:~/Downloads> gsc -cc-options "" -exe fft
> heine:~/Downloads> ./fft
> n = 3; time = 1.2792682647705076e-7; GFLOPS = 2.0636797399751012; error = 6.280369834735101e-16
> n = 4; time = 2.574949264526366e-7; GFLOPS = 2.7340344514690593; error = 1.2560739669470201e-15
> n = 5; time = 5.655374526977542e-7; GFLOPS = 3.1120838975462415; error = 1.3293037379376718e-14
> n = 6; time = 1.257272720336914e-6; GFLOPS = 3.3596529469501935; error = 2.7519201823675253e-14
> n = 7; time = 2.7076988220214864e-6; GFLOPS = 3.639991242689912; error = 1.8198773652309366e-13
> n = 8; time = 6.110149383544923e-6; GFLOPS = 3.686980233358868; error = 8.83819200536562e-13
> n = 9; time = 1.3053115844726564e-5; GFLOPS = 3.8832107676787273; error = 2.7517734093770814e-12
> n = 10; time = 2.9251388549804685e-5; GFLOPS = 3.8507573686019816; error = 8.615107250117524e-12
> n = 11; time = 6.245434570312496e-5; GFLOPS = 3.96782637317103; error = 2.5586863923536608e-11
> n = 12; time = 1.3760546875000003e-4; GFLOPS = 3.9291461662928993; error = 8.374515403013386e-11
> n = 13; time = 2.9157373046874956e-4; GFLOPS = 4.017700765143364; error = 2.427252058167489e-10
> n = 14; time = 6.318623046874996e-4; GFLOPS = 3.993173799547781; error = 6.401279315596559e-10
> n = 15; time = .001321798828125005; GFLOPS = 4.090425778081168; error = 1.9322736676846665e-9
> n = 16; time = .002869578125000008; GFLOPS = 4.019523253091417; error = 6.148274594627871e-9
> n = 17; time = .005964710937500006; GFLOPS = 4.109245905933724; error = 1.895030528746498e-8
> n = 18; time = .01278696874999996; GFLOPS = 4.059172507166733; error = 5.416434749765215e-8
> n = 19; time = .027237953124999992; GFLOPS = 4.022923143201497; error = 1.5924367682223522e-7
> n = 20; time = .057735125; GFLOPS = 3.995604408927841; error = 4.5478152820930204e-7
> n = 21; time = .12327618750000013; GFLOPS = 3.9297298352936125; error = 1.3135697754368119e-6
> n = 22; time = .2585797499999991; GFLOPS = 3.9253714492337606; error = 3.766933517450172e-6
> n = 23; time = .5431375000000003; GFLOPS = 3.907514807944579; error = 1.0091226617647086e-5
> n = 24; time = 1.1226800000000026; GFLOPS = 3.9451892115295455; error = 2.8489239226962006e-5
> n = 25; time = 2.383513999999998; GFLOPS = 3.8713717645459633; error = 7.694023206666354e-5
> n = 26; time = 4.8833489999999955; GFLOPS = 3.930322224358738; error = 2.0768331024043966e-4
> n = 27; time = 10.276466000000013; GFLOPS = 3.8790246779388897; error = 6.771006191341503e-4
> n = 28; time = 22.067048; GFLOPS = 3.746677872273627; error = .00198493924264615
> 
> Upping the optimization level:
> 
> heine:~/Downloads> gsc -cc-options "-fstrict-aliasing -O3 -save-temps" -exe fft
> heine:~/Downloads> ./fft
> n = 3; time = 1.1115747690200805e-7; GFLOPS = 2.3750089274942052; error = 1.4043333874306805e-15
> n = 4; time = 2.0910918712615964e-7; GFLOPS = 3.366662219270467; error = 1.2560739669470201e-15
> n = 5; time = 4.6715402603149463e-7; GFLOPS = 3.7674940210861934; error = 2.2748467065386707e-14
> n = 6; time = 9.806089401245132e-7; GFLOPS = 4.307527524135826; error = 6.925513918651634e-14
> n = 7; time = 2.1452598571777346e-6; GFLOPS = 4.594315214086175; error = 1.8986255008552728e-13
> n = 8; time = 4.814510345458979e-6; GFLOPS = 4.679188200571278; error = 8.658131612109979e-13
> n = 9; time = 1.0385185241699221e-5; GFLOPS = 4.88079883221288; error = 2.6212768034767646e-12
> n = 10; time = 2.2970413208007773e-5; GFLOPS = 4.903699336184875; error = 9.101339655728878e-12
> n = 11; time = 4.84939270019531e-5; GFLOPS = 5.110083165465636; error = 2.6234330924158545e-11
> n = 12; time = 1.0720489501953121e-4; GFLOPS = 5.04335179752284; error = 8.505295203287146e-11
> n = 13; time = 2.2667480468750029e-4; GFLOPS = 5.168002688322593; error = 2.457142635663205e-10
> n = 14; time = 4.962851562500016e-4; GFLOPS = 5.084044864579792; error = 6.456457983110483e-10
> n = 15; time = .0010395449218749964; GFLOPS = 5.201045078694684; error = 1.946559195529706e-9
> n = 16; time = .0022347304687500014; GFLOPS = 5.161399176005213; error = 6.237221035700878e-9
> n = 17; time = .004680433593750005; GFLOPS = 5.236793452796753; error = 1.9179232434271595e-8
> n = 18; time = .009985109374999968; GFLOPS = 5.198191632227381; error = 5.455583080566663e-8
> n = 19; time = .021316359374999982; GFLOPS = 5.14047404025811; error = 1.6040392061497455e-7
> n = 20; time = .046797624999999954; GFLOPS = 4.929453578039489; error = 4.5965622756701105e-7
> n = 21; time = .09856387499999997; GFLOPS = 4.915006760844175; error = 1.3298451540360703e-6
> n = 22; time = .21956825000000002; GFLOPS = 4.622806658066455; error = 3.8105936636522594e-6
> n = 23; time = .4410570000000007; GFLOPS = 4.811890127579875; error = 1.019930547729006e-5
> n = 24; time = .9108285000000045; GFLOPS = 4.86280899642466; error = 2.8808951170769453e-5
> n = 25; time = 1.9416279999999944; GFLOPS = 4.752439087199003; error = 7.76313343393936e-5
> n = 26; time = 3.990959999999987; GFLOPS = 4.809152460560884; error = 2.0982907904532167e-4
> n = 27; time = 8.455573999999999; GFLOPS = 4.71436536608869; error = 6.832370167555158e-4
> n = 28; time = 17.53549000000001; GFLOPS = 4.714902203930427; error = .0020010805164815105
> *** ERROR IN test -- asking for too large a table
> 
> Dialing things back a bit:
> 
> heine:~/Downloads> gsc -cc-options "-fstrict-aliasing -O3 -save-temps -mno-fma" -exe fft
> heine:~/Downloads> ./fft
> n = 3; time = 1.1347168684005738e-7; GFLOPS = 2.32657156469453; error = 6.280369834735101e-16
> n = 4; time = 2.2617471218109142e-7; GFLOPS = 3.1126379833141034; error = 1.2560739669470201e-15
> n = 5; time = 4.947843551635739e-7; GFLOPS = 3.5571051946825407; error = 1.3293037379376718e-14
> n = 6; time = 1.0590076446533188e-6; GFLOPS = 3.98863976225855; error = 2.7519201823675253e-14
> n = 7; time = 2.299959182739257e-6; GFLOPS = 4.285293440843364; error = 1.8198773652309366e-13
> n = 8; time = 5.2182350158691345e-6; GFLOPS = 4.317168531407702; error = 8.83819200536562e-13
> n = 9; time = 1.113512420654298e-5; GFLOPS = 4.552082137549558; error = 2.7517734093770814e-12
> n = 10; time = 2.5001800537109394e-5; GFLOPS = 4.505275523369285; error = 8.615107250117524e-12
> n = 11; time = 5.2638397216796815e-5; GFLOPS = 4.707742125569981; error = 2.5586863923536608e-11
> n = 12; time = 1.1749737548828135e-4; GFLOPS = 4.601566611621245; error = 8.374515403013386e-11
> n = 13; time = 2.4704760742187606e-4; GFLOPS = 4.741822890838763; error = 2.427252058167489e-10
> n = 14; time = 5.420463867187482e-4; GFLOPS = 4.654834091365654; error = 6.401279315596559e-10
> n = 15; time = .0011368671875000014; GFLOPS = 4.755806183384982; error = 1.9322736676846665e-9
> n = 16; time = .0024570624999999957; GFLOPS = 4.694360033576688; error = 6.148274594627871e-9
> n = 17; time = .005130425781249975; GFLOPS = 4.777471704118148; error = 1.895030528746498e-8
> n = 18; time = .011012445312500008; GFLOPS = 4.713259455743606; error = 5.416434749765215e-8
> n = 19; time = .023272265625000066; GFLOPS = 4.708445398727683; error = 1.5924367682223522e-7
> n = 20; time = .05027193750000003; GFLOPS = 4.588777188068391; error = 4.5478152820930204e-7
> n = 21; time = .1088502499999997; GFLOPS = 4.450537431011884; error = 1.3135697754368119e-6
> n = 22; time = .22666912499999992; GFLOPS = 4.477987763000367; error = 3.766933517450172e-6
> n = 23; time = .4811325000000011; GFLOPS = 4.411088055785039; error = 1.0091226617647086e-5
> n = 24; time = 1.0017979999999937; GFLOPS = 4.421235642315144; error = 2.8489239226962006e-5
> n = 25; time = 2.1137259999999998; GFLOPS = 4.365499028729363; error = 7.694023206666354e-5
> n = 26; time = 4.3619779999999935; GFLOPS = 4.400099015630072; error = 2.0768331024043966e-4
> n = 27; time = 9.149559999999994; GFLOPS = 4.356784940040836; error = 6.771006191341503e-4
> n = 28; time = 18.892846000000006; GFLOPS = 4.376160185077461; error = .00198493924264615
> 
> I'll include the code if anyone's interested.
> 
> Brad
> <fft.scm>_______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list



More information about the Gambit-list mailing list