TNGCC - need to decide ponder ON or OFF (new poll)

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

Moderator: Ras

Which option would you prefer TNGCC to use?

1 thread, ponder ON, ht OFF
3
8%
3 threads, ponder ON, ht ON
3
8%
3 threads, ponder OFF, ht OFF
16
43%
7 threads, ponder OFF, ht ON
15
41%
 
Total votes: 37

Lavir
Posts: 263
Joined: Sun Oct 28, 2012 11:45 am

Re: TNGCC - need to decide ponder ON or OFF (new poll)

Post by Lavir »

As I said in the other thread, I think there are too many unknown variables when using HT in this way.

Nobody has tested extensively HT with asymmetric cores, so nobody knows what can happen and if there are problems doing so. If you use HT symmetrically the result ranges from about 20% to 30% of speed increase (it depends on how many physical cores you have, I will talk of this later) in node counts and that can indeed range from neutral to even beneficial with the latest 6 Intel cores.

However that's because you use all the threads at the same time. Every logical core gives a little above half speed of a physical core by itself, so the less the logical cores, the less the speed increase you get, with however a full increase of 1 thread to the tree.

This means that if for example you use 2 physical cores + 1 logical core you get the tree ample 3 threads, but an increase in speed of only about 5% to the normal 2 (so a disadvantage).

So, IMO, either you use HT in full (a thing obviously you cannot do) or it's better to not use it at all. Too many unknown variables and the less the logical cores used, the less benefits and on the contrary disadvantages.

Even 7 threads will almost double the tree with about 15% increase in node count; at that point it's better to use 3 cores IMO.
User avatar
hgm
Posts: 28426
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: TNGCC - need to decide ponder ON or OFF (new poll)

Post by hgm »

Matthias Gemuh wrote:How can a GUI set an affinity mask under Windows through an API call, avoiding the DotNet Framework ?
According to the docs there is a SetProcessAffinityMask function in kernel32.dll for this:

http://msdn.microsoft.com/en-us/library ... 85%29.aspx
User avatar
hgm
Posts: 28426
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: TNGCC - need to decide ponder ON or OFF (new poll)

Post by hgm »

Lavir wrote:So, IMO, either you use HT in full (a thing obviously you cannot do) or it's better to not use it at all. Too many unknown variables and the less the logical cores used, the less benefits and on the contrary disadvantages.
I think this is needlessly conservative. There are many affinity schemes using less than the maximum number of CPUs where it is immediately clear that there should be no difference whether you use cores or hyperthreads. Like when you use (on a quad) logical cores 1-4 for engine A and logical cores 5-8 for engine B. For each of the engines this will not be different from when you were running them with 4 HT on a dual. The two (physical) core pairs will compete with each other for level-3 cache and memory bus, something you would not have when you were running only a single engine on a dual, but this is completely the same as what they would do when you run with HT off, engine A on core 1-2 and engine B on core 3-4.

The only tricky thing is when you would want to use only 6 logical cores, and would share cores between the two engines. Like assigning A to 1-3 and B to 4-6. Then thread 3 and 4, which share the same physical core, have different engines running. So that when some of the participants would not be able to run SMP, the other would get the core all by itself, which would cause it to speed up. So it would be better to let engine A use logical cores 1-3, and engine B cores 5-7, keeping cores 4 and 8 as spares, and the engines perfectly separated.
Modern Times
Posts: 3780
Joined: Thu Jun 07, 2012 11:02 pm

Re: TNGCC - need to decide ponder ON or OFF (new poll)

Post by Modern Times »

Graham Banks wrote:
hgm wrote:The idea was to set an affinity mask for each engine, so they were limited to their own logical cores, and thus could only compete with themselves. That should solve the problem you sketch.
I can recall when I was setting up one of my first 8 core tournaments, I was questioned on this issue:

Graham what are you calling 8 cores?
Do you mean a 4 core system with HT on?
If yes then this is not 8 cores.


However, I have 8 genuine cores across two sockets (Intel Skulltrail), so there wasn't anything to discuss.
Yes, I'm totally bewildered by this. Up until now, HT has nearly always been derided on this forum. Now suddenly HT is OK as extra cores for SMP engines. I don't know what to make of it. My vote still stands at 3 cores HT off, ponder off.

As for 3 threads, ponder ON, ht ON, well that is surely a disaster.
User avatar
Matthias Gemuh
Posts: 3245
Joined: Thu Mar 09, 2006 9:10 am

Re: TNGCC - need to decide ponder ON or OFF (new poll)

Post by Matthias Gemuh »

hgm wrote:
Matthias Gemuh wrote:How can a GUI set an affinity mask under Windows through an API call, avoiding the DotNet Framework ?
According to the docs there is a SetProcessAffinityMask function in kernel32.dll for this:

