floats rather than ints for the evaluation

Discussion about development of draughts in the time of computer and Internet.
Post Reply
gwiesenekker
Posts: 89
Joined: Sun Feb 20, 2011 21:04
Real name: Gijsbert Wiesenekker

floats rather than ints for the evaluation

Post by gwiesenekker »

Hi,

I have been testing floats rather than ints for the evaluation in GWD. As GWD uses embedding vectors for the evaluation of the neural network GWD no longer needs NNUE and evaluation using floats is just as fast as ints.
The idea was to add the material-balance 'behind the comma' to the evaluation rather than as an int (that pollutes the minimal-window) to avoid exchanges. You can get rounding-errors when using floats leading to inconsistencies like alpha + minimal_window == alpha, so you have to use 'scaled floats': floats multiplied by say a 1000 rounded (or truncated) to an int. The minimal window has to be the resolution of the evaluation, so if you use 1000 the minimal window should be 1e-3 (or 1 scaled). The 'int' version uses int((float output of the neural network) / (the average output of the neural network of positions without kings and one man difference)), the 'float' version uses int((float output of the neural network) / (the average output of the neural network of positions without kings and one man difference) * 1000);
Somewhat unexpected the float version searches a lot deeper (although the match result against Kingsrow stayed the same, suggesting that the match result is limited by the evaluation of the neural network), but this allowed me to explore tweaks (more conservative search extensions and reduction settings) that slow down the 'int' version of GWD too much. Some of the tweaks disable features, and surprisingly:
  • I can disable TT based singular extensions in the float version: the match result stays the same. If I disable them in the int version the match result gets (much) worse.
  • I can disable the quiescence search in the float version: the single-threaded match result is slightly worse than that of the int version, the multi-threaded match result is the same. If I disable the quiescence search in the int version both the single- and multi-threaded match result get (much) worse.
GW
Joost Buijs
Posts: 542
Joined: Wed May 04, 2016 11:45
Real name: Joost Buijs

Re: floats rather than ints for the evaluation

Post by Joost Buijs »

Hi Gijsbert,

That you are able to search much deeper with floating point evaluation in the search is very weird.

Usually I see the opposite, when I increase the resolution of the evaluation the search-depth gets less, but this doesn't mean that it is bad. The evaluation difference between a won/lost or draw position is sometimes very small, so I want to have the highest resolution possible to distinguish between positions with an evaluation very close to each other.

The problem in my case is that I'm bound to the transposition table entry, I can't use more than a 16 bit score field in a entry without making the entry larger than 16 bytes, so I have to convert the floating point output of the network to 16 bit int; 16 bytes for an entry is the optimum with a bucket of 4 entries and a cache line of 64 byte (like X86 has).

Of course, it is always possible to grab a few bits here and there, but I like to keep things simple.

Joost
Post Reply