SMP speed up
Moderators: bob, hgm, Harvey Williamson
Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Re: SMP speed up
In your DTS paper you give a measured speedup of 11.1 for 16 CPUs, which is less than your formula says (11.5), despite the fact that DTS is supposed to be a better parallel algorithm than what you're using today.
So which one is it... the formula is wrong, or your current parallel algorithm is actually about as good or even better than DTS for 16 CPUs and possibly above?
To me the results in the DTS paper make more sense, i.e. efficiency keeps going down when adding CPUs instead of hovering around a minimum. Unfortunately the paper doesn't have results for more than 16 CPUs.
So which one is it... the formula is wrong, or your current parallel algorithm is actually about as good or even better than DTS for 16 CPUs and possibly above?
To me the results in the DTS paper make more sense, i.e. efficiency keeps going down when adding CPUs instead of hovering around a minimum. Unfortunately the paper doesn't have results for more than 16 CPUs.

 Posts: 10207
 Joined: Wed Mar 08, 2006 7:57 pm
 Location: Redmond, WA USA
 Contact:
Re: SMP speed up
11.1 seems to answer very neatly for the 11.5 predicted by the forumla.rbarreira wrote:In your DTS paper you give a measured speedup of 11.1 for 16 CPUs, which is less than your formula says (11.5), despite the fact that DTS is supposed to be a better parallel algorithm than what you're using today.
So which one is it... the formula is wrong, or your current parallel algorithm is actually about as good or even better than DTS for 16 CPUs and possibly above?
To me the results in the DTS paper make more sense, i.e. efficiency keeps going down when adding CPUs instead of hovering around a minimum. Unfortunately the paper doesn't have results for more than 16 CPUs.
You were expecting an exact answer agreement? Of course, that would be an utterly ridiculous expectation (in fact we rightly view such data with mathematical suspicion).
If, for instance, a student dropped a penny and measured the force of gravity using the mass of the penny and the mass of the earth and came up with 6.673 x 10^(11) m^3/(kg*s^2) it would seem a little farfetched.

 Posts: 303
 Joined: Wed Mar 22, 2006 9:17 am
 Location: Novi Sad, Serbia
