Best Stockfish parameters EC2 AMD Ubuntu

Discussion of chess software programming and technical issues.

Moderator: Ras

Peperoni
Posts: 72
Joined: Sun Nov 01, 2020 5:27 pm
Full name: Richard Porti

Best Stockfish parameters EC2 AMD Ubuntu

Post by Peperoni »

Hello,

I am currently running some benchmarks with Stockfish 13 on Amazon EC2 servers (AMD) Ubuntu 20, the server has 64 vCPU, 128 Gb of RAM (c6gd.16xlarge)

Stockfish was installed running :
sudo apt-get install stockfish

With setoption name Threads value 64, I reach 86Mnps, which seem a little small to me, am I wrong?

Do you guys have any recommandation to try to have a bigger number of nps?

Thanks
BeyondCritics
Posts: 414
Joined: Sat May 05, 2012 2:48 pm
Full name: Oliver Roese

Re: Best Stockfish parameters EC2 AMD Ubuntu

Post by BeyondCritics »

You are testing on a virtual machine, you probably overcommiting your plan thread wise a bit.
With a setup of that size, memory is a big issue. The default of 16MB is much much too low for that!
Further options:
Make sure large pages are available and configure a few huge pages. Linux does not do that for you, since it can not distinguish from overcomitting and real memory usage.
Compile the latest stockfish, tailored for your machine. This can give a few percent. If you not want to do that, consider a rolling distribution (Arch Linux, Gentoo). Debian/Ubuntu believes that stability is very important, which really hurts here, due to the still fast pace progress.
Peperoni
Posts: 72
Joined: Sun Nov 01, 2020 5:27 pm
Full name: Richard Porti

Re: Best Stockfish parameters EC2 AMD Ubuntu

Post by Peperoni »

BeyondCritics wrote: Thu Apr 29, 2021 2:18 pm You are testing on a virtual machine, you probably overcommiting your plan thread wise a bit.
With a setup of that size, memory is a big issue. The default of 16MB is much much too low for that!
Further options:
Make sure large pages are available and configure a few huge pages. Linux does not do that for you, since it can not distinguish from overcomitting and real memory usage.
Compile the latest stockfish, tailored for your machine. This can give a few percent. If you not want to do that, consider a rolling distribution (Arch Linux, Gentoo). Debian/Ubuntu believes that stability is very important, which really hurts here, due to the still fast pace progress.
Thanks.
Does the Hash value really increase the nps? (for very long computations?)
smatovic
Posts: 3360
Joined: Wed Mar 10, 2010 10:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic

Re: Best Stockfish parameters EC2 AMD Ubuntu

Post by smatovic »

According to this: https://packages.ubuntu.com/focal/stockfish

it is still Stockfish 11 in the repo, you should grab the source and compile for native on your machine.

According to this: https://aws.amazon.com/ec2/instance-types/
Each vCPU is a thread of either an Intel Xeon core or an AMD EPYC core, except for C6g, C6gn, T2 and m3.medium.

Each vCPU on C6g and C6gn instances is a core of the AWS Graviton2 processor.

† AVX, AVX2, and Enhanced Networking are only available on instances launched with HVM AMIs.
Youd did rent the ARM Graviton 64 core processor and not the AMD EPYC one.

Not sure how to take care of AVX for SF NNUE via AWS renting.

--
Srdja
BeyondCritics
Posts: 414
Joined: Sat May 05, 2012 2:48 pm
Full name: Oliver Roese

Re: Best Stockfish parameters EC2 AMD Ubuntu

Post by BeyondCritics »

