<?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 Re: MKL library scans available cores - touching nodes it absolutely shouldn't in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-library-scans-available-cores-touching-nodes-it-absolutely/m-p/1294901#M31632</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Since we didn't hear back from you, we are closing this thread for now. If you require any additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Jul 2021 00:26:45 GMT</pubDate>
    <dc:creator>Ruqiu_C_Intel</dc:creator>
    <dc:date>2021-07-01T00:26:45Z</dc:date>
    <item>
      <title>MKL library scans available cores - touching nodes it absolutely shouldn't</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-library-scans-available-cores-touching-nodes-it-absolutely/m-p/1284598#M31382</link>
      <description>&lt;P&gt;I'm running the following with numpy/mkl 2019. Environment is&amp;nbsp;&lt;/P&gt;
&lt;PRE class="c-mrkdwn__pre" data-stringify-type="pre"&gt;&lt;FONT face="courier new,courier" size="2"&gt;"KMP_AFFINITY=verbose" MKL_NUM_THREADS=1 MKL_DOMAIN_NUM_THREADS="MKL_BLAS=1" MKL_DYNAMIC=FALSE OMP_D&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;YNAMIC=FALSE OMP_NUM_THREADS=1 &lt;SPAN&gt;MKL_VERBOSE=1&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;PRE class="c-mrkdwn__pre" data-stringify-type="pre"&gt;&lt;FONT face="courier new,courier" size="2"&gt;strace -e trace=sched_setaffinity  taskset -cp 2-3     $(which python) -c 'import numpy as np; a = np.random.normal(size=(1000,1000)); np.dot(a, a)' &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;sched_setaffinity(0, 16, {c, 0})        = 0&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Numpy + Intel(R) MKL: THREADING LAYER: (null)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Numpy + Intel(R) MKL: setting Intel(R) MKL to use INTEL OpenMP runtime&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Numpy + Intel(R) MKL: preloading libiomp5.so runtime&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;sched_setaffinity(0, 16, 0)             = -1 EFAULT (Bad address)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;OMP: Info #211: KMP_AFFINITY: decoding x2APIC ids.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;sched_setaffinity(0, 16, {4, 0})        = 0&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;sched_setaffinity(0, 16, {8, 0})        = 0&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;sched_setaffinity(0, 16, {c, 0})        = 0&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;OMP: Info #209: KMP_AFFINITY: Affinity capable, using global cpuid leaf 11 info&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;OMP: Info #154: KMP_AFFINITY: &lt;STRONG&gt;Initial OS proc set respected: {2,3}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;OMP: Info #156: KMP_AFFINITY: 2 available OS procs&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;OMP: Info #157: KMP_AFFINITY: Uniform topology&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;OMP: Info #179: KMP_AFFINITY: 1 packages x 2 cores/pkg x 1 threads/core (2 total cores)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;OMP: Info #249: KMP_AFFINITY: pid 3521664 tid 3521664 thread 0 bound to OS proc set {2,3}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;sched_setaffinity(0, 16, {c, 0})        = 0&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;sched_setaffinity(0, 16, {c, 0})        = 0&lt;/FONT&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" size="2"&gt;sched_setaffinity(0, 16, {1, 0})        = 0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" size="2"&gt;sched_setaffinity(0, 16, {2, 0})        = 0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;sched_setaffinity(0, 16, {c, 0})        = 0&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;MKL_VERBOSE Intel(R) MKL 2019.0 Update 5 Product build 20190808 for Intel(R) 64 architecture Intel(R) Advanced Vector Extensions (Intel(R) AVX) enabled processors, Lnx 3.00GHz lp64 intel_thread&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;MKL_VERBOSE DGEMM(N,N,1000,1000,1000,0x7ffd61ee7270,0x7faf55733010,1000,0x7faf55733010,1000,0x7ffd61ee7278,0x7faf54f91010,1000) 92.50ms CNR:OFF Dyn:0 FastMM:1 TID:0  NThr:1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;+++ exited with 0 +++&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;The problem is that MKL does not seem to be respecting the original taskset (only cores 2 and 3). After declaring that it does, it also probes cores 0 and 1 (with masks 1 and 2, respectively).&lt;BR /&gt;&lt;BR /&gt;Is this a big deal? I can imagine that in most circumstances it is not. But what if you had a realtime process on either core 0 or 1? Well, if the calling process had regular priority, it never gets scheduled, so it hangs.&lt;BR /&gt;&lt;BR /&gt;Please advise.&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;/P&gt;
&lt;P&gt;Vlad&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 May 2021 19:46:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-library-scans-available-cores-touching-nodes-it-absolutely/m-p/1284598#M31382</guid>
      <dc:creator>VladP</dc:creator>
      <dc:date>2021-05-25T19:46:07Z</dc:date>
    </item>
    <item>
      <title>Re:MKL library scans available cores - touching nodes it absolutely shouldn't</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-library-scans-available-cores-touching-nodes-it-absolutely/m-p/1284803#M31383</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks for reporting your issue. We will try this at our end and get back to you with an update.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rahul&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 26 May 2021 11:16:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-library-scans-available-cores-touching-nodes-it-absolutely/m-p/1284803#M31383</guid>
      <dc:creator>RahulV_intel</dc:creator>
      <dc:date>2021-05-26T11:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: MKL library scans available cores - touching nodes it absolutely shouldn't</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-library-scans-available-cores-touching-nodes-it-absolutely/m-p/1287430#M31454</link>
      <description>&lt;P&gt;Hi Vlad,&lt;/P&gt;
