## Efficient computation (solve) of Ax = b when A is symmetric

Open discussion for MAGMA library (Matrix Algebra on GPU and Multicore Architectures)
Klausb
Posts: 21
Joined: Thu Oct 05, 2017 3:04 pm

### Efficient computation (solve) of Ax = b when A is symmetric

Hello,

I want to solve a SPARSE linear system Ax = b and I know, A is always a symmetric matrix (structure & values). The size of the matrix is n = 40800, it's a sparse matrix of size n x n. (containing real, double values).

As the matrix is symmetric with respect to structure and values, there might be quite some efficiency gain (up to 50%) if:

I would only copy and transfer the upper or lower triangle to Magma (Note: A single simulation I do, requires 8000-10000 matrix transfers!)
AND
Apply magmablas_dsymmetrize() ... if it's applicable to sparse matrices in CSR format and fast?
OR
Set a "symmetry" marker if it's available in Magma and if Magma would solve a linear system based on that? (another library offers such an option)

How to solve a linear system with sparse symmetric matrices efficiently?

Klaus

hartwig anzt
Posts: 90
Joined: Tue Sep 02, 2014 5:44 pm

### Re: Efficient computation (solve) of Ax = b when A is symme

Dear Klaus,

MAGMA-sparse contains iterative Krylov solvers that exploit symmetry information, i.e. the CG method (potentially preconditioned with Jacobi or Incomplete Cholesky). This combination should be able to solve your problem with satisfying efficiency.

Most iterative solvers are based on sparse matrix vector products (SpMV), e.g. for generating the Krylov subspace. Your question hence boils down to whether there is an SpMV routine exploiting the symmetry information. The answer is no, and I am not aware of any GPU-implementation of the SpMV that does. (If there is, please point me to it).

My guess is that other libraries exploiting the symmetry information use direct solvers, and move to a Cholesky factorization if appropriate.

Please let me know whether this helps.

Thanks, Hartwig

Klausb
Posts: 21
Joined: Thu Oct 05, 2017 3:04 pm

### Re: Efficient computation (solve) of Ax = b when A is symme

Dear Hartwig,

based on your insights, I assume it's only a wrapper that hides an efficient copy process (lower<>upper) so I'll try the same - we'll whether there's a benefit.

Do you know how to apply (syntax) of magmablas_dsymmetrize()?

Code: Select all

``````void magmablas_dsymmetrize 	( magma_uplo_t  	uplo,
magma_int_t  	m,
magma_int_t  	ldda,
magma_queue_t  	queue
) 	``````

Klausb
Posts: 21
Joined: Thu Oct 05, 2017 3:04 pm

### Re: Efficient computation (solve) of Ax = b when A is symme

Dear Hartwig,

based on your insights, I assume it's only a wrapper that hides an efficient copy process (lower<>upper) so I'll try the same - we'll see whether there's a benefit.

Klaus
{"ft_lang_label":"__label__en","ft_lang_prob":0.86734414,"math_prob":0.84760034,"size":3649,"snap":"2020-10-2020-16","text_gpt3_token_len":887,"char_repetition_ratio":0.11303155,"word_repetition_ratio":0.65829146,"special_character_ratio":0.22417101,"punctuation_ratio":0.116691284,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9776788,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-02-23T20:21:35Z\",\"WARC-Record-ID\":\"<urn:uuid:6d4229b6-e796-42f8-83af-da996bfbd75f>\",\"Content-Length\":\"27184\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:af8540a2-28a4-4a8d-a6ac-c2ae33bc6623>\",\"WARC-Concurrent-To\":\"<urn:uuid:802dfe59-f44e-4c17-8f8b-c37f755089d5>\",\"WARC-IP-Address\":\"160.36.131.221\",\"WARC-Target-URI\":\"http://icl.cs.utk.edu/magma/forum/viewtopic.php?f=2&t=1602&p=4466\",\"WARC-Payload-Digest\":\"sha1:SASSQDIAOSFTNFHNDICD3QBEDE62GD6H\",\"WARC-Block-Digest\":\"sha1:YJ6ODCCDMPPVTHCFDSWAJ7X7Q4CXZMOD\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-10/CC-MAIN-2020-10_segments_1581875145839.51_warc_CC-MAIN-20200223185153-20200223215153-00235.warc.gz\"}"}