Honey-XI and related now with Large Pages Enabled (LP)

Discussion of anything and everything relating to chess playing software and machines.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
MikeB
Posts: 3824
Joined: Thu Mar 09, 2006 5:34 am
Location: Pen Argyl, Pennsylvania

Honey-XI and related now with Large Pages Enabled (LP)

Post by MikeB » Thu Feb 13, 2020 5:53 am

Large Pages code ported from Brainfish by Thomas Zipproth

Both for Windows Popcnt and Bmi2
All 10 engines in the Honey family were enabled with Large Pages, including the functional equivalent Stockfish, Black-Diamond, Bluefish and Weakfish

Some runs
3970x - Windows 10 Pro

Before LP:
Stockfish-XI
bench 2048 64 26
===========================
Total time (ms) : 40053
Nodes searched : 3825860217
Nodes/second : 95519941

After LP
Stockfish-XI-LP
bench 2048 64 26
===========================
Total time (ms) : 40486
Nodes searched : 4186128286
Nodes/second : 103396934

Before LP:
Honey-XI
bench 2048 64 26
===========================
Total time (ms) : 42417
Nodes searched : 4031868048
Nodes/second : 95053116

After LP
Honey-XI-LP
bench 2048 64 26
===========================
Total time (ms) : 42289
Nodes searched : 4353576891
Nodes/second : 102948210

Before LP:
Weakfish-XI
bench 2048 64 14

===========================
Total time (ms) : 151909
Nodes searched : 18787154052
Nodes/second : 123673739

After LP:
Weakfish-XI-LP
bench 2048 64 14
===========================
Total time (ms) : 137214
Nodes searched : 18347938746
Nodes/second : 133717687

This what it will look like when running from the terminal, "b" is a shortcut for bench. You will see feedback when Large pages are enabled. No feedback means they are not enabled.

Code: Select all

# Stockfish-XI-LP b 2048 64 26 >/dev/null
info string Hash LargePages 16 Mb  >> feedback
info string Hash LargePages 2048 Mb >> the switch to 2048M for the bench

Position: 1/46
Nodes/Second: 90057k

Position: 2/46
Nodes/Second: 96955k

Position: 3/46
Nodes/Second: 149867k

Position: 4/46
Nodes/Second: 107021k

Position: 5/46
Nodes/Second: 96096k

Position: 6/46
Nodes/Second: 97556k

Position: 7/46
Nodes/Second: 102131k

Position: 8/46
Nodes/Second: 105759k

Position: 9/46
Nodes/Second: 94619k

Position: 10/46
Nodes/Second: 110949k

Position: 11/46
Nodes/Second: 92430k

Position: 12/46
Nodes/Second: 92261k

Position: 13/46
Nodes/Second: 106225k

Position: 14/46
Nodes/Second: 95441k

Position: 15/46
Nodes/Second: 111919k

Position: 16/46
Nodes/Second: 117256k

Position: 17/46
Nodes/Second: 131569k

Position: 18/46
Nodes/Second: 169362k

Position: 19/46
Nodes/Second: 168165k

Position: 20/46
Nodes/Second: 148695k

Position: 21/46
Nodes/Second: 201570k

Position: 22/46
Nodes/Second: 198146k

Position: 23/46
Nodes/Second: 223107k

Position: 24/46
Nodes/Second: 145669k

Position: 25/46
Nodes/Second: 183492k

Position: 26/46
Nodes/Second: 137464k

Position: 27/46
Nodes/Second: 144809k

Position: 28/46
Nodes/Second: 121770k

Position: 29/46
Nodes/Second: 120945k

Position: 30/46
Nodes/Second: 152202k

Position: 31/46
Nodes/Second: 114101k

Position: 32/46
Nodes/Second: 103902k

Position: 33/46
Nodes/Second: 96549k

Position: 34/46
Nodes/Second: 97917k

Position: 35/46
Nodes/Second: 172706k

Position: 36/46
Nodes/Second: 169495k

