Geschrieben von: / Posted by: Matt McKnight at 29 December 2003 16:02:30:
Als Antwort auf: / In reply to: Re: CPU usage (for Olivier too) geschrieben von: / posted by: JankS at 29 December 2003 13:16:32:
Thanks (sometimes really obvious things are not coming into the mind), now i studied a bit and understood i bought cat in a bag ...
But it seems that now HT definitely should be turned off when running single chess engine tournaments - this could speed up cpu almost 2 times. However if engine authors will start to optimize for HT technology allowing engine to calculate on one thread and ponder on another or winboard gui will allow one engine to use one thread (or logical cpu) and another engine - second thread, things can start to change dramatically

!
Hyperthreading is just Intel's latest hype-word for the way they pipeline the architecture. This has nothing to do with actual "threads." I do not believe that engine authors can do much with their code to take any kind of advantage from this. The only thing would be to use the most modern compilers, with P4 optimizations and such.
If you run a two-engine match in winboard, the two engines will run on separate threads already. Threading is an OS term, and something controlled completely by the OS, has nothing to do with hardware, or "logical cpus"
However, I have to say I'm not sure why having HT enabled in the BIOS causes this 50% cpu problem. I would be very interested to know if this is just a fluke in the windows task manager reporting. After disabling the HT and getting 100% from an engine, does the NPS change by something on the order of 2x? Or is the 50% just an inaccurate representation of the exact same speed? I don't know everything about this subject except for some fundamentals:
1) threading is an OS-level device, not hardware.
2) emulating a 'logical' cpu would be worthless and a step backwards. Except that it would do exactly what you are describing by giving both processes only 50% of the cpu. So effectively you are using a two processor machine, but at half the speed.
3) there _should_ (huge emphasis) never be a need to enable/disable the pipelining scheme.
This isn't meant to say that authors can't come up with a good way to use threads in their engine. One way to take advantage of so called 'hyper-threading' (or any pipelining) might be to do different 'parts' in threads. Example: eval thread, move-gen thread, etc... Because you glean the most speedup from pipelining if you are mixing separate threads through the pipeline (hence the term Hyper-threading). This causes less data/pipeline hazards which in turn gives you optimal speed. I haven't spent much time thinking about how to do things in turn wisely, like generating moves for the next ply while evaluating some positions or forward looking the hash, etc. So multiple threads might not be practical for an application like chess, but I definately agree that overall design and implementation of the different 'parts' of the engine can perhaps be improved upon using threading.
Well anyway, most of this is just conjecture on my part, but the reason for it is my incomplete understanding of Intel's Hyper-threading. I know enough about HT to realize that I know jack about all of it's different 'features.' It just really doesn't make sense, and I hate the feeling that it's name is the only root of confusion. I'm sure everyone will remember those great 'Turbo' buttons on the front of old 386/486 machines. I'd say that HT is nothing more than one of these buttons that make people think their machine is going to be faster.
Matt