What happens with my hyperthreading?

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

Moderators: hgm, Rebel, chrisw

smatovic
Posts: 2639
Joined: Wed Mar 10, 2010 10:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic

Re: What happens with my hyperthreading?

Post by smatovic »

You could do a plain NPS experiment with zero hashtable, just to figure out
what kind of impact memory latencies have on nowadays SF.

--
Srdja
Milos
Posts: 4190
Joined: Wed Nov 25, 2009 1:47 am

Re: What happens with my hyperthreading?

Post by Milos »

Laskos wrote: Fri Aug 07, 2020 9:51 am
Milos wrote: Fri Aug 07, 2020 5:50 am
Laskos wrote: Thu Aug 06, 2020 9:26 pm 60% speedup from hyperthreading using SF NNUE at longer TC, pretty crazy. What's that?

4 physical cores, 8 logical

Code: Select all

Games Completed = 100 of 100 (Avg game length = 60.676 sec)
Settings = Gauntlet/128MB/15000ms+250ms/M 700cp for 3 moves, D 120 moves/EPD:C:\LittleBlitzer\2moves_80_100.epd(1749)
Time = 6115 sec elapsed, 0 sec remaining
 1.  SFNNUE 0633 8 threads    	58.0/100	29-13-58  	(L: m=0 t=0 i=0 a=13)	(D: r=31 i=10 f=3 s=0 a=14)	(tpm=436.9 d=24.20 nps=7969609)
 2.  SFNNUE 0633 4 threads    	42.0/100	13-29-58  	(L: m=0 t=0 i=0 a=29)	(D: r=31 i=10 f=3 s=0 a=14)	(tpm=440.3 d=23.83 nps=4991558)
It's pretty obvious. Your cpu (being Haswell) has 2 8-wide FMA instructions per clock cycle, i.e. 2 FMA units per core. Meaning with 2 threads it can run one instruction per thread per clock cycle. By running 2 threads per core, you are able to hide instruction and operand fetch latency while with only 1 thread per core there would be thread stalling and you wouldn't be able to use both FMA units effectively.
Wasn't this valid 3-4-5 years ago too for my CPU? I was always getting a mere 30% from hyperthreading.
You used FMA vector instructions couple a years ago? Really, what for? C'mon at least try to understand what I wrote. I mean what's the purpose if you can't even put the minimum effort?
User avatar
Laskos
Posts: 10948
Joined: Wed Jul 26, 2006 10:21 pm
Full name: Kai Laskos

Re: What happens with my hyperthreading?

Post by Laskos »

Milos wrote: Fri Aug 07, 2020 12:14 pm
Laskos wrote: Fri Aug 07, 2020 9:51 am
Milos wrote: Fri Aug 07, 2020 5:50 am
Laskos wrote: Thu Aug 06, 2020 9:26 pm 60% speedup from hyperthreading using SF NNUE at longer TC, pretty crazy. What's that?

4 physical cores, 8 logical

Code: Select all

Games Completed = 100 of 100 (Avg game length = 60.676 sec)
Settings = Gauntlet/128MB/15000ms+250ms/M 700cp for 3 moves, D 120 moves/EPD:C:\LittleBlitzer\2moves_80_100.epd(1749)
Time = 6115 sec elapsed, 0 sec remaining
 1.  SFNNUE 0633 8 threads    	58.0/100	29-13-58  	(L: m=0 t=0 i=0 a=13)	(D: r=31 i=10 f=3 s=0 a=14)	(tpm=436.9 d=24.20 nps=7969609)
 2.  SFNNUE 0633 4 threads    	42.0/100	13-29-58  	(L: m=0 t=0 i=0 a=29)	(D: r=31 i=10 f=3 s=0 a=14)	(tpm=440.3 d=23.83 nps=4991558)
