{"id":521,"date":"2024-01-14T00:40:51","date_gmt":"2024-01-14T00:40:51","guid":{"rendered":"https:\/\/mvermeulen.org\/perf\/?page_id=521"},"modified":"2024-01-14T15:03:32","modified_gmt":"2024-01-14T15:03:32","slug":"lczero","status":"publish","type":"page","link":"https:\/\/mvermeulen.org\/perf\/workloads\/phoronix\/lczero\/","title":{"rendered":"lczero"},"content":{"rendered":"\n<p>LeelaChessZero is a chess program automated via neural networks. There are three backends: BLAS, Eigen and OpenCL.  The OpenCL backend didn&#8217;t run because OpenCL wasn&#8217;t configured. The BLAS implementation is much faster on my AMD CPU than my Intel CPU.  Th e profile shows a lot of variation in runnable processes.I expect we will see many short processes running.<\/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\/systemtime-13.png\" alt=\"\" class=\"wp-image-543\" srcset=\"https:\/\/mvermeulen.org\/perf\/wp-content\/uploads\/sites\/7\/2024\/01\/systemtime-13.png 1280w, https:\/\/mvermeulen.org\/perf\/wp-content\/uploads\/sites\/7\/2024\/01\/systemtime-13-1024x768.png 1024w, https:\/\/mvermeulen.org\/perf\/wp-content\/uploads\/sites\/7\/2024\/01\/systemtime-13-768x576.png 768w\" sizes=\"auto, (max-width: 1280px) 100vw, 1280px\" \/><\/figure>\n\n\n\n<p>Frontend stalls periodically spike up and retirement rate is in mid 30s.<\/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-51.png\" alt=\"\" class=\"wp-image-544\" srcset=\"https:\/\/mvermeulen.org\/perf\/wp-content\/uploads\/sites\/7\/2024\/01\/amdtopdown-51.png 1280w, https:\/\/mvermeulen.org\/perf\/wp-content\/uploads\/sites\/7\/2024\/01\/amdtopdown-51-1024x768.png 1024w, https:\/\/mvermeulen.org\/perf\/wp-content\/uploads\/sites\/7\/2024\/01\/amdtopdown-51-768x576.png 768w\" sizes=\"auto, (max-width: 1280px) 100vw, 1280px\" \/><\/figure>\n\n\n\n<p>AMD metrics show a lot of context switches and page faults.  Waiting on both CPU and memory.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>elapsed              2286.628\non_cpu               0.788          # 12.61 \/ 16 cores\nutime                28433.206\nstime                398.719\nnvcsw                3234284        # 4.57%\nnivcsw               67581710       # 95.43%\ninblock              0              # 0.00\/sec\nonblock              28176          # 12.32\/sec\ncpu-clock            28817910710262 # 28817.911 seconds\ntask-clock           28822250831254 # 28822.251 seconds\npage faults          13958000       # 484.279\/sec\ncontext switches     70827221       # 2457.380\/sec\ncpu migrations       638731         # 22.161\/sec\nmajor page faults    6              # 0.000\/sec\nminor page faults    13957994       # 484.278\/sec\nalignment faults     0              # 0.000\/sec\nemulation faults     0              # 0.000\/sec\nbranches             6068063340836  # 48.790 branches per 1000 inst\nbranch misses        161506622845   # 2.66% branch miss\nconditional          4022477007429  # 32.343 conditional branches per 1000 inst\nindirect             635544091025   # 5.110 indirect branches per 1000 inst\ncpu-cycles           127880209993342 # 3.00 GHz\ninstructions         136039223127335 # 1.06 IPC\nslots                255788277627072 #\nretiring             46024278712982 # 18.0% (23.6%)\n-- ucode             148061056873   #     0.1%\n-- fastpath          45876217656109 #    17.9%\nfrontend             16172927052638 #  6.3% ( 8.3%)\n-- latency           8743803494448  #     3.4%\n-- bandwidth         7429123558190  #     2.9%\nbackend              128450684661770 # 50.2% (66.0%)\n-- cpu               72082918052603 #    28.2%\n-- memory            56367766609167 #    22.0%\nspeculation          4004300785800  #  1.6% ( 2.1%)\n-- branch mispredict 3950326280615  #     1.5%\n-- pipeline restart  53974505185    #     0.0%\nsmt-contention       61135597919753 # 23.9% ( 0.0%)\ncpu-cycles           109299872593817 # 2.99 GHz\ninstructions         123409306628789 # 1.13 IPC\ninstructions         41152895861252 # 95.467 l2 access per 1000 inst\nl2 hit from l1       2977220324102  # 7.87% l2 miss\nl2 miss from l1      82623493543    #\nl2 hit from l2 pf    725059870544   #\nl3 hit from l2 pf    106665422650   #\nl3 miss from l2 pf   119803286779   #\ninstructions         41153957789364 # 89.041 float per 1000 inst\nfloat 512            85             # 0.000 AVX-512 per 1000 inst\nfloat 256            11641          # 0.000 AVX-256 per 1000 inst\nfloat 128            3664377273313  # 89.041 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.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>elapsed              4689.232\non_cpu               0.669          # 10.71 \/ 16 cores\nutime                49944.869\nstime                265.709\nnvcsw                10542389       # 27.33%\nnivcsw               28035944       # 72.67%\ninblock              88096          # 18.79\/sec\nonblock              4136           # 0.88\/sec\ncpu-clock            50157070996008 # 50157.071 seconds\ntask-clock           50166215178468 # 50166.215 seconds\npage faults          27500955       # 548.197\/sec\ncontext switches     38601556       # 769.473\/sec\ncpu migrations       2041465        # 40.694\/sec\nmajor page faults    46             # 0.001\/sec\nminor page faults    27500909       # 548.196\/sec\nalignment faults     0              # 0.000\/sec\nemulation faults     0              # 0.000\/sec\nbranches             6812057398539  # 21.566 branches per 1000 inst\nbranch misses        149765412660   # 2.20% branch miss\nconditional          6812058478571  # 21.566 conditional branches per 1000 inst\nindirect             2202417120955  # 6.973 indirect branches per 1000 inst\nslots                306536509111490 #\nretiring             140232905670943 # 45.7% (45.7%)\n-- ucode             2752895743197  #     0.9%\n-- fastpath          137480009927746 #    44.8%\nfrontend             34306137327121 # 11.2% (11.2%)\n-- latency           26258728548842 #     8.6%\n-- bandwidth         8047408778279  #     2.6%\nbackend              118976275623436 # 38.8% (38.8%)\n-- cpu               58208559972379 #    19.0%\n-- memory            60767715651057 #    19.8%\nspeculation          13128862043712 #  4.3% ( 4.3%)\n-- branch mispredict 13020891939040 #     4.2%\n-- pipeline restart  107970104672   #     0.0%\nsmt-contention       0              #  0.0% ( 0.0%)\ncpu-cycles           136668286409257 # 1.86 GHz\ninstructions         242039315669235 # 1.77 IPC\nl2 access            6583853889433  # 46.933 l2 access per 1000 inst\nl2 miss              1277645992049  # 19.41% l2 miss\n<\/code><\/pre>\n\n\n\n<p>Process overview as expected a large number of processes and at times many runnable processes so this benchmark is a good test of process creation for short-lived processes.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>17100 processes\n\t16675 lc0                  41020472.95 418368.36\n\t136 clinfo                  37.67    14.71\n\t 38 vulkaninfo               1.14     1.52\n\t  6 php                      0.21     0.38\n\t  6 glxinfo:gdrv0            0.16     0.10\n\t  4 vulkani:disk$0           0.12     0.16\n\t  2 glxinfo                  0.08     0.04\n\t  2 glxinfo:cs0              0.08     0.04\n\t  2 glxinfo:disk$0           0.08     0.04\n\t  2 glxinfo:sh0              0.08     0.04\n\t  2 glxinfo:shlo0            0.08     0.04\n\t  2 llvmpipe-0               0.06     0.08\n\t  2 llvmpipe-1               0.06     0.08\n\t  2 llvmpipe-10              0.06     0.08\n\t  2 llvmpipe-11              0.06     0.08\n\t  2 llvmpipe-12              0.06     0.08\n\t  2 llvmpipe-13              0.06     0.08\n\t  2 llvmpipe-14              0.06     0.08\n\t  2 llvmpipe-15              0.06     0.08\n\t  2 llvmpipe-2               0.06     0.08\n\t  2 llvmpipe-3               0.06     0.08\n\t  2 llvmpipe-4               0.06     0.08\n\t  2 llvmpipe-5               0.06     0.08\n\t  2 llvmpipe-6               0.06     0.08\n\t  2 llvmpipe-7               0.06     0.08\n\t  2 llvmpipe-8               0.06     0.08\n\t  2 llvmpipe-9               0.06     0.08\n\t  6 clang                    0.06     0.02\n\t  3 rocminfo                 0.03     0.00\n\t  1 lspci                    0.01     0.02\n\t 86 sh                       0.00     0.00\n\t 13 gcc                      0.00     0.00\n\t 12 gsettings                0.00     0.00\n\t  9 lczero                   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 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 lscpu                    0.00     0.00\n\t  2 uname                    0.00     0.00\n\t  2 which                    0.00     0.00\n\t  2 xset                     0.00     0.00\n\t  1 date                     0.00     0.00\n\t  1 dconf worker             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 grep                     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 stty                     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\n\t  1 xrandr                   0.00     0.00\n0 processes running\n108 maximum processes\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>LeelaChessZero is a chess program automated via neural networks. There are three backends: BLAS, Eigen and OpenCL. The OpenCL backend didn&#8217;t run because OpenCL wasn&#8217;t configured. The BLAS implementation is much faster on my AMD CPU than my Intel CPU. <span class=\"excerpt-dots\">&hellip;<\/span> <a class=\"more-link\" href=\"https:\/\/mvermeulen.org\/perf\/workloads\/phoronix\/lczero\/\"><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-521","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/pages\/521","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=521"}],"version-history":[{"count":2,"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/pages\/521\/revisions"}],"predecessor-version":[{"id":545,"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/pages\/521\/revisions\/545"}],"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=521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}