<?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 Thank your for providing that in Intel® Distribution for Python*</title>
    <link>https://community.intel.com/t5/Intel-Distribution-for-Python/scipy-linalg-eigh-and-numpy-linalg-eigh-calculates-different/m-p/1144697#M1016</link>
    <description>&lt;P&gt;Thank your for providing that information. I was able to locate the installer, and recreate your python installation.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Intel Distribution for Python is built on conda, so you can do `source ./intelpython2/bin/activate` to activate conda environment.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;After this `conda list` allows to query environment for version of installed packages and libraries, which was MKL 2018.0.3, running NumPy 1.14.3, and SciPy 1.0.1&lt;BR /&gt;&lt;BR /&gt;Running your script on `Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz` I see&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="brush:plain;"&gt;[15:17:28 vmlin03 eig_vs_eigh]$ ./intelpython2/bin/python2 test.py
0.0
(500, 500)
1.16100171441e-14

&lt;/PRE&gt;

&lt;P&gt;I used flags to try to reproduce your hardware behavior as well. Your processor supports sse4_2, and avx vector instructions.&lt;/P&gt;
&lt;P&gt;Using SSE4.2 produces expected result:&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:plain; class-name:dark;"&gt;[15:20:50 vmlin03 eig_vs_eigh]$ MKL_ENABLE_INSTRUCTIONS=SSE4_2 MKL_CBWR=SSE4_2 MKL_NUM_THREADS=1 ./intelpython2/bin/python2 test.py
0.0
(500, 500)
6.01311978086e-15
&lt;/PRE&gt;

&lt;P&gt;But using avx, there seem to be a fault:&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:plain; class-name:dark;"&gt;[15:21:07 vmlin03 eig_vs_eigh]$ MKL_ENABLE_INSTRUCTIONS=AVX MKL_CBWR=AVX MKL_NUM_THREADS=1 ./intelpython2/bin/python2 test.py
0.0
(500, 500)
0.237262552795
&lt;/PRE&gt;

&lt;P&gt;The problem with AVX path is still reproducible in the latest version of MKL. I will file a bug on your behalf.&lt;BR /&gt;&lt;BR /&gt;As a work-around, try using&amp;nbsp;MKL_ENABLE_INSTRUCTIONS=SSE4_2&lt;/P&gt;</description>
    <pubDate>Fri, 01 Feb 2019 21:36:25 GMT</pubDate>
    <dc:creator>Oleksandr_P_Intel</dc:creator>
    <dc:date>2019-02-01T21:36:25Z</dc:date>
    <item>
      <title>scipy.linalg.eigh and numpy.linalg.eigh calculates different eigenvalues for a symmetric matrix !</title>
      <link>https://community.intel.com/t5/Intel-Distribution-for-Python/scipy-linalg-eigh-and-numpy-linalg-eigh-calculates-different/m-p/1144694#M1013</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I am using Intel Python 2.7.14. This is what I get on my loading the python prompt :&lt;/P&gt;&lt;P&gt;Python 2.7.14 |Intel Corporation| (default, May&amp;nbsp; 4 2018, 04:27:35).&lt;BR /&gt;&lt;BR /&gt;I have come across a surprising case, where the eigenvalues of a symmetric 500 X 500 matrix calculated using scipy.linalg.eigh differs from the ones calculated using numpy.linalg.eigh. Further, the eigenvalues calculated by the scipy.linalg.eigh routine seem to be wrong, and two eigenvectors (v[:,449] and v[:,451] have NaN entries. The eigenvalues calculated using the numpy.linalg.eigh routine matches the results of the the general scipy.linalg.&lt;STRONG&gt;eig&lt;/STRONG&gt; routine as well. I would be grateful for any suggestions as to what might be going on.&lt;BR /&gt;&lt;BR /&gt;I have attached the code and the array(badmat.npy) in a zip file.&lt;BR /&gt;Here is the code:&lt;BR /&gt;########################################&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import numpy as np&lt;BR /&gt;import scipy.linalg as LA&lt;BR /&gt;import numpy.linalg as nLA&lt;/P&gt;&lt;P&gt;Hup=np.load("badmat.npy")&lt;BR /&gt;#Verify that Hup is symmetric,returns zero&lt;BR /&gt;print LA.norm(Hup-np.transpose(Hup))&lt;BR /&gt;print np.shape(Hup)&lt;/P&gt;&lt;P&gt;e,v=nLA.eigh(Hup)&lt;BR /&gt;e=np.real(e)&lt;BR /&gt;idx=np.argsort(e)&lt;BR /&gt;e=e[idx]&lt;BR /&gt;e2,v2=LA.eigh(Hup)&lt;BR /&gt;#this does not return zero&lt;BR /&gt;print LA.norm(e2-e)&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 13:46:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-for-Python/scipy-linalg-eigh-and-numpy-linalg-eigh-calculates-different/m-p/1144694#M1013</guid>
      <dc:creator>Biswas__Sounak</dc:creator>
      <dc:date>2019-01-31T13:46:42Z</dc:date>
    </item>
    <item>
      <title>Thank you for providing the</title>
      <link>https://community.intel.com/t5/Intel-Distribution-for-Python/scipy-linalg-eigh-and-numpy-linalg-eigh-calculates-different/m-p/1144695#M1014</link>
      <description>Thank you for providing the script and the dataset. 

