Ryzen 1800x and best stockfish version

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

Moderators: hgm, Rebel, chrisw

david
Posts: 20
Joined: Sat Jan 16, 2016 7:25 pm

Ryzen 1800x and best stockfish version

Post by david »

I tried Ryzen with different versions of stockfish, based on the build of 06 June 2017. The three versions are "64", "bmi2" and "popcnt". After 510 games with a two-minute fixed time control, BMI2 is a little bit weaker than the other two.

StockfishVariants2, Blitz 2m 2017

1 2 3
1 Stockfish 060617 64 129.0 - 126.0130.5 - 124.5** 259.5/510
2 Stockfish 060617 64 POPCNT 126.0 - 129.0130.5 - 124.5 ** 256.5/510
3 Stockfish 060617 64 BMI2 124.5 - 130.5124.5 - 130.5 ** 249.0/510


similar results from a 300-game tournament with houdini added:
stockfishVariants, Blitz 2m-1 2017

1 2 3 4
1 Stockfish 060617 64 50.0 - 50.054.5 - 45.560.0 - 40.0** 164.5/300
2 Stockfish 060617 64 POPCNT 50.0 - 50.049.5 - 50.559.5 - 40.5 ** 159.0/300
3 Stockfish 060617 64 BMI2 45.5 - 54.550.5 - 49.557.5 - 42.5 ** 153.5/300
4 Houdini 5.01 Pro x64-pext 40.0 - 60.040.5 - 59.542.5 - 57.5 ** 123.0/300
User avatar
Look
Posts: 364
Joined: Thu Jun 05, 2014 2:14 pm
Location: Iran
Full name: Mehdi Amini

Re: Ryzen 1800x and best stockfish version

Post by Look »

[...]
david wrote: 1 2 3
1 Stockfish 060617 64 129.0 - 126.0130.5 - 124.5** 259.5/510
2 Stockfish 060617 64 POPCNT 126.0 - 129.0130.5 - 124.5 ** 256.5/510
3 Stockfish 060617 64 BMI2 124.5 - 130.5124.5 - 130.5 ** 249.0/510
[...]

First of all, I think your whole number of games is too low. Secondly for the same version of Stockfish, I guess this ordering holds:

BMI2 then POPCNT then ordinary 64bit.

You may compare these by their nps in a specific position. Because their difference is based on hardware(CPU) capability.
Farewell.
david
Posts: 20
Joined: Sat Jan 16, 2016 7:25 pm

Re: Ryzen 1800x and best stockfish version

Post by david »

why would you think that nps is a better metric ?
For what it is worth, using Fritz to get the test, the nps number is quite variable in my hands, but nonetheless, the bmi2 version is showing a lower nps than the other two versions.

Nonetheless there are ~300 games showing that bmi2 is showing a lower result. How much for significance ?

david
jhellis3
Posts: 546
Joined: Sat Aug 17, 2013 12:36 am

Re: Ryzen 1800x and best stockfish version

Post by jhellis3 »

I believe their is currently some issue with the BMI builds on Ryzen, thus the best version to use would be the popcount one.

If/when the BMI issues get sorted it will be the best.
User avatar
Eelco de Groot
Posts: 4561
Joined: Sun Mar 12, 2006 2:40 am
Full name:   

Re: Ryzen 1800x and best stockfish version

Post by Eelco de Groot »

Hello David

Thanks for the AMD Ryzen results, an interesting processor! But it probably can be done a bit faster as Mehdi says...

If the compiler is doing what a compiler should do and does not mess up the program (it can happen if you take out all the precautions and safeties for the greatest amount of speed, but not with safe settings) then the only difference is speed. The output of Stockfish is the same for all compiles. So you get a much better estimate of difference in Elo from measuring the speed than from letting them play games. If you do a careful test of speed under controlled circumstances, (not nps but time to depth, for instance by using built in 'bench' command when you open Stockfish in CLI) the statistical margins of that are much lower than from a chessmatch to measure the Elo difference.
Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan
david
Posts: 20
Joined: Sat Jan 16, 2016 7:25 pm

Re: Ryzen 1800x and best stockfish version

Post by david »

:D
that's very helpful. I ran bench for the three executables.
64
Total time (ms) : 4159
Nodes searched : 6599721
Nodes/second : 1586852
Modern (POPCNT)
Total time (ms) : 4024
Nodes searched : 6599721
Nodes/second : 1640089
Bmi2
Total time (ms) : 4999
Nodes searched : 6599721
Nodes/second : 1320208

64 and POPCNT are quite a bit faster than the bmi2.

there is a bit of variation; for the 64 version, i ran bench again.
Total time (ms) : 3997
Nodes searched : 6599721
Nodes/second : 1651168
Total time (ms) : 3876
Nodes searched : 6599721
Nodes/second : 1702714
Total time (ms) : 3979
Nodes searched : 6599721
Nodes/second : 1658638
Total time (ms) : 3992
Nodes searched : 6599721
Nodes/second : 1653236
so that gives you some indication of the variability.

nonetheless, the bmi2 is quite a bit slower.

cheers
david
david
Posts: 20
Joined: Sat Jan 16, 2016 7:25 pm

Re: Ryzen 1800x and best stockfish version

Post by david »

i ran a match between stockfish 64 versus stockfish BMI2. This was on a 1 minute time control. I ran it in two segments.

64 versus BMI2 139-122 / 261. +20, =238, -3
64 versus BMI2 241.5-215.5/ 457. +37, =409, -11

Total
64 versus BMI2 380.5-337.5/ 718 games
That is a net of +43 out of 718 games, or it wins ~6% of the games and draws the rest.
Cardoso
Posts: 362
Joined: Thu Mar 16, 2006 7:39 pm
Location: Portugal
Full name: Alvaro Cardoso

Re: Ryzen 1800x and best stockfish version

Post by Cardoso »

David,
your findings are correct, I'm sorry to tell you but BMI2 instructions are really slow on Ryzen. I already know this for some time, check the following links:

https://www.hardwareluxx.de/community/f ... 56117.html
https://www.reddit.com/r/Amd/comments/6 ... latencies/

On PDEP and PEXT instructions Skylake has one cycle latency.
Ryzen has 18 cycles !!!
syzygy
Posts: 5557
Joined: Tue Feb 28, 2012 11:56 pm

Re: Ryzen 1800x and best stockfish version

Post by syzygy »

Cardoso wrote:On PDEP and PEXT instructions Skylake has one cycle latency.
Ryzen has 18 cycles !!!
Even then it is surprising (to me) that the bmi2 version is SO MUCH slower. (Does a bmi2 instruction flush the pipeline or something?)

I may be wrong, but I expect a software implementation of pdep and pext to do better than this.
jpqy
Posts: 550
Joined: Thu Apr 24, 2008 9:31 am
Location: Belgium

Re: Ryzen 1800x and best stockfish version

Post by jpqy »

syzygy wrote:
Cardoso wrote:On PDEP and PEXT instructions Skylake has one cycle latency.
Ryzen has 18 cycles !!!
Even then it is surprising (to me) that the bmi2 version is SO MUCH slower. (Does a bmi2 instruction flush the pipeline or something?)

I may be wrong, but I expect a software implementation of pdep and pext to do better than this.
That's interesting to try out!

So i download last Stockfish source..
What i have to do first before i compile it?
i make a bmi2.h file and put it in the source..
I have to add something in makefile and/or somewhere else?

Then we can let people with a AMD Ryzen system test this out!

JP.