It's pretty obvious. Your cpu (being Haswell) has 2 8-wide FMA instructions per clock cycle, i.e. 2 FMA units per core. Meaning with 2 threads it can run one instruction per thread per clock cycle. By running 2 threads per core, you are able to hide instruction and operand fetch latency while with only 1 thread per core there would be thread stalling and you wouldn't be able to use both FMA units effectively.
Wasn't this valid 3-4-5 years ago too for my CPU? I was always getting a mere 30% from hyperthreading.
You used FMA vector instructions couple a years ago? Really, what for? C'mon at least try to understand what I wrote. I mean what's the purpose if you can't even put the minimum effort?
The fact is, aside SF NNUE, Sf_dev, Komodo have this "new" speed-up. Where did it came from as of now and was not there 2 years ago?
Milos
Posts: 4190
Joined: Wed Nov 25, 2009 1:47 am

Re: What happens with my hyperthreading?

Post by Milos »

Laskos wrote: Fri Aug 07, 2020 12:37 pm
Milos wrote: Fri Aug 07, 2020 12:14 pm
Laskos wrote: Fri Aug 07, 2020 9:51 am
Milos wrote: Fri Aug 07, 2020 5:50 am
Laskos wrote: Thu Aug 06, 2020 9:26 pm 60% speedup from hyperthreading using SF NNUE at longer TC, pretty crazy. What's that?

4 physical cores, 8 logical

Code: Select all

Games Completed = 100 of 100 (Avg game length = 60.676 sec)
Settings = Gauntlet/128MB/15000ms+250ms/M 700cp for 3 moves, D 120 moves/EPD:C:\LittleBlitzer\2moves_80_100.epd(1749)
Time = 6115 sec elapsed, 0 sec remaining
 1.  SFNNUE 0633 8 threads    	58.0/100	29-13-58  	(L: m=0 t=0 i=0 a=13)	(D: r=31 i=10 f=3 s=0 a=14)	(tpm=436.9 d=24.20 nps=7969609)
 2.  SFNNUE 0633 4 threads    	42.0/100	13-29-58  	(L: m=0 t=0 i=0 a=29)	(D: r=31 i=10 f=3 s=0 a=14)	(tpm=440.3 d=23.83 nps=4991558)
It's pretty obvious. Your cpu (being Haswell) has 2 8-wide FMA instructions per clock cycle, i.e. 2 FMA units per core. Meaning with 2 threads it can run one instruction per thread per clock cycle. By running 2 threads per core, you are able to hide instruction and operand fetch latency while with only 1 thread per core there would be thread stalling and you wouldn't be able to use both FMA units effectively.
Wasn't this valid 3-4-5 years ago too for my CPU? I was always getting a mere 30% from hyperthreading.
You used FMA vector instructions couple a years ago? Really, what for? C'mon at least try to understand what I wrote. I mean what's the purpose if you can't even put the minimum effort?
The fact is, aside SF NNUE, Sf_dev, Komodo have this "new" speed-up. Where did it came from as of now and was not there 2 years ago?
For SF-NNUE it makes total sense for others I have no clue. Looks like numbers are a bit high, but only 30% extra you had before also looks too low. Maybe you didn't use AVX2 based compiles before?
User avatar
Laskos
Posts: 10948
Joined: Wed Jul 26, 2006 10:21 pm
Full name: Kai Laskos

Re: What happens with my hyperthreading?

Post by Laskos »

smatovic wrote: Fri Aug 07, 2020 11:34 am You could do a plain NPS experiment with zero hashtable, just to figure out
what kind of impact memory latencies have on nowadays SF.

--
Srdja
The same speed-up, only at some 15% lower NPS than using hashtable.
User avatar
Laskos
Posts: 10948
Joined: Wed Jul 26, 2006 10:21 pm
Full name: Kai Laskos

Re: What happens with my hyperthreading?

Post by Laskos »

Milos wrote: Fri Aug 07, 2020 12:54 pm
Laskos wrote: Fri Aug 07, 2020 12:37 pm
Milos wrote: Fri Aug 07, 2020 12:14 pm
Laskos wrote: Fri Aug 07, 2020 9:51 am
Milos wrote: Fri Aug 07, 2020 5:50 am
Laskos wrote: Thu Aug 06, 2020 9:26 pm 60% speedup from hyperthreading using SF NNUE at longer TC, pretty crazy. What's that?

