<?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 dgemm: slow performance  in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dgemm-slow-performance/m-p/928116#M13518</link>
    <description>&lt;P&gt;I am using&amp;nbsp;dgemm function from Math Kernel Library in my FORTRAN source code to do the following matrix calculation: &lt;FONT color="#234600"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;X = A - transpose(B) *C&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;A is 400*400 &lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;de&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;nse matrix, B is 10000*400 sparse matrix and C is 10000*400 matrix.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;CALL dgemm('T', 'N', &lt;/SPAN&gt;400&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;, &lt;/SPAN&gt;400&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;, &lt;/SPAN&gt;10000&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;, -1.d0,&amp;nbsp;. B, &lt;/SPAN&gt;10000&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;, C, &lt;/SPAN&gt;10000&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;, 1.d0, A, &lt;/SPAN&gt;400&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;This operation takes about 3.5 seconds! which is a lot in my program! 1.&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Is 3.5 seconds a reasonable amount of time for this operation?&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;2. Is there any way to speed up the process? &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;I am using a dell computer which has Intel Core 2 Duo CPU and my MKL version is 10.0.1 which is relatively old. My last question is if I switch to the most recent MKL can I see significant improvement in the performance for matrix multiplication?&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Dec 2013 20:18:43 GMT</pubDate>
    <dc:creator>vahid_s_</dc:creator>
    <dc:date>2013-12-04T20:18:43Z</dc:date>
    <item>
      <title>dgemm: slow performance</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dgemm-slow-performance/m-p/928116#M13518</link>
      <description>&lt;P&gt;I am using&amp;nbsp;dgemm function from Math Kernel Library in my FORTRAN source code to do the following matrix calculation: &lt;FONT color="#234600"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;X = A - transpose(B) *C&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;A is 400*400 &lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;de&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;nse matrix, B is 10000*400 sparse matrix and C is 10000*400 matrix.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;CALL dgemm('T', 'N', &lt;/SPAN&gt;400&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;, &lt;/SPAN&gt;400&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;, &lt;/SPAN&gt;10000&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;, -1.d0,&amp;nbsp;. B, &lt;/SPAN&gt;10000&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;, C, &lt;/SPAN&gt;10000&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;, 1.d0, A, &lt;/SPAN&gt;400&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;This operation takes about 3.5 seconds! which is a lot in my program! 1.&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Is 3.5 seconds a reasonable amount of time for this operation?&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;2. Is there any way to speed up the process? &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;I am using a dell computer which has Intel Core 2 Duo CPU and my MKL version is 10.0.1 which is relatively old. My last question is if I switch to the most recent MKL can I see significant improvement in the performance for matrix multiplication?&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2013 20:18:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dgemm-slow-performance/m-p/928116#M13518</guid>
      <dc:creator>vahid_s_</dc:creator>
      <dc:date>2013-12-04T20:18:43Z</dc:date>
    </item>
    <item>
      <title>A few suggestions:</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dgemm-slow-performance/m-p/928117#M13519</link>
      <description>&lt;P&gt;A few suggestions:&lt;/P&gt;

&lt;UL&gt;
	&lt;LI&gt;MKL 10.0.1 is 5 years old. Please upgrade to the latest version (MKL 11.1.1) and you should see significant performance improvement across the board.&lt;/LI&gt;
	&lt;LI&gt;If 'B' is sparse then why you use DGEMM to do transpose(B)*C? Do you actually store 'B' with the full-storage format? Can you try a sparse matrix storage format (e.g. CSR, BSR, COO, etc.) for B and call one of the sparse-matrix matrix multiply functions? Find more details about these functions here: &lt;A href="http://software.intel.com/en-us/node/468534" target="_blank"&gt;http://software.intel.com/en-us/node/468534&lt;/A&gt;&lt;/LI&gt;
	&lt;LI&gt;Are you using sequential MKL or parallel MKL? How many threads do you use? Is the memory space for input data (A, B and C) aligned? Follow this link for performance tips: &lt;A href="http://software.intel.com/en-us/node/438624" target="_blank"&gt;http://software.intel.com/en-us/node/438624&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2013 22:44:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dgemm-slow-performance/m-p/928117#M13519</guid>
      <dc:creator>Zhang_Z_Intel</dc:creator>
      <dc:date>2013-12-04T22:44:43Z</dc:date>
    </item>
    <item>
      <title>Hi Zhang Z,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dgemm-slow-performance/m-p/928118#M13520</link>
      <description>&lt;P&gt;Hi Zhang Z,&lt;/P&gt;

&lt;P&gt;Thanks for your reply and good suggestions.&lt;/P&gt;

&lt;P&gt;I tried both sequential and parallel forms. But I could not see significant improvement in performance.&lt;/P&gt;

&lt;P&gt;I also change number of threads from default which is maximum number of threads possible to 1 thread. But nothing significant happened!&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I store B as full-storage format!&amp;nbsp;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;I am definitely going to try the sparse multiply function. &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;I found out that the speed is a direct function of number of columns of C matrix&amp;nbsp;(I changed number of rows too but it was not &amp;nbsp;really major factor). With number of columns equal to 11000 I get the following results:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Number of rows = 363, &amp;nbsp; Time=3.34 seconds&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Number of rows = 120 &amp;nbsp; &amp;nbsp;Time=0.3 seconds&lt;/P&gt;

&lt;P&gt;Number of rows = 30 &amp;nbsp; &amp;nbsp; Time=0.016 seconds​&lt;/P&gt;

&lt;P&gt;Would you please explain me why timing is so different based on number of rows? Does it make sense for you? Is the new version of MKL improved in this part?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2013 02:26:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dgemm-slow-performance/m-p/928118#M13520</guid>
      <dc:creator>vahid_s_</dc:creator>
      <dc:date>2013-12-06T02:26:57Z</dc:date>
    </item>
    <item>
      <title>First, please try the latest</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dgemm-slow-performance/m-p/928119#M13521</link>
      <description>&lt;P&gt;First, please try the latest MKL 11.1.1. Second, if you still see slow performance then post your test code here to facilitate further investigation and discussion.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2013 17:40:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dgemm-slow-performance/m-p/928119#M13521</guid>
      <dc:creator>Zhang_Z_Intel</dc:creator>
      <dc:date>2013-12-06T17:40:30Z</dc:date>
    </item>
  </channel>
</rss>

