GMP on the Cell processor

Paul Leyland paul at leyland.vispa.com
Fri Apr 20 12:33:37 CEST 2007


On Thu, 2007-04-19 at 18:37, Torbjorn Granlund wrote:
> Paul Leyland <paul at leyland.vispa.com> writes:
> 
>   My interest is primarily in integer factorization, several algorithms
>   for which are trivially parallelizable and computationally demanding (as
>   opposed to memory-intensive).  ECM is probably the best example but
>   there are others, including some which are subroutines for other
>   algorithms such as NFS.  Other algorithms are not entirely trivial to
>   parallelize but the Chinese Remainder Theorem provides an obvious entry
>   point into their parallelization.
>   
>   Running 7 copies of stage 1 of ECM suimultaneously, each with the same N
>   but different curves, on the SPUs of a PS3 using their local memory is
>   *very* attractive.   Their second stages, which are very memory-hungry,
>   would then be farmed out either to the main PPC or to other more
>   conventional machines.
>   
> This is out-of-scope for GMP.  You'd need to write a library for "SIMD
> bignum" arithmetic, i.e., a lib for performing the same operations on
> a set of bignums.  That would probably make the best use of Cell for
> ECM factoring.

True, and I was not suggesting it should be.  The paragraphs above were
to give my motivation for wanting to see GMP-for-SPU.

>   GMP for the SPU, a stripped down version if necessary to get it to fit
>   in the limited memory, would be very welcome indeed.
> 
> I would not expect it to perform well at all, unfortunately.  Reasons:
> 
> * IIRC, the Cell doesn't have a 32x32->64 bit multiply instruction.
>   The lack of such an operation is a disaster for the performance.
> 
> * Making good use of SIMD for the most critical GMP operations is hard.
>   (See the mpn/cray and perhaps mpn/powerpc*/vmx for some examples.)
> 
> * Using multiple cores for any real GMP peformance benefit is probably
>   very difficult.
> 
> I think Cell is a very cool processor, although not for GMP.

Fair enough, though you appear to be concentrating on performance/Cell
in the analysis above whereas I'm rather more interested in
performance/price.

Even if each SPU is slow, the fact that you get 7 of them, and a PPC and
a usable Linux box all for a few hundred {EUR,GBP,USD} is very
attractive from where I am.


Paul

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://gmplib.org/list-archives/gmp-discuss/attachments/20070420/3dc64bdb/attachment.bin 


More information about the gmp-discuss mailing list