{"id":228,"date":"2024-01-05T10:10:40","date_gmt":"2024-01-05T10:10:40","guid":{"rendered":"https:\/\/mvermeulen.org\/perf\/?page_id=228"},"modified":"2024-01-05T13:38:08","modified_gmt":"2024-01-05T13:38:08","slug":"stockfish","status":"publish","type":"page","link":"https:\/\/mvermeulen.org\/perf\/workloads\/phoronix\/stockfish\/","title":{"rendered":"stockfish"},"content":{"rendered":"\n<p>Stockfish is a chess simulator. It has pattern that differs on a second basis with occasional waiting for backend memory and a moderate amount of branch misprediction.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"960\" src=\"https:\/\/mvermeulen.org\/perf\/wp-content\/uploads\/sites\/7\/2024\/01\/amdtopdown-18.png\" alt=\"\" class=\"wp-image-263\" srcset=\"https:\/\/mvermeulen.org\/perf\/wp-content\/uploads\/sites\/7\/2024\/01\/amdtopdown-18.png 1280w, https:\/\/mvermeulen.org\/perf\/wp-content\/uploads\/sites\/7\/2024\/01\/amdtopdown-18-1024x768.png 1024w, https:\/\/mvermeulen.org\/perf\/wp-content\/uploads\/sites\/7\/2024\/01\/amdtopdown-18-768x576.png 768w\" sizes=\"auto, (max-width: 1280px) 100vw, 1280px\" \/><\/figure>\n\n\n\n<p>AMD metrics confirm branch misprediction and L2 misses both occur. There is some floating point but not much.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>elapsed              1384.118\non_cpu               0.952          # 15.23 \/ 16 cores\nutime                21076.319\nstime                6.667\nnvcsw                18847          # 5.55%\nnivcsw               320971         # 94.45%\ninblock              92656          # 66.94\/sec\nonblock              24016          # 17.35\/sec\ncpu-clock            21086578525058 # 21086.579 seconds\ntask-clock           21086871739374 # 21086.872 seconds\npage faults          1522050        # 72.180\/sec\ncontext switches     346514         # 16.433\/sec\ncpu migrations       359            # 0.017\/sec\nmajor page faults    367            # 0.017\/sec\nminor page faults    1521683        # 72.163\/sec\nalignment faults     0              # 0.000\/sec\nemulation faults     0              # 0.000\/sec\nbranches             9684555930271  # 98.355 branches per 1000 inst\nbranch misses        573154236984   # 5.92% branch miss\nconditional          8296142807057  # 84.254 conditional branches per 1000 inst\nindirect             101382653603   # 1.030 indirect branches per 1000 inst\ncpu-cycles           16866386094273 # 3.73 GHz\ninstructions         19983394101588 # 1.18 IPC\nslots                33720258649008 #\nretiring             6744916097790  # 20.0% (27.2%)\n-- ucode             6891013174     #     0.0%\n-- fastpath          6738025084616  #    20.0%\nfrontend             6617800247940  # 19.6% (26.6%)\n-- latency           4767554687280  #    14.1%\n-- bandwidth         1850245560660  #     5.5%\nbackend              9932644504225  # 29.5% (40.0%)\n-- cpu               1893238505762  #     5.6%\n-- memory            8039405998463  #    23.8%\nspeculation          1542532995220  #  4.6% ( 6.2%)\n-- branch mispredict 1530609982806  #     4.5%\n-- pipeline restart  11923012414    #     0.0%\nsmt-contention       8882340075342  # 26.3% ( 0.0%)\ncpu-cycles           16740842864574 # 3.73 GHz\ninstructions         19931947861899 # 1.19 IPC\ninstructions         6645376767345  # 99.428 l2 access per 1000 inst\nl2 hit from l1       446181719701   # 11.87% l2 miss\nl2 miss from l1      26985632445    #\nl2 hit from l2 pf    163101649579   #\nl3 hit from l2 pf    45361494017    #\nl3 miss from l2 pf   6088573564     #\ninstructions         6644088416780  # 34.037 float per 1000 inst\nfloat 512            80             # 0.000 AVX-512 per 1000 inst\nfloat 256            16             # 0.000 AVX-256 per 1000 inst\nfloat 128            226147813954   # 34.037 AVX-128 per 1000 inst\nfloat MMX            0              # 0.000 MMX per 1000 inst\nfloat scalar         0              # 0.000 scalar per 1000 inst\n<\/code><\/pre>\n\n\n\n<p>Intel metrics also show a high branch misprediction<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>elapsed              1640.895\non_cpu               0.965          # 15.44 \/ 16 cores\nutime                25329.305\nstime                3.520\nnvcsw                16253          # 7.98%\nnivcsw               187395         # 92.02%\ninblock              93480          # 56.97\/sec\nonblock              21472          # 13.09\/sec\ncpu-clock            25333794283551 # 25333.794 seconds\ntask-clock           25333963779703 # 25333.964 seconds\npage faults          1237282        # 48.839\/sec\ncontext switches     211663         # 8.355\/sec\ncpu migrations       1506           # 0.059\/sec\nmajor page faults    366            # 0.014\/sec\nminor page faults    1236915        # 48.824\/sec\nalignment faults     0              # 0.000\/sec\nemulation faults     0              # 0.000\/sec\nbranches             7994058687634  # 95.904 branches per 1000 inst\nbranch misses        519871858414   # 6.50% branch miss\nconditional          7994058723858  # 95.904 conditional branches per 1000 inst\nindirect             1527383862423  # 18.324 indirect branches per 1000 inst\nslots                94369743796502 #\nretiring             38302277643659 # 40.6% (40.6%)\n-- ucode             1150130197139  #     1.2%\n-- fastpath          37152147446520 #    39.4%\nfrontend             28816472204386 # 30.5% (30.5%)\n-- latency           14730504927444 #    15.6%\n-- bandwidth         14085967276942 #    14.9%\nbackend              10793915769259 # 11.4% (11.4%)\n-- cpu               6233594044595  #     6.6%\n-- memory            4560321724664  #     4.8%\nspeculation          17570676295568 # 18.6% (18.6%)\n-- branch mispredict 17420985834181 #    18.5%\n-- pipeline restart  149690461387   #     0.2%\nsmt-contention       0              #  0.0% ( 0.0%)\ncpu-cycles           39480962644128 # 1.61 GHz\ninstructions         49309411201069 # 1.25 IPC\nl2 access            2896293695870  # 76.281 l2 access per 1000 inst\nl2 miss              469759342148   # 16.22% l2 miss\n<\/code><\/pre>\n\n\n\n<p>Process summary shows almost all time is spent in stockfish processes.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>624 processes\n\t337 stockfish            115727.47    51.96\n\t 38 vulkaninfo               0.90     0.95\n\t  4 vulkani:disk$0           0.08     0.10\n\t  6 php                      0.07     0.09\n\t  6 clang                    0.06     0.01\n\t  2 llvmpipe-0               0.05     0.05\n\t  2 llvmpipe-1               0.05     0.05\n\t  2 llvmpipe-10              0.05     0.05\n\t  2 llvmpipe-11              0.05     0.05\n\t  2 llvmpipe-12              0.05     0.05\n\t  2 llvmpipe-13              0.05     0.05\n\t  2 llvmpipe-14              0.05     0.05\n\t  2 llvmpipe-15              0.05     0.05\n\t  2 llvmpipe-2               0.05     0.05\n\t  2 llvmpipe-3               0.05     0.05\n\t  2 llvmpipe-4               0.05     0.05\n\t  2 llvmpipe-5               0.05     0.05\n\t  2 llvmpipe-6               0.05     0.05\n\t  2 llvmpipe-7               0.05     0.05\n\t  2 llvmpipe-8               0.05     0.05\n\t  2 llvmpipe-9               0.05     0.05\n\t  1 lspci                    0.00     0.03\n\t 91 sh                       0.00     0.00\n\t 13 gcc                      0.00     0.00\n\t 11 gsettings                0.00     0.00\n\t  9 stty                     0.00     0.00\n\t  8 stat                     0.00     0.00\n\t  8 systemd-detect-          0.00     0.00\n\t  6 llvm-link                0.00     0.00\n\t  5 glxinfo                  0.00     0.00\n\t  5 phoronix-test-s          0.00     0.00\n\t  3 gmain                    0.00     0.00\n\t  2 cc                       0.00     0.00\n\t  2 clinfo                   0.00     0.00\n\t  2 dconf worker             0.00     0.00\n\t  2 grep                     0.00     0.00\n\t  2 lscpu                    0.00     0.00\n\t  2 setterm                  0.00     0.00\n\t  2 uname                    0.00     0.00\n\t  2 which                    0.00     0.00\n\t  1 date                     0.00     0.00\n\t  1 dirname                  0.00     0.00\n\t  1 dmesg                    0.00     0.00\n\t  1 dmidecode                0.00     0.00\n\t  1 ifconfig                 0.00     0.00\n\t  1 ip                       0.00     0.00\n\t  1 lsmod                    0.00     0.00\n\t  1 mktemp                   0.00     0.00\n\t  1 ps                       0.00     0.00\n\t  1 qdbus                    0.00     0.00\n\t  1 readlink                 0.00     0.00\n\t  1 realpath                 0.00     0.00\n\t  1 sed                      0.00     0.00\n\t  1 sort                     0.00     0.00\n\t  1 systemctl                0.00     0.00\n\t  1 template.sh              0.00     0.00\n\t  1 wc                       0.00     0.00\n8 processes running\n55 maximum processes\n\n\n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Stockfish is a chess simulator. It has pattern that differs on a second basis with occasional waiting for backend memory and a moderate amount of branch misprediction. AMD metrics confirm branch misprediction and L2 misses both occur. There is some <span class=\"excerpt-dots\">&hellip;<\/span> <a class=\"more-link\" href=\"https:\/\/mvermeulen.org\/perf\/workloads\/phoronix\/stockfish\/\"><span class=\"more-msg\">Continue reading &rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":58,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-228","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/pages\/228","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/comments?post=228"}],"version-history":[{"count":3,"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/pages\/228\/revisions"}],"predecessor-version":[{"id":269,"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/pages\/228\/revisions\/269"}],"up":[{"embeddable":true,"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/pages\/58"}],"wp:attachment":[{"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/media?parent=228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}