Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Must the Block in sparse BSR format be Square?

cui__zhihao
Beginner
642 Views

Dear all,

I am new to the MKL sparse blas, and want to use BSR as my sparse matrix format.

I notice that the block_size is specified by an integer. Does this mean the block must be a square matrix?

Is there a way to specify a non-square block in BSR?

 

Best,

Zhihao

 

0 Kudos
4 Replies
Spencer_P_Intel
Employee
642 Views

Hi Zhihao,

Yes, the way that BSR format is currently defined and implemented, the block part of the BSR matrix is a square dense matrix.  Typical use cases are 2x2 or 3x3, but in reality it could be any square size.  Currently there is not a way to specify a non square block in the BSR matrix format.  I am not familiar with any use cases where that would even make sense.  Can you describe a little what you are trying to do?

Best,

Spencer

0 Kudos
Connor_Wong
Beginner
598 Views

@Spencer_P_Intel It is indeed possible to have non-square block sizes. Is there any way we can make a formal request to the Intel MKL developer team to support non-square blocks?

0 Kudos
Kirill_V_Intel
Employee
583 Views

Hi @Connor_Wong,

Such a request already exists but is not a small thing to add. @Gennady_F_Intel can help you with the official request so that you will be added to the group of customers who requested it.

Best,
Kirill

0 Kudos
cui__zhihao
Beginner
642 Views

Spencer P. (Intel) wrote:

Hi Zhihao,

Yes, the way that BSR format is currently defined and implemented, the block part of the BSR matrix is a square dense matrix.  Typical use cases are 2x2 or 3x3, but in reality it could be any square size.  Currently there is not a way to specify a non square block in the BSR matrix format.  I am not familiar with any use cases where that would even make sense.  Can you describe a little what you are trying to do?

Best,

Spencer

 

Thanks for your reply, Spencer.

I am using BSR format as the basic storage format of some Hamiltonian matrix. After some reshaping operations, the matrix can be rectangular, and at that moment, the square block size is not very useful.

I think it is quite common that the matrix itself is non-square, so that the block size would be quite convenient if they can support non-square shape.

See the Scipy's implementation of BSR, it does support the non-square shape of block, but I would like to use similar things in MKL, as it is more efficient ^^

https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.sparse.bsr_matrix.html

 

Zhihao

 

 

 

0 Kudos
Reply