Position: 37/46
Nodes/Second: 151874k

Position: 38/46
Nodes/Second: 150158k

Position: 39/46
Nodes/Second: 153048k

Position: 40/46
Nodes/Second: 170206k

Position: 41/46
Nodes/Second: 136215k

Position: 42/46
Nodes/Second: 91093k

Position: 43/46
Nodes/Second: 71358k

Position: 44/46
Nodes/Second: 0k

Position: 45/46
Nodes/Second: 0k

Position: 46/46
Nodes/Second: 86456k

===========================
Total time (ms) : 77074
Nodes searched  : 8073053897
Nodes/second    : 104744192

Also , it does seem to me much more efficient, when you set the memory to 2048 or a multiple of 2048. e.g.

# Stockfish-XI-LP b 24000 64 26
Stockfish XI-LP by T. Romstad, M. Costalba, J. Kiiski, G. Linscott
info string Hash LargePages 16 Mb
info string Hash LargePages 24000 Mb

===========================
Total time (ms) : 81096
Nodes searched : 8352466673
Nodes/second : 102994804

versus:

# Stockfish-XI-LP b 32768 64 26 >/dev/null
info string Hash LargePages 16 Mb
info string Hash LargePages 32768 Mb
===========================
Total time (ms) : 72008
Nodes searched : 7581919305
Nodes/second : 105292735

Enjoy!
https://github.com/MichaelB7/Stockfish/releases/tag/XI

To Enable Large Pages in Windows 10 Pro ( admin account required)

PLEASE UNDERSTAND THE RISKS BEFORE YOU DO THIS - enabling Large Pages can slow your system to CRAWL if you have insufficient memory. I would recommend at least 128 GB of RAM. I assume no responsibility for any action you take. At the minimum, I would divide the RAM you have by 4 and use that as your max hash for all engines running. It's probably best to reboot your machine if you re planning to use a big hash ( 25% of your RAM) relative to the memory you have
  • On the Start menu, click Run. In the Open box, type gpedit.msc.

    On the Local Group Policy Editor console, expand Computer Configuration, and then expand Windows Settings.

    Expand Security Settings, and then expand Local Policies.

    Select the User Rights Assignment folder.

    The policies will be displayed in the details pane.

    In the pane, double-click Lock pages in memory.

    In the Local Security Setting - Lock pages in memory dialog box, click Add User or Group.

MikeB
Posts: 3824
Joined: Thu Mar 09, 2006 5:34 am
Location: Pen Argyl, Pennsylvania

Re: Honey-XI and related now with Large Pages Enabled (LP)

Post by MikeB » Thu Feb 13, 2020 5:01 pm

For those that may be interested, I just pushed the changes to build Honey and related binaries with large pages to Github.

https://github.com/MichaelB7/Stockfish/ ... c5c123a3b7

You have to set largepages to 'yes' , in the makefile. There is threadripper flag that sets the cache parameter to the 3970x. You may want to change to match your CPU.

Build.sh builds all 10 PGO binaires on both my Mac and Threadripper box your mileage may vary. Just few items need to be changed between OS.
It requires a fairly compliant UNIX shell under the hood. For that functionality under windows , you need to install MYSYS2 and a few other items. IT also requires setting paths in the environment. It's not for everyone. Google is your friend if you get stuck

MikeB
Posts: 3824
Joined: Thu Mar 09, 2006 5:34 am
Location: Pen Argyl, Pennsylvania

Re: Honey-XI and related now with Large Pages Enabled (LP)

Post by MikeB » Fri Feb 14, 2020 1:28 pm

For those that like bleeding edge binaries :

https://github.com/MichaelB7/Stockfish/ ... es/Windows

also includes base x64 , which should run on the early 64 bit windows machines which do not have popcnt or sse4.2 .

These development binaries have the 25 commits since Stockfish 11 ( really 20, since 5 were reverted) .

All versions are enabled for Large Pages - which is on by default, but can be turned off in the uci settings.

This is not a release.

Post Reply