<?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 mkl_sparse_d_svd running unexpectedly slowly for large problems in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-sparse-d-svd-running-unexpectedly-slowly-for-large-problems/m-p/1706992#M37282</link>
    <description>&lt;P&gt;I've modified the&amp;nbsp;mkl_sparse_d_svd example from mkl 2023.0.0 to use a much larger matrix and it's running surprisingly slowly on my machine compared to running the same problem in python using&amp;nbsp;svds from scipy.sparse.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone see what I'm doing wrong or confirm that this same example is also slow for them?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code in the zip file is a basically unchanged copy of the mkl_sparse_d_svd.c example except with 4Mb of arrays declared at the top.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The differences to the original example are the matrix shape:&lt;/P&gt;&lt;P&gt;descr.type = SPARSE_MATRIX_TYPE_SYMMETRIC;&lt;BR /&gt;descr.mode = SPARSE_FILL_MODE_UPPER;&lt;BR /&gt;descr.diag = SPARSE_DIAG_NON_UNIT;&lt;BR /&gt;&lt;BR /&gt;and the options are now:&lt;BR /&gt;pm[1] = tol;&lt;BR /&gt;pm[2] = 2;&lt;BR /&gt;pm[6] = compute_vectors;&lt;BR /&gt;pm[7] = 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the number of singular values to compute is declared as a #define at the top:&lt;BR /&gt;#define xK0 25&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I compiled it without any special options and linked with&amp;nbsp;/STACK:50000000 against&amp;nbsp;mkl_intel_lp64_dll.lib mkl_intel_thread_dll.lib mkl_core_dll.lib&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The runtime for me is several minutes compared to seconds running the same matrix through svds, but they do report the same singular values at the end.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apologies for the horrific example code, it was just the easiest way to reproduce a problem I'm having locally in code I cant easily put here.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Aug 2025 17:32:59 GMT</pubDate>
    <dc:creator>ChrisCX</dc:creator>
    <dc:date>2025-08-01T17:32:59Z</dc:date>
    <item>
      <title>mkl_sparse_d_svd running unexpectedly slowly for large problems</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-sparse-d-svd-running-unexpectedly-slowly-for-large-problems/m-p/1706992#M37282</link>
      <description>&lt;P&gt;I've modified the&amp;nbsp;mkl_sparse_d_svd example from mkl 2023.0.0 to use a much larger matrix and it's running surprisingly slowly on my machine compared to running the same problem in python using&amp;nbsp;svds from scipy.sparse.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone see what I'm doing wrong or confirm that this same example is also slow for them?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code in the zip file is a basically unchanged copy of the mkl_sparse_d_svd.c example except with 4Mb of arrays declared at the top.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The differences to the original example are the matrix shape:&lt;/P&gt;&lt;P&gt;descr.type = SPARSE_MATRIX_TYPE_SYMMETRIC;&lt;BR /&gt;descr.mode = SPARSE_FILL_MODE_UPPER;&lt;BR /&gt;descr.diag = SPARSE_DIAG_NON_UNIT;&lt;BR /&gt;&lt;BR /&gt;and the options are now:&lt;BR /&gt;pm[1] = tol;&lt;BR /&gt;pm[2] = 2;&lt;BR /&gt;pm[6] = compute_vectors;&lt;BR /&gt;pm[7] = 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the number of singular values to compute is declared as a #define at the top:&lt;BR /&gt;#define xK0 25&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I compiled it without any special options and linked with&amp;nbsp;/STACK:50000000 against&amp;nbsp;mkl_intel_lp64_dll.lib mkl_intel_thread_dll.lib mkl_core_dll.lib&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The runtime for me is several minutes compared to seconds running the same matrix through svds, but they do report the same singular values at the end.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apologies for the horrific example code, it was just the easiest way to reproduce a problem I'm having locally in code I cant easily put here.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2025 17:32:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-sparse-d-svd-running-unexpectedly-slowly-for-large-problems/m-p/1706992#M37282</guid>
      <dc:creator>ChrisCX</dc:creator>
      <dc:date>2025-08-01T17:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: mkl_sparse_d_svd running unexpectedly slowly for large problems</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-sparse-d-svd-running-unexpectedly-slowly-for-large-problems/m-p/1718931#M37354</link>
      <description>&lt;P class=""&gt;Hi,&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Thank you for posting in the oneMKL forum. I'd suggest to use&amp;nbsp;&lt;SPAN&gt;pm&lt;/SPAN&gt;&lt;SPAN class=""&gt;[2]&lt;/SPAN&gt;&lt;SPAN&gt;=1 (the Krylov-Schur method) for your case. It works very fast. There is a minor mistake in your reproducer which might cause segmentation fault.&amp;nbsp; The line&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;double Y&lt;/SPAN&gt;&lt;SPAN class=""&gt;[3*3]&lt;/SPAN&gt;&lt;SPAN&gt;;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;should be changed to&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;double Y&lt;/SPAN&gt;&lt;SPAN class=""&gt;[25*25]&lt;/SPAN&gt;&lt;SPAN&gt;;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;or&amp;nbsp; the array Y should be allocated just after finishing mkl_sparse_d_svd.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;The algorithm for pm[2]=2 is recommended&amp;nbsp; mostly&amp;nbsp; for cases where matrix-vector operations&amp;nbsp; are not expensive and spectrum is not too irregularly distributed.&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;Thanks&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Sep 2025 23:20:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-sparse-d-svd-running-unexpectedly-slowly-for-large-problems/m-p/1718931#M37354</guid>
      <dc:creator>Sergey_K_Intel1</dc:creator>
      <dc:date>2025-09-24T23:20:22Z</dc:date>
    </item>
  </channel>
</rss>

