No "last core parallel slowdown" on OS X
Dave Bayer
bayer at cpw.math.columbia.edu
Sat Apr 18 14:39:00 EDT 2009
I'm a huge fan of the recent paper
http://ghcmutterings.wordpress.com/2009/03/03/new-paper-runtime-support-for-multicore-haskell/
which put me over the top to get started writing parallel code in
Haskell. Parallel code is now integral to my and my Ph.D. students'
research. For example, we recently checked an assertion for the
roughly 69 billion atomic lattices on six atoms, in a day rather than
a week, using perhaps 6 lines of parallel code in otherwise sequential
code. When you're anxiously waiting for the answer, a day is a lot
better than a week. (The enumeration itself is down to two hours on 7
cores, which astounds me. I see no reason to ever use another language.)
In that paper, they routinely benchmark N-1 cores on an N core Linux
box, because of a noticeable falloff using the last core, which can do
more harm than good. I had confirmed this on my four core Linux box,
but was puzzled that my two core MacBook showed no such falloff. Hey,
two cores isn't representative of many cores, cache issues yada yada,
so I waited.
I just got an EFi-X "boot processor" (efi-x.com) working on a nearly
identical quad core box that I built, and I tested the same
computations with OS X. For my test case, there's a mild cost to
moving to parallel at all, but...
Compared to 2 cores, using 3, 4 cores on a four core Linux box gives
speedups of
1.37x, 1.38x
Compared to 2 cores, using 3, 4 cores on an equivalent four core box
running OS X gives speedups of
1.45x, 1.9x
Here 1.5x, 2.0x is ideal, so I'm thrilled. If we can't shame Linux
into fixing this, I'm never looking back. How true is this for other
parallel languages? Haskell alone is perhaps too fringe to cause a
Linux scandal over this, even if it should...
The EFi-X boot processor itself is rather expensive ($240 now), and
there's sticking to a specific hardware compatibility list, and I
needed to update my motherboard BIOS and the EFi-X firmware, but no
other fiddling for me. These boxes are just compute servers for me, I
would have been ok returning to Linux, but not if it means giving up a
core. People worry about compatibility, "I sensed a softness in the
surround sound in game X...", but for me the above numbers put all
this in perspective.
Another way to put this, especially for those who don't have a strong
preference for building their own machines, and can't wait for Linux
to get its act together:
If you're serious about parallel Haskell, buy a Mac Pro.
More information about the Glasgow-haskell-users
mailing list