<?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:Profiling MKL on Intel CPU shows sudden boost in performance in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Profiling-MKL-on-Intel-CPU-shows-sudden-boost-in-performance/m-p/1235612#M30473</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Could you please provide the&lt;B&gt; source code&lt;/B&gt; which you are using for benchmarking? Are you using FORTRAN / C?&lt;/P&gt;&lt;P&gt;Also, could you please provide the following details which will help us to investigate better:&lt;/P&gt;&lt;P&gt;System configuration(OS Version),&lt;/P&gt;&lt;P&gt;Memory configuration(RAM, Cache),&lt;/P&gt;&lt;P&gt;BLAS Version,&lt;/P&gt;&lt;P&gt;Compiler Version.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks are Regards&lt;/P&gt;&lt;P&gt;Goutham&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 09 Dec 2020 12:55:40 GMT</pubDate>
    <dc:creator>GouthamK_Intel</dc:creator>
    <dc:date>2020-12-09T12:55:40Z</dc:date>
    <item>
      <title>Profiling MKL on Intel CPU shows sudden boost in performance</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Profiling-MKL-on-Intel-CPU-shows-sudden-boost-in-performance/m-p/1235224#M30464</link>
      <description>&lt;P&gt;I am benchmarking the Intel MKL sgemm routine for input size M=10, N=500, K=64 on a dual-socket system with 2 Intel Xeon Gold 6140 CPUs and have noticed that sometimes the runtimes of a few consecutive sgemm calls is significantly lower than the calls before. I made sure that no other programs are executed while benchmarking. I have plotted the runtimes of 200 evaluations and you can see the drop around the 90th evaluation and again around the 180th:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="line_mkl_200.png" style="width: 400px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/14016i191206F6E7CD5681/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="line_mkl_200.png" alt="line_mkl_200.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Can you help me identify, what causes the sudden drop in runtime in the plot? This behavior makes it difficult for me to compare MKL's sgemm with other implementations, because I can never be sure if such a drop has happened or not. &lt;/P&gt;
&lt;P&gt;Many thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 15:42:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Profiling-MKL-on-Intel-CPU-shows-sudden-boost-in-performance/m-p/1235224#M30464</guid>
      <dc:creator>Richard_S_7</dc:creator>
      <dc:date>2020-12-08T15:42:01Z</dc:date>
    </item>
    <item>
      <title>Re:Profiling MKL on Intel CPU shows sudden boost in performance</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Profiling-MKL-on-Intel-CPU-shows-sudden-boost-in-performance/m-p/1235612#M30473</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Could you please provide the&lt;B&gt; source code&lt;/B&gt; which you are using for benchmarking? Are you using FORTRAN / C?&lt;/P&gt;&lt;P&gt;Also, could you please provide the following details which will help us to investigate better:&lt;/P&gt;&lt;P&gt;System configuration(OS Version),&lt;/P&gt;&lt;P&gt;Memory configuration(RAM, Cache),&lt;/P&gt;&lt;P&gt;BLAS Version,&lt;/P&gt;&lt;P&gt;Compiler Version.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks are Regards&lt;/P&gt;&lt;P&gt;Goutham&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Dec 2020 12:55:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Profiling-MKL-on-Intel-CPU-shows-sudden-boost-in-performance/m-p/1235612#M30473</guid>
      <dc:creator>GouthamK_Intel</dc:creator>
      <dc:date>2020-12-09T12:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: Re:Profiling MKL on Intel CPU shows sudden boost in performance</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Profiling-MKL-on-Intel-CPU-shows-sudden-boost-in-performance/m-p/1235629#M30475</link>
      <description>&lt;P&gt;Hi Goutham,&lt;/P&gt;
&lt;P&gt;many thanks for your reply. I am using the following C++ code for benchmarking:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;#include &amp;lt;mkl.h&amp;gt;
#include &amp;lt;iostream&amp;gt;
#include &amp;lt;algorithm&amp;gt;
#include &amp;lt;vector&amp;gt;
#include &amp;lt;chrono&amp;gt;

