<?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 I used -mkl option, such as in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/SVD-multithreading-bug-in-MKL/m-p/938027#M14261</link>
    <description>&lt;P&gt;I used -mkl option, such as&lt;/P&gt;
&lt;P&gt;icpc main.cpp -o main -mkl -O3&lt;/P&gt;</description>
    <pubDate>Mon, 22 Apr 2013 09:08:04 GMT</pubDate>
    <dc:creator>YoungTaek_Oh</dc:creator>
    <dc:date>2013-04-22T09:08:04Z</dc:date>
    <item>
      <title>SVD multithreading bug in MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/SVD-multithreading-bug-in-MKL/m-p/938024#M14258</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;It seems like that mkl has a serious bug in ?gesvd.&lt;/P&gt;
&lt;P&gt;First, I tried to find singular values using the Armadillo library with mkl backends, but results are different according to MKL_NUM_THREADS.&lt;/P&gt;
&lt;P&gt;for example,&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;/* -*- mode: c++; -*- */&lt;BR /&gt;#include &amp;lt;armadillo&amp;gt;&lt;BR /&gt;&lt;BR /&gt;int main(int argc, char *argv[])&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; using namespace arma;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mat M = randu&amp;lt;mat&amp;gt;(957, 957);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mat U, V;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vec s;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; svd(U, s, V, M);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mat newM = U * diagmat(s) * V.t();&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("norm: %f\n", arma::norm(M - newM,2));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;BR /&gt;}&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;yields the following results&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;$ MKL_NUM_THREADS=1 ./main&lt;BR /&gt;norm: 0.000000&lt;BR /&gt;$ MKL_NUM_THREADS=2 ./main&lt;BR /&gt;norm: 0.000000&lt;BR /&gt;$ MKL_NUM_THREADS=3 ./main&lt;BR /&gt;norm: 0.000000&lt;BR /&gt;$ MKL_NUM_THREADS=4 ./main&lt;BR /&gt;norm: 0.000000&lt;BR /&gt;$ MKL_NUM_THREADS=5 ./main&lt;BR /&gt;norm: 371.303371&lt;BR /&gt;$ MKL_NUM_THREADS=6 ./main&lt;BR /&gt;norm: 138.622780&lt;BR /&gt;$ MKL_NUM_THREADS=7 ./main&lt;BR /&gt;norm: 138.622780&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I wrote another program that uses mkl only, but it was worse.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;/* -*- mode: c++; -*- */&lt;BR /&gt;#include &amp;lt;mkl.h&amp;gt;&lt;BR /&gt;#include &amp;lt;string.h&amp;gt;&lt;BR /&gt;#include &amp;lt;math.h&amp;gt;&lt;BR /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;BR /&gt;&lt;BR /&gt;int main(int argc, char *argv[])&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lapack_int M = 958;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; double *mat = new double[M * M];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; double *mat_orig = new double[M * M];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; double *s = new double&lt;M&gt;;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; double *diags = new double[M*M];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; double *U = new double[M * M];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; double *Vt = new double[M * M];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; double *superb = new double[M-2];&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i=0; i&amp;lt;M*M; ++i)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mat&lt;I&gt; = static_cast&amp;lt;double&amp;gt;(rand())/RAND_MAX;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; memcpy(mat_orig, mat, sizeof(double) * M * M);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LAPACKE_dgesvd(LAPACK_COL_MAJOR, 'a', 'a', M, M, mat, M, s, U, M, Vt, M, superb);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; memset(diags, 0, sizeof(double) * M * M);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i=0; i&amp;lt;M; ++i)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; diags[i * M + i] = s&lt;I&gt;;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, M, M, M, 1.0, U, M, diags, M, 0.0, mat, M);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, M, M, M, 1.0, mat, M, Vt, M, 0.0, U, M);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; double res = 0.0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i=0; i&amp;lt;M*M; ++i) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double t = mat_orig&lt;I&gt; - U&lt;I&gt;;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; res += (t*t);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("norm: %f\n", sqrt(res));&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; delete[] superb;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; delete[] Vt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; delete[] U;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; delete[] diags;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; delete[] s;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; delete[] mat_orig;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; delete[] mat;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;BR /&gt;}&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/M&gt;&lt;/P&gt;
&lt;P&gt;$ MKL_NUM_THREADS=1 ./main2&lt;BR /&gt;norm: 0.000000&lt;BR /&gt;$ MKL_NUM_THREADS=2 ./main2&lt;BR /&gt;norm: 0.000000&lt;BR /&gt;$ MKL_NUM_THREADS=3 ./main2&lt;BR /&gt;norm: 0.000000&lt;BR /&gt;$ MKL_NUM_THREADS=4 ./main2&lt;BR /&gt;norm: 0.000000&lt;BR /&gt;$ MKL_NUM_THREADS=5 ./main2&lt;BR /&gt;norm: 457.024091&lt;BR /&gt;$ MKL_NUM_THREADS=6 ./main2&lt;BR /&gt;Segmentation fault (core dumped)&lt;BR /&gt;$ MKL_NUM_THREADS=7 ./main2&lt;BR /&gt;Segmentation fault (core dumped)&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What's wrong with this? I'm using the lastest mkl + intel compiler (11.0 update 3) in ubuntu 12.04 LTS, intel i7 990X machine.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2013 05:33:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/SVD-multithreading-bug-in-MKL/m-p/938024#M14258</guid>
      <dc:creator>YoungTaek_Oh</dc:creator>
      <dc:date>2013-04-22T05:33:24Z</dc:date>
    </item>
    <item>
      <title>thanks for the report, we</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/SVD-multithreading-bug-in-MKL/m-p/938025#M14259</link>
      <description>&lt;P&gt;thanks for the report, we will check the problem on our side.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2013 08:43:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/SVD-multithreading-bug-in-MKL/m-p/938025#M14259</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2013-04-22T08:43:13Z</dc:date>
    </item>
    <item>
      <title>how did you link the test -</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/SVD-multithreading-bug-in-MKL/m-p/938026#M14260</link>
      <description>&lt;P&gt;how did you link the test - statically or dinamically? is that LP64 or ILP64 interfaces?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2013 08:45:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/SVD-multithreading-bug-in-MKL/m-p/938026#M14260</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2013-04-22T08:45:26Z</dc:date>
    </item>
    <item>
      <title>I used -mkl option, such as</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/SVD-multithreading-bug-in-MKL/m-p/938027#M14261</link>
      <description>&lt;P&gt;I used -mkl option, such as&lt;/P&gt;
