Engine vs CPU power

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

Moderator: Ras

User avatar
Laskos
Posts: 10948
Joined: Wed Jul 26, 2006 10:21 pm
Full name: Kai Laskos

Re: Engine vs CPU power.

Post by Laskos »

Ajedrecista wrote:Hello Colin:
Colin-G wrote:
Laskos wrote:
Lumbis wrote:Are there any stats on how CPU power effects the engine strength?
Trying to improvise a rapid answer. Yes, if the total MHz of your machine is M (summing all cores), then ELO performance of engine is roughly:

ELO ~ 700 * log(log(M)) + C

C is dependent on engine, say for a top engine like Stockfish C ~ 1800. Also dependent on time control. That's fine?
I wrote a little python script to see how the effect of doubling cpu power (or doubling the thinking time) changes ELO value using the above equation.
Actual ELO value is obviously dependent on the undefined engine thinking time, but it can be seen that the effect of increasing cpu power (or thinking time) gives smaller and smaller improvements.

Code: Select all

Total MHz 1000 ELO is 3152.85131374 Increase in ELO is 74.0194478207
Total MHz 2000 ELO is 3219.78688944 Increase in ELO is 66.9355757023
Total MHz 4000 ELO is 3280.87684281 Increase in ELO is 61.0899533641
Total MHz 8000 ELO is 3337.06069232 Increase in ELO is 56.1838495155
Total MHz 16000 ELO is 3389.06820658 Increase in ELO is 52.0075142582
Total MHz 32000 ELO is 3437.4775391 Increase in ELO is 48.409332514
Total MHz 64000 ELO is 3482.75452074 Increase in ELO is 45.2769816466
[/color]
With the formula provided by Kai:

Code: Select all

M = MHz > 0
Elo(M) = C + 700*ln[ln(M)]
I take the equality (= instead of ~) for my next math.
I see that your 'Increase in Elo' column is Elo(M) - Elo(M/2), so:

Code: Select all

Elo(M)   = C + 700*ln[ln(M)]
Elo(M/2) = C + 700*ln[ln(M/2)]

Elo(M) - Elo(M/2) = 700*{ln[ln(M)] - ln[ln(M/2)]} = 700*ln{[ln(M)]/[ln(M/2)]}
Elo(M) - Elo(M/2) = 700*ln{[ln(M)]/[ln(M) - ln(2)]} = 700*ln{1/[1 - ln(2)/ln(M)]}
Elo(M) - Elo(M/2) = -700*ln[1 - ln(2)/ln(M)]
When ln(2)/ln(M) << 1:

Code: Select all

Maclaurin series:

ln(1 - x) ~ -(x + x²/2! + x³/3! + ...)
|x| << 1 ==> ln(1 - x) ~ -x

If ln(2)/ln(M) << 1:
Elo(M) - Elo(M/2) ~ 700*ln(2)/ln(M) ~ 485.2/ln(M)
You can plot easily both the exact gain and the Maclaurin series approximation.

The derivative of 485.2/ln(M) is d[485.2/ln(M)]/dM = -485.2/{M*[ln(M)]²}, and you can see how fast the gain drops.

The derivative of the exact gain per doubling is d{-700*ln[1 - ln(2)/ln(M)]}/dM = -700*ln(2)/[M*ln(M)*ln(M/2)] ~ -485.2/[M*ln(M)*ln(M/2)].

Of course 700 could be replaced by K, for making it more general.

Regards from Spain.

Ajedrecista.
To include time control (in seconds per move), it might be improvised something like

M = total MHz of machine (summed up all cores).
t = seconds per move.
FIDE ELO = 600 * ln(ln(M*t/40)) + C
with C = 1900 for Stockfish. For weaker engines C is smaller.

But first it's very rough, and second it doesn't take into account the scaling on multicore machines (which again will give even more diminishing returns for high number of cores). I just wanted to answer quickly the general question in OP. Yes, monotonically increasing both with hardware and time control, with diminishing returns in both cases.