4 physical cores, 8 logical

Code: Select all

Games Completed = 100 of 100 (Avg game length = 60.676 sec)
Settings = Gauntlet/128MB/15000ms+250ms/M 700cp for 3 moves, D 120 moves/EPD:C:\LittleBlitzer\2moves_80_100.epd(1749)
Time = 6115 sec elapsed, 0 sec remaining
 1.  SFNNUE 0633 8 threads    	58.0/100	29-13-58  	(L: m=0 t=0 i=0 a=13)	(D: r=31 i=10 f=3 s=0 a=14)	(tpm=436.9 d=24.20 nps=7969609)
 2.  SFNNUE 0633 4 threads    	42.0/100	13-29-58  	(L: m=0 t=0 i=0 a=29)	(D: r=31 i=10 f=3 s=0 a=14)	(tpm=440.3 d=23.83 nps=4991558)
It's pretty obvious. Your cpu (being Haswell) has 2 8-wide FMA instructions per clock cycle, i.e. 2 FMA units per core. Meaning with 2 threads it can run one instruction per thread per clock cycle. By running 2 threads per core, you are able to hide instruction and operand fetch latency while with only 1 thread per core there would be thread stalling and you wouldn't be able to use both FMA units effectively.
Wasn't this valid 3-4-5 years ago too for my CPU? I was always getting a mere 30% from hyperthreading.
You used FMA vector instructions couple a years ago? Really, what for? C'mon at least try to understand what I wrote. I mean what's the purpose if you can't even put the minimum effort?
The fact is, aside SF NNUE, Sf_dev, Komodo have this "new" speed-up. Where did it came from as of now and was not there 2 years ago?
For SF-NNUE it makes total sense for others I have no clue. Looks like numbers are a bit high, but only 30% extra you had before also looks too low. Maybe you didn't use AVX2 based compiles before?
57% speed-up using an old SF_8 binary.
smatovic
Posts: 2639
Joined: Wed Mar 10, 2010 10:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic

Re: What happens with my hyperthreading?

Post by smatovic »

Hmm, so what's left? Windows SMT and maybe some kind of CPU micro-code update?

--
Srdja
User avatar
towforce
Posts: 11544
Joined: Thu Mar 09, 2006 12:57 am
Location: Birmingham UK

Re: What happens with my hyperthreading?

Post by towforce »

smatovic wrote: Fri Aug 07, 2020 1:28 pm Hmm, so what's left? Windows SMT and maybe some kind of CPU micro-code update?

--
Srdja

Any possibility that before, other processes were consuming threads?

Maybe if the older machine was slower, Windows itself needed more thread time. Or maybe it was a different installation, with more crap (Microsoft or another software company) running under Windows? Maybe a worse virus shield, or more or less anything.
Writing is the antidote to confusion.
It's not "how smart you are", it's "how are you smart".
Your brain doesn't work the way you want, so train it!
User avatar
Laskos
Posts: 10948
Joined: Wed Jul 26, 2006 10:21 pm
Full name: Kai Laskos

Re: What happens with my hyperthreading?

Post by Laskos »

smatovic wrote: Fri Aug 07, 2020 1:28 pm Hmm, so what's left? Windows SMT and maybe some kind of CPU micro-code update?

--
Srdja
Some nonsense is left. I will restart my PC after I finish today my project.
Milos
Posts: 4190
Joined: Wed Nov 25, 2009 1:47 am

Re: What happens with my hyperthreading?

Post by Milos »

Laskos wrote: Fri Aug 07, 2020 4:42 pm
smatovic wrote: Fri Aug 07, 2020 1:28 pm Hmm, so what's left? Windows SMT and maybe some kind of CPU micro-code update?

--
Srdja
Some nonsense is left. I will restart my PC after I finish today my project.
Did you check HT off nps numbers are they the same as before or maybe lower?
Maybe something is screwed with your HT off in OS?