int main(int argc, const char **argv) {
    // input size
    const int M = 10;
    const int N = 500;
    const int K = 64;

    // initialize data
    auto a = (float*) mkl_malloc(M * K * sizeof(float), 64); for (int i = 0; i &amp;lt; M * K; ++i) a[i] = (i + 1) % 10;
    auto b = (float*) mkl_malloc(K * N * sizeof(float), 64); for (int i = 0; i &amp;lt; K * N; ++i) b[i] = (i + 1) % 10;
    auto c = (float*) mkl_malloc(M * N * sizeof(float), 64); for (int i = 0; i &amp;lt; M * N; ++i) c[i] = 0;

    // warm ups
    for (int i = 0; i &amp;lt; 10; ++i) {
        cblas_sgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans,
                    M, N, K,
                    1.0f,
                    a, K,
                    b, N,
                    0.0f,
                    c, N);
    }

    // evaluations
    std::vector&amp;lt;long long&amp;gt; evaluations;
    for (int i = 0; i &amp;lt; 2000; ++i) {
        auto start = std::chrono::high_resolution_clock::now();
        cblas_sgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans,
                    M, N, K,
                    1.0f,
                    a, K,
                    b, N,
                    0.0f,
                    c, N);
        auto end = std::chrono::high_resolution_clock::now();
        evaluations.push_back(std::chrono::duration_cast&amp;lt;std::chrono::nanoseconds&amp;gt;(end - start).count());
    }
    std::cout &amp;lt;&amp;lt; "min runtime: " &amp;lt;&amp;lt; *std::min_element(evaluations.begin(), evaluations.end()) &amp;lt;&amp;lt; "ns" &amp;lt;&amp;lt; std::endl;

    mkl_free(a);
    mkl_free(b);
    mkl_free(c);
}
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is my system:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;OS: CentOS Linux release 7.8.2003&lt;/LI&gt;
&lt;LI&gt;RAM: 192GB&lt;/LI&gt;
&lt;LI&gt;Compiler: icpc (ICC) 19.0.1.144 20181018&lt;/LI&gt;
&lt;LI&gt;BLAS: MKL 2020 Initial Release&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Best,&lt;BR /&gt;Richard&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 13:33:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Profiling-MKL-on-Intel-CPU-shows-sudden-boost-in-performance/m-p/1235629#M30475</guid>
      <dc:creator>Richard_S_7</dc:creator>
      <dc:date>2020-12-09T13:33:12Z</dc:date>
    </item>
    <item>
      <title>Re:Profiling MKL on Intel CPU shows sudden boost in performance</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Profiling-MKL-on-Intel-CPU-shows-sudden-boost-in-performance/m-p/1237779#M30507</link>
      <description>&lt;P&gt;Hi Richard,&lt;/P&gt;&lt;P&gt;Thanks for providing the source code and system environment details.&lt;/P&gt;&lt;P&gt;We tried to reproduce the same on our end with slightly different hardware on Ubuntu 18.04 OS but with same compiler version and MKL version. We didn't see any such sudden drops and spikes on our end. &lt;/P&gt;&lt;P&gt;However, we are escalating this thread to Subject Matter Experts who will guide you further. &lt;/P&gt;&lt;P&gt;Have a Good day!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Goutham&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 16 Dec 2020 06:24:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Profiling-MKL-on-Intel-CPU-shows-sudden-boost-in-performance/m-p/1237779#M30507</guid>
      <dc:creator>GouthamK_Intel</dc:creator>
      <dc:date>2020-12-16T06:24:19Z</dc:date>
    </item>
    <item>
      <title>Re:Profiling MKL on Intel CPU shows sudden boost in performance</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Profiling-MKL-on-Intel-CPU-shows-sudden-boost-in-performance/m-p/1238377#M30521</link>
      <description>&lt;P&gt;if you will run this code once again, will you see the same picture?&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Dec 2020 15:14:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Profiling-MKL-on-Intel-CPU-shows-sudden-boost-in-performance/m-p/1238377#M30521</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2020-12-17T15:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Re:Profiling MKL on Intel CPU shows sudden boost in performance</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Profiling-MKL-on-Intel-CPU-shows-sudden-boost-in-performance/m-p/1243104#M30604</link>
      <description>&lt;P&gt;Hi Gennady,&lt;/P&gt;
