Hyperthreading Hype predates Intel

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

Moderators: hgm, Rebel, chrisw

User avatar
Matthias Gemuh
Posts: 3245
Joined: Thu Mar 09, 2006 9:10 am

Re: Hyperthreading Hype predates Intel

Post by Matthias Gemuh »

lmader wrote:
Ahhhh, ok. I am at peace now :P
We can agree that HT CPUs aren't always slow.

And yes, the L1/L2 caches getting wiped out by one thread, and various other issues can result in performance loss with HT. Whether it's an overall, general system gain for the average user is probably unclear, but I do notice that my old P4 system with a gig and half of memory runs Vista more smoothly than with the HT off. Perhaps Vista has optimized the scheduler well.

I use Windows XP and only have an acceptably responsive Pentium IV machine if HT is active.
Whoever can say whatever he likes, but the fact remains that HT is a very welcome measurable gain in practice, independent of theory I don't understand :D

Matthias.
My engine was quite strong till I added knowledge to it.
http://www.chess.hylogic.de
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Hyperthreading Hype predates Intel

Post by bob »

Matthias Gemuh wrote:
lmader wrote:
Ahhhh, ok. I am at peace now :P
We can agree that HT CPUs aren't always slow.

And yes, the L1/L2 caches getting wiped out by one thread, and various other issues can result in performance loss with HT. Whether it's an overall, general system gain for the average user is probably unclear, but I do notice that my old P4 system with a gig and half of memory runs Vista more smoothly than with the HT off. Perhaps Vista has optimized the scheduler well.

I use Windows XP and only have an acceptably responsive Pentium IV machine if HT is active.
Whoever can say whatever he likes, but the fact remains that HT is a very welcome measurable gain in practice, independent of theory I don't understand :D

Matthias.
It can also be a "placebo effect" as well...
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Hyperthreading Hype predates Intel - heres some data

Post by bob »

I did not have time to run a lot of tests, but here are three different positions that sort of illustrate what I expect from hyperthreading. The first position is always run with SMT on, just using one CPU. The second run is same position, mt=2 (SMT always on). The third run is same again but with mt=4 since this box has 2 physical processors which support SMT.

Position 1:
log.001: time=47.43 mat=0 n=43607485 fh=92% nps=919K
log.002: time=22.38 mat=0 n=40739099 fh=92% nps=1.8M
log.003: time=22.24 mat=0 n=42172438 fh=92% nps=1.9M

This is one of those "good positions" that actually produces a better-than expected speedup with 2 cpus. Notice that the tree size is actually smaller than the one-cpu tree which accounts for the super-linear speedup of 2.12X. Notice that with two threads, the NPS is almost exactly double, which is expected. With SMT on and 4 threads however, the nps does climb very slightly about 5% roughly. So 5% faster nps, .1 second faster time. OK.

Position 2:
log.004: time=19.70 mat=0 n=18126212 fh=92% nps=920K
log.005: time=10.72 mat=0 n=19442367 fh=92% nps=1.8M
log.006: time=11.82 mat=0 n=21781144 fh=92% nps=1.8M

speedup for 2 cpus looks decent, speedup for 4 is somewhat worse. No NPS improvement at all.

Position 3:
log.007: time=1:30 mat=1 n=96832656 fh=87% nps=1.1M
log.008: time=44.07 mat=1 n=90680477 fh=87% nps=2.1M
log.009: time=46.88 mat=1 n=98290842 fh=87% nps=2.1M

Again speedup for 2 looks good, speedup for 4 is slightly worse than for 2, no NPS improvement at all for four.

Only good thing is that with SMT on, the linux process scheduler uses two run queues, one for each physical processor, so that if you have just two processes ready to run, each always runs on a different physical processor, which old versions of the kernel did not do at all. So you can leave it on and by using just two threads, get good performance. But going to 4 is a losing proposition at worst, a break-even at best. And these positions are known for being pretty good speedup-tests. There are worse positions that show SMT in a worse light...

Here is just one I had time to do:

position 4:
log.010: time=1:20 mat=0 n=70897844 fh=90% nps=879K
log.011: time=35.69 mat=0 n=58625873 fh=90% nps=1.6M
log.012: time=1:01 mat=0 n=108054377 fh=90% nps=1.7M

Note that 4 threads is almost 2x slower than 2 and is barely faster than just one.

So for crafty, NPS improvement is minimal, between 0 and 5%, while search overhead stays solidly at 30% + most of the time... There is a moral. 4 cpus that are each as fast as the one original works well. But given the choice of two x ghz processors, or four x/2 ghz processors, I'll take the 2 x ghz processors every time, where smt gives you 4 x/2 that are not as efficient for chess and very little faster in terms of raw nps...
User avatar
Matthias Gemuh
Posts: 3245
Joined: Thu Mar 09, 2006 9:10 am

Re: Hyperthreading Hype predates Intel

Post by Matthias Gemuh »

bob wrote:
Matthias Gemuh wrote:
I use Windows XP and only have an acceptably responsive Pentium IV machine if HT is active.
Whoever can say whatever he likes, but the fact remains that HT is a very welcome measurable gain in practice, independent of theory I don't understand :D

Matthias.
It can also be a "placebo effect" as well...

A "placebo effect" that speeds up systems significantly, makes them more responsive and much more stable is always welcome.

Matthias.
My engine was quite strong till I added knowledge to it.
http://www.chess.hylogic.de
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Hyperthreading Hype predates Intel

Post by bob »

Matthias Gemuh wrote:
bob wrote:
Matthias Gemuh wrote:
I use Windows XP and only have an acceptably responsive Pentium IV machine if HT is active.
Whoever can say whatever he likes, but the fact remains that HT is a very welcome measurable gain in practice, independent of theory I don't understand :D

Matthias.
It can also be a "placebo effect" as well...

A "placebo effect" that speeds up systems significantly, makes them more responsive and much more stable is always welcome.

Matthias.
My point was that this is something that is not quantatively measured. I have been running with SMT on on my box, compiling, playing chess, browsing. I don't notice _any_ difference at all.

As far as "much more stable" that makes no sense to me at all. I have yet to see a "speeds up systems significantly" on anything I do. Which would primarily be compiling, executing, and other such things on several different "number crunching" applications, of which chess is just one. "makes them more responsive" doesn't work for me. I can tell absolutely no difference with SMT on or off on my linux box using recent kernels.

The "placebo effect" is well-documented, as believing in something is often enough to make things seem better, whether they really are or not is another issue. I can't help but notice that after the PIV SMT went the way of the dinosaurs for a while, which suggests that it was not worthwhile for most.. Bringing it back doesn't necessarily mean it is better. It might be just another "gimmick" for sales hyperbole...