BayesElo recompiled and faster

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

Moderator: Ras

mar
Posts: 2654
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

BayesElo recompiled and faster

Post by mar »

hi all,

link to Rémi's original project: https://www.remi-coulom.fr/Bayesian-Elo

recompiling with a modern compiler already gave a very nice speedup but that's not all, on top of that:
- up to 3x faster reading of pgn files due to internal buffering
- around 2x faster exactdist processing due to optimization based on the fact that pow(x,y) = exp(y * ln(x))

the download link is here if anyone is interested, including the modified source code (minor quick and dirty changes)
https://www.crabaware.com/Private/chess ... faster.zip

I only ran one quick test on ccrl data so no warranty

hope it helps
User avatar
Brunetti
Posts: 424
Joined: Tue Dec 08, 2009 1:37 pm
Location: Milan, Italy
Full name: Alex Brunetti

Re: BayesElo recompiled and faster

Post by Brunetti »

mar wrote: Sun Dec 15, 2024 11:20 pm recompiling with a modern compiler already gave a very nice speedup but that's not all, on top of that:
- up to 3x faster reading of pgn files due to internal buffering
- around 2x faster exactdist processing due to optimization based on the fact that pow(x,y) = exp(y * ln(x))
Hi,
just tested on my UBC archive of 5.4 million games, we went from 40 to 15 seconds, excellent work!

Thanks,
Alex
mar
Posts: 2654
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: BayesElo recompiled and faster

Post by mar »

Brunetti wrote: Mon Dec 16, 2024 12:42 am Hi,
just tested on my UBC archive of 5.4 million games, we went from 40 to 15 seconds, excellent work!

Thanks,
Alex
I'm glad it works for you, Alex

had to reupload a minor fix (0xff character in pgns would be treated as EOF) - the fixed exe is 482304 bytes and should read "compiled Dec 16 2024 00:11:27"; link is the same
Modern Times
Posts: 3703
Joined: Thu Jun 07, 2012 11:02 pm

Re: BayesElo recompiled and faster

Post by Modern Times »

Yes, CCRL have been using a faster x64 compile that you provided since around Jan 2024 - good speedup.

Below are tests that were run at the time

old compile
readpgn 46s
covariance calc 2:34s

new x64 compile
readpgn 21s
covariance calc 2:28s
mar
Posts: 2654
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: BayesElo recompiled and faster

Post by mar »

Modern Times wrote: Mon Dec 16, 2024 1:07 am Yes, CCRL have been using a faster x64 compile that you provided since around Jan 2024 - good speedup.

Below are tests that were run at the time

old compile
readpgn 46s
covariance calc 2:34s

new x64 compile
readpgn 21s
covariance calc 2:28s
I see, Ray.

this is not just a recompile, but I made some minor changes to the code as well to run faster
I've just now update the zip with an actual version
(note: I've also added timing output for readpgn and covariance)
link is the same

Graham told me you use covariance, well... it's runtime is roughly proportional to the square of number of players (=engines)
I succeeded to speed it up a bit (not much, it's almost a 4k by 4k double matrix, also eating lots of cache misses along the way)
by using clang and loop autovectorization hints.
started at about 1m:40s then went to 1m:32s and finally 1m:14s standard and 1m:4s avx2 build

so not great, not terrible. should be still measurably faster than the actual one
Modern Times
Posts: 3703
Joined: Thu Jun 07, 2012 11:02 pm

Re: BayesElo recompiled and faster

Post by Modern Times »

Can't download that, Defender blocks it.
mar
Posts: 2654
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: BayesElo recompiled and faster

Post by mar »

Modern Times wrote: Mon Dec 16, 2024 5:45 am Can't download that, Defender blocks it.
oh no, getting bullied by false positives: https://www.virustotal.com/gui/file/435 ... 7979780f8a

I'll see what I can do...
mar
Posts: 2654
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: BayesElo recompiled and faster

Post by mar »

Modern Times wrote: Mon Dec 16, 2024 5:45 am Can't download that, Defender blocks it.
please try again now, same link
I even digitally signed the binaries now, see 0 on virtustotal, speed is the same
zip should be 547,103 bytes (you may need to refresh your browser)
Modern Times
Posts: 3703
Joined: Thu Jun 07, 2012 11:02 pm

Re: BayesElo recompiled and faster

Post by Modern Times »

Yes that downloads fine.
Modern Times
Posts: 3703
Joined: Thu Jun 07, 2012 11:02 pm

Re: BayesElo recompiled and faster

Post by Modern Times »

I tried it on a 1.2M game database. Identical output and around 15% faster than your January x64 compile of the existing code.