&lt;P&gt;sorry for the delay. Yes, the result is still the same.&lt;/P&gt;
&lt;P&gt;Best,&lt;BR /&gt;Richard&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2021 17:03:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Profiling-MKL-on-Intel-CPU-shows-sudden-boost-in-performance/m-p/1243104#M30604</guid>
      <dc:creator>Richard_S_7</dc:creator>
      <dc:date>2021-01-04T17:03:23Z</dc:date>
    </item>
    <item>
      <title>Re:Profiling MKL on Intel CPU shows sudden boost in performance</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Profiling-MKL-on-Intel-CPU-shows-sudden-boost-in-performance/m-p/1252285#M30801</link>
      <description>&lt;P&gt;Could you try to set the KMP Affinity masks as follows:&lt;/P&gt;&lt;P&gt;export KMP_AFFINITY=compact,1,0,granularity=fine&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;usually using this affinity help to get the&lt;SPAN style="background-color: var(--lwc-colorBackgroundInput,rgb(255, 255, 255)); color: var(--lwc-colorTextWeak,rgb(62, 62, 60)); font-size: var(--lwc-fontSize3,0.8125rem); font-family: var(--lwc-fontFamily,&amp;quot;Salesforce Sans&amp;quot;, Arial, sans-serif);"&gt; best performance on systems with multi-core processors by requiring that threads do not migrate from core to core. To do this, bind threads to the CPU cores by setting an affinity mask to threads. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 02 Feb 2021 07:42:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Profiling-MKL-on-Intel-CPU-shows-sudden-boost-in-performance/m-p/1252285#M30801</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2021-02-02T07:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: Re:Profiling MKL on Intel CPU shows sudden boost in performance</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Profiling-MKL-on-Intel-CPU-shows-sudden-boost-in-performance/m-p/1252746#M30827</link>
      <description>&lt;P&gt;Many thanks for still trying to solve this problem!&lt;/P&gt;
&lt;P&gt;I tried setting the affinity mask and it does indeed seem to improve the measurement:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="runtimes_10x500x64_kmp_affinity.png" style="width: 999px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/15094i729431EB905A2ED6/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="runtimes_10x500x64_kmp_affinity.png" alt="runtimes_10x500x64_kmp_affinity.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;It is pretty stable now for the first 200 evaluations as measured above, but I noticed it still drops off a bit at the end. Do you maybe have any insights what could be the cause of this?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 11:43:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Profiling-MKL-on-Intel-CPU-shows-sudden-boost-in-performance/m-p/1252746#M30827</guid>
      <dc:creator>Richard_S_7</dc:creator>
      <dc:date>2021-02-03T11:43:51Z</dc:date>
    </item>
    <item>
      <title>Re:Profiling MKL on Intel CPU shows sudden boost in performance</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Profiling-MKL-on-Intel-CPU-shows-sudden-boost-in-performance/m-p/1253117#M30833</link>
      <description>&lt;P&gt;I think it's OS's fluctuations.  &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Feb 2021 12:37:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Profiling-MKL-on-Intel-CPU-shows-sudden-boost-in-performance/m-p/1253117#M30833</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2021-02-04T12:37:54Z</dc:date>
    </item>
    <item>
      <title>Re:Profiling MKL on Intel CPU shows sudden boost in performance</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Profiling-MKL-on-Intel-CPU-shows-sudden-boost-in-performance/m-p/1253868#M30856</link>
      <description>&lt;P&gt;The issue is closing and we will no longer respond to this thread.&amp;nbsp;If you require additional assistance from Intel, please start a new thread.&amp;nbsp;Any further interaction in this thread will be considered community only.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 08 Feb 2021 03:30:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Profiling-MKL-on-Intel-CPU-shows-sudden-boost-in-performance/m-p/1253868#M30856</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2021-02-08T03:30:44Z</dc:date>
    </item>
  </channel>
</rss>