Please provide output of &lt;CODE&gt;conda list --explicit&lt;/CODE&gt;, as well as  your processor type. If you are on Linux, these could be obtained with &lt;CODE&gt;lscpu&lt;/CODE&gt;.

Thank you,
Oleksandr</description>
      <pubDate>Thu, 31 Jan 2019 22:28:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-for-Python/scipy-linalg-eigh-and-numpy-linalg-eigh-calculates-different/m-p/1144695#M1014</guid>
      <dc:creator>Oleksandr_P_Intel</dc:creator>
      <dc:date>2019-01-31T22:28:25Z</dc:date>
    </item>
    <item>
      <title>Quote:Oleksandr P. (Intel)</title>
      <link>https://community.intel.com/t5/Intel-Distribution-for-Python/scipy-linalg-eigh-and-numpy-linalg-eigh-calculates-different/m-p/1144696#M1015</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Oleksandr P. (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for providing the script and the dataset.&lt;/P&gt;&lt;P&gt;Please provide output of conda list --explicit, as well as your processor type. If you are on Linux, these could be obtained with lscpu.&lt;/P&gt;&lt;P&gt;Thank you,&lt;BR /&gt;Oleksandr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; I do not have conda. My distribution is installed from the tarball&amp;nbsp;l_python2_pu3_2018.3.039.tgz (downloaded from intel), if that helps.&lt;BR /&gt;&lt;BR /&gt;Here is my lscpu output :&lt;/P&gt;&lt;P&gt;Architecture: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x86_64&lt;BR /&gt;CPU op-mode(s): &amp;nbsp; &amp;nbsp; &amp;nbsp;32-bit, 64-bit&lt;BR /&gt;Byte Order: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Little Endian&lt;BR /&gt;CPU(s): &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8&lt;BR /&gt;On-line CPU(s) list: 0-7&lt;BR /&gt;Thread(s) per core: &amp;nbsp;1&lt;BR /&gt;Core(s) per socket: &amp;nbsp;4&lt;BR /&gt;Socket(s): &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;BR /&gt;NUMA node(s): &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;BR /&gt;Vendor ID: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GenuineIntel&lt;BR /&gt;CPU family: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;6&lt;BR /&gt;Model: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 45&lt;BR /&gt;Model name: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Intel(R) Xeon(R) CPU E5-2609 0 @ 2.40GHz&lt;BR /&gt;Stepping: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7&lt;BR /&gt;CPU MHz: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1196.826&lt;BR /&gt;CPU max MHz: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2400.0000&lt;BR /&gt;CPU min MHz: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1200.0000&lt;BR /&gt;BogoMIPS: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4788.16&lt;BR /&gt;Virtualization: &amp;nbsp; &amp;nbsp; &amp;nbsp;VT-x&lt;BR /&gt;L1d cache: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 32K&lt;BR /&gt;L1i cache: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 32K&lt;BR /&gt;L2 cache: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;256K&lt;BR /&gt;L3 cache: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10240K&lt;BR /&gt;NUMA node0 CPU(s): &amp;nbsp; 0-3&lt;BR /&gt;NUMA node1 CPU(s): &amp;nbsp; 4-7&lt;BR /&gt;Flags: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm epb pti ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid xsaveopt dtherm arat pln pts&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 06:40:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-for-Python/scipy-linalg-eigh-and-numpy-linalg-eigh-calculates-different/m-p/1144696#M1015</guid>
      <dc:creator>Biswas__Sounak</dc:creator>
      <dc:date>2019-02-01T06:40:13Z</dc:date>
    </item>
    <item>
      <title>Thank your for providing that</title>
      <link>https://community.intel.com/t5/Intel-Distribution-for-Python/scipy-linalg-eigh-and-numpy-linalg-eigh-calculates-different/m-p/1144697#M1016</link>
      <description>&lt;P&gt;Thank your for providing that information. I was able to locate the installer, and recreate your python installation.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Intel Distribution for Python is built on conda, so you can do `source ./intelpython2/bin/activate` to activate conda environment.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;After this `conda list` allows to query environment for version of installed packages and libraries, which was MKL 2018.0.3, running NumPy 1.14.3, and SciPy 1.0.1&lt;BR /&gt;&lt;BR /&gt;Running your script on `Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz` I see&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="brush:plain;"&gt;[15:17:28 vmlin03 eig_vs_eigh]$ ./intelpython2/bin/python2 test.py