&lt;P&gt;The issue might be python itself&amp;nbsp; or openMP. Inside MKL we don’t have any unique mechanism for threading, we just rely on openMP. MKL printed that it got only 1 thread (MKL_BLAS=1) so it would use only 1 thread. Also MKL verbose info is printed before going to the execution of the MKL kernels.&lt;/P&gt;
&lt;P&gt;If you remove np.dot and keep everything else, you will see the&amp;nbsp;sched_setaffinity(0, 16, [0])&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0 and&amp;nbsp;sched_setaffinity(0, 16, [1])&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0 still exist. So we can confirm that the issue is not relate to MKL. You can try it in your site.&lt;/P&gt;
&lt;P&gt;Here is my logs:&lt;/P&gt;
&lt;P&gt;# strace -e trace=sched_setaffinity&amp;nbsp; taskset -c 2-3 $(which python) -c "import numpy as np; a = np.random.normal(size=(1000,1000)); "&lt;/P&gt;
&lt;P&gt;sched_setaffinity(0, 16, [2, 3])&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0&lt;/P&gt;
&lt;P&gt;mkl-service + Intel(R) MKL: THREADING LAYER: (null)&lt;/P&gt;
&lt;P&gt;mkl-service + Intel(R) MKL: setting Intel(R) MKL to use INTEL OpenMP runtime&lt;/P&gt;
&lt;P&gt;mkl-service + Intel(R) MKL: preloading libiomp5.so runtime&lt;/P&gt;
&lt;P&gt;OMP: Info #155: KMP_AFFINITY: Initial OS proc set respected: 2,3&lt;/P&gt;
&lt;P&gt;OMP: Info #216: KMP_AFFINITY: decoding x2APIC ids.&lt;/P&gt;
&lt;P&gt;sched_setaffinity(0, 16, [2])&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0&lt;/P&gt;
&lt;P&gt;sched_setaffinity(0, 16, [3])&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0&lt;/P&gt;
&lt;P&gt;sched_setaffinity(0, 16, [2, 3])&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0&lt;/P&gt;
&lt;P&gt;OMP: Info #157: KMP_AFFINITY: 2 available OS procs&lt;/P&gt;
&lt;P&gt;OMP: Info #158: KMP_AFFINITY: Uniform topology&lt;/P&gt;
&lt;P&gt;OMP: Info #287: KMP_AFFINITY: topology layer "LL cache" is equivalent to "socket".&lt;/P&gt;
&lt;P&gt;OMP: Info #287: KMP_AFFINITY: topology layer "L3 cache" is equivalent to "socket".&lt;/P&gt;
&lt;P&gt;OMP: Info #287: KMP_AFFINITY: topology layer "L2 cache" is equivalent to "core".&lt;/P&gt;
&lt;P&gt;OMP: Info #287: KMP_AFFINITY: topology layer "L1 cache" is equivalent to "core".&lt;/P&gt;
&lt;P&gt;OMP: Info #192: KMP_AFFINITY: 1 socket x 2 cores/socket x 1 thread/core (2 total cores)&lt;/P&gt;
&lt;P&gt;OMP: Info #218: KMP_AFFINITY: OS proc to physical thread map:&lt;/P&gt;
&lt;P&gt;OMP: Info #172: KMP_AFFINITY: OS proc 2 maps to socket 0 core 2 thread 0&lt;/P&gt;
&lt;P&gt;OMP: Info #172: KMP_AFFINITY: OS proc 3 maps to socket 0 core 3 thread 0&lt;/P&gt;
&lt;P&gt;OMP: Info #254: KMP_AFFINITY: pid 76728 tid 76728 thread 0 bound to OS proc set 2,3&lt;/P&gt;
&lt;P&gt;sched_setaffinity(0, 16, [2, 3])&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0&lt;/P&gt;
&lt;P&gt;sched_setaffinity(0, 16, [2, 3])&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0&lt;/P&gt;
&lt;P&gt;sched_setaffinity(0, 16, [0])&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0&lt;/P&gt;
&lt;P&gt;sched_setaffinity(0, 16, [1])&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0&lt;/P&gt;
&lt;P&gt;sched_setaffinity(0, 16, [2, 3])&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0&lt;/P&gt;
&lt;P&gt;MKL_VERBOSE Intel(R) MKL 2021.0 Update 2 Product build 20210312 for Intel(R) 64 architecture Intel(R) Advanced Vector Extensions 512 (Intel(R) AVX-512) with support of Intel(R) Deep Learning Boost (Intel(R) DL Boost), Lnx 2.10GHz lp64 intel_thread&lt;/P&gt;
&lt;P&gt;MKL_VERBOSE SDOT(2,0x556a2f4621b0,1,0x556a2f4621b0,1) 1.86ms CNR:OFF Dyn:1 FastMM:1 TID:0&amp;nbsp; NThr:1&lt;/P&gt;
&lt;P&gt;+++ exited with 0 +++&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Ruqiu&lt;/P&gt;</description>
      <pubDate>Sat, 05 Jun 2021 06:22:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-library-scans-available-cores-touching-nodes-it-absolutely/m-p/1287430#M31454</guid>
      <dc:creator>Ruqiu_C_Intel</dc:creator>
      <dc:date>2021-06-05T06:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: MKL library scans available cores - touching nodes it absolutely shouldn't</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-library-scans-available-cores-touching-nodes-it-absolutely/m-p/1294901#M31632</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Since we didn't hear back from you, we are closing this thread for now. If you require any additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 00:26:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-library-scans-available-cores-touching-nodes-it-absolutely/m-p/1294901#M31632</guid>
      <dc:creator>Ruqiu_C_Intel</dc:creator>
      <dc:date>2021-07-01T00:26:45Z</dc:date>
    </item>
  </channel>
</rss>