&lt;P&gt;icpc main.cpp -o main -mkl -O3&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2013 09:08:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/SVD-multithreading-bug-in-MKL/m-p/938027#M14261</guid>
      <dc:creator>YoungTaek_Oh</dc:creator>
      <dc:date>2013-04-22T09:08:04Z</dc:date>
    </item>
    <item>
      <title>yes, I see the similar</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/SVD-multithreading-bug-in-MKL/m-p/938028#M14262</link>
      <description>&lt;P&gt;yes, I see the similar behavioir on my side with the latest 11.0 update 3.&lt;/P&gt;
&lt;P&gt;icc -mkl test.cpp.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;# export MKL_NUM_THREADS=1&lt;BR /&gt;# a.out &lt;BR /&gt;norm: 0.000000&lt;/P&gt;
&lt;P&gt;# export MKL_NUM_THREADS=2&lt;BR /&gt;# ./a.out &lt;BR /&gt;norm: 0.000000&lt;/P&gt;
&lt;P&gt;# export MKL_NUM_THREADS=3&lt;BR /&gt;# ./a.out &lt;BR /&gt;norm: 0.000000&lt;/P&gt;
&lt;P&gt;# export MKL_NUM_THREADS=4&lt;BR /&gt;# ./a.out &lt;BR /&gt; norm: 0.000000&lt;BR /&gt;# export MKL_NUM_THREADS=5&lt;BR /&gt;# ./a.out &lt;BR /&gt; norm: 457.024091&lt;BR /&gt;# export MKL_NUM_THREADS=6&lt;BR /&gt;# ./a.out &lt;BR /&gt; Segmentation fault (core dumped)&lt;/P&gt;
&lt;P&gt;We will digg the issue and will keep you updated as much as possible.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2013 09:33:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/SVD-multithreading-bug-in-MKL/m-p/938028#M14262</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2013-04-22T09:33:04Z</dc:date>
    </item>
    <item>
      <title>the issue is escalated to the</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/SVD-multithreading-bug-in-MKL/m-p/938029#M14263</link>
      <description>&lt;P&gt;the issue is escalated to the owner of SVD. here is the number of the issue for your reference : DPD200335246&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2013 09:52:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/SVD-multithreading-bug-in-MKL/m-p/938029#M14263</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2013-04-22T09:52:00Z</dc:date>
    </item>
    <item>
      <title>the fix of the problem</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/SVD-multithreading-bug-in-MKL/m-p/938030#M14264</link>
      <description>&lt;P&gt;the fix of the problem available in version 11.0 update4 which released the last week.&lt;/P&gt;
