PDA

View Full Version : Why hyperthread? Why never hyperthread?


SamuraiCatJB
04-04-2005, 01:32 PM
I get asked this question a LOT of times. "Should I enable/disable hyperthread?" and when I respond back with another question, "what are you trying to do with the system?" people often get offended.

I'll skip the gory details of the technology, a good google will tell you that. But basically hyperthread divides your CPU in half. Now Windows is fooled into thinking you have two 1.6ghz processors instead of a single 3.2ghz processor. *cue screaming* So why does the manufacturer of the PCs often turn on hyperthread? The answer is multi-tasking....

Setup a very common tech support phone cal (trimmed for brevity)l:
*ring*
TS: hello, tech support, my name is ____ how can I help you today?
Cust: I can't burn a CD on your ***** machine.
* customer and TS exchange serial number and hardware specs *
TS: what kind of media and what speed?
Cust: CD-R 48x
TS: okay, that should be compatible. What were you burning and what else were you doing?
Cust: an Audio CD and why do you care?
TS: sorry sir, just trying to make sure you were not doing something that would overburden the machine while making the CD.
Cust: uhhhhh... I was playing Doom while the CD was burning.

Bingo.... Multitasking.... the evil monster of tech support nightmares. The hardware works, the software works, everything is compatible, and someone decides to play Doom or HL while burning a CD. And everything looks like it is working, but buffers underflow in the CD writer, CD pointers to data are lost in the burn process, the CD laser is targetting passing air-craft in boredom waiting for data, dogs and cats are sleeping together... you get the picture.

So hyperthread was meant to fix tech support nightmares? Nope, not at all. Okay, now you are confused. :) That is just why most computer manufacturers enable the hyperthread immeadiately upon building it. Hyperthread was a theory test, can a dual processor share the same process queue and work efficiently, work efficiently being the proper cornerstone. It is the entire design behind dual core coming later this year. AMD didn't bother with hyperthread, Intel proved it works so AMD didn't need to. This is also why you won't find Hyperthread Macs. It also solves an Intel only problem. Intel in its "infinite wisdom" builders larger and larger process queues, but this looses effiency when the processor multi-tasks. You will find Intel designs talking about Hyperthread achieving 10-15% higher performance. Well, then a hyperthread G4 or G5 or Athlon would get 10-15% performance increase too? nope. With the smaller process queues of the Athlon it is able to switch processes faster than the Intel, it is that difference between the Athlon and the Intel chips that hyperthread makes up for.... but only if you are running two high performance tasks! ooooo cue the dramatic music.

A power-pc design being RISC would gain almost nothing in hyperthread, but the microcode to handle logical processor splits would most assuredly slow it down. So no hyperthread Macs. AMD FX and Opteron lines finally get up to the processor queues that might gain something from hyperthread, but they are trying desperately to beat Intel to the dual core and skip hyperthread all-together. Thus no hyperthread on AMD.

So back to the question, should you enable disable hyperthread?
A) What are you trying to do? If you are running two high demand multi-tasking operations, or one critical timing operation (like burning a CD) and still doing other things... you want hyperthread on. But each task runs slower only allowed half the CPU total processing capability. If you want one really fast task able to stomp the other tasks into the ground and leave them a pile of mush in your wake, you want hyperthread off.

In the future you won't have a choice. Dual core means two 3ghz processors instead of one 3.2ghz processor. A good programmer can program his code to use both cores, but most software will only use one core. Hyperthread did serve its purpose in showing the path to dual core, and gave programmers a chance to code for dual processors on the cheap.

Now shut off the hyperthread like me, and stop playing doom while burning a CD and mush all the remaining processes into goo. :) enjoy! :)

Cyker
04-04-2005, 03:09 PM
IMHO it's generally best to leave HT on unless you do a lot of streamed data processing which can keep the P4 running at full tilt - The only performance deficit will be in slightly higher latencys, but the P4 has such huge latency anyway that you wouldn't notice :). The other problem is that a lot of older apps don't like dual-cpu systems, but this is usually easily fixed by setting the processor affinity.

I'm not sure why AMD never put it on theirs - They've over-engineered their CPUs just as much as Intel to get around the utter lameness of x86 (If only Intel made EPIC free!!), and have even more execution units so in theory their CPUs could be even better at it! Then again as SamCat says their CPUs are much better at keeping all the execution units busy than the P4 so maybe they're better off as they are. I also suspect it's because AMD can't be assed to step into the almighty Patent System minefield...

SamuraiCatJB
04-04-2005, 05:11 PM
I'm not sure why AMD never put it on theirs - They've over-engineered their CPUs just as much as Intel to get around the utter lameness of x86 (If only Intel made EPIC free!!), and have even more execution units so in theory their CPUs could be even better at it! Then again as SamCat says their CPUs are much better at keeping all the execution units busy than the P4 so maybe they're better off as they are. I also suspect it's because AMD can't be assed to step into the almighty Patent System minefield...

