<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Dense-Sparse Matrix Multiplication routine instead if sparse-dense multiplication in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Dense-Sparse-Matrix-Multiplication-routine-instead-if-sparse/m-p/1519280#M35009</link>
    <description>&lt;P&gt;I ran into a similar problem. What I need to compute is C = A * B or C = A * B^T with A sparse and B, C dense. The solution I came up with is to rewrite these expressions into C = (B^T * A^T)^T and C = (B * A^T)^T. The remaining dense times sparse matrix multiplications are supported by MKL. This approach introduces a few extra transpose operations on dense matrices. But thanks to your suggestion I found out that these operations can be done without actually changing the underlying data, by swapping the rows/columns and row/column major attributes.&lt;BR /&gt;&lt;BR /&gt;Of course it's possible to do all of this by yourself. What puzzles me is why such routines for sparse times dense matrix multiplication are missing in the MKL library. Perhaps for historical reasons the linear algebra packages offer only a minimal set of operations. But from a user's perspective this is far from ideal.&lt;/P&gt;</description>
    <pubDate>Thu, 31 Aug 2023 08:21:09 GMT</pubDate>
    <dc:creator>wiegerw</dc:creator>
    <dc:date>2023-08-31T08:21:09Z</dc:date>
    <item>
      <title>Dense-Sparse Matrix Multiplication routine instead if sparse-dense multiplication</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Dense-Sparse-Matrix-Multiplication-routine-instead-if-sparse/m-p/1166030#M28253</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have a problem where I need to multiply a dense matrix by a sparse matrix. The function "&lt;EM&gt;&lt;STRONG&gt;mkl_?csrmm&lt;/STRONG&gt;&lt;/EM&gt;" asks for the first matrix to be sparse and the second to be dense. But my case is opposite.&lt;/P&gt;

&lt;P&gt;Problem: &lt;STRONG&gt;C = A * B + C ,&amp;nbsp;&lt;/STRONG&gt;where A is dense and B is sparse.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I know that I can use "mkl_?csrmm" after taking the transpose of both matrices &lt;STRONG&gt;A &lt;/STRONG&gt;and &lt;STRONG&gt;B &lt;/STRONG&gt;but the transpose operation will be costly. Is there a better way or existing routine for dense-sparse matrix multiplication?&lt;/P&gt;

&lt;P&gt;I am beginner so kindly forgive for mistakes. Thanks in advance!&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Regards&lt;BR /&gt;
	Shailesh Tripathi&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 21:51:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Dense-Sparse-Matrix-Multiplication-routine-instead-if-sparse/m-p/1166030#M28253</guid>
      <dc:creator>Tripathi__Shailesh</dc:creator>
      <dc:date>2017-11-30T21:51:43Z</dc:date>
    </item>
    <item>
      <title>Hi Tripathi,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Dense-Sparse-Matrix-Multiplication-routine-instead-if-sparse/m-p/1166031#M28254</link>
      <description>&lt;P&gt;Hi Tripathi,&lt;/P&gt;

&lt;P&gt;I do not understand why you would like to be multiplied by sparse matrix. MKL only provide mm API that 1st matrix is sparse, and 2nd is dense. For the "&lt;SPAN class="option" style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;mkl_sparse_?_mm&lt;/SPAN&gt;" function, you can control transposition(A or A&lt;SUP&gt;T&lt;/SUP&gt;) and layout(row-major or col-major) for both A and B, that would be easier for you. Thanks.&lt;/P&gt;

&lt;P&gt;Best regards,&lt;BR /&gt;
	Fiona&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2017 03:45:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Dense-Sparse-Matrix-Multiplication-routine-instead-if-sparse/m-p/1166031#M28254</guid>
      <dc:creator>Zhen_Z_Intel</dc:creator>
      <dc:date>2017-12-01T03:45:31Z</dc:date>
    </item>
    <item>
      <title>Hello Fiona, </title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Dense-Sparse-Matrix-Multiplication-routine-instead-if-sparse/m-p/1166032#M28255</link>
      <description>&lt;P&gt;Hello Fiona,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks a lot you for your help. So you mean to say that if my dense matrix is row major but during the function call, if I treat it as column major (which means transpose), I would inherently get the product of two transpose (sparse also transposed). And the result matrix will also be returned as column major but it is basically the transpose of the row major. So basically, that would yield me what I want. Am I right?&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;

&lt;P&gt;Shailesh Tripathi&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2017 05:06:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Dense-Sparse-Matrix-Multiplication-routine-instead-if-sparse/m-p/1166032#M28255</guid>
      <dc:creator>Tripathi__Shailesh</dc:creator>
      <dc:date>2017-12-01T05:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: Dense-Sparse Matrix Multiplication routine instead if sparse-dense multiplication</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Dense-Sparse-Matrix-Multiplication-routine-instead-if-sparse/m-p/1519280#M35009</link>
      <description>&lt;P&gt;I ran into a similar problem. What I need to compute is C = A * B or C = A * B^T with A sparse and B, C dense. The solution I came up with is to rewrite these expressions into C = (B^T * A^T)^T and C = (B * A^T)^T. The remaining dense times sparse matrix multiplications are supported by MKL. This approach introduces a few extra transpose operations on dense matrices. But thanks to your suggestion I found out that these operations can be done without actually changing the underlying data, by swapping the rows/columns and row/column major attributes.&lt;BR /&gt;&lt;BR /&gt;Of course it's possible to do all of this by yourself. What puzzles me is why such routines for sparse times dense matrix multiplication are missing in the MKL library. Perhaps for historical reasons the linear algebra packages offer only a minimal set of operations. But from a user's perspective this is far from ideal.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 08:21:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Dense-Sparse-Matrix-Multiplication-routine-instead-if-sparse/m-p/1519280#M35009</guid>
      <dc:creator>wiegerw</dc:creator>
      <dc:date>2023-08-31T08:21:09Z</dc:date>
    </item>
  </channel>
</rss>