Peperoni wrote: Thu Apr 29, 2021 2:28 pm
BeyondCritics wrote: Thu Apr 29, 2021 2:18 pm You are testing on a virtual machine, you probably overcommiting your plan thread wise a bit.
With a setup of that size, memory is a big issue. The default of 16MB is much much too low for that!
Further options:
Make sure large pages are available and configure a few huge pages. Linux does not do that for you, since it can not distinguish from overcomitting and real memory usage.
Compile the latest stockfish, tailored for your machine. This can give a few percent. If you not want to do that, consider a rolling distribution (Arch Linux, Gentoo). Debian/Ubuntu believes that stability is very important, which really hurts here, due to the still fast pace progress.
Thanks.
Does the Hash value really increase the nps? (for very long computations?)
I had concluded you were seeking for the best stockfish setup. If you just want to compare machines, a much simpler setup will do of course.
Consider also, using this professional stockfish benchmark (https://openbenchmarking.org/test/pts/stockfish) und upload the results, this will benefit us chess players.
Peperoni
Posts: 72
Joined: Sun Nov 01, 2020 5:27 pm
Full name: Richard Porti

Re: Best Stockfish parameters EC2 AMD Ubuntu

Post by Peperoni »

BeyondCritics wrote: Thu Apr 29, 2021 2:37 pm
Peperoni wrote: Thu Apr 29, 2021 2:28 pm
BeyondCritics wrote: Thu Apr 29, 2021 2:18 pm You are testing on a virtual machine, you probably overcommiting your plan thread wise a bit.
With a setup of that size, memory is a big issue. The default of 16MB is much much too low for that!
Further options:
Make sure large pages are available and configure a few huge pages. Linux does not do that for you, since it can not distinguish from overcomitting and real memory usage.
Compile the latest stockfish, tailored for your machine. This can give a few percent. If you not want to do that, consider a rolling distribution (Arch Linux, Gentoo). Debian/Ubuntu believes that stability is very important, which really hurts here, due to the still fast pace progress.
Thanks.
Does the Hash value really increase the nps? (for very long computations?)
I had concluded you were seeking for the best stockfish setup. If you just want to compare machines, a much simpler setup will do of course.
Consider also, using this professional stockfish benchmark (https://openbenchmarking.org/test/pts/stockfish) und upload the results, this will benefit us chess players.
What I want to do is automatically analyze hundreds of thousands of games to a certain depth ;-)
Peperoni
Posts: 72
Joined: Sun Nov 01, 2020 5:27 pm
Full name: Richard Porti

Re: Best Stockfish parameters EC2 AMD Ubuntu

Post by Peperoni »

smatovic wrote: Thu Apr 29, 2021 2:31 pm According to this: https://packages.ubuntu.com/focal/stockfish

it is still Stockfish 11 in the repo, you should grab the source and compile for native on your machine.

According to this: https://aws.amazon.com/ec2/instance-types/
Each vCPU is a thread of either an Intel Xeon core or an AMD EPYC core, except for C6g, C6gn, T2 and m3.medium.

Each vCPU on C6g and C6gn instances is a core of the AWS Graviton2 processor.

† AVX, AVX2, and Enhanced Networking are only available on instances launched with HVM AMIs.
Youd did rent the ARM Graviton 64 core processor and not the AMD EPYC one.

Not sure how to take care of AVX for SF NNUE via AWS renting.

--
Srdja
Thanks, I will run a test and compare the 2 !
Peperoni
Posts: 72
Joined: Sun Nov 01, 2020 5:27 pm
Full name: Richard Porti

Re: Best Stockfish parameters EC2 AMD Ubuntu

Post by Peperoni »

First benchmarks :
sudo apt-get install stockfish

c6g.16xlarge (ARM, Graviton CPU, Ubuntu 20)

21 000 000 (Threads = 16)
42 000 000 (Threads = 32)
86 000 000 (Threads = 64)

c5a.24xlarge (x86, EPYC 7002 series CPU, Ubuntu 20)

20 000 000 (Threads = 16)
70 000 000 (Threads = 64)
80 000 000 (Threads = 96)

Note that c5a.24xlarge is twice more expensive than c6g.16xlarge and seems to perform less well.