welll... the almighty patent system minefield is not as almighty as it once was. AMD could have integrated hyperthread and probably gained half the performance gain of Intel. As you said, their design is also getting overloaded now. But AMD had two goals, 64bit hybrid, which stomped out Intel's design for 64bit. And the new EM64t based processors of Intel are exact copies of the AMD design, including one accidental (or maybe more deliberate than we think), duplicate microcode instruction that proved to the world that Intel copied AMD. AMD didn't try to sue, though they didn't rule it out, they used it as publicity, and got an extra 3% boost following the news that Intel copied their design. So I expect they got their money via that boost, and there will be nothing but embarassment to Intel. 2nd is dual core. AMD desperately wants to beat Intel on the way to dual core. I cannot legally say how long Intel has had dual cores in prototype testing, and I have no idea how long AMD has been working on it. But almost everyone agrees, including AMD that to have attempted to impliment hyperthread, it would have pushed back their dual core releases to 2006 one or two quarters behind Intel.

None of us know who will be first to production cycle, either or both could be right now and stock piling for a mass market drop. No one knows. But if AMD had tried to match hyperthread, it would have killed their schedule of beating Intel on 64bit, and "maybe" beating them to dual core. Time will tell. :D

I am eagerly awaiting my dual processor dual core.... I just proved I can overload two processors with a single program. I am multithreaded, and heading towards massively parallel. They can feed me quad cores, I'll fill them. :D

Cyker
04-04-2005, 05:28 PM
...AMD didn't try to sue, though they didn't rule it out, they used it as publicity, and got an extra 3% boost following the news that Intel copied their design...
Are you sure? I thought Intel licensed the AMD64 instruction-set from them...!
But Intel still have some legal hooks in AMD from the old 486 days - Part of a long-forgotten settlement was some cross-sharing of IP and it's possible Intel got in via. that...



As for AMD's 64-bit set - I kinda think it sucks, esp. compared to what I know about EPIC. They've worked around a lot of the crap-ness of x86 in it (Like getting rid of the stupid stack-based floating-point system! Woo!), but the fact that it's still based on x86 still shows...

They're gonna run into the same trouble we're at now in the semi-near future, because x86 is incredibly bad for extracting parallelism at CPU level.
That's why HyperThreading is possible - There are so many parts of modern CPUs that get seriously under-utilised. Intel noticed this, and figured that with a few tweaks they could boost their CPU throughput by using a few of these extra 'hidden' registers and execution units as 'tho they were a second core.

In fact, compared to an 8086, modern CPUs are practically multi-core - One of the main thing that differentiates them is that, unlike true multi-core systems, they only have one memory pathway, and the Opterons with their on-board memory controllers are paving the way past that obstacle too!

SamuraiCatJB
04-04-2005, 06:01 PM
Where there is a will there is a way.

No one has said if any licensing was done. Intel certainly has not publicised that they licensed a copy from AMD. And AMD has made a fortune off of advertising that duplicate instruction (which btw, is sometimes called a poor-mans copyright, put in dead code somewhere that does nothing, but can be used to see if someone copies functionality or copies everything). It is possible Intel licensed it, but they certainly haven't admitted it.

True, backward compatibility holds us back. We're dragging around 100 of those 8086 boxes with full height 10mb hard drives. and we don't even know it. The chain gets longer, and heavier at every generation. Intels 64bit would have meant scrapping everything and moving to 64bit, but throwing away a good 1/3 of the chain in the process. That would have made everything faster, more efficient, but would have made a lot of people unhappy. But we would have grumbled and done it, had not AMD released an "easy" method of going 64bit. Unfortunately it keeps all, every inch, of that chain.... The easy road is not always the fastest road, but so too the more difficult road is not a good choice if you kill 1/3 of all the cars that drive it. :)

athlon64
05-03-2005, 03:26 AM
AMD never put it in because it would have barely made a difference in their processors.

Cyker
05-03-2005, 12:09 PM
Where there is a will there is a way.

No one has said if any licensing was done. Intel certainly has not publicised that they licensed a copy from AMD. And AMD has made a fortune off of advertising that duplicate instruction (which btw, is sometimes called a poor-mans copyright, put in dead code somewhere that does nothing, but can be used to see if someone copies functionality or copies everything). It is possible Intel licensed it, but they certainly haven't admitted it.

True, backward compatibility holds us back. We're dragging around 100 of those 8086 boxes with full height 10mb hard drives. and we don't even know it. The chain gets longer, and heavier at every generation. Intels 64bit would have meant scrapping everything and moving to 64bit, but throwing away a good 1/3 of the chain in the process. That would have made everything faster, more efficient, but would have made a lot of people unhappy. But we would have grumbled and done it, had not AMD released an "easy" method of going 64bit. Unfortunately it keeps all, every inch, of that chain.... The easy road is not always the fastest road, but so too the more difficult road is not a good choice if you kill 1/3 of all the cars that drive it. :)

Yeah, this was why I was kinda rooting for EPIC to work.

What I wanted was for someone to make a new more modular and extendable architecture that can run x86 crap via emulation.
This was what EPIC did, but obviously you can't emulate as fast as a native code CPU, and EPIC CPUs got most of their performance through parallelisation, not MHz, which made it espescially bad at emulating x86 which is a very very bad arhitecture for parallelism. In the end, people were not willing to settle for the downsides so it died off through lack of interest and we end up with the crappy x86 instruction set again...


It's a bit like digital TV - Many countries are not going to make their targets for shutting down the analog system because there's just too many analog TVs still in use: After all, why should someone get rid of a perfectly good TV for a disgracefully overpriced digital TV when the analog one works fine?
There is the option of getting a set-top box (The 'emulator') to run analog TV's on digital signals, but still people aren't going shift because there is no immediate benefit for them, and it will cost them crap-loads of money due to the price-hiking of digital sets.
(Which is almost as bad as LCD vs CRT was!)