<?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 Scalapack SVD gives negative singular values for large matrices in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Scalapack-SVD-gives-negative-singular-values-for-large-matrices/m-p/893325#M10587</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;We have been using Scalapack for a while on our Linux cluster of Pentium 4 PCs. We use pdgesvd in order to compute the generalized inverse of large matrices. The function is called from a C routine.&lt;BR /&gt;Up to matrix sizes of about 15 000 x 15 000, everything seems to work fine (i.e. the inverted matrix makes sense). For matrices 20 000x20 000 and up, we get the wrong answer. To diagnose the problem, we tried:&lt;BR /&gt;- Compute U^T # U -&amp;gt; Gives the identity matrix. Ok.&lt;BR /&gt;- Compute V^T # V -&amp;gt; Gives the identity matrix. Ok.&lt;BR /&gt;- Some singular values are negative (!). Not OK.&lt;BR /&gt;- U # sigma #V^T doesn't give (obviously) the original matrix, since some singular values are negative.&lt;BR /&gt;The content of the matrix doesn't seem to matter, as meaningful (for us) and random matrices seem to give the same (wrong) result.&lt;/P&gt;
&lt;P&gt;I would like to emphasize that "small" matrices are fine. So it excludes the obvious kind of bugs (but doesn't exclude with 100% certainty the possibility of memory corruption or something).&lt;/P&gt;
&lt;P&gt;I have tested the following:&lt;BR /&gt;- Scalapack 1.7.4 and 1.7.0&lt;BR /&gt;- gcc and intel compilers&lt;BR /&gt;- I have tested the intel scalapack and netlib scalapack libraries and both seem to be problematic.&lt;BR /&gt;- I have tried to take the absolute value of the eigenvalues (the negative values are in the same range in absolute value as the positive ones) but that doesn't help.&lt;BR /&gt;- Different block sizes and numbers of CPUs (64 is the standard value I used)&lt;BR /&gt;- Different matrix shapes: both 20 000 square and 20 000 x 40 000 fail.&lt;/P&gt;
&lt;P&gt;So my question is: is this behaviour "normal" ? Is it a bug in pdgesvd ? The propagation of numerical errors for large matrices in the particular algorithm used in pdgesvd ? Some other weird "feature" ?&lt;BR /&gt;Is there a way out of this ?&lt;/P&gt;
&lt;P&gt;Any suggestions will be appreciated !&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Miska&lt;BR /&gt;PS: Just in case, I have a little test code which demonstrates the effect. But in principle, just do the SVD of a 20kx20k random matrix and explore the singular values.&lt;BR /&gt;PPS: Using Linux 2.6.12-1.1381_FC3smp (fedora core 3)&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Dec 2006 21:22:41 GMT</pubDate>
    <dc:creator>Miska</dc:creator>
    <dc:date>2006-12-15T21:22:41Z</dc:date>
    <item>
      <title>Scalapack SVD gives negative singular values for large matrices</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Scalapack-SVD-gives-negative-singular-values-for-large-matrices/m-p/893325#M10587</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;We have been using Scalapack for a while on our Linux cluster of Pentium 4 PCs. We use pdgesvd in order to compute the generalized inverse of large matrices. The function is called from a C routine.&lt;BR /&gt;Up to matrix sizes of about 15 000 x 15 000, everything seems to work fine (i.e. the inverted matrix makes sense). For matrices 20 000x20 000 and up, we get the wrong answer. To diagnose the problem, we tried:&lt;BR /&gt;- Compute U^T # U -&amp;gt; Gives the identity matrix. Ok.&lt;BR /&gt;- Compute V^T # V -&amp;gt; Gives the identity matrix. Ok.&lt;BR /&gt;- Some singular values are negative (!). Not OK.&lt;BR /&gt;- U # sigma #V^T doesn't give (obviously) the original matrix, since some singular values are negative.&lt;BR /&gt;The content of the matrix doesn't seem to matter, as meaningful (for us) and random matrices seem to give the same (wrong) result.&lt;/P&gt;
&lt;P&gt;I would like to emphasize that "small" matrices are fine. So it excludes the obvious kind of bugs (but doesn't exclude with 100% certainty the possibility of memory corruption or something).&lt;/P&gt;
&lt;P&gt;I have tested the following:&lt;BR /&gt;- Scalapack 1.7.4 and 1.7.0&lt;BR /&gt;- gcc and intel compilers&lt;BR /&gt;- I have tested the intel scalapack and netlib scalapack libraries and both seem to be problematic.&lt;BR /&gt;- I have tried to take the absolute value of the eigenvalues (the negative values are in the same range in absolute value as the positive ones) but that doesn't help.&lt;BR /&gt;- Different block sizes and numbers of CPUs (64 is the standard value I used)&lt;BR /&gt;- Different matrix shapes: both 20 000 square and 20 000 x 40 000 fail.&lt;/P&gt;
&lt;P&gt;So my question is: is this behaviour "normal" ? Is it a bug in pdgesvd ? The propagation of numerical errors for large matrices in the particular algorithm used in pdgesvd ? Some other weird "feature" ?&lt;BR /&gt;Is there a way out of this ?&lt;/P&gt;
&lt;P&gt;Any suggestions will be appreciated !&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Miska&lt;BR /&gt;PS: Just in case, I have a little test code which demonstrates the effect. But in principle, just do the SVD of a 20kx20k random matrix and explore the singular values.&lt;BR /&gt;PPS: Using Linux 2.6.12-1.1381_FC3smp (fedora core 3)&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2006 21:22:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Scalapack-SVD-gives-negative-singular-values-for-large-matrices/m-p/893325#M10587</guid>
      <dc:creator>Miska</dc:creator>
      <dc:date>2006-12-15T21:22:41Z</dc:date>
    </item>
  </channel>
</rss>

