Sunday, April 21, 2013

R performance benchmarks with sequential vs multi-threading MKL libraries

Using benchmark script from http://r.research.att.com/benchmarks/R-benchmark-25.R

Sequential MKL
 Loading required package: Matrix  
 Loading required package: methods  
 Loading required package: lattice  
 Loading required package: SuppDists  
 Warning messages:  
 1: In remove("a", "b") : object 'a' not found  
 2: In remove("a", "b") : object 'b' not found  
   
   
   R Benchmark 2.5  
   ===============  
 Number of times each test is run__________________________: 3  
   
   I. Matrix calculation  
   ---------------------  
 Creation, transp., deformation of a 2500x2500 matrix (sec): 1.51233333333333   
 2400x2400 normal distributed random matrix ^1000____ (sec): 0.914333333333333   
 Sorting of 7,000,000 random values__________________ (sec): 0.814666666666666   
 2800x2800 cross-product matrix (b = a' * a)_________ (sec): 2.19166666666667   
 Linear regr. over a 3000x3000 matrix (c = a \ b')___ (sec): 1.20833333333333   
            --------------------------------------------  
          Trimmed geom. mean (2 extremes eliminated): 1.18662349903113   
   
   II. Matrix functions  
   --------------------  
 FFT over 2,400,000 random values____________________ (sec): 0.968666666666666   
 Eigenvalues of a 640x640 random matrix______________ (sec): 0.536333333333334   
 Determinant of a 2500x2500 random matrix____________ (sec): 1.15233333333333   
 Cholesky decomposition of a 3000x3000 matrix________ (sec): 1.08166666666667   
 Inverse of a 1600x1600 random matrix________________ (sec): 0.947666666666668   
            --------------------------------------------  
         Trimmed geom. mean (2 extremes eliminated): 0.997641413170114   
   
   III. Programmation  
   ------------------  
 3,500,000 Fibonacci numbers calculation (vector calc)(sec): 1.05033333333334   
 Creation of a 3000x3000 Hilbert matrix (matrix calc) (sec): 0.601666666666664   
 Grand common divisors of 400,000 pairs (recursion)__ (sec): 1.48566666666666   
 Creation of a 500x500 Toeplitz matrix (loops)_______ (sec): 0.812666666666667   
 Escoufier's method on a 45x45 matrix (mixed)________ (sec): 0.533000000000001   
            --------------------------------------------  
         Trimmed geom. mean (2 extremes eliminated): 0.800814353816818   
   
   
 Total time for all 15 tests_________________________ (sec): 15.8113333333333   
 Overall mean (sum of I, II and III trimmed means/3)_ (sec): 0.982365467154044   
            --- End of test ---  
   


Multi-threading MKL
 Loading required package: Matrix  
 Loading required package: methods  
 Loading required package: lattice  
 Loading required package: SuppDists  
 Warning message:  
 In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :  
  there is no package called ‘SuppDists’  
 Warning messages:  
 1: In remove("a", "b") : object 'a' not found  
 2: In remove("a", "b") : object 'b' not found  
   
   
   R Benchmark 2.5  
   ===============  
 Number of times each test is run__________________________: 3  
   
   I. Matrix calculation  
   ---------------------  
 Creation, transp., deformation of a 2500x2500 matrix (sec): 1.52433333333333   
 2400x2400 normal distributed random matrix ^1000____ (sec): 0.911666666666667   
 Sorting of 7,000,000 random values__________________ (sec): 0.814666666666665   
 2800x2800 cross-product matrix (b = a' * a)_________ (sec): 0.525000000000001   
 Linear regr. over a 3000x3000 matrix (c = a \ b')___ (sec): 0.393333333333333   
            --------------------------------------------  
          Trimmed geom. mean (2 extremes eliminated): 0.730564293362432   
   
   II. Matrix functions  
   --------------------  
 FFT over 2,400,000 random values____________________ (sec): 0.969   
 Eigenvalues of a 640x640 random matrix______________ (sec): 0.794666666666667   
 Determinant of a 2500x2500 random matrix____________ (sec): 0.385000000000003   
 Cholesky decomposition of a 3000x3000 matrix________ (sec): 0.349000000000001   
 Inverse of a 1600x1600 random matrix________________ (sec): 0.462999999999999   
            --------------------------------------------  
         Trimmed geom. mean (2 extremes eliminated): 0.521285412938827   
   
   III. Programmation  
   ------------------  
 3,500,000 Fibonacci numbers calculation (vector calc)(sec): 1.045   
 Creation of a 3000x3000 Hilbert matrix (matrix calc) (sec): 0.600999999999999   
 Grand common divisors of 400,000 pairs (recursion)__ (sec): 1.55266666666667   
 Creation of a 500x500 Toeplitz matrix (loops)_______ (sec): 0.814666666666668   
 Escoufier's method on a 45x45 matrix (mixed)________ (sec): 1.06   
            --------------------------------------------  
         Trimmed geom. mean (2 extremes eliminated): 0.966349072573083   
   
   
 Total time for all 15 tests_________________________ (sec): 12.203   
 Overall mean (sum of I, II and III trimmed means/3)_ (sec): 0.716620701088256   
            --- End of test ---  
   

No comments:

Post a Comment