Threads vs Cores

Discussion about chess-playing software (engines, hosts, opening books, platforms, etc...)
Post Reply
andytl755
Posts: 4
Joined: Fri Sep 07, 2012 12:23 pm

Threads vs Cores

Post by andytl755 » Sat Aug 02, 2014 5:02 pm

I know it might seem like an obvious question, but I'm not sure what setting to use for the UCI Engines I am using.

For example, my laptop has 4 Cores, and 8 Threads. Stockfish, and I think a number of engines, instruct to set the number of Threads to the number of Cores you have. So although I have 8 Threads, according to Stockfish I should make the setting Thread be 4.

When I set Threads to 4, I find the Performance tab in Windows Task Manager displays 8 seperate graphs for CPU Usage History. The overall CPU usage approximates around 50%, while nearly all the time 6 graphs show functioning, while 2 show flatlining.

If I make the setting 8, I find the Performance tab shows an overal CPU usage of 95-100%, while all 8 graphs showing very high usage.

Could somebody please advise me, are Chess Engine Threads different to CPU threads? What do I need to have the setting on? I am happy if it is genuinely 4. I do not want to be guilty of psuedo-over clocking as it were.

Many Thanks
Andy

BB+
Posts: 1484
Joined: Thu Jun 10, 2010 4:26 am

Re: Threads vs Cores

Post by BB+ » Sat Aug 02, 2014 11:45 pm

I know it might seem like an obvious question,
Well, it seems to get debated a lot, so it's not that obvious.

In your case of 4 cores and 8 threads, there is a tradeoff to having the engine use 8 threads:

*) Its overall NPS will (or should) go up somewhat, due to gains from the OS hyperthreading;
*) But now it is splitting the search tree into 8 rather than 4 parts, which is algorithmically a loss (in most engines).

It can be engine-dependent (or OS-dependent, or AMD/Intel-dependent, or memory-management-subsystem-dependent) as to whether or not the overall gain is worth it. It could also depend on the target time control (splitting is easier at longer time controls, due to bigger trees). I personally generally use hyperthreading, though I think I might be in the minority.

The above assumes you are using the computer for nothing else but chess, that you don't have NUMA issues with a dual-cpu setup, etc.

Mathboy
Posts: 2
Joined: Sun Feb 23, 2014 7:39 am

Re: Threads vs Cores

Post by Mathboy » Mon Aug 25, 2014 1:09 am

I agree. It is a subject of frequent debate. Many who I think are actually quite knowledgeable, certainly far more knowledgable than I am, swear that performance degrades if you use more threads than the number of physical cores. But I've experienced the opposite at least in Windows. Now I just do what seems to work best. Unfortunately, that's subjective. It would take enormous amounts of time to figure out rigorously how many threads actually leads to the best rating on a machine.

Post Reply