0.0
(500, 500)
1.16100171441e-14

&lt;/PRE&gt;

&lt;P&gt;I used flags to try to reproduce your hardware behavior as well. Your processor supports sse4_2, and avx vector instructions.&lt;/P&gt;
&lt;P&gt;Using SSE4.2 produces expected result:&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:plain; class-name:dark;"&gt;[15:20:50 vmlin03 eig_vs_eigh]$ MKL_ENABLE_INSTRUCTIONS=SSE4_2 MKL_CBWR=SSE4_2 MKL_NUM_THREADS=1 ./intelpython2/bin/python2 test.py
0.0
(500, 500)
6.01311978086e-15
&lt;/PRE&gt;

&lt;P&gt;But using avx, there seem to be a fault:&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:plain; class-name:dark;"&gt;[15:21:07 vmlin03 eig_vs_eigh]$ MKL_ENABLE_INSTRUCTIONS=AVX MKL_CBWR=AVX MKL_NUM_THREADS=1 ./intelpython2/bin/python2 test.py
0.0
(500, 500)
0.237262552795
&lt;/PRE&gt;

&lt;P&gt;The problem with AVX path is still reproducible in the latest version of MKL. I will file a bug on your behalf.&lt;BR /&gt;&lt;BR /&gt;As a work-around, try using&amp;nbsp;MKL_ENABLE_INSTRUCTIONS=SSE4_2&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 21:36:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-for-Python/scipy-linalg-eigh-and-numpy-linalg-eigh-calculates-different/m-p/1144697#M1016</guid>
      <dc:creator>Oleksandr_P_Intel</dc:creator>
      <dc:date>2019-02-01T21:36:25Z</dc:date>
    </item>
    <item>
      <title>Dear Oleksandr,</title>
      <link>https://community.intel.com/t5/Intel-Distribution-for-Python/scipy-linalg-eigh-and-numpy-linalg-eigh-calculates-different/m-p/1144698#M1017</link>
      <description>&lt;P&gt;Dear Oleksandr,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Thanks&amp;nbsp; a lot for taking a look at this. I will use SSE4.2 in all cases from now on.&lt;BR /&gt;-Sounak.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Feb 2019 07:13:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-for-Python/scipy-linalg-eigh-and-numpy-linalg-eigh-calculates-different/m-p/1144698#M1017</guid>
      <dc:creator>Biswas__Sounak</dc:creator>
      <dc:date>2019-02-02T07:13:56Z</dc:date>
    </item>
    <item>
      <title>It turns out that if</title>
      <link>https://community.intel.com/t5/Intel-Distribution-for-Python/scipy-linalg-eigh-and-numpy-linalg-eigh-calculates-different/m-p/1144699#M1018</link>
      <description>&lt;P&gt;It turns out that if eigenvalues produced by call to scipy.linalg.eigh are also sorted&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="brush:python; class-name:dark;"&gt;e2,v2=LA.eigh(Hup)

# idx2=np.argsort(e2)
# e2 = e[idx2]
&lt;/PRE&gt;

&lt;P&gt;Then the discrepancy goes away even when using AVX instruction set.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2020 20:24:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-for-Python/scipy-linalg-eigh-and-numpy-linalg-eigh-calculates-different/m-p/1144699#M1018</guid>
      <dc:creator>Oleksandr_P_Intel</dc:creator>
      <dc:date>2020-01-08T20:24:22Z</dc:date>
    </item>
    <item>
      <title>Sounak,</title>
      <link>https://community.intel.com/t5/Intel-Distribution-for-Python/scipy-linalg-eigh-and-numpy-linalg-eigh-calculates-different/m-p/1144700#M1019</link>
      <description>&lt;P&gt;Sounak,&lt;/P&gt;&lt;P&gt;Thank you for bringing this issue to our attention. Oleksandr was able to reproduce it.&amp;nbsp;The issue is quite specific and only appears for CBWR mode + AVX codepath + sequential mode, and only for very specific input matrices. This is fixed in MKL 2020 update 1 which releases in a few weeks.&lt;/P&gt;&lt;P&gt;Pamela&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 20:51:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-for-Python/scipy-linalg-eigh-and-numpy-linalg-eigh-calculates-different/m-p/1144700#M1019</guid>
      <dc:creator>Pamela_H_Intel</dc:creator>
      <dc:date>2020-03-13T20:51:00Z</dc:date>
    </item>
  </channel>
</rss>

