Page 1 of 1

Virtualization and multi-processor engines

Posted: Thu Aug 16, 2012 8:16 pm
by rreagan
How does virtualization affect engines that are multi-processor aware? Can you accurately develop and test a MP engine on a virtual machine?

Re: Virtualization and multi-processor engines

Posted: Fri Aug 17, 2012 5:33 am
by bob
rreagan wrote:How does virtualization affect engines that are multi-processor aware? Can you accurately develop and test a MP engine on a virtual machine?
You can test/debug, but performance sucks and you can't really tune the parallel algorithm for performance...

Re: Virtualization and multi-processor engines

Posted: Sat Aug 18, 2012 7:50 am
by diep
rreagan wrote:How does virtualization affect engines that are multi-processor aware? Can you accurately develop and test a MP engine on a virtual machine?
For some engines it will be factor 1000 slower under specific circumstances.

Stockfish is good example.

Diep suffers at least factor 2 in nps, but in search depth that's more ugly. Easily loses 3 to 5 ply search depth.

It's good to debug your engine under such circumstances usually.

SMP search suffers from exponential problems if threads suffer from unknown delays.

I assume of course virtualization where you do not have the garantuee that every virtual 'core' is getting you the 100% system time when you need it.

Suppose some virtual environment has in reality 8 cores and is showing to you 24 cores. Some threads get a short 'blockade' for a bunch of milliseconds and then others.

Instantly your SMP program will simply be in 1 thread T and that blocks all other threads T'. When T gets system time we know others get blocked again. So T can do something tiny then it runs into something that's locked or causes it to wait by some thread from the pool of T'.

Even if you would seemingly scale reasonable then, like Diep, this gives huge search depth problems. Losing 5 plies search depth is not uncommon and it's easy to prove why.

Some total idiotic subtree Y is not blocked of course. Normally spoken we would abort all cpu's now as we have a fail high somewhere; that just doesn't happen as those threads are kind of semi deadlocked thanks to the virtualization not garantueeing us a smooth run.

So the abort never occurs and we keep searching already aborted subtrees.

You really need a hard garantuee for SMP search that every thread *never* gets interrupted in any manner. It MUST be able to execute instructions nonstop. Sure it may be slow, but that's not how 99% of the virtualization world works.

They run more threads than they have cores obviously.

Re: Virtualization and multi-processor engines

Posted: Sat Aug 18, 2012 8:41 am
by mcostalba
diep wrote: For some engines it will be factor 1000 slower under specific circumstances.

Stockfish is good example.
Set UCI option "Use Sleeping Threads" to true and retry...

Re: Virtualization and multi-processor engines

Posted: Sat Aug 18, 2012 3:29 pm
by diep
mcostalba wrote:
diep wrote: For some engines it will be factor 1000 slower under specific circumstances.

Stockfish is good example.
Set UCI option "Use Sleeping Threads" to true and retry...
Won't help you much if you use central locking at a virtual server that
shows you n cores meanwhile you have n-i with i > 0...