scalability of parallel alg for matrix multiplication

Upload: nguyentrungkien

Post on 02-Jun-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 Scalability of Parallel Alg for Matrix Multiplication

    1/26

    S c a l a b i l i t y o f P a r a l l e l A l g o r i t h m s f o r M a t r i x

    M u l t i p l i c a t i o n

    A n s h u l G u p t a a n d V i p i n K u m a r

    D e p a r t m e n t o f C o m p u t e r S c i e n c e ,

    U n i v e r s i t y o f M i n n e s o t a

    M i n n e a p o l i s , M N - 5 5 4 5 5

    a g u p t a @ c s . u m n . e d u a n d k u m a r @ c s . u m n . e d u

    T R 9 1 - 5 4 , N o v e m b e r 1 9 9 1 ( R e v i s e d A p r i l 1 9 9 4 )

    A b s t r a c t

    A n u m b e r o f p a r a l l e l f o r m u l a t i o n s o f d e n s e m a t r i x m u l t i p l i c a t i o n a l g o r i t h m h a v e b e e n d e v e l -

    o p e d . F o r a r b i t r a r i l y l a r g e n u m b e r o f p r o c e s s o r s , a n y o f t h e s e a l g o r i t h m s o r t h e i r v a r i a n t s c a n

    p r o v i d e n e a r l i n e a r s p e e d u p f o r s u c i e n t l y l a r g e m a t r i x s i z e s a n d n o n e o f t h e a l g o r i t h m s c a n b e

    c l e a r l y c l a i m e d t o b e s u p e r i o r t h a n t h e o t h e r s . I n t h i s p a p e r w e a n a l y z e t h e p e r f o r m a n c e a n d

    s c a l a b i l i t y o f a n u m b e r o f p a r a l l e l f o r m u l a t i o n s o f t h e m a t r i x m u l t i p l i c a t i o n a l g o r i t h m a n d p r e -

    d i c t t h e c o n d i t i o n s u n d e r w h i c h e a c h f o r m u l a t i o n i s b e t t e r t h a n t h e o t h e r s . W e p r e s e n t a p a r a l l e l

    f o r m u l a t i o n f o r h y p e r c u b e a n d r e l a t e d a r c h i t e c t u r e s t h a t p e r f o r m s b e t t e r t h a n a n y o f t h e s c h e m e s

    d e s c r i b e d i n t h e l i t e r a t u r e s o f a r f o r a w i d e r a n g e o f m a t r i x s i z e s a n d n u m b e r o f p r o c e s s o r s . T h e

    s u p e r i o r p e r f o r m a n c e a n d t h e a n a l y t i c a l s c a l a b i l i t y e x p r e s s i o n s f o r t h i s a l g o r i t h m a r e v e r i e d

    t h r o u g h e x p e r i m e n t s o n t h e T h i n k i n g M a c h i n e s C o r p o r a t i o n ' s C M - 5

    T M y

    p a r a l l e l c o m p u t e r f o r

    u p t o 5 1 2 p r o c e s s o r s . W e s h o w t h a t s p e c i a l h a r d w a r e p e r m i t t i n g s i m u l t a n e o u s c o m m u n i c a t i o n

    o n a l l t h e p o r t s o f t h e p r o c e s s o r s d o e s n o t i m p r o v e t h e o v e r a l l s c a l a b i l i t y o f t h e m a t r i x m u l t i p l i -

    c a t i o n a l g o r i t h m s o n a h y p e r c u b e . W e a l s o d i s c u s s t h e d e p e n d e n c e o f s c a l a b i l i t y o n t e c h n o l o g y

    d e p e n d e n t f a c t o r s s u c h a s c o m m u n i c a t i o n a n d c o m p u t a t i o n s p e e d s a n d s h o w t h a t u n d e r c e r t a i n

    c o n d i t i o n s , i t m a y b e b e t t e r t o h a v e a p a r a l l e l c o m p u t e r w i t h k - f o l d a s m a n y p r o c e s s o r s r a t h e r

    t h a n o n e w i t h t h e s a m e n u m b e r o f p r o c e s s o r s , e a c h k - f o l d a s f a s t .

    T h i s w o r k w a s s u p p o r t e d b y I S T / S D I O t h r o u g h t h e A r m y R e s e a r c h O c e g r a n t # 2 8 4 0 8 - M A - S D I t o t h e

    U n i v e r s i t y o f M i n n e s o t a a n d b y t h e U n i v e r s i t y o f M i n n e s o t a A r m y H i g h P e r f o r m a n c e C o m p u t i n g R e s e a r c h

    C e n t e r u n d e r c o n t r a c t # D A A L 0 3 - 8 9 - C - 0 0 3 8 .

    y

    C M - 5 i s a t r a d e m a r k o f t h e T h i n k i n g M a c h i n e s C o r p o r a t i o n .

    1

  • 8/10/2019 Scalability of Parallel Alg for Matrix Multiplication

    2/26

    1 I n t r o d u c t i o n

    M a t r i x m u l t i p l i c a t i o n i s w i d e l y u s e d i n a v a r i e t y o f a p p l i c a t i o n s a n d i s o f t e n o n e o f t h e c o r e

    c o m p o n e n t s o f m a n y s c i e n t i c c o m p u t a t i o n s . S i n c e t h e m a t r i x m u l t i p l i c a t i o n a l g o r i t h m i s

    h i g h l y c o m p u t a t i o n i n t e n s i v e , t h e r e h a s b e e n a g r e a t d e a l o f i n t e r e s t i n d e v e l o p i n g p a r a l l e l

    f o r m u l a t i o n s o f t h i s a l g o r i t h m a n d t e s t i n g i t s p e r f o r m a n c e o n v a r i o u s p a r a l l e l a r c h i t e c t u r e s

    1 , 3 , 5 , 6 , 7 , 9 , 1 1 , 1 7 , 1 8 , 3 7 , 8 ] .

    S o m e o f t h e e a r l y p a r a l l e l f o r m u l a t i o n s o f m a t r i x m u l t i p l i c a t i o n w e r e d e v e l o p e d b y C a n n o n

    5 ] , D e k e l , N a s s i m i a n d S a h n i 9 ] , a n d F o x e t a l . 1 1 ] . V a r i a n t s a n d i m p r o v e m e n t s o f t h e s e

    a l g o r i t h m s h a v e b e e n p r e s e n t e d i n 3 , 1 8 ] . I n p a r t i c u l a r , B e r n t s e n 3 ] p r e s e n t s a n a l g o r i t h m

    w h i c h h a s a s t r i c t l y s m a l l e r c o m m u n i c a t i o n o v e r h e a d t h a n C a n n o n ' s a l g o r i t h m , b u t h a s a

    s m a l l e r d e g r e e o f c o n c u r r e n c y . H o e t a l . 1 8 ] p r e s e n t a n o t h e r v a r i a n t o f C a n n o n ' s a l g o r i t h m

    f o r a h y p e r c u b e w h i c h p e r m i t s c o m m u n i c a t i o n o n a l l c h a n n e l s s i m u l t a n e o u s l y . T h i s a l g o r i t h m

    t o o , w h i l e r e d u c i n g c o m m u n i c a t i o n , a l s o r e d u c e s t h e d e g r e e o f c o n c u r r e n c y .

    F o r a r b i t r a r i l y l a r g e n u m b e r o f p r o c e s s o r s , a n y o f t h e s e a l g o r i t h m s o r t h e i r v a r i a n t s c a n

    p r o v i d e n e a r l i n e a r s p e e d u p f o r s u c i e n t l y l a r g e m a t r i x s i z e s , a n d n o n e o f t h e a l g o r i t h m s c a n

    b e c l e a r l y c l a i m e d t o b e s u p e r i o r t h a n t h e o t h e r s . S c a l a b i l i t y a n a l y s i s i s a a n e e c t i v e t o o l f o r

    p r e d i c t i n g t h e p e r f o r m a n c e o f v a r i o u s a l g o r i t h m - a r c h i t e c t u r e c o m b i n a t i o n s . H e n c e a g r e a t d e a l

    o f r e s e a r c h h a s b e e n d o n e t o d e v e l o p m e t h o d s f o r s c a l a b i l i t y a n a l y s i s 2 3 ] . T h e i s o e c i e n c y

    f u n c t i o n 2 4 , 2 6 ] i s o n e s u c h m e t r i c o f s c a l a b i l i t y w h i c h i s a m e a s u r e o f a n a l g o r i t h m ' s c a p a b i l i t y

    t o e e c t i v e l y u t i l i z e a n i n c r e a s i n g n u m b e r o f p r o c e s s o r s o n a p a r a l l e l a r c h i t e c t u r e . I s o e c i e n c y

    a n a l y s i s h a s b e e n f o u n d t o b e v e r y u s e f u l i n c h a r a c t e r i z i n g t h e s c a l a b i l i t y o f a v a r i e t y o f

    p a r a l l e l s y s t e m s 1 9 , 1 5 , 2 4 , 2 5 , 2 8 , 3 5 , 3 6 , 3 9 , 3 8 , 1 4 , 2 6 , 1 3 , 2 2 ] . A n i m p o r t a n t f e a t u r e o f t h e

    i s o e c i e n c y f u n c t i o n i s t h a t i t s u c c i n c t l y c a p t u r e s t h e i m p a c t o f c o m m u n i c a t i o n o v e r h e a d s ,

    c o n c u r r e n c y , s e r i a l b o t t l e n e c k s , l o a d i m b a l a n c e , e t c . i n a s i n g l e e x p r e s s i o n .

    I n t h i s p a p e r , w e u s e t h e i s o e c i e n c y m e t r i c 2 4 ] t o a n a l y z e t h e s c a l a b i l i t y o f a n u m -

    b e r o f p a r a l l e l f o r m u l a t i o n s o f t h e m a t r i x m u l t i p l i c a t i o n a l g o r i t h m f o r h y p e r c u b e a n d r e l a t e d

    a r c h i t e c t u r e s . W e a n a l y z e t h e p e r f o r m a n c e o f v a r i o u s p a r a l l e l f o r m u l a t i o n s o f t h e m a t r i x

    m u l t i p l i c a t i o n a l g o r i t h m f o r d i e r e n t m a t r i x s i z e s a n d n u m b e r o f p r o c e s s o r s , a n d p r e d i c t t h e

    c o n d i t i o n s u n d e r w h i c h e a c h f o r m u l a t i o n i s b e t t e r t h a n t h e o t h e r s . W e p r e s e n t a p a r a l l e l

    a l g o r i t h m f o r t h e h y p e r c u b e a n d r e l a t e d a r c h i t e c t u r e s t h a t p e r f o r m s b e t t e r t h a n a n y o f t h e

    s c h e m e s d e s c r i b e d i n t h e l i t e r a t u r e s o f a r f o r a w i d e r a n g e o f m a t r i x s i z e s a n d n u m b e r o f p r o -

    c e s s o r s . T h e s u p e r i o r p e r f o r m a n c e a n d t h e a n a l y t i c a l s c a l a b i l i t y e x p r e s s i o n s f o r t h i s a l g o r i t h m

    a r e v e r i e d t h r o u g h e x p e r i m e n t s o n t h e C M - 5 p a r a l l e l c o m p u t e r f o r u p t o 5 1 2 p r o c e s s o r s . W e

    s h o w t h a t s p e c i a l h a r d w a r e p e r m i t t i n g s i m u l t a n e o u s c o m m u n i c a t i o n o n a l l t h e p o r t s o f t h e

    p r o c e s s o r s d o e s n o t i m p r o v e t h e o v e r a l l s c a l a b i l i t y o f t h e m a t r i x m u l t i p l i c a t i o n a l g o r i t h m s o n

    a h y p e r c u b e . W e a l s o d i s c u s s t h e d e p e n d e n c e o f s c a l a b i l i t y o f p a r a l l e l m a t r i x m u l t i p l i c a t i o n

    a l g o r i t h m s o n t e c h n o l o g y d e p e n d e n t f a c t o r s s u c h a s c o m m u n i c a t i o n a n d c o m p u t a t i o n s p e e d s

    a n d s h o w t h a t u n d e r c e r t a i n c o n d i t i o n s , i t m a y b e b e t t e r t o h a v e a p a r a l l e l c o m p u t e r w i t h

    2

  • 8/10/2019 Scalability of Parallel Alg for Matrix Multiplication

    3/26

    k - f o l d a s m a n y p r o c e s s o r s r a t h e r t h a n o n e w i t h t h e s a m e n u m b e r o f p r o c e s s o r s , e a c h k - f o l d a s

    f a s t .

    T h e o r g a n i z a t i o n o f t h e p a p e r i s a s f o l l o w s . I n S e c t i o n 2 , w e d e n e t h e t e r m s t h a t a r e

    f r e q u e n t l y u s e d i n t h e r e s t o f t h e p a p e r . S e c t i o n 3 g i v e s a n o v e r v i e w o f t h e i s o e c i e n c y m e t r i c

    o f s c a l a b i l i t y . I n S e c t i o n 4 , w e g i v e a n o v e r v i e w o f s e v e r a l p a r a l l e l a l g o r i t h m s f o r m a t r i x

    m u l t i p l i c a t i o n a n d g i v e e x p r e s s i o n s f o r t h e i r p a r a l l e l e x e c u t i o n t i m e s . I n S e c t i o n 5 , w e a n a l y z e

    t h e s c a l a b i l i t y o f a l l t h e p a r a l l e l f o r m u l a t i o n s d i s c u s s e d i n S e c t i o n 4 . I n S e c t i o n 6 , w e p r o v i d e

    a d e t a i l e d c o m p a r i s o n o f a l l t h e a l g o r i t h m s d e s c r i b e d i n t h i s p a p e r a n d d e r i v e t h e c o n d i t i o n s

    u n d e r w h i c h e a c h o n e i s b e t t e r t h a n t h e r e s t . I n S e c t i o n 7 , w e a n a l y z e t h e i m p a c t o f p e r m i t t i n g

    s i m u l t a n e o u s c o m m u n i c a t i o n o n a l l p o r t s o f t h e p r o c e s s o r s o f a h y p e r c u b e o n t h e p e r f o r m a n c e

    a n d s c a l a b i l i t y o f t h e v a r i o u s m a t r i x m u l t i p l i c a t i o n a l g o r i t h m s . I n S e c t i o n 8 , t h e i m p a c t

    o f t e c h n o l o g y d e p e n d e n t f a c t o r s o n t h e s c a l a b i l i t y o f t h e a l g o r i t h m i s d i s c u s s e d . S e c t i o n 9

    c o n t a i n s s o m e e x p e r i m e n t a l r e s u l t s c o m p a r i n g t h e p e r f o r m a n c e o f o u r p a r a l l e l f o r m u l a t i o n

    w i t h t h a t o f C a n n o n ' s a l g o r i t h m o n t h e C M - 5 . S e c t i o n 1 0 c o n t a i n s c o n c l u d i n g r e m a r k s .

    2 T e r m i n o l o g y

    I n t h i s s e c t i o n , w e i n t r o d u c e t h e t e r m i n o l o g y t h a t s h a l l b e f o l l o w e d i n t h e r e s t o f t h e p a p e r .

    P a r a l l e l S y s t e m : W e d e n e a p a r a l l e l s y s t e m a s t h e c o m b i n a t i o n o f a p a r a l l e l a l g o r i t h m

    a n d t h e p a r a l l e l a r c h i t e c t u r e o n w h i c h i t i s i m p l e m e n t e d .

    N u m b e r o f P r o c e s s o r s , p : T h e n u m b e r o f h o m o g e n e o u s p r o c e s s i n g u n i t s i n t h e p a r a l l e l

    c o m p u t e r t h a t c o o p e r a t e t o s o l v e a p r o b l e m .

    P r o b l e m S i z e , W : T h e t i m e t a k e n b y t h e s e r i a l a l g o r i t h m t o s o l v e t h e g i v e n p r o b l e m o n a

    s i n g l e p r o c e s s o r . T h i s i s a l s o e q u a l t o t h e s u m t o t a l o f a l l t h e u s e f u l w o r k d o n e b y a l l t h e

    p r o c e s s o r s w h i l e s o l v i n g t h e s a m e p r o b l e m i n p a r a l l e l u s i n g p p r o c e s s o r s . F o r i n s t a n c e ,

    f o r t h e m u l t i p l i c a t i o n o f t w o n n m a t r i c e s

    1

    , w e c o n s i d e r W = O ( n

    3

    )

    P a r a l l e l E x e c u t i o n T i m e , T

    p

    : T h e t i m e t a k e n b y p p r o c e s s o r s t o s o l v e a p r o b l e m . F o r a

    g i v e n p a r a l l e l s y s t e m , T

    p

    i s a f u n c t i o n o f t h e p r o b l e m s i z e a n d t h e n u m b e r o f p r o c e s s o r s .

    P a r a l l e l S p e e d u p , S : T h e r a t i o o f W t o T

    p

    T o t a l P a r a l l e l O v e r h e a d , T

    o

    : T h e s u m t o t a l o f a l l t h e o v e r h e a d s i n c u r r e d b y a l l t h e p r o -

    c e s s o r s d u r i n g t h e p a r a l l e l e x e c u t i o n o f t h e a l g o r i t h m . I t i n c l u d e s c o m m u n i c a t i o n c o s t s ,

    n o n - e s s e n t i a l w o r k a n d i d l e t i m e d u e t o s y n c h r o n i z a t i o n a n d s e r i a l c o m p o n e n t s o f t h e

    1

    I n t h i s p a p e r w e c o n s i d e r t h e c o n v e n t i o n a l O ( n

    3

    ) s e r i a l m a t r i x m u l t i p l i c a t i o n a l g o r i t h m o n l y . S e r i a l m a t r i x

    m u l t i p l i c a t i o n a l g o r i t h m s w i t h b e t t e r c o m p l e x i t y h a v e h i g h e r c o n s t a n t s a n d a r e n o t u s e d m u c h i n p r a c t i c e .

    3

  • 8/10/2019 Scalability of Parallel Alg for Matrix Multiplication

    4/26

    a l g o r i t h m . F o r a g i v e n p a r a l l e l s y s t e m , T

    o

    i s u s u a l l y a f u n c t i o n o f t h e p r o b l e m s i z e a n d

    t h e n u m b e r o f p r o c e s s o r s a n d i s o f t e n w r i t t e n a s T

    o

    ( W ; p ) . T h u s T

    o

    ( W ; p ) = p T

    p

    ? W

    E c i e n c y , E : T h e r a t i o o f S t o p . H e n c e , E = W = p T

    p

    = 1 = ( 1 +

    T

    o

    W

    )

    D a t a C o m m u n i c a t i o n C o s t s , t

    s

    a n d t

    w

    : O n a m e s s a g e p a s s i n g p a r a l l e l c o m p u t e r , t h e

    t i m e r e q u i r e d f o r t h e c o m p l e t e t r a n s f e r o f a m e s s a g e c o n t a i n i n g m w o r d s b e t w e e n t w o

    a d j a c e n t p r o c e s s o r s i s g i v e n b y t

    s

    + t

    w

    m , w h e r e t

    s

    i s t h e m e s s a g e s t a r t u p t i m e , a n d

    t

    w

    ( p e r - w o r d c o m m u n i c a t i o n t i m e ) i s e q u a l t o

    y

    B

    w h e r e B i s t h e b a n d w i d t h o f t h e

    c o m m u n i c a t i o n c h a n n e l b e t w e e n t h e p r o c e s s o r s i n b y t e s / s e c o n d a n d y i s t h e n u m b e r o f

    b y t e s p e r w o r d .

    F o r t h e s a k e o f s i m p l i c i t y , i n t h i s p a p e r w e a s s u m e t h a t e a c h b a s i c a r i t h m e t i c o p e r a t i o n

    ( i . e . , o n e o a t i n g p o i n t m u l t i p l i c a t i o n a n d o n e o a t i n g p o i n t a d d i t i o n i n c a s e o f m a t r i x

    m u l t i p l i c a t i o n ) t a k e s u n i t t i m e . T h e r e f o r e , t

    s

    a n d t

    w

    a r e r e l a t i v e d a t a c o m m u n i c a t i o n

    c o s t s n o r m a l i z e d w i t h r e s p e c t t o t h e u n i t c o m p u t a t i o n t i m e .

    3 T h e I s o e c i e n c y M e t r i c o f S c a l a b i l i t y

    I t i s w e l l k n o w n t h a t g i v e n a p a r a l l e l a r c h i t e c t u r e a n d a p r o b l e m i n s t a n c e o f a x e d s i z e ,

    t h e s p e e d u p o f a p a r a l l e l a l g o r i t h m d o e s n o t c o n t i n u e t o i n c r e a s e w i t h i n c r e a s i n g n u m b e r o f

    p r o c e s s o r s b u t t e n d s t o s a t u r a t e o r p e a k a t a c e r t a i n v a l u e . F o r a x e d p r o b l e m s i z e , t h e

    s p e e d u p s a t u r a t e s e i t h e r b e c a u s e t h e o v e r h e a d s g r o w w i t h i n c r e a s i n g n u m b e r o f p r o c e s s o r s o r

    b e c a u s e t h e n u m b e r o f p r o c e s s o r s e v e n t u a l l y e x c e e d s t h e d e g r e e o f c o n c u r r e n c y i n h e r e n t i n

    t h e a l g o r i t h m . F o r a v a r i e t y o f p a r a l l e l s y s t e m s , g i v e n a n y n u m b e r o f p r o c e s s o r s p , s p e e d u p

    a r b i t r a r i l y c l o s e t o p c a n b e o b t a i n e d b y s i m p l y e x e c u t i n g t h e p a r a l l e l a l g o r i t h m o n b i g e n o u g h

    p r o b l e m i n s t a n c e s ( e . g . , 2 1 , 1 2 , 2 9 , 3 4 , 1 6 , 1 0 , 3 1 , 3 3 , 3 2 , 4 0 ] ) . T h e e a s e w i t h w h i c h a p a r a l l e l

    a l g o r i t h m c a n a c h i e v e s p e e d u p s p r o p o r t i o n a l t o p o n a p a r a l l e l a r c h i t e c t u r e c a n s e r v e a s a

    m e a s u r e o f t h e s c a l a b i l i t y o f t h e p a r a l l e l s y s t e m .

    T h e i s o e c i e n c y f u n c t i o n 2 4 , 2 6 ] i s o n e s u c h m e t r i c o f s c a l a b i l i t y w h i c h i s a m e a s u r e o f

    a n a l g o r i t h m ' s c a p a b i l i t y t o e e c t i v e l y u t i l i z e a n i n c r e a s i n g n u m b e r o f p r o c e s s o r s o n a p a r a l l e l

    a r c h i t e c t u r e . T h e i s o e c i e n c y f u n c t i o n o f a c o m b i n a t i o n o f a p a r a l l e l a l g o r i t h m a n d a p a r a l l e l

    a r c h i t e c t u r e r e l a t e s t h e p r o b l e m s i z e t o t h e n u m b e r o f p r o c e s s o r s n e c e s s a r y t o m a i n t a i n a

    x e d e c i e n c y o r t o d e l i v e r s p e e d u p s i n c r e a s i n g p r o p o r t i o n a l l y w i t h i n c r e a s i n g n u m b e r o f

    p r o c e s s o r s . T h e e c i e n c y o f a p a r a l l e l s y s t e m i s g i v e n b y E =

    W

    W + T

    o

    ( W p )

    . I f a p a r a l l e l s y s t e m

    i s u s e d t o s o l v e a p r o b l e m i n s t a n c e o f a x e d s i z e W , t h e n t h e e c i e n c y d e c r e a s e s a s p

    i n c r e a s e s . T h e r e a s o n i s t h a t t h e t o t a l o v e r h e a d T

    o

    ( W ; p ) i n c r e a s e s w i t h p . F o r m a n y p a r a l l e l

    s y s t e m s , f o r a x e d p , i f t h e p r o b l e m s i z e W i s i n c r e a s e d , t h e n t h e e c i e n c y i n c r e a s e s b e c a u s e

    f o r a g i v e n p , T

    o

    ( W ; p ) g r o w s s l o w e r t h a n O ( W ) . F o r t h e s e p a r a l l e l s y s t e m s , t h e e c i e n c y

    c a n b e m a i n t a i n e d a t a d e s i r e d v a l u e ( b e t w e e n 0 a n d 1 ) f o r i n c r e a s i n g p , p r o v i d e d W i s a l s o

    4

  • 8/10/2019 Scalability of Parallel Alg for Matrix Multiplication

    5/26

    i n c r e a s e d . W e c a l l s u c h s y s t e m s s c a l a b l e p a r a l l e l s y s t e m s . N o t e t h a t f o r a g i v e n p a r a l l e l

    a l g o r i t h m , f o r d i e r e n t p a r a l l e l a r c h i t e c t u r e s , W m a y h a v e t o i n c r e a s e a t d i e r e n t r a t e s w i t h

    r e s p e c t t o p i n o r d e r t o m a i n t a i n a x e d e c i e n c y . F o r e x a m p l e , i n s o m e c a s e s , W m i g h t n e e d

    t o g r o w e x p o n e n t i a l l y w i t h r e s p e c t t o p t o k e e p t h e e c i e n c y f r o m d r o p p i n g a s p i s i n c r e a s e d .

    S u c h a p a r a l l e l s y s t e m i s p o o r l y s c a l a b l e b e c a u s e i t w o u l d b e d i c u l t t o o b t a i n g o o d s p e e d u p s

    f o r a l a r g e n u m b e r o f p r o c e s s o r s , u n l e s s t h e s i z e o f t h e p r o b l e m b e i n g s o l v e d i s e n o r m o u s l y

    l a r g e . O n t h e o t h e r h a n d , i f W n e e d s t o g r o w o n l y l i n e a r l y w i t h r e s p e c t t o p , t h e n t h e p a r a l l e l

    s y s t e m i s h i g h l y s c a l a b l e a n d c a n e a s i l y d e l i v e r s p e e d u p s i n c r e a s i n g l i n e a r l y w i t h r e s p e c t t o

    t h e n u m b e r o f p r o c e s s o r s f o r r e a s o n a b l y i n c r e a s i n g p r o b l e m s i z e s . T h e i s o e c i e n c y f u n c t i o n s

    o f s e v e r a l c o m m o n p a r a l l e l s y s t e m s a r e p o l y n o m i a l f u n c t i o n s o f p ; i . e . , t h e y a r e O ( p

    x

    ) , w h e r e

    x 1 . A s m a l l p o w e r o f p i n t h e i s o e c i e n c y f u n c t i o n i n d i c a t e s a h i g h s c a l a b i l i t y .

    I f a p a r a l l e l s y s t e m i n c u r s a t o t a l o v e r h e a d o f T

    o

    ( W ; p ) , w h e r e p i s t h e n u m b e r o f p r o c e s s o r s

    i n t h e p a r a l l e l e n s e m b l e a n d W i s t h e p r o b l e m s i z e , t h e n t h e e c i e n c y o f t h e s y s t e m i s g i v e n

    b y E =

    1

    1 +

    T

    o

    W p )

    W

    . I n o r d e r t o m a i n t a i n a c o n s t a n t e c i e n c y , W s h o u l d b e p r o p o r t i o n a l t o

    T

    o

    ( W ; p ) o r t h e f o l l o w i n g r e l a t i o n m u s t b e s a t i s e d :

    W = K T

    o

    ( W ; p ) ( 1 )

    H e r e K =

    E

    1 ? E

    i s a c o n s t a n t d e p e n d i n g o n t h e e c i e n c y t o b e m a i n t a i n e d . E q u a t i o n ( 1 ) i s

    t h e c e n t r a l r e l a t i o n t h a t i s u s e d t o d e t e r m i n e t h e i s o e c i e n c y f u n c t i o n . T h i s i s a c c o m p l i s h e d

    b y a b s t r a c t i n g W a s a f u n c t i o n o f p t h r o u g h a l g e b r a i c m a n i p u l a t i o n s o n E q u a t i o n ( 1 ) . I f t h e

    p r o b l e m s i z e n e e d s t o g r o w a s f a s t a s f

    E

    ( p ) t o m a i n t a i n a n e c i e n c y E , t h e n f

    E

    ( p ) i s d e n e d

    t o b e t h e i s o e c i e n c y f u n c t i o n o f t h e p a r a l l e l a l g o r i t h m - a r c h i t e c t u r e c o m b i n a t i o n f o r e c i e n c y

    E

    I s o e c i e n c y a n a l y s i s h a s b e e n f o u n d t o b e v e r y u s e f u l i n c h a r a c t e r i z i n g t h e s c a l a b i l i t y o f

    a v a r i e t y o f p a r a l l e l s y s t e m s 2 4 , 1 5 , 2 5 , 2 7 , 3 5 , 3 6 , 3 9 , 3 8 , 1 4 , 2 6 , 1 3 , 2 2 ] . A n i m p o r t a n t

    f e a t u r e o f i s o e c i e n c y a n a l y s i s i s t h a t i n a s i n g l e e x p r e s s i o n , i t s u c c i n c t l y c a p t u r e s t h e e e c t s

    o f c h a r a c t e r i s t i c s o f t h e p a r a l l e l a l g o r i t h m a s w e l l a s t h e p a r a l l e l a r c h i t e c t u r e o n w h i c h i t

    i s i m p l e m e n t e d . B y p e r f o r m i n g i s o e c i e n c y a n a l y s i s , o n e c a n t e s t t h e p e r f o r m a n c e o f a

    p a r a l l e l p r o g r a m o n a f e w p r o c e s s o r s , a n d t h e n p r e d i c t i t s p e r f o r m a n c e o n a l a r g e r n u m b e r

    o f p r o c e s s o r s . B u t t h e u t i l i t y o f t h e i s o e c i e n c y a n a l y s i s i s n o t l i m i t e d t o p r e d i c t i n g t h e

    i m p a c t o n p e r f o r m a n c e o f a n i n c r e a s i n g n u m b e r o f p r o c e s s o r s . I t c a n a l s o b e u s e d t o s t u d y

    t h e b e h a v i o r o f a p a r a l l e l s y s t e m w i t h r e s p e c t t o c h a n g e s i n o t h e r h a r d w a r e r e l a t e d p a r a m e t e r s

    s u c h a s t h e s p e e d o f t h e p r o c e s s o r s a n d t h e d a t a c o m m u n i c a t i o n c h a n n e l s .

    4 P a r a l l e l M a t r i x M u l t i p l i c a t i o n A l g o r i t h m s

    I n t h i s s e c t i o n w e b r i e y d e s c r i b e s o m e w e l l k n o w n p a r a l l e l m a t r i x m u l t i p l i c a t i o n a l g o r i t h m s

    g i v e t h e i r p a r a l l e l e x e c u t i o n t i m e s .

    5

  • 8/10/2019 Scalability of Parallel Alg for Matrix Multiplication

    6/26

    4 . 1 A S i m p l e A l g o r i t h m

    C o n s i d e r a l o g i c a l t w o d i m e n s i o n a l m e s h o f p p r o c e s s o r s ( w i t h

    p

    p r o w s a n d

    p

    p c o l u m n s )

    o n w h i c h t w o n n m a t r i c e s A a n d B a r e t o b e m u l t i p l i e d t o y i e l d t h e p r o d u c t m a t r i x

    C . L e t n

    p

    p . T h e m a t r i c e s a r e d i v i d e d i n t o s u b - b l o c k s o f s i z e

    n

    p

    p

    n

    p

    p w h i c h a r e

    m a p p e d n a t u r a l l y o n t h e p r o c e s s o r a r r a y . T h e a l g o r i t h m c a n b e i m p l e m e n t e d o n a h y p e r c u b e

    b y e m b e d d i n g t h i s p r o c e s s o r m e s h i n t o i t . I n t h e r s t s t e p o f t h e a l g o r i t h m , e a c h p r o c e s s o r

    a c q u i r e s a l l t h o s e e l e m e n t s o f b o t h t h e m a t r i c e s t h a t a r e r e q u i r e d t o g e n e r a t e t h e

    n

    2

    p

    e l e m e n t s o f

    t h e p r o d u c t m a t r i x w h i c h a r e t o r e s i d e i n t h a t p r o c e s s o r . T h i s i n v o l v e s a n a l l - t o - a l l b r o a d c a s t

    o f

    n

    2

    p

    e l e m e n t s o f m a t r i x A a m o n g t h e

    p

    p p r o c e s s o r s o f e a c h r o w o f p r o c e s s o r s a n d t h a t o f t h e

    s a m e s i z e d b l o c k s o f m a t r i x B a m o n g

    p

    p p r o c e s s o r s o f e a c h c o l u m n w h i c h c a n b e a c c o m p l i s h e d

    i n 2 t

    s

    l o g p + 2 t

    w

    n

    2

    p

    p

    t i m e . A f t e r e a c h p r o c e s s o r g e t s a l l t h e d a t a i t n e e d s , i t m u l t i p l i e s t h e

    p

    p

    p a i r s o f s u b - b l o c k s o f t h e t w o m a t r i c e s t o c o m p u t e i t s s h a r e o f

    n

    2

    p

    e l e m e n t s o f t h e p r o d u c t

    m a t r i x . A s s u m i n g t h a t a n a d d i t i o n a n d m u l t i p l i c a t i o n t a k e s a u n i t t i m e ( S e c t i o n 2 ) , t h e

    m u l t i p l i c a t i o n p h a s e c a n b e c o m p l e t e d i n

    n

    3

    p

    u n i t s o f t i m e . T h u s t h e t o t a l p a r a l l e l e x e c u t i o n

    t i m e o f t h e a l g o r i t h m i s g i v e n b y t h e f o l l o w i n g e q u a t i o n :

    T

    p

    =

    n

    3

    p

    + 2 t

    s

    l o g p + 2 t

    w

    n

    2

    p

    p

    ( 2 )

    T h i s a l g o r i t h m i s m e m o r y - i n e c i e n t . T h e m e m o r y r e q u i r e m e n t f o r e a c h p r o c e s s o r i s O (

    n

    2

    p

    p

    )

    a n d t h u s t h e t o t a l m e m o r y r e q u i r e m e n t i s O ( n

    2

    p

    p ) w o r d s a s a g a i n s t O ( n

    2

    ) f o r t h e s e q u e n t i a l

    a l g o r i t h m .

    4 . 2 C a n n o n ' s A l g o r i t h m

    A p a r a l l e l a l g o r i t h m t h a t i s m e m o r y e c i e n t a n d i s f r e q u e n t l y u s e d i s d u e t o C a n n o n 5 ] .

    A g a i n t h e t w o n n m a t r i c e s A a n d B a r e d i v i d e d i n t o s q u a r e s u b m a t r i c e s o f s i z e

    n

    p

    p

    n

    p

    p

    a m o n g t h e p p r o c e s s o r s o f a w r a p - a r o u n d m e s h ( w h i c h c a n b e e m b e d d e d i n a h y p e r c u b e i f

    t h e a l g o r i t h m w a s t o b e i m p l e m e n t e d o n i t ) . T h e s u b - b l o c k s o f A a n d B r e s i d i n g w i t h t h e

    p r o c e s s o r ( i ; j ) a r e d e n o t e d b y A

    i j

    a n d B

    i j

    r e s p e c t i v e l y , w h e r e 0 i

  • 8/10/2019 Scalability of Parallel Alg for Matrix Multiplication

    7/26

    s p e n t i n t h e i n i t i a l a l i g n m e n t s t e p c a n b e i g n o r e d w i t h r e s p e c t t o t h e

    p

    p s h i f t o p e r a t i o n s

    d u r i n g t h e m u l t i p l i c a t i o n p h a s e , a s t h e f o r m e r i s a s i m p l e o n e - t o - o n e c o m m u n i c a t i o n a l o n g

    n o n - c o n i c t i n g p a t h s . S i n c e e a c h s u b - b l o c k m o v e m e n t i n t h e s e c o n d p h a s e t a k e s t

    s

    + t

    w

    n

    2

    p

    t i m e , t h e t o t a l p a r a l l e l e x e c u t i o n t i m e f o r a l l t h e m o v e m e n t s o f t h e s u b - b l o c k s o f b o t h t h e

    m a t r i c e s i s g i v e n b y t h e f o l l o w i n g e q u a t i o n :

    T

    p

    =

    n

    3

    p

    + 2 t

    s

    p

    p + 2 t

    w

    n

    2

    p

    p

    ( 3 )

    4 . 3 F o x ' s A l g o r i t h m

    T h i s a l g o r i t h m i s d u e t o F o x e t a l a n d i s d e s c r i b e d i n d e t a i l i n 1 1 ] a n d 1 0 ] . T h e i n p u t

    m a t r i c e s a r e i n i t i a l l y d i s t r i b u t e d a m o n g t h e p r o c e s s o r s i n t h e s a m e m a n n e r a s i n t h e a l g o r i t h m

    i n S e c t i o n 4 . 1 . T h e a l g o r i t h m w o r k s i n

    p

    p i t e r a t i o n s , w h e r e p i s t h e n u m b e r o f p r o c e s s o r s

    b e i n g u s e d . T h e d a t a c o m m u n i c a t i o n i n t h e a l g o r i t h m i n v o l v e s s u c c e s s i v e b r o a d c a s t o f t h e

    t h e s u b - b l o c k s o f A i n a h o r i z o n t a l d i r e c t i o n s o t h a t a l l p r o c e s s o r s i n t h e i t h r o w r e c e i v e t h e

    s u b - b l o c k A

    i ( i + j )

    i n t h e j t h i t e r a t i o n ( i t e r a t i o n s a r e n u m b e r e d f r o m 0 t o j - 1 ) . A f t e r e a c h

    b r o a d c a s t t h e s u b - b l o c k s o f A a r e m u l t i p l i e d b y t h e s u b - b l o c k s o f B c u r r e n t l y r e s i d i n g i n e a c h

    p r o c e s s o r a n d a r e a c c u m u l a t e d i n t h e s u b - b l o c k s o f S . T h e l a s t s t e p o f e a c h i t e r a t i o n i s t h e

    s h i f t i n g o f t h e s u b - b l o c k s o f B i n a l l t h e p r o c e s s o r s t o t h e i r r e s p e c t i v e N o r t h n e i g h b o r s i n t h e

    w r a p - a r o u n d m e s h , t h e s u b - b l o c k s o f t h e t o p m o s t r o w b e i n g r o l l e d i n t o t h e b o t t o m m o s t r o w .

    T h u s , f o r t h e m e s h a r c h i t e c t u r e , t h e a l g o r i t h m t a k e s ( t

    s

    + t

    w

    n

    2

    p

    )

    p

    p t i m e i n c o m m u n i c a t i o n i n

    e a c h o f t h e

    p

    p i t e r a t i o n s , r e s u l t i n g i n a t o t a l p a r a l l e l e x e c u t i o n t i m e o f

    n

    3

    p

    + t

    w

    n

    2

    + t

    s

    p B y

    s e n d i n g t h e s u b - b l o c k s i n s m a l l p a c k e t s i n a p i p e l i n e d f a s h i o n , F o x e t a l . s h o w t h e r u n t i m e

    o f t h i s a l g o r i t h m t o b e :

    T

    p

    =

    n

    3

    p

    + 2 t

    w

    n

    2

    p

    p

    + t

    s

    p ( 4 )

    C l e a r l y t h e p a r a l l e l e x e c u t i o n t i m e o f t h i s a l g o r i t h m i s w o r s e t h a n t h a t o f t h e s i m p l e a l g o -

    r i t h m o r C a n n o n ' s a l g o r i t h m . O n a h y p e r c u b e , i t i s p o s s i b l e t o e m p l o y a m o r e s o p h i s t i c a t e d

    s c h e m e f o r o n e - t o - a l l b r o a d c a s t 2 0 ] o f s u b - b l o c k s o f m a t r i x A a m o n g t h e r o w s . U s i n g t h i s

    s c h e m e , t h e p a r a l l e l e x e c u t i o n t i m e c a n b e i m p r o v e d t o

    n

    3

    p

    + 2 t

    w

    n

    2

    p

    p

    + t

    s

    p

    p l o g p + 2 n

    p

    t

    s

    t

    w

    l o g p ,

    w h i c h i s s t i l l w o r s e t h a n C a n n o n ' s a l g o r i t h m . H o w e v e r , i f t h e p r o c e d u r e i s p e r f o r m e d i n a n

    a s y n c h r o n o u s m a n n e r ( i . e . , i n e v e r y i t e r a t i o n , a p r o c e s s o r s t a r t s p e r f o r m i n g i t s c o m p u t a t i o n

    a s s o o n a s i t h a s a l l t h e r e q u i r e d d a t a , a n d d o e s n o t w a i t f o r t h e e n t i r e b r o a d c a s t t o n i s h )

    t h e c o m p u t a t i o n a n d c o m m u n i c a t i o n o f s u b - b l o c k s c a n b e i n t e r l e a v e d . I t c a n b e s h o w n t h a t

    i f e a c h s t e p o f F o x ' s a l g o r i t h m i s n o t s y n c h r o n i z e d a n d t h e p r o c e s s o r s w o r k i n d e p e n d e n t l y ,

    t h e n i t s p a r a l l e l e x e c u t i o n t i m e c a n b e r e d u c e d t o a l m o s t a f a c t o r o f t w o o f t h a t C a n n o n ' s

    a l g o r i t h m .

    7

  • 8/10/2019 Scalability of Parallel Alg for Matrix Multiplication

    8/26

    4 . 4 B e r n t s e n ' s A l g o r i t h m

    D u e t o n e a r e s t n e i g h b o r c o m m u n i c a t i o n s o n t h e

    p

    p

    p

    p w r a p - a r o u n d a r r a y o f p r o c e s s o r s ,

    C a n n o n ' s a l g o r i t h m ' s p e r f o r m a n c e i s t h e s a m e o n b o t h m e s h a n d h y p e r c u b e a r c h i t e c t u r e s .

    I n 3 ] , B e r n t s e n d e s c r i b e s a n a l g o r i t h m w h i c h e x p l o i t s g r e a t e r c o n n e c t i v i t y p r o v i d e d b y a

    h y p e r c u b e . T h e a l g o r i t h m u s e s p = 2

    3 q

    p r o c e s s o r s w i t h t h e r e s t r i c t i o n t h a t p n

    3 = 2

    f o r

    m u l t i p l y i n g t w o n n m a t r i c e s A a n d B . M a t r i x A i s s p l i t b y c o l u m n s a n d B b y r o w s i n t o 2

    q

    p a r t s . T h e h y p e r c u b e i s s p l i t i n t o 2

    q

    s u b c u b e s , e a c h p e r f o r m i n g a s u b m a t r i x m u l t i p l i c a t i o n

    b e t w e e n s u b m a t r i c e s o f A o f s i z e

    n

    2

    q

    n

    2

    2 q

    a n d s u b m a t r i c e s o f B o f s i z e

    n

    2

    2 q

    n

    2

    q

    u s i n g C a n n o n ' s

    a l g o r i t h m . I t i s s h o w n i n 3 ] t h a t t h e t i m e s p e n t i n d a t a c o m m u n i c a t i o n b y t h i s a l g o r i t h m o n

    a h y p e r c u b e i s 2 t

    s

    p

    1 = 3

    +

    1

    3

    t

    s

    l o g p + 3 t

    w

    n

    2

    p

    2 = 3

    , a n d h e n c e t h e t o t a l p a r a l l e l e x e c u t i o n t i m e i s g i v e n

    b y t h e f o l l o w i n g e q u a t i o n :

    T

    p

    =

    n

    3

    p

    + 2 t

    s

    p

    1 = 3

    +

    1

    3

    t

    s

    l o g p + 3 t

    w

    n

    2

    p

    2 = 3

    ( 5 )

    T h e t e r m s a s s o c i a t e d w i t h b o t h t

    s

    a n d t

    w

    a r e s m a l l e r i n t h i s a l g o r i t h m t h a n t h e a l g o r i t h m s

    d i s c u s s e d i n S e c t i o n s 4 . 1 t o 4 . 2 . I t s h o u l d a l s o b e n o t e d t h a t t h i s a l g o r i t h m , l i k e t h e o n e i n

    S e c t i o n 4 . 1 i s n o t m e m o r y e c i e n t a s i t r e q u i r e s s t o r a g e o f 2

    n

    2

    p

    +

    n

    2

    p

    2 = 3

    m a t r i x e l e m e n t s p e r

    p r o c e s s o r .

    4 . 5 T h e D N S A l g o r i t h m

    4 . 5 . 1 O n e E l e m e n t P e r P r o c e s s o r V e r s i o n

    A n a l g o r i t h m t h a t u s e s a h y p e r c u b e w i t h p = n

    3

    = 2

    3 q

    p r o c e s s o r s t o m u l t i p l y t w o n n

    m a t r i c e s w a s p r o p o s e d b y D e k e l , N a s s i m i a n d S a h n i i n 9 , 3 5 ] . T h e p p r o c e s s o r s c a n b e v i s u -

    a l i z e d a s b e i n g a r r a n g e d i n a n 2

    q

    2

    q

    2

    q

    a r r a y . I n t h i s a r r a y , p r o c e s s o r p

    r

    o c c u p i e s p o s i t i o n

    ( i ; j ; k ) w h e r e r = i 2

    2 q

    + j 2

    q

    + k a n d 0 i ; j ; k < 2

    q

    . T h u s i f t h e b i n a r y r e p r e s e n t a t i o n o f r i s

    r

    3 q ? 1

    r

    3 q ? 2

    : : : r

    0

    , t h e n t h e b i n a r y r e p r e s e n t a t i o n s o f i , j a n d k a r e r

    3 q ? 1

    r

    3 q ? 2

    : : : r

    2 q

    , r

    2 q ? 1

    r

    2 q ? 2

    : : : r

    q

    a n d r

    q ? 1

    r

    q ? 2

    : : : r

    0

    r e s p e c t i v e l y . E a c h p r o c e s s o r p

    r

    h a s t h r e e d a t a r e g i s t e r s a

    r

    , b

    r

    a n d c

    r

    , r e -

    s p e c t i v e l y . I n i t i a l l y , p r o c e s s o r p

    s

    i n p o s i t i o n ( 0 , j , k ) c o n t a i n s t h e e l e m e n t a ( j ; k ) a n d b ( j ; k ) i n

    a

    s

    a n d b

    s

    r e s p e c t i v e l y . T h e c o m p u t a t i o n i s a c c o m p l i s h e d i n t h r e e s t a g e s . I n t h e r s t s t a g e ,

    t h e e l e m e n t s o f t h e m a t r i c e s A a n d B a r e d i s t r i b u t e d o v e r t h e p p r o c e s s o r s . A s a r e s u l t , a

    r

    g e t s a ( j ; i ) a n d b

    r

    g e t s b ( i ; k ) . I n t h e s e c o n d s t a g e , p r o d u c t e l e m e n t s c ( j ; k ) a r e c o m p u t e d a n d

    s t o r e d i n e a c h c

    r

    . I n t h e n a l s t a g e , t h e s u m s

    n ? 1

    i = 0

    c

    i ; j ; k

    a r e c o m p u t e d a n d s t o r e d i n c

    0 ; j ; k

    T h e a b o v e a l g o r i t h m a c c o m p l i s h e s t h e O ( n

    3

    ) t a s k o f m a t r i x m u l t i p l i c a t i o n i n O ( l o g n )

    t i m e u s i n g n

    3

    p r o c e s s o r s . S i n c e t h e p r o c e s s o r - t i m e p r o d u c t o f t h i s p a r a l l e l a l g o r i t h m e x c e e d s

    t h e s e q u e n t i a l t i m e c o m p l e x i t y o f t h e a l g o r i t h m , i t i s n o t p r o c e s s o r - e c i e n t . T h i s a l g o r i t h m

    c a n b e m a d e p r o c e s s o r - e c i e n t b y u s i n g f e w e r t h a t n

    3

    p r o c e s s o r s , i . e . ; b y p u t t i n g m o r e t h a n

    o n e e l e m e n t o f t h e m a t r i c e s o n e a c h p r o c e s s o r . T h e r e a r e m o r e t h a n o n e w a y s t o a d a p t t h i s

    8

  • 8/10/2019 Scalability of Parallel Alg for Matrix Multiplication

    9/26

    a l g o r i t h m t o u s e f e w e r t h a n n

    3

    p r o c e s s o r s . T h e m e t h o d p r o p o s e d b y D e k e l , N a s s i m i a n d S a h n i

    i n 9 , 3 5 ] i s a s f o l l o w s .

    4 . 5 . 2 V a r i a n t W i t h M o r e T h a n O n e E l e m e n t P e r P r o c e s s o r

    T h i s v a r i a n t o f t h e D N S a l g o r i t h m c a n w o r k w i t h n

    2

    r p r o c e s s o r s , w h e r e 1 < r < n , t h u s

    u s i n g o n e p r o c e s s o r f o r m o r e t h a n o n e e l e m e n t o f e a c h o f t h e t w o n n m a t r i c e s . T h e

    a l g o r i t h m i s s i m i l a r t o t h e o n e a b o v e e x c e p t t h a t a l o g i c a l p r o c e s s o r a r r a y o f r

    3

    ( i n s t e a d o f

    n

    3

    ) s u p e r p r o c e s s o r s i s u s e d , e a c h s u p e r p r o c e s s o r c o m p r i s i n g o f ( n = r )

    2

    h y p e r c u b e p r o c e s s o r s .

    I n t h e s e c o n d s t e p , m u l t i p l i c a t i o n o f b l o c k s o f ( n = r ) ( n = r ) e l e m e n t s i n s t e a d o f i n d i v i d u a l

    e l e m e n t s i s p e r f o r m e d . T h i s m u l t i p l i c a t i o n o f ( n = r ) ( n = r ) b l o c k s i s p e r f o r m e d a c c o r d i n g t o

    t h e a l g o r i t h m i n S e c t i o n 4 . 3 o n

    n

    r

    n

    r

    s u b a r r a y s ( e a c h s u c h s u b a r r a y i s a c t u a l l y a s u b c u b e ) o f

    p r o c e s s o r s u s i n g C a n n o n ' s a l g o r i t h m f o r o n e e l e m e n t p e r p r o c e s s o r . T h i s s t e p w i l l r e q u i r e a

    c o m m u n i c a t i o n t i m e o f 2 ( t

    s

    + t

    w

    )

    n

    r

    I n t h e r s t s t a g e o f t h e a l g o r i t h m , e a c h d a t a e l e m e n t i s b r o a d c a s t o v e r r p r o c e s s o r s . I n o r d e r

    t o p l a c e t h e e l e m e n t s o f m a t r i x A i n t h e i r r e s p e c t i v e p o s i t i o n s , r s t t h e b u e r a

    ( 0 ; j ; k )

    i s s e n t t o

    a

    ( k ; j ; k )

    i n l o g r s t e p s a n d t h e n a

    ( k ; j ; k )

    i s b r o a d c a s t t o a

    ( k ; j ; l )

    ; 0 l < r , a g a i n i n l o g r s t e p s . B y

    f o l l o w i n g a s i m i l a r p r o c e d u r e , t h e e l e m e n t s o f m a t r i x B c a n b e t r a n s m i t t e d t o t h e i r r e s p e c t i v e

    p r o c e s s o r s . I n t h e s e c o n d s t a g e , g r o u p s o f ( n = r )

    2

    p r o c e s s o r s m u l t i p l y b l o c k s o f ( n = r ) ( n = r )

    e l e m e n t s e a c h p r o c e s s o r p e r f o r m i n g n = r c o m p u t a t i o n s a n d 2 n = r c o m m u n i c a t i o n s . I n t h e n a l

    s t e p , t h e e l e m e n t s o f m a t r i x C a r e r e s t o r e d t o t h e i r d e s i g n a t e d p r o c e s s o r s i n l o g r s t e p s . T h e

    c o m m u n i c a t i o n t i m e c a n t h u s b e s h o w n t o b e e q u a l t o ( t

    s

    + t

    w

    ) ( 5 l o g r + 2

    n

    r

    ) r e s u l t i n g i n t h e

    p a r a l l e l r u n t i m e g i v e n b y t h e f o l l o w i n g e q u a t i o n :

    T

    p

    =

    n

    3

    p

    + ( t

    s

    + t

    w

    ) ( 5 l o g (

    p

    n

    2

    ) + 2

    n

    3

    p

    ) ( 6 )

    I f p =

    n

    3

    l o g n

    p r o c e s s o r s a r e u s e d , t h e n t h e p a r a l l e l e x e c u t i o n t i m e o f t h e D N S a l g o r i t h m

    i s O ( l o g n ) . T h e p r o c e s s o r - t i m e p r o d u c t i s n o w O ( n

    3

    ) , w h i c h i s s a m e a s t h e s e q u e n t i a l t i m e

    c o m p l e x i t y o f t h e a l g o r i t h m .

    4 . 6 O u r V a r i a n t o f t h e D N S A l g o r i t h m

    H e r e w e p r e s e n t a n o t h e r s c h e m e t o a d a p t t h e s i n g l e e l e m e n t p e r p r o c e s s o r v e r s i o n o f t h e D N S

    a l g o r i t h m t o b e a b l e t o u s e f e w e r t h a n n

    3

    p r o c e s s o r s o n a h y p e r c u b e . I n t h e r e s t o f t h e p a p e r

    w e s h a l l r e f e r t o t h i s a l g o r i t h m a s t h e G K v a r i a n t o f t h e D N S a l g o r i t h m . A s s h o w n l a t e r i n

    S e c t i o n 6 , t h i s a l g o r i t h m p e r f o r m s b e t t e r t h a n t h e D N S a l g o r i t h m f o r a w i d e r a n g e o f n a n d

    p . A l s o , u n l i k e t h e D N S a l g o r i t h m w h i c h w o r k s o n l y f o r n

    2

    p n

    3

    , t h i s a l g o r i t h m c a n

    u s e a n y n u m b e r o f p r o c e s s o r s f r o m 1 t o n

    3

    . I n t h i s v a r i a n t , w e u s e p = 2

    3 q

    p r o c e s s o r s w h e r e

    q

  • 8/10/2019 Scalability of Parallel Alg for Matrix Multiplication

    10/26

    4 . 5 . 1 . N o w , a l l t h e s i n g l e e l e m e n t o p e r a t i o n s o f t h e a l g o r i t h m o f S e c t i o n 4 . 5 . 1 a r e r e p l a c e d b y

    s u b - b l o c k o p e r a t i o n s ; i . e . , m a t r i x s u b - b l o c k s a r e m u l t i p l i e d , c o m m u n i c a t e d a n d a d d e d .

    L e t t

    m u l t

    a n d t

    a d d

    i s t h e t i m e t o p e r f o r m a s i n g l e o a t i n g p o i n t m u l t i p l i c a t i o n a n d a d d i t i o n

    r e s p e c t i v e l y . A l s o , a c c o r d i n g t o t h e a s s u m p t i o n o f S e c t i o n 2 , t

    m u l t

    + t

    a d d

    = 1 . I n t h e r s t s t a g e

    o f t h i s a l g o r i t h m ,

    n

    2

    p

    2 = 3

    d a t a e l e m e n t s a r e b r o a d c a s t o v e r p

    1 = 3

    p r o c e s s o r s f o r e a c h m a t r i x . I n

    o r d e r t o p l a c e t h e e l e m e n t s o f m a t r i x A i n t h e i r r e s p e c t i v e p o s i t i o n s , r s t t h e b u e r a

    ( 0 ; j ; k )

    i s s e n t t o a

    ( k ; j ; k )

    i n l o g p

    1 = 3

    s t e p s a n d t h e n a

    ( k ; j ; k )

    i s b r o a d c a s t t o a

    ( k ; j ; l )

    ; 0 l < p

    1 = 3

    , a g a i n

    i n l o g p

    1 = 3

    s t e p s . B y f o l l o w i n g a s i m i l a r p r o c e d u r e , t h e e l e m e n t s o f m a t r i x B c a n b e s e n t

    t o t h e p r o c e s s o r s w h e r e t h e y a r e t o b e u t i l i z e d i n 2 l o g p

    1 = 3

    s t e p s . I n t h e s e c o n d s t a g e o f

    t h e a l g o r i t h m , e a c h p r o c e s s o r p e r f o r m s (

    n

    p

    1 = 3

    )

    3

    =

    n

    3

    p

    m u l t i p l i c a t i o n s . I n t h e t h i r d s t e p , t h e

    c o r r e s p o n d i n g e l e m e n t s o f p

    1 = 3

    g r o u p s o f

    n

    2

    p

    2 = 3

    e l e m e n t s e a c h a r e a d d e d i n a t r e e f a s h i o n . T h e

    r s t s t a g e t a k e s 4 t

    s

    l o g p

    1 = 3

    + 4 t

    w

    n

    2

    p

    2 = 3

    l o g p

    1 = 3

    t i m e . T h e s e c o n d s t a g e c o n t r i b u t e s t

    m u l t

    n

    3

    p

    t o t h e

    p a r a l l e l e x e c u t i o n t i m e a n d t h e t h i r d s t a g e i n v o l v e s t

    s

    l o g p

    1 = 3

    + t

    w

    n

    2

    p

    2 = 3

    l o g p

    1 = 3

    c o m m u n i c a t i o n

    t i m e a n d t

    a d d

    n

    3

    p

    c o m p u t a t i o n t i m e f o r c a l c u l a t i n g t h e s u m s . T h e t o t a l p a r a l l e l e x e c u t i o n t i m e

    i s t h e r e f o r e g i v e n b y t h e f o l l o w i n g e q u a t i o n :

    T

    p

    =

    n

    3

    p

    +

    5

    3

    t

    s

    l o g p +

    5

    3

    t

    w

    n

    2

    p

    2 = 3

    l o g p ( 7 )

    T h i s e x e c u t i o n t i m e c a n b e f u r t h e r r e d u c e d b y u s i n g a m o r e s o p h i s t i c a t e d s c h e m e f o r

    o n e - t o - a l l b r o a d c a s t o n a h y p e r c u b e 2 0 ] . T h i s i s d i s c u s s e d i n d e t a i l i n S e c t i o n 5 . 4 .

    5 S c a l a b i l i t y A n a l y s i s

    I f W i s t h e s i z e o f t h e p r o b l e m t o b e s o l v e d a n d T

    o

    ( W ; P ) i s t h e t o t a l o v e r h e a d , t h e n t h e

    e c i e n c y E i s g i v e n b y

    W

    W + T

    o

    ( W p )

    . C l e a r l y , f o r a g i v e n W , i f p i n c r e a s e s , t h e n E w i l l d e c r e a s e

    b e c a u s e T

    o

    ( W ; p ) i n c r e a s e s w i t h p . O n t h e o t h e r h a n d , i f W i n c r e a s e s , t h e n E i n c r e a s e s b e c a u s e

    t h e r a t e o f i n c r e a s e o f T

    o

    i s s l o w e r t h a n t h a t o f W f o r a s c a l a b l e a l g o r i t h m . T h e i s o e c i e n c y

    f u n c t i o n f o r a c e r t a i n e c i e n c y E c a n b e o b t a i n e d b y e q u a t i n g W w i t h

    E

    1 ? E

    T

    o

    ( E q u a t i o n ( 1 ) )

    a n d t h e n s o l v i n g t h i s e q u a t i o n t o d e t e r m i n e W a s a f u n c t i o n o f p . I n m o s t o f t h e p a r a l l e l

    a l g o r i t h m s d e s c r i b e d i n S e c t i o n 4 , t h e c o m m u n i c a t i o n o v e r h e a d h a s t w o d i e r e n t t e r m s d u e

    t o t

    s

    a n d t

    w

    . W h e n t h e r e a r e m u l t i p l e t e r m s i n T

    o

    o f d i e r e n t o r d e r , i t i s o f t e n n o t p o s s i b l e

    t o o b t a i n t h e i s o e c i e n c y f u n c t i o n a s a c l o s e d f o r m f u n c t i o n o f p A s p a n d W i n c r e a s e i n a

    p a r a l l e l s y s t e m , e c i e n c y i s g u a r a n t e e d n o t t o d r o p i f n o n e o f t h e t e r m s o f T

    o

    g r o w s f a s t e r t h a n

    W . T h e r e f o r e , i f T

    o

    h a s m u l t i p l e t e r m s , w e b a l a n c e W a g a i n s t e a c h i n d i v i d u a l t e r m o f T

    o

    t o

    c o m p u t e t h e r e s p e c t i v e i s o e c i e n c y f u n c t i o n . T h e c o m p o n e n t o f T

    o

    t h a t r e q u i r e s t h e p r o b l e m

    s i z e t o g r o w a t t h e f a s t e s t r a t e w i t h r e s p e c t t o p d e t e r m i n e s t h e o v e r a l l i s o e c i e n c y f u n c t i o n

    o f t h e e n t i r e c o m p u t a t i o n . S o m e t i m e s , t h e i s o e c i e n c y f u n c t i o n f o r a p a r a l l e l a l g o r i t h m i s

    d u e t o t h e l i m i t o n t h e c o n c u r r e n c y o f t h e a l g o r i t h m . F o r i n s t a n c e , i f f o r a p r o b l e m s i z e W ,

    1 0

  • 8/10/2019 Scalability of Parallel Alg for Matrix Multiplication

    11/26

    a n a l g o r i t h m c a n n o t u s e m o r e t h a n h ( W ) p r o c e s s o r s , t h e n a s t h e n u m b e r o f p r o c e s s o r s i s

    i n c r e a s e d , e v e n t u a l l y W h a s t o b e i n c r e a s e d a s h

    ? 1

    ( p ) i n o r d e r t o k e e p a l l t h e p r o c e s s o r s b u s y

    a n d t o a v o i d t h e e c i e n c y f r o m f a l l i n g d u e t o i d l e p r o c e s s o r s . I f h

    ? 1

    ( p ) i s g r e a t e r t h a n a n y o f

    t h e i s o e c i e n c y t e r m s d u e t o c o m m u n i c a t i o n o v e r h e a d s , t h e n h

    ? 1

    ( p ) i s t h e o v e r a l l i s o e c i e n c y

    f u n c t i o n a n d d e t e r m i n e s t h e s c a l a b i l i t y o f t h e p a r a l l e l a l g o r i t h m . T h u s i t i s p o s s i b l e f o r a n

    a l g o r i t h m t o h a v e l i t t l e c o m m u n i c a t i o n o v e r h e a d , b u t s t i l l a b a d s c a l a b i l i t y d u e t o l i m i t e d

    c o n c u r r e n c y .

    I n t h e f o l l o w i n g s u b s e c t i o n s , w e d e t e r m i n e t h e i s o e c i e n c y f u n c t i o n s f o r a l l t h e a l g o r i t h m s

    d i s c u s s e d i n S e c t i o n 4 . T h e p r o b l e m s i z e W i s t a k e n a s n

    3

    f o r a l l t h e a l g o r i t h m s .

    5 . 1 I s o e c i e n c y A n a l y s i s o f C a n n o n ' s A l g o r i t h m

    F r o m E q u a t i o n ( 3 ) , i t f o l l o w s t h a t t h e t o t a l o v e r h e a d o v e r a l l t h e p r o c e s s o r s f o r t h i s a l g o r i t h m

    i s 2 t

    s

    p

    p

    p + 2 t

    w

    n

    2

    p

    p . I n o r d e r t o d e t e r m i n e t h e i s o e c i e n c y t e r m d u e t o t

    s

    , W h a s t o b e

    p r o p o r t i o n a l t o 2 K t

    s

    p

    p

    p ( s e e E q u a t i o n ( 1 ) ) , w h e r e K =

    1

    1 ? E

    a n d E i s t h e d e s i r e d e c i e n c y

    t h a t h a s t o b e m a i n t a i n e d . H e n c e t h e f o l l o w i n g i s o e c i e n c y r e l a t i o n r e s u l t s :

    n

    3

    = W / 2 K t

    s

    p

    p

    p ( 8 )

    S i m i l a r l y , t o d e t e r m i n e t h e i s o e c i e n c y t e r m d u e t o t

    w

    , n

    3

    h a s t o p r o p o r t i o n a l t o 2 K t

    w

    n

    2

    p

    p

    T h e r e f o r e ,

    n

    3

    / 2 K t

    w

    n

    2

    p

    p

    = > n / 2 K t

    w

    p

    p

    = > n

    3

    = W / 8 K

    3

    t

    3

    w

    p

    1 5

    ( 9 )

    A c c o r d i n g t o b o t h E q u a t i o n s ( 8 ) a n d ( 9 ) , t h e a s y m p t o t i c i s o e c i e n c y f u n c t i o n o f C a n n o n ' s

    a l g o r i t h m i s O ( p

    1 5

    ) . A l s o , s i n c e t h e m a x i m u m n u m b e r o f p r o c e s s o r s t h a t c a n b e u s e d b y t h i s

    a l g o r i t h m i s n

    2

    , t h e i s o e c i e n c y d u e t o c o n c u r r e n c y

    2

    i s a l s o O ( p

    1 5

    ) . T h u s C a n n o n ' s a l g o r i t h m

    i s a s s c a l a b l e o n a h y p e r c u b e a s a n y m a t r i x m u l t i p l i c a t i o n a l g o r i t h m u s i n g O ( n

    2

    ) p r o c e s s o r s

    c a n b e o n a n y a r c h i t e c t u r e .

    A l l o f t h e a b o v e a n a l y s i s a l s o a p p l i e s t o t h e s i m p l e a l g o r i t h m a n d t h e a s y n c h r o n o u s v e r s i o n

    o f F o x ' s a l g o r i t h m a l s o b e c a u s e t h e d e g r e e o f c o n c u r r e n c y o f C a n n o n ' s a l g o r i t h m a s w e l l a s i t s

    c o m m u n i c a t i o n o v e r h e a d s ( a s y m p t o t i c a l l y , o r w i t h i n a c o n s t a n t f a c t o r s ) a r e i d e n t i c a l t o t h e s e

    a l g o r i t h m s .

    2

    n

    2

    / p = > n

    3

    = W / p

    1 5

    1 1

  • 8/10/2019 Scalability of Parallel Alg for Matrix Multiplication

    12/26

    5 . 2 I s o e c i e n c y A n a l y s i s o f B e r n t s e n ' s A l g o r i t h m

    T h e o v e r a l l o v e r h e a d f u n c t i o n f o r t h i s a l g o r i t h m c a n b e d e t e r m i n e d f r o m t h e e x p r e s s i o n o f t h e

    p a r a l l e l e x e c u t i o n t i m e i n E q u a t i o n ( 5 ) t o b e 2 t

    s

    p

    4 = 3

    +

    1

    3

    t

    s

    p l o g p + 3 t

    w

    n

    2

    p

    1 = 3

    . B y a n a n a l y s i s

    s i m i l a r t o t h a t i n S e c t i o n 5 . 1 , i t c a n b e s h o w n t h a t t h e i s o e c i e n c y t e r m s d u e t o t

    s

    a n d t

    w

    f o r

    t h i s a l g o r i t h m a r e g i v e n b y t h e f o l l o w i n g e q u a t i o n s :

    n

    3

    = W / 2 K t

    s

    p

    4 = 3

    ( 1 0 )

    n

    3

    = W / 2 7 K

    3

    t

    3

    w

    p ( 1 1 )

    R e c a l l f r o m S e c t i o n 4 . 4 t h a t f o r t h i s a l g o r i t h m , p n

    3 = 2

    . T h i s m e a n s t h a t n

    3

    = W / p

    2

    a s t h e n u m b e r o f p r o c e s s o r s i s i n c r e a s e d . T h u s t h e i s o e c i e n c y f u n c t i o n d u e t o c o n c u r r e n c y i s

    O ( p

    2

    ) , w h i c h i s w o r s e t h a n a n y o f t h e i s o e c i e n c y t e r m s d u e t o t h e c o m m u n i c a t i o n o v e r h e a d .

    T h u s t h i s a l g o r i t h m h a s a p o o r s c a l a b i l i t y d e s p i t e l i t t l e c o m m u n i c a t i o n c o s t d u e t o i t s l i m i t e d

    c o n c u r r e n c y .

    5 . 3 I s o e c i e n c y A n a l y s i s o f t h e D N S A l g o r i t h m

    I t c a n b e s h o w n t h a t t h e o v e r h e a d f u n c t i o n T

    o

    f o r t h i s a l g o r i t h m i s ( t

    s

    + t

    w

    ) (

    5

    3

    p l o g p + 2 n

    3

    )

    S i n c e W i s O ( n

    3

    ) , t h e t e r m s 2 ( t

    s

    + t

    w

    ) n

    3

    w i l l a l w a y s b e b a l a n c e d w i t h r e s p e c t t o W . T h i s

    t e r m i s i n d e p e n d e n t o f p a n d d o e s n o t c o n t r i b u t e t o t h e i s o e c i e n c y f u n c t i o n . I t d o e s h o w -

    e v e r i m p o s e a n u p p e r l i m i t o n t h e e c i e n c y t h a t t h i s a l g o r i t h m c a n a c h i e v e . S i n c e , f o r t h i s

    a l g o r i t h m , E =

    1

    1 +

    5 = 3 p o g p

    n

    3

    + 2 ( t

    s

    + t

    w

    )

    , a n e c i e n c y h i g h e r t h a n

    1

    1 + 2 ( t

    s

    + t

    w

    )

    c a n n o t b e a t t a i n e d , n o

    m a t t e r h o w b i g t h e p r o b l e m s i z e i s . S i n c e t

    s

    i s u s u a l l y a l a r g e c o n s t a n t f o r m o s t p r a c t i c a l

    M I M D c o m p u t e r s , t h e a c h i e v a b l e e c i e n c y o f t h i s a l g o r i t h m i s q u i t e l i m i t e d o n s u c h m a c h i n e s .

    T h e o t h e r t e r m i n T

    o

    y i e l d s t h e f o l l o w i n g i s o e c i e n c y f u n c t i o n f o r t h e a l g o r i t h m :

    n

    3

    = W /

    5

    3

    K t

    s

    p l o g p ( 1 2 )

    T h e a b o v e e q u a t i o n s h o w s t h a t t h e a s y m p t o t i c i s o e c i e n c y f u n c t i o n o f t h e D N S a l g o r i t h m

    o n a h y p e r c u b e i s O ( p l o g p ) . I t c a n e a s i l y b e s h o w n t h a t a n O ( p l o g p ) s c a l a b i l i t y i s t h e b e s t

    a n y p a r a l l e l f o r m u l a t i o n o f t h e c o n v e n t i o n a l O ( n

    3

    ) a l g o r i t h m c a n a c h i e v e o n a n y p a r a l l e l

    a r c h i t e c t u r e 4 ] a n d t h e D N S a l g o r i t h m a c h i e v e s t h i s l o w e r b o u n d o n a h y p e r c u b e .

    5 . 4 I s o e c i e n c y A n a l y s i s o f t h e G K A l g o r i t h m

    T h e t o t a l o v e r h e a d T

    o

    f o r t h i s a l g o r i t h m i s e q u a l t o

    5

    3

    t

    s

    p l o g p +

    5

    3

    t

    w

    n

    2

    p

    1 = 3

    l o g p a n d t h e f o l l o w i n g

    e q u a t i o n s g i v e t h e i s o e c i e n c y t e r m s d u e t o t

    s

    a n d t

    w

    r e s p e c t i v e l y f o r t h i s a l g o r i t h m :

    1 2

  • 8/10/2019 Scalability of Parallel Alg for Matrix Multiplication

    13/26

    n

    3

    = W /

    5

    3

    K t

    s

    p l o g p ( 1 3 )

    n

    3

    = W /

    1 2 5

    2 7

    K

    3

    t

    3

    w

    p ( l o g p )

    3

    ( 1 4 )

    T h e c o m m u n i c a t i o n o v e r h e a d s a n d t h e i s o e c i e n c y f u n c t i o n o f t h e G K a l g o r i t h m c a n b e

    i m p r o v e d b y u s i n g a m o r e s o p h i s t i c a t e d s c h e m e f o r o n e - t o - a l l b r o a d c a s t o n a h y p e r c u b e 2 0 ] .

    D u e t o t h e c o m p l e x i t y o f t h i s s c h e m e , w e h a v e u s e d t h e s i m p l e o n e - t o - a l l b r o a d c a s t s c h e m e i n

    o u r i m p l e m e n t a t i o n o f t h i s a l g o r i t h m o n t h e C M - 5 . W e t h e r e f o r e u s e E q u a t i o n ( 7 ) i n S e c t i o n s

    6 f o r c o m p a r i n g t h e G K a l g o r i t h m w i t h t h e o t h e r a l g o r i t h m s d i s c u s s e d i n t h i s p a p e r . I n t h e

    n e x t s u b s e c t i o n w e g i v e t h e e x p r e s s i o n s f o r t h e r u n t i m e a n d t h e i s o e c i e n c y f u n c t i o n o f t h e

    G K a l g o r i t h m w i t h t h e i m p r o v e d o n e - t o - a l l b r o a d c a s t .

    5 . 4 . 1 G K A l g o r i t h m W i t h I m p r o v e d C o m m u n i c a t i o n

    I n t h e d e s c r i p t i o n o f t h e G K a l g o r i t h m i n S e c t i o n 4 . 6 , t h e c o m m u n i c a t i o n m o d e l o n a h y p e r -

    c u b e a s s u m e s t h a t t h e o n e - t o - a l l b r o a d c a s t o f a m e s s a g e o f s i z e m o n p h y p e r c u b e p r o c e s s o r s

    t a k e s t

    s

    l o g p + t

    w

    m l o g p t i m e . I n 2 0 ] , J o h n s s o n a n d H o p r e s e n t a m o r e s o p h i s t i c a t e d o n e - t o - a l l

    b r o a d c a s t s c h e m e t h a t w i l l r e d u c e t h i s t i m e t o t

    s

    l o g p + t

    w

    m + 2 t

    w

    l o g p d

    q

    t

    s

    m

    t

    w

    l o g p

    e . U s i n g t h i s

    s c h e m e , t h e s u b - b l o c k s o f m a t r i c e s A a n d B c a n b e t r a n s p o r t e d t o t h e i r d e s t i n a t i o n p r o c e s s o r s

    i n t i m e 4 t

    w

    n

    2

    p

    2 = 3

    +

    4

    3

    t

    s

    l o g p + 8

    n

    p

    1 = 3

    q

    1

    3

    t

    s

    t

    w

    l o g p w i t h t h e c o n d i t i o n t h a t

    q

    3 t

    s

    n

    2

    t

    w

    p

    1 = 3

    l o g p

    i s c o n s i d e r e d

    e q u a l t o 1 i f 3 t

    s

    n

    2

    < t

    w

    p

    1 = 3

    l o g p . A c o m m u n i c a t i o n p a t t e r n s i m i l a r t o t h a t u s e d f o r t h i s

    o n e - t o - a l l b r o a d c a s t c a n b e u s e d t o g a t h e r a n d s u m u p t h e s u b - b l o c k s o f t h e r e s u l t m a t r i x C

    w i t h a c o m m u n i c a t i o n t i m e o f t

    w

    n

    2

    p

    2 = 3

    +

    1

    3

    t

    s

    l o g p + 2

    n

    p

    1 = 3

    q

    1

    3

    t

    s

    t

    w

    l o g p

    A n a n a l y s i s s i m i l a r t o t h a t i n S e c t i o n 5 . 4 c a n b e p e r f o r m e d t o o b t a i n t h e i s o e c i e n c y

    f u n c t i o n f o r t h i s s c h e m e . I t c a n b e s h o w n t h a t t h e a s y m p t o t i c a l l y h i g h e s t i s o e c i e n c y t e r m

    n o w i s

    5

    3

    t

    s

    p l o g p w h i c h i s a n i m p r o v e m e n t o v e r O ( p ( l o g p )

    3

    ) i s o e c i e n c y f u n c t i o n f o r t h e n a i v e

    b r o a d c a s t i n g s c h e m e .

    T h e b r o a d c a s t i n g s c h e m e o f 2 0 ] r e q u i r e s t h a t t h e m e s s a g e b e b r o k e n u p i n t o p a c k e t s a n d a n

    o p t i m a l p a c k e t s i z e t o o b t a i n t h e b r o a d c a s t t i m e g i v e n a b o v e i s

    q

    t

    s

    m

    t

    w

    l o g p

    f o r a m e s s a g e o f s i z e m

    T h i s m e a n s t h a t i n t h e G K a l g o r i t h m ,

    n

    2

    p

    2 = 3

    >

    t

    s

    t

    w

    l o g p , o r n

    3

    = W > (

    t

    s

    t

    w

    )

    1 5

    p ( l o g p )

    1 5

    . I n o t h e r

    w o r d s , J o h n s s o n ' s s c h e m e o f r e d u c i n g t h e c o m m u n i c a t i o n t i m e i s e e c t i v e o n l y w h e n t h e r e

    i s e n o u g h d a t a t o b e s e n t o n a l l t h e c h a n n e l s . T h i s i m p o s e s a l o w e r l i m i t o n t h e g r a n u l a r i t y

    o f t h e p r o b l e m b e i n g s o l v e d . I n c a s e o f t h e m a t r i x m u l t i p l i c a t i o n a l g o r i t h m u n d e r s t u d y i n

    t h i s s e c t i o n , t h e s c a l a b i l i t y i m p l i c a t i o n o f t h i s i s t h a t t h e p r o b l e m s i z e h a s t o g r o w a t l e a s t

    a s f a s t a s O ( p ( l o g p )

    1 5

    ) w i t h r e s p e c t t o p . T h u s t h e e e c t i v e i s o e c i e n c y f u n c t i o n o f t h e G K

    a l g o r i t h m w i t h J o h n s s o n ' s o n e - t o - a l l b r o a d c a s t s c h e m e o n t h e h y p e r c u b e i s o n l y O ( p ( l o g p )

    1 5

    )

    a n d n o t O ( p l o g p ) a s m i g h t a p p e a r f r o m t h e r e d u c e d c o m m u n i c a t i o n t e r m s .

    1 3

  • 8/10/2019 Scalability of Parallel Alg for Matrix Multiplication

    14/26

    H o w e v e r , i f t h e m e s s a g e s t a r t u p t i m e t

    s

    i s c l o s e t o z e r o ( a s m i g h t b e t h e c a s e f o r a n S I M D

    m a c h i n e ) , t h e p a c k e t s i z e c a n b e a s s m a l l a s o n e w o r d a n d a n i s o e c i e n c y f u n c t i o n o f O ( p l o g p )

    i s r e a l i z a b l e .

    5 . 5 S u m m a r y o f S c a l a b i l i t y A n a l y s i s

    S u b s e c t i o n s 5 . 1 t h r o u g h 5 . 4 g i v e t h e o v e r a l l i s o e c i e n c y f u n c t i o n s o f t h e f o u r a l g o r i t h m s o n

    a h y p e r c u b e a r c h i t e c t u r e . T h e a s y m p t o t i c s c a l a b i l i t i e s a n d t h e r a n g e o f a p p l i c a b i l i t y o f t h e s e

    a l g o r i t h m s i s s u m m a r i z e d i n T a b l e 1 . I n t h i s s e c t i o n a n d t h e r e s t o f t h i s p a p e r , w e s k i p

    t h e d i s c u s s i o n o f t h e s i m p l e a l g o r i t h m a n d F o x ' s a l g o r i t h m b e c a u s e t h e e x p r e s s i o n s f o r t h e i r

    i s o - e c i e n c y f u n c t i o n s d i e r w i t h t h a t f o r C a n n o n ' s a l g o r i t h m b y s m a l l c o n s t a n t f a c t o r s o n l y .

    A l g o r i t h m T o t a l O v e r h e a d A s y m p t o t i c R a n g e o f

    F u n c t i o n , T

    o

    I s o e . F u n c t i o n A p p l i c a b i l i t y

    B e r n t s e n ' s 2 t

    s

    p

    4 = 3

    +

    1

    3

    t

    s

    p l o g p + 3 t

    w

    n

    2

    p

    1 = 3

    O ( p

    2

    ) 1 p n

    3 = 2

    C a n n o n ' s 2 t

    s

    p

    3 = 2

    + 2 t

    w

    n

    2

    p

    p O ( p

    1 5

    ) 1 p n

    2

    G K

    5

    3

    t

    s

    p l o g p +

    5

    3

    t

    w

    n

    2

    p

    1 = 3

    l o g p O ( p ( l o g p )

    3

    ) 1 p n

    3

    I m r p o v e d G K t

    w

    n

    2

    p

    1 = 3

    +

    1

    3

    t

    s

    p l o g p + 2 n p

    2 = 3

    q

    1

    3

    t

    s

    t

    w

    l o g p O ( p ( l o g p )

    1 5

    ) 1 p (

    n

    q

    t

    s

    t

    w

    l o g n

    )

    3

    D N S ( t

    s

    + t

    w

    ) (

    5

    3

    p l o g p + 2 n

    3

    ) O ( p l o g p ) n

    2

    p n

    3

    T a b l e 1 : C o m m u n i c a t i o n o v e r h e a d , s c a l a b i l i t y a n d r a n g e o f a p p l i c a t i o n o f t h e f o u r a l g o r i t h m s

    o n a h y p e r c u b e .

    N o t e t h a t T a b l e 1 g i v e s o n l y t h e a s y m p t o t i c s c a l a b i l i t i e s o f t h e f o u r a l g o r i t h m s . I n p r a c t i c e ,

    n o n e o f t h e a l g o r i t h m s i s s t r i c t l y b e t t e r t h a n t h e o t h e r s f o r a l l p o s s i b l e p r o b l e m s i z e s a n d

    n u m b e r o f p r o c e s s o r s . F u r t h e r a n a l y s i s i s r e q u i r e d t o d e t e r m i n e t h e b e s t a l g o r i t h m f o r a g i v e n

    p r o b l e m s i z e a n d a c e r t a i n p a r a l l e l m a c h i n e d e p e n d i n g o n t h e n u m b e r o f p r o c e s s o r s b e i n g

    u s e d a n d t h e h a r d w a r e p a r a m e t e r s o f t h e m a c h i n e . A d e t a i l e d c o m p a r i s o n o f t h e s e a l g o r i t h m s

    b a s e d o n t h e i r r e s p e c t i v e t o t a l o v e r h e a d f u n c t i o n s i s p r e s e n t e d i n t h e n e x t s e c t i o n .

    6 R e l a t i v e P e r f o r m a n c e o f t h e F o u r A l g o r i t h m s o n a

    H y p e r c u b e

    T h e i s o e c i e n c y f u n c t i o n s o f t h e f o u r m a t r i x m u l t i p l i c a t i o n a l g o r i t h m s p r e d i c t t h e i r r e l a t i v e

    p e r f o r m a n c e f o r a l a r g e n u m b e r o f p r o c e s s o r s a n d l a r g e p r o b l e m s i z e s . B u t f o r m o d e r a t e

    v a l u e s o f n a n d p , a s e e m i n g l y l e s s s c a l a b l e p a r a l l e l f o r m u l a t i o n c a n o u t p e r f o r m t h e o n e t h a t

    1 4

  • 8/10/2019 Scalability of Parallel Alg for Matrix Multiplication

    15/26

    h a s a n a s y m p t o t i c a l l y s m a l l e r i s o e c i e n c y f u n c t i o n . I n t h i s s u b s e c t i o n , w e d e r i v e t h e e x a c t

    c o n d i t i o n s u n d e r w h i c h e a c h o f t h e s e f o u r a l g o r i t h m s y i e l d s t h e b e s t p e r f o r m a n c e .

    W e c o m p a r e a p a i r o f a l g o r i t h m s b y c o m p a r i n g t h e i r t o t a l o v e r h e a d f u n c t i o n s ( T

    o

    ) a s g i v e n

    i n T a b l e 1 . F o r i n s t a n c e , w h i l e c o m p a r i n g t h e G K a l g o r i t h m w i t h C a n n o n ' s a l g o r i t h m , i t

    i s c l e a r t h a t t h e t

    s

    t e r m f o r t h e G K a l g o r i t h m w i l l a l w a y s b e l e s s t h a n t h a t f o r C a n n o n ' s

    a l g o r i t h m . E v e n i f t

    s

    = 0 , t h e t

    w

    t e r m o f t h e G K a l g o r i t h m b e c o m e s s m a l l e r t h a n t h a t o f

    C a n n o n ' s a l g o r i t h m f o r p > 1 3 0 m i l l i o n . T h u s , p = 1 3 0 m i l l i o n i s t h e c u t - o p o i n t b e y o n d

    w h i c h t h e G K a l g o r i t h m w i l l p e r f o r m b e t t e r t h a n C a n n o n ' s a l g o r i t h m i r r e s p e c t i v e o f t h e v a l u e s

    o f n . F o r p

  • 8/10/2019 Scalability of Parallel Alg for Matrix Multiplication

    16/26

    DNS vs. GKGK vs. Berntsens

    GK vs. Cannons

    0

    50

    100

    150

    200

    250

    0 10 20 30 40 50 60 70

    n

    p

    p = np = n

    p = n

    a bx

    3

    2

    1.5

    F i g u r e 1 : A c o m p a r i s o n o f t h e f o u r a l g o r i t h m s f o r t

    w

    = 3 a n d t

    s

    = 1 5 0

    a n x i s t h e o n e w h e r e p > n

    3

    a n d n o n e o f t h e a l g o r i t h m s i s a p p l i c a b l e , t h e r e g i o n m a r k e d w i t h

    a n a i s t h e o n e w h e r e t h e G K a l g o r i t h m i s t h e b e s t c h o i c e , t h e s y m b o l b r e p r e s e n t s t h e r e g i o n

    w h e r e B e r n t s e n ' s a l g o r i t h m i s s u p e r i o r t o t h e o t h e r s , t h e r e g i o n m a r k e d w i t h a c i s t h e o n e

    w h e r e C a n n o n ' s a l g o r i t h m s h o u l d b e u s e d a n d t h e r e g i o n m a r k e d w i t h a d i s t h e o n e w h e r e

    t h e D N S a l g o r i t h m i s t h e b e s t .

    F i g u r e 1 c o m p a r e s t h e f o u r a l g o r i t h m s f o r t

    w

    = 3 a n d t

    s

    = 1 5 0 . T h e s e p a r a m e t e r s a r e v e r y

    c l o s e t o t h a t o f a c u r r e n t l y a v a i l a b l e p a r a l l e l c o m p u t e r l i k e t h e n C U B E 2

    T M y

    . I n t h i s g u r e ,

    s i n c e t h e n

    E q u a l ? T

    o

    c u r v e f o r t h e D N S a l g o r i t h m a n d t h e G K a l g o r i t h m l i e s i n t h e x r e g i o n ,

    a n d t h e D N S a l g o r i t h m i s b e t t e r t h a n t h e G K a l g o r i t h m o n l y f o r v a l u e s o f n s m a l l e r t h a n

    n

    E q u a l ? T

    o

    ( p ) . H e n c e t h e D N S a l g o r i t h m w i l l a l w a y s

    3

    p e r f o r m w o r s e t h a n t h e G K a l g o r i t h m f o r

    t h i s s e t o f v a l u e s o f t

    s

    a n d t

    w

    a n d t h e l a t t e r i s t h e b e s t o v e r a l l c h o i c e f o r p > n

    2

    a s B e r n t s e n ' s

    a l g o r i t h m a n d C a n n o n ' s a l g o r i t h m a r e n o t a p p l i c a b l e i n t h i s r a n g e o f p . S i n c e t h e n

    E q u a l ? T

    o

    c u r v e f o r G K a n d C a n n o n ' s a l g o r i t h m l i e s b e l o w t h e p = n

    3 = 2

    c u r v e , t h e G K a l g o r i t h m i s t h e

    b e s t c h o i c e e v e n f o r n

    3 = 2

    p n

    2

    . F o r p < n

    3 = 2

    , B e r n t s e n ' s a l g o r i t h m i s a l w a y s b e t t e r t h a n

    C a n n o n ' s a l g o r i t h m , a n d f o r t h i s s e t o f t

    s

    a n d t

    w

    , a l s o t h a n t h e G K a l g o r i t h m . H e n c e i t i s t h e

    b e s t c h o i c e i n t h a t r e g i o n i n F i g u r e 1 .

    I n F i g u r e 2 , w e c o m p a r e t h e f o u r a l g o r i t h m s f o r a h y p e r c u b e w i t h t

    w

    = 3 a n d t

    s

    = 1 0 .

    S u c h a m a c h i n e c o u l d e a s i l y b e d e v e l o p e d i n t h e n e a r f u t u r e b y u s i n g f a s t e r C P U ' s ( t

    w

    a n d

    t

    s

    r e p r e s e n t r e l a t i v e c o m m u n i c a t i o n c o s t s w i t h r e s p e c t t o t h e u n i t c o m p u t a t i o n t i m e ) a n d

    r e d u c i n g t h e m e s s a g e s t a r t u p t i m e . B y o b s e r v i n g t h e n

    E q u a l ? T

    o

    c u r v e s a n d t h e r e g i o n s o f

    y

    n C U B E 2 i s a t r a d e m a r k o f t h e N c u b e c o r p o r a t i o n .

    3

    A c t u a l l y , t h e n

    E q u a l T

    o

    c u r v e f o r D N S v s G K a l g o r i t h m s w i l l c r o s s t h e p = n

    3

    c u r v e f o r p = 2 6 1 0

    1 8

    b u t c l e a r l y t h i s r e g i o n h a s n o p r a c t i c a l i m p o r t a n c e .

    1 6

  • 8/10/2019 Scalability of Parallel Alg for Matrix Multiplication

    17/26

    x

    0

    50

    100

    150

    200

    250

    0 5 10 15 20 25 30 35

    p

    n

    p = np = np = n

    GK vs. Berntsens

    GK vs. CannonsDNS vs. GK

    3

    2

    1.5

    a cd

    b

    F i g u r e 2 : A c o m p a r i s o n o f t h e f o u r a l g o r i t h m s f o r t

    w

    = 3 a n d t

    s

    = 1 0

    a p p l i c a b i l i t y o f t h e s e a l g o r i t h m s , t h e r e g i o n s o f s u p e r i o r i t y o f e a c h o f t h e a l g o r i t h m s c a n b e

    d e t e r m i n e d j u s t a s i n c a s e o f F i g u r e 1 . I t i s n o t e w o r t h y t h a t i n F i g u r e 2 e a c h o f t h e f o u r

    a l g o r i t h m s p e r f o r m s b e t t e r t h a n t h e r e s t i n s o m e r e g i o n a n d a l l t h e f o u r r e g i o n s a , b , c a n d

    d c o n t a i n p r a c t i c a l v a l u e s o f p a n d n

    I n F i g u r e 3 , w e p r e s e n t a c o m p a r i s o n o f t h e f o u r a l g o r i t h m s f o r t

    w

    = 3 a n d t

    s

    = 0 5 . T h e s e

    p a r a m e t e r s a r e c l o s e t o w h a t o n e c a n e x p e c t t o o b s e r v e o n a t y p i c a l S I M D m a c h i n e l i k e t h e

    C M - 2 . F o r t h e r a n g e o f p r o c e s s o r s s h o w n i n t h e g u r e , t h e G K a l g o r i t h m i s i n f e r i o r t o t h e

    o t h e r s

    4

    . H e n c e i t i s b e s t t o u s e t h e D N S a l g o r i t h m f o r n

    2

    p n

    3

    , C a n n o n ' s a l g o r i t h m f o r

    n

    3 = 2

    p n

    2

    a n d B e r n t s e n ' s a l g o r i t h m f o r p < n

    3 = 2

    7 S c a l a b i l i t i e s o f D i e r e n t A l g o r i t h m s W i t h S i m u l t a -

    n e o u s C o m m u n i c a t i o n o n A l l H y p e r c u b e C h a n n e l s

    O n c e r t a i n p a r a l l e l m a c h i n e s l i k e t h e n C U B E 2 , t h e h a r d w a r e s u p p o r t s s i m u l t a n e o u s c o m m u n i -

    c a t i o n o n a l l t h e c h a n n e l s . T h i s f e a t u r e o f t h e h a r d w a r e c a n b e u t i l i z e d t o s i g n i c a n t l y r e d u c e

    t h e c o m m u n i c a t i o n c o s t o f c e r t a i n o p e r a t i o n s i n v o l v i n g b r o a d c a s t i n g a n d p e r s o n a l i z e d c o m -

    m u n i c a t i o n 2 0 ] . I n t h i s s e c t i o n w e i n v e s t i g a t e a s t o w h a t e x t e n t c a n t h e p e r f o r m a n c e o f t h e

    a l g o r i t h m s d e s c r i b e d i n S e c t i o n 4 c a n b e i m p r o v e d b y u t i l i z i n g s i m u l t a n e o u s c o m m u n i c a t i o n

    o n a l l t h e l o g p p o r t s o f t h e h y p e r c u b e p r o c e s s o r s .

    C a n n o n ' s a l g o r i t h m ( S e c t i o n 4 . 2 ) , B e r n t s e n ' s a l g o r i t h m ( S e c t i o n 4 . 4 ) a n d t h e p i p e l i n e d

    4

    T h e G K a l g o r i t h m d o e s b e g i n t o p e r f o r m b e t t e r t h a n t h e o t h e r a l g o r i t h m s f o r p > 1 3 1 0

    8

    , b u t a g a i n

    w e c o n s i d e r t h i s r a n g e o f p t o b e i m p r a c t i c a l .

    1 7

  • 8/10/2019 Scalability of Parallel Alg for Matrix Multiplication

    18/26

    3

    2

    1.5

    GK vs. CannonsDNS vs. GK

    GK vs. Berntsens

    0

    50

    100

    150

    200

    250

    0 5 10 15 20 25 30 35 40 45

    p = np = n

    p = n

    n

    p

    d c bx

    F i g u r e 3 : A c o m p a r i s o n o f t h e f o u r a l g o r i t h m s f o r t

    w

    = 3 a n d t

    s

    = 0 5

    v e r s i o n o f F o x ' s a l g o r i t h m e m p l o y o n l y n e a r e s t n e i g h b o r c o m m u n i c a t i o n a n d h e n c e c a n b e n e t

    f r o m s i m u l t a n e o u s c o m m u n i c a t i o n b y a c o n s t a n t f a c t o r o n l y a s t h e s u b b o c k s o f m a t r i c e s A a n d

    B c a n n o w b e t r a n s f e r r e d s i m u l t a n e o u s l y . T h e D N S a l g o r i t h m c a n a l s o g a i n o n l y a c o n s t a n t

    f a c t o r i n i t s c o m m u n i c a t i o n t e r m s a s a l l d a t a m e s s a g e s a r e o n l y o n e w o r d l o n g . H e n c e , a m o n g

    t h e a l g o r i t h m s d i s c u s s e d i n t h i s p a p e r , t h e o n e s t h a t c a n p o t e n t i a l l y b e n e t f r o m s i m u l t a n e o u s

    c o m m u n i c a t i o n s o n a l l t h e p o r t s a r e t h e s i m p l e a l g o r i t h m ( o r i t s v a r i a t i o n s 1 8 ] ) a n d t h e G K

    a l g o r i t h m .

    7 . 1 T h e S i m p l e A l g o r i t h m W i t h A l l P o r t C o m m u n i c a t i o n

    T h i s a l g o r i t h m r e q u i r e s a n a l l - t o - a l l b r o a d c a s t o f t h e s u b - b l o c k s o f t h e m a t r i c e s A a n d B

    a m o n g g r o u p s o f

    p

    p p r o c e s s o r s . T h e b e s t p o s s i b l e s c h e m e u t i l i z i n g a l l t h e c h a n n e l s o f a

    h y p e r c u b e s i m u l t a n e o u s l y c a n a c c o m p l i s h a n a l l - t o - a l l b r o a d c a s t o f b l o c k s o f s i z e

    n

    2

    p

    a m o n g

    p

    p p r o c e s s o r s i n t i m e 2 t

    w

    n

    2

    p

    p

    p l o g p

    +

    1

    2

    t

    s

    l o g p . M o r e o v e r , t h e c o m m u n i c a t i o n o f t h e s u b - b l o c k s o f

    b o t h A a n d B c a n p r o c e e d s i m u l t a n e o u s l y . T h u s t h e p a r a l l e l e x e c u t i o n t i m e o f t h i s a l g o r i t h m

    o n a h y p e r c u b e w i t h s i m u l t a n e o u s c o m m u n i c a t i o n i s g i v e n b y t h e f o l l o w i n g e q u a t i o n :

    T

    p

    =

    n

    3

    p

    + 2 t

    w

    n

    2

    p

    p l o g p

    +

    1

    2

    t

    s

    l o g p ( 1 6 )

    R e c a l l f r o m S e c t i o n 4 . 1 t h a t t h e s i m p l e a l g o r i t h m i s n o t m e m o r y e c i e n t . H o e t a l . 1 8 ]

    g i v e a m e m o r y e c i e n t v e r s i o n o f t h i s a l g o r i t h m w h i c h h a s s o m e w h a t h i g h e r e x e c u t i o n t i m e

    t h a n t h a t g i v e n b y E q u a t i o n ( 1 6 ) . I t c a n b e s h o w n t h a t t h e i s o e c i e n c y f u n c t i o n d u e t o

    c o m m u n i c a t i o n o v e r h e a d s i s o n l y O ( p l o g p ) n o w , w h i c h i s a s i g n i c a n t i m p r o v e m e n t o v e r t h e

    1 8

  • 8/10/2019 Scalability of Parallel Alg for Matrix Multiplication

    19/26

    O ( p

    1 5

    ) i s o e c i e n c y f u n c t i o n o f t h i s a l g o r i t h m w h e n c o m m u n i c a t i o n o n o n l y o n e o f t h e l o g p

    p o r t s o f a p r o c e s s o r w a s a l l o w e d a t a t i m e .

    H o w e v e r , a s m e n t i o n e d i n 1 8 ] , t h e l o w e r l i m i t o n t h e m e s s a g e s i z e i m p o s e s t h e c o n d i t i o n

    t h a t n

    1

    2

    p

    p l o g p . T h i s r e q u i r e s t h a t n

    3

    = W

    1

    8

    p

    1 5

    ( l o g p )

    3

    . T h u s t h e r a t e a t w h i c h t h e t h e

    p r o b l e m s i z e i s r e q u i r e d t o g r o w w i t h r e s p e c t t o t h e n u m b e r o f p r o c e s s o r s i n o r d e r t o u t i l i z e

    a l l t h e c o m m u n i c a t i o n c h a n n e l s o f t h e h y p e r c u b e i s h i g h e r t h a n t h e i s o e c i e n c y f u n c t i o n o f

    t h e a l g o r i t h m i m p l e m e n t e d o n a s i m p l e h y p e r c u b e w i t h o n e p o r t c o m m u n i c a t i o n a t a t i m e .

    7 . 2 T h e G K A l g o r i t h m W i t h A l l P o r t C o m m u n i c a t i o n

    U s i n g t h e o n e - t o - a l l b r o a d c a s t s c h e m e o f 2 0 ] f o r a h y p e r c u b e w i t h s i m u l t a n e o u s a l l - p o r t c o m -

    m u n i c a t i o n , t h e p a r a l l e l e x e c u t i o n t i m e o f t h e G K a l g o r i t h m c a n b e r e d u c e d t o t h e f o l l o w i n g :

    T

    p

    =

    n

    3

    p

    + t

    s

    l o g p + 9 t

    w

    n

    2

    p

    2 = 3

    l o g p

    + 6

    n

    p

    1 = 3

    p

    t

    s

    t

    w

    ( 1 7 )

    T h e c o m m u n i c a t i o n t e r m s n o w y i e l d a n i s o e c i e n c y f u n c t i o n o f O ( p l o g p ) , b u t i t c a n b e

    s h o w n t h a t l o w e r l i m i t o n t h e m e s s a g e s i z e e n t a i l s t h e p r o b l e m s i z e t o g r o w a s O ( p ( l o g p )

    3

    )

    w i t h r e s p e c t t o p w h i c h i s n o t a n y b e t t e r t h a t t h e i s o e c i e n c y f u n c t i o n o f t h i s a l g o r i t h m o n

    a s i m p l e h y p e r c u b e w i t h o n e p o r t c o m m u n i c a t i o n a t a t i m e .

    7 . 3 D i s c u s s i o n

    T h e g i s t o f t h e a n a l y s i s i n t h i s s e c t i o n i s t h a t a l l o w i n g s i m u l t a n e o u s o n a l l t h e p o r t s o f a

    p r o c e s s o r o n a h y p e r c u b e d o e s n o t i m p r o v e t h e o v e r a l l s c a l a b i l i t y o f m a t r i x m u l t i p l i c a t i o n

    a l g o r i t h m s . T h e r e a s o n i s t h a t s i m u l t a n e o u s c o m m u n i c a t i o n o n a l l c h a n n e l s r e q u i r e s t h a t

    e a c h p r o c e s s o r h a s l a r g e e n o u g h c h u n k s o f d a t a t o t r a n s f e r t o o t h e r p r o c e s s o r s . T h i s i m p o s e s

    a l o w e r b o u n d o n t h e s i z e o f t h e p r o b l e m t h a t w i l l g e n e r a t e s u c h l a r g e m e s s a g e s . I n c a s e o f

    m a t r i x m u l t i p l i c a t i o n a l g o r i t h m s , t h e p r o b l e m s i z e ( a s a f u n c t i o n o f p ) t h a t c a n g e n e r a t e l a r g e

    e n o u g h m e s s a g e s f o r s i m u l t a n e o u s c o m m u n i c a t i o n t o b e u s e f u l , t u r n s o u t t o b e l a r g e r t h a n

    w h a t i s r e q u i r e d t o m a i n t a i n a x e d e c i e n c y w i t h o n l y o n e p o r t c o m m u n i c a t i o n a t a t i m e .

    H o w e v e r , t h e r e w i l l b e c e r t a i n v a l u e s o f n a n d p f o r w h i c h t h e m o d i e d a l g o r i t h m w i l l p e r f o r m

    b e t t e r .

    8 I s o e c i e n c y a s a F u n c t i o n o f T e c h n o l o g y D e p e n d e n t

    F a c t o r s

    T h e i s o e c i e n c y f u n c t i o n c a n b e u s e d n o t o n l y t o d e t e r m i n e t h e r a t e a t w h i c h t h e p r o b l e m s i z e

    s h o u l d g r o w w i t h r e s p e c t t o t h e n u m b e r o f p r o c e s s o r s , b u t a l s o w i t h r e s p e c t t o a v a r i a t i o n i n

    o t h e r h a r d w a r e d e p e n d e n t c o n s t a n t s s u c h a s t h e c o m m u n i c a t i o n s p e e d a n d p r o c e s s i n g p o w e r

    1 9

  • 8/10/2019 Scalability of Parallel Alg for Matrix Multiplication

    20/26

    o f t h e p r o c e s s o r s u s e d e t c . I n m a n y a l g o r i t h m s , t h e s e c o n s t a n t s c o n t r i b u t e a m u l t i p l i c a t i v e

    t e r m t o t h e i s o e c i e n c y f u n c t i o n , b u t i n s o m e o t h e r s t h e y e e c t t h e a s y m p t o t i c i s o e c i e n c y o f

    a p a r a l l e l s y s t e m ( e . g . , p a r a l l e l F F T 1 4 ] ) . F o r i n s t a n c e , a m u l t i p l i c a t i v e t e r m o f ( t

    w

    )

    3

    a p p e a r s

    i n m o s t i s o e c i e n c y f u n c t i o n s o f m a t r i x m u l t i p l i c a t i o n a l g o r i t h m s d e s c r i b e d i n t h i s p a p e r . A s

    d i s c u s s e d e a r l i e r , t

    w

    d e p e n d s o n t h e r a t i o o f t h e d a t a c o m m u n i c a t i o n s p e e d o f t h e c h a n n e l s t o

    t h e c o m p u t a t i o n s p e e d o f t h e p r o c e s s o r s u s e d i n t h e p a r a l l e l a r c h i t e c t u r e . T h i s m e a n s t h a t

    i f t h e p r o c e s s o r s o f t h e m u l t i c o m p u t e r a r e r e p l a c e d b y k t i m e s f a s t e r p r o c e s s o r s , t h e n t h e

    p r o b l e m s i z e w i l l h a v e t o b e i n c r e a s e d b y a f a c t o r o f k

    3

    i n o r d e r t o o b t a i n t h e s a m e e c i e n c y .

    T h u s t h e i s o e c i e n c y f u n c t i o n f o r m a t r i x m u l t i p l i c a t i o n i s v e r y s e n s i t i v e t o t h e h a r d w a r e

    d e p e n d e n t c o n s t a n t s o f t h e a r c h i t e c t u r e . F o r e x a m p l e , i n c a s e o f C a n n o n ' s a l g o r i t h m , i f t h e

    n u m b e r o f p r o c e s s o r s i s i n c r e a s e d 1 0 t i m e s , o n e w o u l d h a v e t o s o l v e a p r o b l e m 3 1 . 6 t i m e s

    b i g g e r i n o r d e r t o g e t t h e s a m e e c i e n c y . O n t h e o t h e r h a n d , f o r s m a l l v a l u e s o f t

    s

    ( a s m a y

    b e t h e c a s e w i t h m o s t S I M D m a c h i n e s ) , i f p i s k e p t t h e s a m e a n d 1 0 t i m e s f a s t e r p r o c e s s o r s

    a r e u s e d , t h e n o n e w o u l d n e e d t o s o l v e a 1 0 0 0 t i m e s l a r g e r p r o b l e m t o b e a b l e t o o b t a i n t h e

    s a m e e c i e n c y . H e n c e f o r c e r t a i n p r o b l e m s i z e s , i t m a y b e b e t t e r t o h a v e a p a r a l l e l c o m p u t e r

    w i t h k - f o l d a s m a n y p r o c e s s o r s r a t h e r t h a n o n e w i t h t h e s a m e n u m b e r o f p r o c e s s o r s , e a c h

    k - f o l d a s f a s t ( a s s u m i n g t h a t t h e c o m m u n i c a t i o n n e t w o r k a n d t h e b a n d w i d t h e t c . r e m a i n t h e

    s a m e ) . T h i s s h o u l d b e c o n t r a s t e d w i t h t h e c o n v e n t i o n a l w i s d o m t h a t s u g g e s t s t h a t b e t t e r

    p e r f o r m a n c e i s a l w a y s o b t a i n e d u s i n g f e w e r f a s t e r p r o c e s s o r s 2 ] .

    9 E x p e r i m e n t a l R e s u l t s

    W e v e r i e d a p a r t o f t h e a n a l y s i s o f t h i s p a p e r t h r o u g h e x p e r i m e n t s o f t h e C M - 5 p a r a l l e l

    c o m p u t e r . O n t h i s m a c h i