&lt;P&gt;please check the problem and let us know the results.&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jun 2013 15:58:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/SVD-multithreading-bug-in-MKL/m-p/938030#M14264</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2013-06-01T15:58:25Z</dc:date>
    </item>
    <item>
      <title>are there any updates regard</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/SVD-multithreading-bug-in-MKL/m-p/938031#M14265</link>
      <description>&lt;P&gt;are there any updates regard to this issue?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2013 09:17:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/SVD-multithreading-bug-in-MKL/m-p/938031#M14265</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2013-07-01T09:17:02Z</dc:date>
    </item>
    <item>
      <title>Gennady,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/SVD-multithreading-bug-in-MKL/m-p/938032#M14266</link>
      <description>&lt;P&gt;Gennady,&lt;/P&gt;
&lt;P&gt;I am reading this thread rather late, and I find it slightly puzzling. I cannot comment about the Armadillo library, since I don't have it. However, the OP's straight MKL example has a &lt;STRONG&gt;user error&lt;/STRONG&gt;:&lt;/P&gt;
&lt;P&gt;[cpp]double *superb = new double[M-2];[/cpp]&lt;/P&gt;
&lt;P&gt;should be&lt;/P&gt;
&lt;P&gt;[cpp]double *superb = new double[M-1];[/cpp]&lt;/P&gt;
&lt;P&gt;since the documentation states "On exit,&amp;nbsp;superb(0:min(m,n)-2)&amp;nbsp;contains...".&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This error may, of course, be additional to and independent of the suspected threading bug in MKL but, even with the latest MKL update, it caused seg-faults on Windows because the array is under-allocated..&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2013 15:00:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/SVD-multithreading-bug-in-MKL/m-p/938032#M14266</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2013-07-01T15:00:00Z</dc:date>
    </item>
    <item>
      <title>mecej, thanks a lot. this is</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/SVD-multithreading-bug-in-MKL/m-p/938033#M14267</link>
      <description>&lt;P&gt;mecej, thanks a lot. this is an additional probem. You absolutely right. The test is not correct and we didn't check this example after update 4 has been released.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2013 18:03:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/SVD-multithreading-bug-in-MKL/m-p/938033#M14267</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2013-07-02T18:03:54Z</dc:date>
    </item>
    <item>
      <title>I am still observing this</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/SVD-multithreading-bug-in-MKL/m-p/938034#M14268</link>
      <description>&lt;P&gt;I am still observing this problem 11.0 update 5. Can anybody else confirm this. Is this being worked on?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2013 14:03:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/SVD-multithreading-bug-in-MKL/m-p/938034#M14268</guid>
      <dc:creator>Michael_H_5</dc:creator>
      <dc:date>2013-07-25T14:03:24Z</dc:date>
    </item>
    <item>
      <title>Michael, </title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/SVD-multithreading-bug-in-MKL/m-p/938035#M14269</link>
      <description>&lt;P&gt;Michael,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is surprise for us. Do you use the example from the original post from&amp;nbsp;&lt;A href="http://software.intel.com/en-us/user/812145"&gt;YoungTaek O&lt;/A&gt;? if not then pls give us the exact example to check the problem on our side.&lt;/P&gt;
&lt;P&gt;It would be useful to see the info about version of MKL and Processor type which have been used.&lt;/P&gt;
&lt;P&gt;int version(void) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; MKLVersion Version;&lt;BR /&gt;&amp;nbsp; mkl_get_version(&amp;amp;Version);&lt;BR /&gt;&amp;nbsp; printf("Major version: %d\n",Version.MajorVersion);&lt;BR /&gt;&amp;nbsp; printf("Minor version: %d\n",Version.MinorVersion);&lt;BR /&gt;&amp;nbsp; printf("Update version: %d\n",Version.UpdateVersion);&lt;BR /&gt;&amp;nbsp; printf("Product status: %s\n",Version.ProductStatus);&lt;BR /&gt;&amp;nbsp; printf("Build: %s\n",Version.Build);&lt;BR /&gt;&amp;nbsp; printf("Platform: %s\n",Version.Platform);&lt;BR /&gt;&amp;nbsp; printf("Processor optimization: %s\n",Version.Processor);&lt;BR /&gt;&amp;nbsp; return 0;&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2013 17:55:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/SVD-multithreading-bug-in-MKL/m-p/938035#M14269</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2013-08-27T17:55:39Z</dc:date>
    </item>
  </channel>
</rss>

