Stockfish "Use Sleeping Threads" Test

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

Moderator: Ras

bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Stockfish "Use Sleeping Threads" Test

Post by bob »

mcostalba wrote:
pawnslinger wrote:I use Stockfish in conjunction with Aquarium. I analyze ongoing games that I am playing thru ICCF. With "sleeping threads" I have noticed that I am able to run more threads at the same core temperature. Even when not hyper-threading.

I run an OC'ed rig based on a i7-920 using air cooling, so I am very sensitive to my core temps. I frequently monitor them using "RealTemp". And try to maintain an average in the mid-60s C.

Before "Sleeping Threads", I was able to run Stockfish 1.9.1 with 4 cores and I would see average core temps run around 65C, depending on alot of extraneous factors... like ambient temp and dust clogging my air filter on the computer case.

So with "Sleeping Threads" enabled under Stockfish 2.0.1 I have been able to increase my threads to 6 and yet the core temps are still slightly lower than previously observed running 4 threads under Stockfish 1.9.1.

Also, it seems to me that now the size of the cache has an effect on core temps. I noticed the other night that a cache size of 2.4gb would cause higher core temps than a 1gb cache. Don't know why this is happening, but since this observation, I have kept my cache size on the smaller end of things.

Overall, I think that "sleeping threads" should be enabled by default. In my Aquarium setup, I have enabled them now, on a permanent basis.
When "sleeping threads" is on then there is less pressure on CPU becuase when a thread has finished its search job then simply stops running (sleeps) instead of continue ask for CPU resources as is with default setting. When new job comes ready then thread is awaken and starts another search.

We also have started to use "sleeping threads" for our development tests, not becuase is stronger (we still don't know) but because is "lighter" on the CPU pressure, for instance my QUAD runs much more quiet and cooler now (and is much more responsive to mouse, keyboard, etc. and other external events) and the result we want to achieve, i.e. understand if a modification is good or bad, can be done the same and in the same way than before.
One thing is clear, this is _not_ more efficient from a chess perspective. The latency of blocking/unblocking a thread is much higher than that needed to exit a simple spin loop. So those that see improved performance are measuring noise, not real results, until you use HT. For hyper-threading, if you spin you must use the pause instruction in the spin loop or it will most definitely perform worse. But this was old news that was discussed at length when hyper-threading first came along in the pentium IV, and I had assumed everyone was aware of the issue.