Software Archive
Read-only legacy content
17061 Discussions

Memory Management of Strassen Heap Based Matrix Multiplication algorithms

SergeyKostrov
Valued Contributor II
347 Views
*** Memory Management of Strassen Heap Based Matrix Multiplication algorithms *** [ Abstract ] Memory Management of Strassen Heap Based Matrix Multiplication algorithms is evaluated for matrix sizes: 8192 x 8192 16384 x 16384 32768 x 32768 65536 x 65536 Single Precision Floating point data type.
0 Kudos
5 Replies
SergeyKostrov
Valued Contributor II
347 Views
[ Abbreviations ] VM - Virtual Memory PM - Physical Memory IM - Input Matrices HM - Heap Matrices SM - Swaped Memory ( to VM ) TM - Total Memory TM = ( IM + HM ) MS - Memory Saved MS = ( HM - SM ) FP - Floating Point DT - Data Type SP - Single Precision FP DT ( float - 4 bytes ) DP - Double Precision FP DT ( double - 8 bytes ) EP - Extended Precision FP DT ( long double - 10/12 bytes )
0 Kudos
SergeyKostrov
Valued Contributor II
347 Views
[ Case 1 -  8192 x  8192 ]

 [ Input Matrices ( IM ) ]
 Matrix A:  8192 x  8192    SP data type    Memory used:   256MB x 1 =   256 MB
 Matrix B:  8192 x  8192    SP data type    Memory used:   256MB x 1 =   256 MB
 Matrix C:  8192 x  8192    SP data type    Memory used:   256MB x 1 =   256 MB
                                            Total      :             =   768 MB  IM
 [ Heap Matrices ( HM ) ]
 A[2]    :  4096 x  4096    SP data type    Memory used:    64MB x 2 =   128 MB
 B[2]    :  4096 x  4096    SP data type    Memory used:    64MB x 2 =   128 MB
 M[7]    :  4096 x  4096    SP data type    Memory used:    64MB x 7 =   448 MB
                                            Total      :             =   704 MB  HM
 Total Memory ( TM ):
                                                                        1472 MB  TM
 [ Swaped Memory ( SM ) ]
 A[2]    :  4096 x  4096    SP data type    Memory used:    64MB x 2 =   128 MB
 B[2]    :  4096 x  4096    SP data type    Memory used:    64MB x 2 =   128 MB
                                            Total      :             =   256 MB  SM

                                                                         704 MB  HM
                                                                      -
                                                                         256 MB  SM
                                                                      ---------
                                                    Memory Saved:        448 MB  MS

 

0 Kudos
SergeyKostrov
Valued Contributor II
347 Views
[ Case 2 - 16384 x 16384 ]

 [ Input Matrices ( IM ) ]
 Matrix A: 16384 x 16384    SP data type    Memory used:  1024MB x 1 =  1024 MB
 Matrix B: 16384 x 16384    SP data type    Memory used:  1024MB x 1 =  1024 MB
 Matrix C: 16384 x 16384    SP data type    Memory used:  1024MB x 1 =  1024 MB
                                            Total      :             =  3072 MB  IM
 [ Heap Matrices ( HM ) ]
 A[2]    :  8192 x  8192    SP data type    Memory used:   256MB x 2 =   512 MB
 B[2]    :  8192 x  8192    SP data type    Memory used:   256MB x 2 =   512 MB
 M[7]    :  8192 x  8192    SP data type    Memory used:   256MB x 7 =  1792 MB
                                            Total      :             =  2816 MB  HM
 Total Memory ( TM ):
                                                                        5888 MB  TM
 [ Swaped Memory ( SM ) ]
 A[2]    :  8192 x  8192    SP data type    Memory used:   256MB x 2 =   512 MB
 B[2]    :  8192 x  8192    SP data type    Memory used:   256MB x 2 =   512 MB
                                            Total      :             =  1024 MB  SM

                                                                        2816 MB  HM
                                                                      -
                                                                        1024 MB  SM
                                                                      ---------
                                                    Memory Saved:       1792 MB  MS

 

0 Kudos
SergeyKostrov
Valued Contributor II
347 Views
[ Case 3 - 32768 x 32768 ]

 [ Input Matrices ( IM ) ]
 Matrix A: 32768 x 32768    SP data type    Memory used:  4096MB x 1 =  4096 MB
 Matrix B: 32768 x 32768    SP data type    Memory used:  4096MB x 1 =  4096 MB
 Matrix C: 32768 x 32768    SP data type    Memory used:  4096MB x 1 =  4096 MB
                                            Total      :             = 12288 MB  IM
 [ Heap Matrices ( HM ) ]
 A[2]    : 16384 x 16384    SP data type    Memory used:  1024MB x 2 =  2048 MB
 B[2]    : 16384 x 16384    SP data type    Memory used:  1024MB x 2 =  2048 MB
 M[7]    : 16384 x 16384    SP data type    Memory used:  1024MB x 7 =  7168 MB
                                            Total      :             = 11264 MB  HM
 Total Memory ( TM ):
                                                                       23552 MB  TM
 [ Swaped Memory ( SM ) ]
 A[2]    : 16384 x 16384    SP data type    Memory used:  1024MB x 2 =  2048 MB
 B[2]    : 16384 x 16384    SP data type    Memory used:  1024MB x 2 =  2048 MB
                                            Total      :             =  4096 MB  SM

                                                                       11264 MB  HM
                                                                      -
                                                                        4096 MB  SM
                                                                      ---------
                                                    Memory Saved:       7168 MB  MS

 

0 Kudos
SergeyKostrov
Valued Contributor II
347 Views
[ Case 4 - 65536 x 65536 ]

 [ Input Matrices ( IM ) ]
 Matrix A: 65536 x 65536    SP data type    Memory used: 16384MB x 1 = 16384 MB
 Matrix B: 65536 x 65536    SP data type    Memory used: 16384MB x 1 = 16384 MB
 Matrix C: 65536 x 65536    SP data type    Memory used: 16384MB x 1 = 16384 MB
                                            Total      :             = 49152 MB  IM
 [ Heap Matrices ( HM ) ]
 A[2]    : 32768 x 32768    SP data type    Memory used:  4096MB x 2 =  8192 MB
 B[2]    : 32768 x 32768    SP data type    Memory used:  4096MB x 2 =  8192 MB
 M[7]    : 32768 x 32768    SP data type    Memory used:  4096MB x 7 = 28672 MB
                                            Total      :             = 45056 MB  HM
 Total Memory ( TM ):
                                                                       94208 MB  TM
 [ Swaped Memory ( SM ) ]
 A[2]    : 32768 x 32768    SP data type    Memory used:  4096MB x 2 =  8192 MB
 B[2]    : 32768 x 32768    SP data type    Memory used:  4096MB x 2 =  8192 MB
                                            Total      :             = 16384 MB  SM

                                                                       45056 MB  HM
                                                                      -
                                                                       16384 MB  SM
                                                                      ---------
                                                    Memory Saved:      28672 MB  MS

 

0 Kudos
Reply