Re: SMP speed up
I think this is a realistic formula:michiguel wrote:This is a spin off of another thread.
I never gave a lot thought about it but the well know formula for Crafty
speedup = 1 + (NCPUS  1) * 0.7
may indicate that the inefficiency is not related to the Amdahl's law, even if this applies to a low number of CPUs. What is the cause of the parallel inefficiency? The shape of the tree? still, it looks like it should either saturate quicker or the speed up with 2 cores should be higher than 1.7
Was this investigated?
Miguel
Speedup(1) = 1
Speedup(NCPUS) = 1.7*Speedup(NCPUS/2)
Best Regards,
Karlo Balla Jr.
Karlo Balla Jr.
Re: SMP speed up
What part of my post made you think that I was complaining about 11.1 not being equal to 11.5?Dann Corbit wrote:11.1 seems to answer very neatly for the 11.5 predicted by the forumla.rbarreira wrote:In your DTS paper you give a measured speedup of 11.1 for 16 CPUs, which is less than your formula says (11.5), despite the fact that DTS is supposed to be a better parallel algorithm than what you're using today.
So which one is it... the formula is wrong, or your current parallel algorithm is actually about as good or even better than DTS for 16 CPUs and possibly above?
To me the results in the DTS paper make more sense, i.e. efficiency keeps going down when adding CPUs instead of hovering around a minimum. Unfortunately the paper doesn't have results for more than 16 CPUs.
You were expecting an exact answer agreement? Of course, that would be an utterly ridiculous expectation (in fact we rightly view such data with mathematical suspicion).
If, for instance, a student dropped a penny and measured the force of gravity using the mass of the penny and the mass of the earth and came up with 6.673 x 10^(11) m^3/(kg*s^2) it would seem a little farfetched.
Did you actually read/understand my post and the fact that the formula is predicing something different from DTS? According to Robert, the formula is supposed to predict Crafty's scaling, which is supposed to be worse than DTS scaling.
The fact that the formula predicts a scaling which is better than DTS (or about equal, if you want to ignore the small difference) is what I find strange given that Robert always says that DTS is quite a lot better than the other parallel algorithms.
Does DTS only pay off with more than 16 CPUs? Does the formula wrongly predict Crafty's scaling above 8 CPUs? Or maybe Crafty's parallel algorithm is already as good as DTS? All are possibilities, I'm just trying to find out the reason for the discrepancy.
Re: SMP speed up
This chart compares Crafty's estimated speedup function with actual workload benchmarks from an IBM mainframe (zseries 2097). It shows that Crafty's estimate is not unreasonable up to about 42 CPUs. This would make sense since the function was derived from measurements with far fewer CPUs. Only one test is known at more than 32 CPUs (64) for crafty, and the details of that test are sketchy since Bob did not run it.bob wrote:I beat it to death for 18 cores. About all that can be said is that after the first CPU, every processor added makes the tree grow. If you run the old CB positions, which are all the positions from a single real game that everyone has seen, it is pretty consistent. There is lots of variation until you average over all the moves, and then that 30% extra nodes per CPU starts to settle down. You could drive this down by improving move ordering to get a higher percentage of fail highs on the first move. But I have been stuck at 9092% for years, which pretty well fixes the overhead since one of every 10 splits (when I split right after the first move) is going to be at a bad point that adds overhead...michiguel wrote:This is a spin off of another thread.
I never gave a lot thought about it but the well know formula for Crafty
speedup = 1 + (NCPUS  1) * 0.7
may indicate that the inefficiency is not related to the Amdahl's law, even if this applies to a low number of CPUs. What is the cause of the parallel inefficiency? The shape of the tree? still, it looks like it should either saturate quicker or the speed up with 2 cores should be higher than 1.7
Was this investigated?
Miguel
There is likely a mathematical model that considers fh % as computed in Crafty, and predicts the speedup, but I have never tried to quantify that at all since it would not be of any benefit. We all know that YBW depends on the first move being the one to cause a cutoff, else we think it is an ALL node.
In my dissertation I tackled this by searching perfectly ordered trees and got perfect linearity in the speedup. But I faked the eval to produce a monotonically decreasing value to simulate perfect ordering. I also tackled worstfirst, which is pure minimax, and also got perfect speedups. But it was slow with no cutoffs at all. It is the very good trees that cause the problem.
Source data is from Cheryl Watson z/OS CPU Chart, October 2008, Watson & Walker, Inc.
Matthew Hull
Re: SMP speed up
Matthew what is that graphic supposed to prove? If you know anything about programming you will know that parallel speedups depend heavily on the problem at hand.
Not to mention the fact that that graphic can be used to prove almost anything, given the quantity of different curves it has.
Not to mention the fact that that graphic can be used to prove almost anything, given the quantity of different curves it has.
Re: SMP speed up
It proves that the Crafty estimate function is not physically impossible (as Milos implied) up to 32 CPUs (with some room to spare). You will note that it is actually worse than several of the benchmarks up to 40 CPUs.rbarreira wrote:Matthew what is that graphic supposed to prove? If you know anything about programming you will know that parallel speedups depend heavily on the problem at hand.
Not to mention the fact that that graphic can be used to prove almost anything, given the quantity of different curves it has.
I suspect that if measurements could be made of crafty for for each number of CPUS on such a box, the curve would end up looking like the other curves in shape.
Matthew Hull
Re: SMP speed up
I've run on two 64cpu boxes. The first was a pain in the a**. Eugene Nalimov had a 64processor Itanium box they were using in his group at Microsoft. NUMA all the way. It was very difficult to get NPS scaling to work very well at all. The second was more usable. But again, testing time was limited. I have run extensively on 2/4/8/16 cpu boxes, both Intel and AMD. AMD has had quadchip processors in the development lab for years, and 4x4 and 4x6 are doable. There have been 8chip boxes scattered around, but they are always pricey and not always reliable.mhull wrote:This chart compares Crafty's estimated speedup function with actual workload benchmarks from an IBM mainframe (zseries 2097). It shows that Crafty's estimate is not unreasonable up to about 42 CPUs. This would make sense since the function was derived from measurements with far fewer CPUs. Only one test is known at more than 32 CPUs (64) for crafty, and the details of that test are sketchy since Bob did not run it.bob wrote:I beat it to death for 18 cores. About all that can be said is that after the first CPU, every processor added makes the tree grow. If you run the old CB positions, which are all the positions from a single real game that everyone has seen, it is pretty consistent. There is lots of variation until you average over all the moves, and then that 30% extra nodes per CPU starts to settle down. You could drive this down by improving move ordering to get a higher percentage of fail highs on the first move. But I have been stuck at 9092% for years, which pretty well fixes the overhead since one of every 10 splits (when I split right after the first move) is going to be at a bad point that adds overhead...michiguel wrote:This is a spin off of another thread.
I never gave a lot thought about it but the well know formula for Crafty
speedup = 1 + (NCPUS  1) * 0.7
may indicate that the inefficiency is not related to the Amdahl's law, even if this applies to a low number of CPUs. What is the cause of the parallel inefficiency? The shape of the tree? still, it looks like it should either saturate quicker or the speed up with 2 cores should be higher than 1.7
Was this investigated?
Miguel
There is likely a mathematical model that considers fh % as computed in Crafty, and predicts the speedup, but I have never tried to quantify that at all since it would not be of any benefit. We all know that YBW depends on the first move being the one to cause a cutoff, else we think it is an ALL node.
In my dissertation I tackled this by searching perfectly ordered trees and got perfect linearity in the speedup. But I faked the eval to produce a monotonically decreasing value to simulate perfect ordering. I also tackled worstfirst, which is pure minimax, and also got perfect speedups. But it was slow with no cutoffs at all. It is the very good trees that cause the problem.
Source data is from Cheryl Watson z/OS CPU Chart, October 2008, Watson & Walker, Inc.
Intel keeps delaying their 8core chip, we'd like to buy a 4x8 box like that as it would not be excessively expensive. But it is always "3 more months" although they have announced the 7500. And AMD has announced a 12core chip although again I have not (yet) run on one.
Once either of those is available, I will be able to produce a lot more 12481632 data, and can probably begin to find nonprototypenonNDA machines with 4864 (and perhaps even beyond) numbers of CPUs.
Another note is that not all Ncpu boxes are created equal. Years ago I bought an ALR box with 4 chips, thing had 4way interleaved memory. We bought a cheapo4way box later, and it performed significantly worse. Turns out it used a standard memory controller/design, which meant 4 cpus fighting for data and starving for both instructions and data. The "server" boxes are generally better, but also more pricey. But they typically offer a better memory subsystem as well to keep all the CPUs busy.
My linear speedup approximation formula is based on the reasonable machines I have run on. It is an approximation. Certainly a bit low for 2x, may well be a little high for 64x since there is not a lot of good data that I have produced. When NUMA enters the picture, there is yet another issue to deal with since memory starts to slow down as it gets farther from a particular CPU. Formula won't be so accurate there, although for a 4chip AMD it works well since that was where much of the testing was done, starting with the old 4x2 opteron boxes I used in some early CCT events. 4 nodes is not so bad for NUMA. 32 nodes (using the AMD hypertransport model becomes quite problematic.
Re: SMP speed up
How many times does it take for me to say this before it sinks in.rbarreira wrote:In your DTS paper you give a measured speedup of 11.1 for 16 CPUs, which is less than your formula says (11.5), despite the fact that DTS is supposed to be a better parallel algorithm than what you're using today.
So which one is it... the formula is wrong, or your current parallel algorithm is actually about as good or even better than DTS for 16 CPUs and possibly above?
To me the results in the DTS paper make more sense, i.e. efficiency keeps going down when adding CPUs instead of hovering around a minimum. Unfortunately the paper doesn't have results for more than 16 CPUs.
The formula is not exact. It is not intended to be accurate to decimal places. It is simply a linear approximation to suggest where a particular data point will fall, within a reasonable margin of error. To answer your question, it is _neither_. DTS is better, it has less overhead due to being able to choose better split points. But once you get a lot of processors involved, it actually could get worse than the current algorithm. I've since spent quite a bit of time (things like "minthreadgroup" that everyone seems to have copied. That addressed something with DTS that we did not have time to test and tune. With that idea the DTS paper in the JICCA might (emphasis on might) have been a little better at 16 or 32. We ran on the 32 cpu box for one tournament, and the data we got there was not nearly as good as we had hoped. But time marches on, new ideas were discovered to address specific weaknesses that were difficult to anticipate until the actual hardware became available.
So please stop trying to make this formula about accuracy. It was intended to answer the question that always came up in the days when nobody else was doing parallel search, namely "Bob, what kind of speedup should I see if I buy a dualcpu box? A quadcpu box? I'm looking at a 4socked AMD with dual cores, how much faster will that run?"
That was all it was intended. Now a couple of idiots want to take a linear approximation to a very much nonlinear (and small) set of data points (nothing about chess is linear) and quibble about it's accuracy.
Feel free to run a few thousand positions on 1, 2, 4, 8, and 16/32/64 if you can get access, and produce a more accurate formula. Would not bother me at all. When that was written, there was no T932 available, so we could not go to 32. If we had had access, I'd bet we could have pushed that flattening up a bit. The simplest example is that we always split somewhere with all processors that were available. Why split at a node where you have 8 cpus and 8 moves (or even fewer, and sometimes we did not know how many moves we would have since we didn't generate them all at once at every position. In Crafty, I limit the number of threads working at any single split point to address this problem, plus it is better to not put all your eggs in one basket (or all your cpus on one node) in those cases where this ALL node turns into a CUT node. With only 4 processors working there, you get less overhead.
So there are ideas to improve things, but for smallish numbers of processors, Cray Blitz could simply choose better split points than the simple YBW algorithm I use today.
Re: SMP speed up
Forget that point. Remember, this is a linear approximation (emphasis on approximation) to nonlinear data points, but it _must_ be accurate to 4 decimal places for some to be happy. For the purposes it was intended for, within 25% would be just fine. How fast using 4 cpus? 2.04.0 depending on the position. Occasionally not even 2.0. Average? 1.71.9 depending on positions? Lots of positions? Close to 1.8. Formula predicts 1.7. Less than 10% off? Not good enough, it seems. Never knew "linear approximations" had to have that kind of accuracy or I would never have even mentioned the rough guess...Dann Corbit wrote:11.1 seems to answer very neatly for the 11.5 predicted by the forumla.rbarreira wrote:In your DTS paper you give a measured speedup of 11.1 for 16 CPUs, which is less than your formula says (11.5), despite the fact that DTS is supposed to be a better parallel algorithm than what you're using today.
So which one is it... the formula is wrong, or your current parallel algorithm is actually about as good or even better than DTS for 16 CPUs and possibly above?
To me the results in the DTS paper make more sense, i.e. efficiency keeps going down when adding CPUs instead of hovering around a minimum. Unfortunately the paper doesn't have results for more than 16 CPUs.
You were expecting an exact answer agreement? Of course, that would be an utterly ridiculous expectation (in fact we rightly view such data with mathematical suspicion).
If, for instance, a student dropped a penny and measured the force of gravity using the mass of the penny and the mass of the earth and came up with 6.673 x 10^(11) m^3/(kg*s^2) it would seem a little farfetched.