http://msdn.microsoft.com/en-us/library ... 85%29.aspx
Thanks ! 8-)
My engine was quite strong till I added knowledge to it.
http://www.chess.hylogic.de
User avatar
Houdini
Posts: 1471
Joined: Tue Mar 16, 2010 12:00 am

Re: TNGCC - need to decide ponder ON or OFF (new poll)

Post by Houdini »

My 2 cents.

1) For this kind of tournament, I guess that the most desirable result is having the best level of chess possible.
Ponder on, while fun and probably the most natural way of using an engine in a match, is less CPU-effective than ponder off with the double number of threads.

2) Running with a total number of engine threads larger than the number of cores is probably not recommended if you use different engines.
Thread management differs from engine to engine. Some engines use sleeping threads, whereas other engines will keep all their threads running all the time. This can create a CPU imbalance in favor of the latter engines.
If I recall correctly Stockfish falls in the first category, which means that when using hyper-threads there could be a CPU disadvantage for Stockfish.

3) On a recent Core i7 processor the GUI and management functions (e.g. interfacing with the web server) can probably run on the hyper-threads without too much disturbance of the engine process, if the Time Control is not too fast (say, more than 10 seconds per move).

Based on all this, I would suggest for the engine matches 4 threads without ponder, using the additional hyper-threads for the GUI and management processes.

Robert
bhlangonijr
Posts: 482
Joined: Thu Oct 16, 2008 4:23 am
Location: Milky Way

Re: TNGCC - need to decide ponder ON or OFF (new poll)

Post by bhlangonijr »

Houdini wrote: Based on all this, I would suggest for the engine matches 4 threads without ponder, using the additional hyper-threads for the GUI and management processes.

Robert
+1

The setup suggested by Robert should squeeze the best from the hardware.

HT ON
PONDER OFF
Engine settings: Threads 4
Lavir
Posts: 263
Joined: Sun Oct 28, 2012 11:45 am

Re: TNGCC - need to decide ponder ON or OFF (new poll)

Post by Lavir »

hgm wrote: I think this is needlessly conservative. There are many affinity schemes using less than the maximum number of CPUs where it is immediately clear that there should be no difference whether you use cores or hyperthreads. Like when you use (on a quad) logical cores 1-4 for engine A and logical cores 5-8 for engine B. For each of the engines this will not be different from when you were running them with 4 HT on a dual. The two (physical) core pairs will compete with each other for level-3 cache and memory bus, something you would not have when you were running only a single engine on a dual, but this is completely the same as what they would do when you run with HT off, engine A on core 1-2 and engine B on core 3-4.
From which "tests" did you extrapolate these conclusions? I never heard of a tester running a tournament of physical vs. logical cores.

I repeat: when you use a logical core it is about +5% speed. When you use 4 in total is about 20% speed increase that with doubling the tree it's fine and neutral (and with 6 cores it's even beneficial), but the less logical cores used, the less the increase while the tree grows the same as it does when you use real physical cores.

If for example you use only 1 physical core + 2 logical processors, you have a tree that work presuming 3 cores, but with only 1 core + 10% increase. This is a net loss.

In a more practical example: let's assume 2.500 kn/s for 1 core, and something like 7.000 for all three. With 1 core + 2 logical processes it will just be 2.750 for a tree of 3 threads.

Do you call that fine?
Last edited by Lavir on Thu Jan 03, 2013 12:06 am, edited 4 times in total.
User avatar
hgm
Posts: 28426
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: TNGCC - need to decide ponder ON or OFF (new poll)

Post by hgm »

Modern Times wrote:Yes, I'm totally bewildered by this. Up until now, HT has nearly always been derided on this forum. Now suddenly HT is OK as extra cores for SMP engines. I don't know what to make of it. My vote still stands at 3 cores HT off, ponder off.
They are not sleeping at Intel, and their stuff gets better and better. While the first HT implementation (in P-IV) was a bummer, they did a much better job when they re-introduced it in the i7. So what was true back then, will not necessarily stay true forever. On the Atom it even is a life saver. But on the i7 it is about neutral now, and with an engine that scales really well, HT on seems to improve the performance.
Lavir
Posts: 263
Joined: Sun Oct 28, 2012 11:45 am

Re: TNGCC - need to decide ponder ON or OFF (new poll)

Post by Lavir »

It's "neutral" because you have many logical cores that add up. With 4 is neutral (about 20%), with 6 is even beneficial (about 30%), but the adding of any logical process is only about 5% alone.

The tests that have been done (and that also I have done) have all used all the logical cores to add up the speed.