<?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 Welcome to the wonderful in Software Tuning, Performance Optimization &amp; Platform Monitoring</title>
    <link>https://community.intel.com/t5/Software-Tuning-Performance/Counting-number-of-uops/m-p/1101622#M5871</link>
    <description>&lt;P&gt;Welcome to the wonderful world of inconsistent product documentation!&lt;/P&gt;

&lt;P&gt;I found my notes on the Haswell overcounting bug at &lt;A href="http://www.agner.org/optimize/blog/read.php?i=452&amp;amp;v=t&amp;nbsp;&amp;nbsp;" target="_blank"&gt;http://www.agner.org/optimize/blog/read.php?i=452&amp;amp;v=t&amp;nbsp;&amp;nbsp;&lt;/A&gt;;&lt;/P&gt;

&lt;P&gt;To summarize:&lt;/P&gt;

&lt;UL&gt;
	&lt;LI&gt;The loop clearly had 10 instructions and (using Agner's counts) 12 micro-ops.&lt;/LI&gt;
	&lt;LI&gt;The performance counters consistently reported 12 retired instructions and 14 UOPS_RETIRED.&lt;/LI&gt;
	&lt;LI&gt;The ratio did not change as I changed the iteration count from 500 to 11000.&lt;/LI&gt;
	&lt;LI&gt;HyperThreading was enabled, but I only used one logical processor (pinned) and the machine was otherwise idle.&lt;/LI&gt;
	&lt;LI&gt;Overall, I ran several hundred trials, with entirely consistent results.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Other similar loops had no (net) counting errors.&amp;nbsp; (They might have had multiple offsetting errors?).&lt;/P&gt;

&lt;P&gt;I was not able to identify any particular instruction type or instruction combination that caused this overcounting, but I did not look particularly hard.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Feb 2017 16:51:59 GMT</pubDate>
    <dc:creator>McCalpinJohn</dc:creator>
    <dc:date>2017-02-24T16:51:59Z</dc:date>
    <item>
      <title>Counting number of uops</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Counting-number-of-uops/m-p/1101619#M5868</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I want to count number of retired uops for a benchmark on an Intel Core i7 Processor (Haswell). I just have few confusions on my understanding of the available counters. So, I have figured out that I can use counter event code 0xc2 and umask of 0x01 for this purpose. My question is do these event codes depend on the actual processor or not ? Secondly does the event UOPS.RETIRED count fused micro-ops as two simple uops (in other words is this counter incremented by 2 when a fused uop retires) ?&lt;/P&gt;

&lt;P&gt;Thanks for your time.&lt;/P&gt;

&lt;P&gt;-Ayaz&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 18:19:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Counting-number-of-uops/m-p/1101619#M5868</guid>
      <dc:creator>Ayaz_A_</dc:creator>
      <dc:date>2017-02-22T18:19:51Z</dc:date>
    </item>
    <item>
      <title>Chapter 19 of Volume 3 of the</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Counting-number-of-uops/m-p/1101620#M5869</link>
      <description>&lt;P&gt;Chapter 19 of Volume 3 of the Intel Architecture Software Developer's Manual (document 325384) includes tables of the performance counter events for each processor family.&amp;nbsp; Event 0xC2, Umask 0x01 is not one of the "architectural" events listed in Table 19-1, but that event is listed with a name consistent with "UOPS_RETIRED" in most of the sections of Chapter 19.&amp;nbsp;&amp;nbsp; It looks like when you get back as far as the "Core" architecture, the details of the event definition start to change.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;The documentation is not clear about how the various fused uops are handled.&amp;nbsp; If you go back as far as Nehalem (Table 19-17 of Volume 3 of the SWDM), the notes say that "macro-fused" uops increment the counter once, "micro-fused" uops increment the counter twice, and all other cases increment the counter once.&amp;nbsp;&amp;nbsp; It is not clear whether this implementation detail applies to newer processor cores, but this is fairly easy to measure.&lt;/P&gt;

&lt;P&gt;The Haswell core has a bug that causes the "INSTRUCTIONS_RETIRED" event to sometimes overcount or undercount.&amp;nbsp;&amp;nbsp; If I recall correctly, this same bug applies to UOPS_RETIRED as well, but I can't find my notes on it right now.&amp;nbsp; Fortunately in my test cases the errors were repeatable, so they did not cause me much trouble, and I only saw the errors in a few fairly small pieces of code.&amp;nbsp; (This might mean that the overcounting and undercounting canceled out most of the time?)&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 18:32:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Counting-number-of-uops/m-p/1101620#M5869</guid>
      <dc:creator>McCalpinJohn</dc:creator>
      <dc:date>2017-02-23T18:32:47Z</dc:date>
    </item>
    <item>
      <title>The "Intel ® Xeon Processor</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Counting-number-of-uops/m-p/1101621#M5870</link>
      <description>&lt;P&gt;The "Intel ® Xeon Processor E3-1200 v3 Product Family Specification Update, October 2016" lists only UOPS.EXECUTED to may untercount (HSW30) and further inaccuracies with HT enabled (HSW144) &lt;A href="http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/xeon-e3-1200v3-spec-update-oct2016.pdf"&gt;http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/xeon-e3-1200v3-spec-update-oct2016.pdf&lt;/A&gt;&lt;BR /&gt;
	&lt;BR /&gt;
	The "Intel® Xeon® Processor E5 v3 Product Family Processor Specification Update September 2016" lists Instructions_Retired to not count consitently (HSE71) &lt;A href="http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/xeon-e5-v3-spec-update.pdf"&gt;http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/xeon-e5-v3-spec-update.pdf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;The "Desktop 4th Generation Intel® Core™ Processor Family, Desktop Intel® Pentium® Processor Family, and Desktop Intel® Celeron® Processor Family Specification Update January 2017" also lists UOPS.EXECUTED to may untercount (HSD30) and further inaccuracies with HT enabled (HSD144) &lt;A href="http://www.intel.com/content/www/us/en/processors/core/4th-gen-core-family-desktop-specification-update.html"&gt;http://www.intel.com/content/www/us/en/processors/core/4th-gen-core-family-desktop-specification-update.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 09:39:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Counting-number-of-uops/m-p/1101621#M5870</guid>
      <dc:creator>Thomas_G_4</dc:creator>
      <dc:date>2017-02-24T09:39:01Z</dc:date>
    </item>
    <item>
      <title>Welcome to the wonderful</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Counting-number-of-uops/m-p/1101622#M5871</link>
      <description>&lt;P&gt;Welcome to the wonderful world of inconsistent product documentation!&lt;/P&gt;

&lt;P&gt;I found my notes on the Haswell overcounting bug at &lt;A href="http://www.agner.org/optimize/blog/read.php?i=452&amp;amp;v=t&amp;nbsp;&amp;nbsp;" target="_blank"&gt;http://www.agner.org/optimize/blog/read.php?i=452&amp;amp;v=t&amp;nbsp;&amp;nbsp;&lt;/A&gt;;&lt;/P&gt;

&lt;P&gt;To summarize:&lt;/P&gt;

&lt;UL&gt;
	&lt;LI&gt;The loop clearly had 10 instructions and (using Agner's counts) 12 micro-ops.&lt;/LI&gt;
	&lt;LI&gt;The performance counters consistently reported 12 retired instructions and 14 UOPS_RETIRED.&lt;/LI&gt;
	&lt;LI&gt;The ratio did not change as I changed the iteration count from 500 to 11000.&lt;/LI&gt;
	&lt;LI&gt;HyperThreading was enabled, but I only used one logical processor (pinned) and the machine was otherwise idle.&lt;/LI&gt;
	&lt;LI&gt;Overall, I ran several hundred trials, with entirely consistent results.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Other similar loops had no (net) counting errors.&amp;nbsp; (They might have had multiple offsetting errors?).&lt;/P&gt;

&lt;P&gt;I was not able to identify any particular instruction type or instruction combination that caused this overcounting, but I did not look particularly hard.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 16:51:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Counting-number-of-uops/m-p/1101622#M5871</guid>
      <dc:creator>McCalpinJohn</dc:creator>
      <dc:date>2017-02-24T16:51:59Z</dc:date>
    </item>
  </channel>
</rss>

