Optimizing the operations with sparse matrices on Intel architecture Gladkikh V. S. victor.s.gladkikh@intel.com Intel Xeon, Intel Itanium are trademarks of Intel Corporation in the U.S. and other countries. 1/11 5-12 Oct 2008 Differential Equations. Function Spaces.
Technical Collateral Disclaimer INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL PRODUCTS. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. EXCEPT AS PROVIDED IN INTEL'S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. UNLESS OTHERWISE AGREED IN WRITING BY INTEL, THE INTEL PRODUCTS ARE NOT DESIGNED NOR INTENDED FOR ANY APPLICATION IN WHICH THE FAILURE OF THE INTEL PRODUCT COULD CREATE A SITUATION WHERE PERSONAL INJURY OR DEATH MAY OCCUR. Intel may make changes to specifications and product descriptions at any time, without notice. Designers must not rely on the absence or characteristics of any features or instructions marked "reserved" or "undefined." Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. The information here is subject to change without notice. Do not finalize a design with this information. The products described in this document may contain design defects or errors known as errata which may cause the product to deviate from published specifications. Current characterized errata are available on request. Contact your local Intel sales office or your distributor to obtain the latest specifications and before placing your product order. Copies of documents which have an order number and are referenced in this document, or other Intel literature, may be obtained by calling 1-800-548-4725, or by visiting Intel's Web Site 2/11 5-12 Oct 2008 Differential Equations. Function Spaces.
Agenda Overview of sparse BLAS Performance of different formats Performance factors Summary 3/11 5-12 Oct 2008 Differential Equations. Function Spaces.
Sparse Matrix Storage formats Intel Math Kernel Library (Intel MKL) supports 6 sparse matrix storage format (CSR, CSC, COO, DIA, SKY, BSR): COO: The coordinate format is the most flexible and simplest format for the sparse matrix representation. Only nonzero entries are provided, and the coordinates of each nonzero entry are given explicitly. CSR: Compress Sparse Row format - The compression of the non-zeros of a sparse matrix A into a linear array is done by walking across each row in order, and writing the non-zero elements to a linear array. BSR: This format is similar to the CSR format. Nonzero entries in the BSR are square dense blocks. 4/11 5-12 Oct 2008 Differential Equations. Function Spaces.
Sparse BLAS functionality Intel MKL Sparse BLAS is a group of computational kernels optimized for Intel architectures that perform operations: 1. Sparse matrix-vector/matrix-matrix product: C <- alpha* op(a)* B + beta * C C <- op(a)* B (Level 2 only) 2. Solving a triangular system or C <- alpha*inverse of ( op(a) ) B or C <- inverse of ( op(a) ) B (Level 2 only) where C and B are dense matrices or vectors, A is a sparse matrix, alpha and beta are scalars, op(a) is one of the possible operations: op(a)=a or op(a)= transpose of A. 5/11 5-12 Oct 2008 Differential Equations. Function Spaces.
Scaling of sparse matrix-matrix multiply Ratio MKL_DCSRMM (MKL 10.0 Gold) 8 7 6 5 4 3 2 1 0 airfoil_2d.mtx Pres_Poisson.mtx FEM_3D_thermal1.mtx bcsstk36.mtx std1_jac2.mtx ct20stif.mtx venkat01.mtx matrix nd6k.mtx Dual-Core Intel Itanium 2 processor 9050 1.6GHz, 24MB L3 Cache laminar_duct3d.mtx time 1th/2th time 1th/4th time 1 th/8th Performance tests and ratings are measured using specific computer systems and/or components and reflect the approximate performance of Intel products as measured by those tests. Any difference in system hardware or software design or configuration may affect actual performance. Buyers should consult other sources of information to evaluate the performance of systems or components they are considering purchasing. For more information on performance tests and on the performance of Intel products, visit Intel Performance Benchmark Limitations 6/11 5-12 Oct 2008 Differential Equations. Function Spaces.
Performance of symmetric matrix-vector multiplication COO vs CSR vs BSR (MKL 10.0 Gold) 2 x Quad-Core Intel Xeon 5300 Series Processor 2.4GHz, 8MB L2 Cache 7 6 time mkl_dcoosymv/mkl_dcsrsymv time mkl_dcoosymv/mkl_dbsrsymv 5 Ratio 4 3 2 1 0 50676-block-2 101384-block-2 151940-block-2 76014-block-3 152076-block-3 227910-block-3 126015-block-5 253800-block-5 503625-block-5 126690-block-5 253460-block-5 505940-block-5 Matrix Performance tests and ratings are measured using specific computer systems and/or components and reflect the approximate performance of Intel products as measured by those tests. Any difference in system hardware or software design or configuration may affect actual performance. Buyers should consult other sources of information to evaluate the performance of systems or components they are considering purchasing. For more information on performance tests and on the performance of Intel products, visit Intel Performance Benchmark Limitations 7/11 5-12 Oct 2008 Differential Equations. Function Spaces.
Performance of symmetric matrix-vector multiplication (+converters) 3 2.5 COO vs CSR vs BSR (MKL 10.0 Gold) time mkl_dcoosymv/mkl_dcsrsymv time mkl_dcoosymv/mkl_bsrsymv 2 x Quad-Core Intel Xeon 5300 Series Processor 2.4GHz, 8MB L2 Cache 2 Ratio 1.5 1 0.5 0 33691 56197 86983 127345 178579 241981 318847 410473 786871 1830361 3534451 6061141 9572431 14230321 20196811 27633901 36703591 47567881 60388771 75328261 92548351 number of nonzeros Performance tests and ratings are measured using specific computer systems and/or components and reflect the approximate performance of Intel products as measured by those tests. Any difference in system hardware or software design or configuration may affect actual performance. Buyers should consult other sources of information to evaluate the performance of systems or components they are considering purchasing. For more information on performance tests and on the performance of Intel products, visit Intel Performance Benchmark Limitations 8/11 5-12 Oct 2008 Differential Equations. Function Spaces.
Performance factors Hardware characteristics (cache size, FSB bandwidth and etc) impact on the performance of Sparse BLAS routines. Proper choice of sparse matrix format can increase performance and scalability of your application. Memory bandwidth plays important role and impacts on performance and scalability of your application. Good matrix structure (matrix bandwidth, sparsity, ) can increase the performance of application. 9/11 5-12 Oct 2008 Differential Equations. Function Spaces.
Thus, Intel MKL Sparse BLAS: Support for wide range of sparse formats and operations Optimization for Intel platforms Open MP support Static and dynamic Efficient and fast solution for high- performance application design 10/11 5-12 Oct 2008 Differential Equations. Function Spaces.
Q&A 11/11 5-12 Oct 2008 Differential Equations. Function Spaces.