Cores versus Hyper-threading

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

Moderator: Ras

Sean Evans
Posts: 1777
Joined: Thu Jun 05, 2008 10:58 pm
Location: Canada

Cores versus Hyper-threading

Post by Sean Evans »

http://www.intel.com/products/processor ... /index.htm

Sorry to ask such a technophobe question, but what does Intel Hyper- Threading do as opposed to cores? i.e. how does it work and what will it do?

Thank you,

Sean
User avatar
M ANSARI
Posts: 3726
Joined: Thu Mar 16, 2006 7:10 pm

Re: Cores versus Hyper-threading

Post by M ANSARI »

For many applications HT will make things faster because it will use "virtual" cores to do more threads. For chess though this seems to not work. I have yet to hear of a chess engine that benefits from HT. If anything HT seems to be detrimental to chess engine performance if left on.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Cores versus Hyper-threading

Post by bob »

Sean Evans wrote:http://www.intel.com/products/processor ... /index.htm

Sorry to ask such a technophobe question, but what does Intel Hyper- Threading do as opposed to cores? i.e. how does it work and what will it do?

Thank you,

Sean
The easiest explanation goes back to operating systems and multiple processes running concurrently. When one does an I/O, which is a slow procedure, that process is blocked and the operating system chooses another process to run to consume the CPU cycles that would be wasted had we just looped and waited for the I/O operation to complete.

now zoom in to the CPU. hyper-threading gives the CPU two sets of registers, two sets of program counters/flag registers/etc, but one physical set of pipelines to execute instructions. When one instruction stream stalls due to a cache miss, or a long floating point instruction delay, the other instruction stream gets executed rather than having the processor stall and wait on the first stream to become executable again.

That's really all there is. If you carefully design a program to minimize cache misses, then hyper-threading doesn't help and since all parallel searches (at least the real ones in the world, not the imaginary ones "some" claim to have written) have some overhead involved, the overhead will usually more than offset the hyper-threading gains and the net effect is a slower time-to-solution.

With multiple cores this does not happen, multiple cores is exactly the same as having multiple CPUs, they are just on one chip rather than on several.
Sean Evans
Posts: 1777
Joined: Thu Jun 05, 2008 10:58 pm
Location: Canada

Re: Cores versus Hyper-threading

Post by Sean Evans »

bob wrote:With multiple cores this does not happen, multiple cores is exactly the same as having multiple CPUs, they are just on one chip rather than on several.
Hi, thanks for the explanation; however, multiple CPUs do have hyper-threading.

I misunderstood, I thought having HT was the same as turning 4-cores into 8-cores.

Thank you,

Sean
User avatar
M ANSARI
Posts: 3726
Joined: Thu Mar 16, 2006 7:10 pm

Re: Cores versus Hyper-threading

Post by M ANSARI »

Yes but as was explained HT will NOT be the same as having multiple real cores. The first Pentium series processors with HT had one physical core but would also have another virtual core. Then with E6600 you had 2 physical cores but no HT. Now Core i7 has 4 physical cores and 4 virtual cores (so still 4 cores). The HT in the Core i7 is supposed to be different and more advanced than the older HT ... but with chess engines it seems that the virtual cores still hurt performance and don't help ... as much as more than 20% worse with HT on for Rybka 3.
trojanfoe

Re: Cores versus Hyper-threading

Post by trojanfoe »

Is it possible for a process to turn off HT for itself then? AFAIK HT was only controllable on the P4 using the BIOS and there was no program control. If you know you will not benefit from HT and it might/will hurt your performance I would have thought you should have the option to turn it off. I am assuming no in which case what happens to chess engines that inadvertantely use HT?

Cheers,
Andy
User avatar
hgm
Posts: 28391
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Cores versus Hyper-threading

Post by hgm »

Hyperthreading is basically having two cores that share all execution units and caches. So to the software they look like two cores. But if the execution units are the bottleneck, like they seem to be in most Chess programs, both these virtual cores slow down, waiting for each others instructions to complete and release the executing units.
Vinvin
Posts: 5298
Joined: Thu Mar 09, 2006 9:40 am
Full name: Vincent Lejeune

Re: Cores versus Hyper-threading

Post by Vinvin »

M ANSARI wrote:. Now Core i7 has 4 physical cores and 4 virtual cores (so still 4 cores).
I think it's not clear , I'd say :
Core i7 has 4 physical cores and can run 2 threads simultaneously per core, so 8 virtual cores (so still 4 cores).
Vinvin
Posts: 5298
Joined: Thu Mar 09, 2006 9:40 am
Full name: Vincent Lejeune

Re: Cores versus Hyper-threading

Post by Vinvin »

As on P4, you can select to run 1 thread per physical core. Cores are always numbered in the same way; the program can select wich thread it will running on.
trojanfoe wrote:Is it possible for a process to turn off HT for itself then? AFAIK HT was only controllable on the P4 using the BIOS and there was no program control.
...
Andy
Aleks Peshkov
Posts: 928
Joined: Sun Nov 19, 2006 9:16 pm
Location: Russia
Full name: Aleks Peshkov

Re: Cores versus Hyper-threading

Post by Aleks Peshkov »

Do not forget, modern OSes have hundreds of system processes and device drivers. So HT should help performance in whole, just do not grub all CPU resources solely for a chess program.