Thank you Matt!

It appears that the HIP implementation is designed for sparse matvec on AMD 
GPUs, similar to CUDA for Nvidia GPUs, is that correct?

We are primarily focusing on CPUs with AOCL. It would be great if PETSc offered 
an AOCL AIJ class. We could use AOCL in the same manner as we use MKL.

In the meantime, I wonder if I can simply use MATAIJ-type matrices and 
configure PETSc with AOCL during compilation. Will the MatMult() API then use 
AOCL BLAS as the backend?

Thanks,
Yongzhong




From: Matthew Knepley <knep...@gmail.com>
Date: Monday, August 11, 2025 at 12:44 PM
To: Yongzhong Li <yongzhong...@mail.utoronto.ca>
Cc: petsc-users@mcs.anl.gov <petsc-users@mcs.anl.gov>, petsc-ma...@mcs.anl.gov 
<petsc-ma...@mcs.anl.gov>, Jasper Hatton <jasper.hat...@mail.utoronto.ca>, 
Piero Triverio <piero.trive...@utoronto.ca>, Atacan Tuhan 
<a.tu...@mail.utoronto.ca>
Subject: Re: [petsc-users] Inquiry about configuring PETSc with AOCL BLAS/LAPACK
On Mon, Aug 11, 2025 at 12:32 PM Yongzhong Li 
<yongzhong...@mail.utoronto.ca<mailto:yongzhong...@mail.utoronto.ca>> wrote:
Dear PETSc’s developer,

Hi, I am a user of PETSc. I have some questions about how we can configure 
PETSc with AOCL BLAS and LAPACK.

Previously, we linked PETSc with Intel MKL BLAS. This solution provides us with 
much better multithreading capability for sparse matrix-vector product compared 
with configuring PETSc with OpenBLAS. Now, our compute nodes have been upgraded 
with AMD CPUs, we are considering switching from Intel MKL to AMD AOCL.

My questions are:


  1.  If we configure PETSc in compile time with —with-blaslapack-dir = 
$AOCLROOT, will we be able to use AOCL BLAS as the backend of PETSc MatMult() 
API?

Do you mean use the AMD sparse matvec? We have a HIP implementation 
(https://urldefense.us/v3/__https://petsc.org/main/manualpages/Mat/MATAIJHIPSPARSE/__;!!G_uCfscf7eWS!erObo4bZtlWw2VuQgcNv1mF6FQ0629E3AUF29xJ1MC425B_G8NL2xhSbiULNL58ZGQcMnQWy85kVeTiFbTeeREz4Ubko4R7i9vQ$
 ), but nothing for AOCL comparable to the AIJMKL class. If you think we need 
it, we would certainly help implement it.


  1.
  2.  What if AOCL BLAS and AOCL LAPACK are installed in two different 
directories, not under AOCLROOT?

You would use -with-blaslapack-lib=[liblist]


  1.
  2.  PETSc has MatAIJMKL type for sparse matrix stored in Intel MKL format. 
Does PETSc also have another type for AMD AOCL?

No, but it would be straightforward to add.

  Thanks,

     Matt

Thanks!
Yongzhong


--
What most experimenters take for granted before they begin their experiments is 
infinitely more interesting than any results to which their experiments lead.
-- Norbert Wiener

https://urldefense.us/v3/__https://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!erObo4bZtlWw2VuQgcNv1mF6FQ0629E3AUF29xJ1MC425B_G8NL2xhSbiULNL58ZGQcMnQWy85kVeTiFbTeeREz4UbkoEUTinu8$
 
<https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!erObo4bZtlWw2VuQgcNv1mF6FQ0629E3AUF29xJ1MC425B_G8NL2xhSbiULNL58ZGQcMnQWy85kVeTiFbTeeREz4Ubko--hqJ1I$
 >

Reply via email to