Multicore SALSA Parallel Computing and Web 2.0 for Cheminformatics and GIS Analysis 2007 Microsoft eScience Workshop at RENCI The Friday Center for Continuing Education.

Download Report

Transcript Multicore SALSA Parallel Computing and Web 2.0 for Cheminformatics and GIS Analysis 2007 Microsoft eScience Workshop at RENCI The Friday Center for Continuing Education.

Multicore

S A

L

S A

Parallel Computing and Web 2.0

for Cheminformatics and GIS Analysis

2007 Microsoft eScience Workshop at RENCI The Friday Center for Continuing Education UNC - Chapel Hill October 22 2007 Geoffrey Fox, Seung-Hee Bae, Neil Devadasan, Rajarshi Guha, Marlon Pierce, Xiaohong Qiu, David Wild, Huapeng Yuan Community Grids Laboratory, Research Computing UITS

,

School of informatics and POLIS Center Indiana University George Chrysanthakopoulos, Henrik Frystyk Nielsen Microsoft Research, Redmond WA http://www.infomall.org/multicore [email protected]

, http://www.infomall.org

1

  

Too much Computing?

Historically one has tried to increase computing capabilities by

• •

Optimizing performance of codes Exploiting all possible CPU’s such as Graphics co-processors and “idle cycles”

Making central computers available such as NSF/DoE/DoD supercomputer networks Next Crisis in technology area will be the opposite problem – commodity chips will be 32-128way parallel we currently have no idea how to use them in 5 years time and – especially on clients

Only 2 releases of standard software (e.g. Office) in this time span Gaming and Generalized decision support (data mining) are two obvious ways of using these cycles

• •

Intel RMS analysis Note even cell phones will be multicore

Intel’s Projection

   

Too much Data to the Rescue?

Multicore servers have clear “universal parallelism” as many users can access and use machines simultaneously Maybe also need application parallelism as needed on client machines Over next years, we will be submerged of course in data deluge

Scientific observations for e-Science

Local (video, environmental) sensors

Data fetched from Internet defining users interests Maybe data-mining of this “too much computing” “too much data” will use up the both for science and commodity PC’s

PC will use this data(-mining) to be intelligent user assistant ?

Must have highly parallel algorithms

Intel’s Application Stack

CICC Chemical Informatics and Cyberinfrastructure Collaboratory Web Service Infrastructure Cheminformatics Services Statistics Services Database Services

Core functionality

Fingerprints Similarity Descriptors 2D diagrams File format conversion

Computation functionality

Regression Classification Clustering Sampling distributions

3D structures by

CID SMARTS 3D Similarity

Applications

Docking Filtering Druglikeness

Applications

Predictive models Feature selection Toxicity predictions Mutagenecity predictions 2D plots Arbitrary R code (PkCell) Anti-cancer activity predictions Pharmacokinetic parameters OSCAR Document Analysis

Need to make all this parallel

InChI Generation/Search Computational Chemistry (Gamess, Jaguar etc.)

Docking scores/poses by

CID SMARTS Protein Docking scores

PubChem related data by

CID, SMARTS

Varuna.net

Quantum Chemistry

Core Grid Services

Service Registry Job Submission and Management

Local Clusters IU Big Red, TeraGrid, Open Science Grid

Portal Services

RSS Feeds User Profiles Collaboration as in Sakai

   

Deterministic Annealing for Data Mining

We are looking at deterministic annealing algorithms because although heuristic

They have clear scalable parallelism (e.g. use parallel BLAS )

They avoid (some) local minima and regularize ill defined problems in an intuitively clear fashion

• •

They are fast (no Monte Carlo) I understand them and Google Scholar likes them Developed first by Durbin as Elastic Net for TSP Extended by Rose (my student then; now at UCSB)) and Gurewitz (visitor to C 3 P) at Caltech for signal processing and applied later to many optimization and supervised and unsupervised learning methods.

See K. Rose , "

Deterministic Annealing for Clustering, Compression, Classification, Regression, and Related Optimization Problems

," Proceedings of the IEEE, vol. 80, pp. 2210-2239, November 1998

   

High Level Theory

Deterministic Annealing

can be looked at from a Physics, Statistics and/or Information theoretic point of view Consider a function (e.g. a

likelihood

)

L({y})

that we want to operate on (e.g.

maximize

) Set

L

({y

},T) =

 •

L({y}) exp(- ({y

} - {y})

2

/T ) d{y}

Incorporating entropy term ensuring that one looks for most

likely states at temperature T If {y} is a distance , replacing L by L

or smoothing it over resolution

T corresponds to smearing Minimize

Free Energy F = -Ln L

({y

},T)

rather than energy E = -Ln L ({y})

Use mean field approximation to avoid Monte Carlo (simulated annealing)

Deterministic Annealing for Clustering I

 

N

Points

x i

and

K

Cluster Centers

y k

Pr(

x i

C k

)

exp(

E

(

x i

,

y k

) /

T

) /

Z

(

x i

) where

Z

(

x i

)

 

K k

 1

exp(

E

(

x i

,

y k

) /

T

)

E

(

x i

,

y k

)

(

x i

y k

)

2

Free Energy

F

 

T

i N

 1

ln

Z

(

x i

)) Compare Simple Gaussian Mixture (K centers) with

Z

(

x i

)

 

K k

 1

P k

exp(

E

(

x i

,

y k

) /( 2

k

2

) )

Illustrating similarity between clustering and Gaussian mixtures and anneals down to mixture size

2 

k

2 

k

2 

T

Deterministic Annealing for Clustering II

with Pr(

x i

C k

)  exp( 

E

(

x i

,

y k old

) /

T

) /

Z

(

x i

,

y k old

) Calculate

y k new

 

i N

 1

x i

Pr(

x i

C k

) 

i N

 1 Pr(

x i

C k

)      

This is an extended K-means algorithm Start with a single cluster giving as solution y

1

as centroid For some annealing schedule for T, iterate above algorithm testing correlation matrix in x

i

“elongated” about each cluster center to see if Split cluster if elongation “long enough”; splitting is a phase transition in physics view You do not need to assume number of clusters resolution

T or equivalent but rather a final At T=0 , uninteresting solution is N clusters; one at each point x

i

Deterministic Annealing

F({y}, T) Solve Linear Equations for each temperature Nonlinearity removed by approximating with solution at previous higher temperature

 

Configuration {y} Minimum evolving as temperature decreases Movement at fixed temperature going to local minima if not initialized “correctly

     

Clustering Data

Cheminformatics was tested successfully with small datasets and compared to commercial tools Cluster on properties of chemicals from high throughput screening results to chemical properties (structure, molecular weight etc.) Applying to PubChem (and commercial databases) that have 6 20 million compounds

Comparing traditional fingerprint properties (binary properties) with real-valued GIS Census aggregated in 200,000 Census Blocks covering Indiana

uses publicly available Census data; in particular the 2000 100MB of data Initial clustering done on simple attributes given in this data

Total population and number of Asian , Hispanic and Renters Working with POLIS Center at Indianapolis on clustering of SAVI ( Social Assets and Vulnerabilities Indicators ) attributes at http://www.savi.org

) for community and decision makers

Economy, Loans, Crime, Religion etc.

    

Where are we?

We have deterministically annealed clustering running well do this (is there a large Windows quad core cluster on TeraGrid?)

This would also be efficient on large problems on 8 core (2-processor quad core) Intel systems using C# and Microsoft Robotics Studio CCR/DSS Could also run on multicore-based parallel machines but didn’t Applied to Geographical Information Systems (GIS) and census data

Could be an interesting application on future broadly deployed PC’s

Visualize nicely on Google Maps (and presumably Microsoft Virtual Earth) Applied to several Cheminformatics problems efficiency but dimensions visualization harder and have parallel as in 150-1024 (or more) Will develop a family of such parallel annealing data-mining tools

• • •

where basic approach known for Clustering Gaussian Mixtures and possibly (Expectation Maximization) Hidden Markov Methods

Clustering algorithm annealing by decreasing distance scale and gradually finds more clusters as resolution improved Here we see 10 clusters increasing to 30 as algorithm progresses

Total Asian Hispanic Renters Total Asian Hispanic Purdue IUB 30 Clusters 10 Clusters

In detail, different groups have different cluster centers

Multicore S

A

LS

A

at CGL

S ervice A ggregated

L

inked S equential A ctivities

http://www.infomall.org/multicore

Aims to

link parallel and distributed

(Grid) computing by developing parallel applications as services and not as programs or libraries

Improve traditionally poor parallel programming development environments

Can use messaging to link parallel and Grid services but performance – functionality tradeoffs different

Parallelism needs few µs latency for message latency and thread spawning

Network overheads in Grid 10-100’s µs

This presentation describes first of set of

services (library)

of

multicore parallel data mining algorithms

      

Parallel Programming Model

If multicore technology is to succeed, mere mortals build effective parallel programs must be able to There are interesting new developments – especially the Darpa HPCS Languages X10, Chapel and Fortress However if years, then we must use today’s technology and we must make it easy

mortals are to program the 64-256 core chips expected in 5-7 This rules out radical new approaches such as new languages The important applications are not scientific computing algorithms but most of the needed are similar to those explored in scientific parallel computing

Intel RMS analysis We can divide problem into two parts:

High Performance scalable (in number of cores) parallel kernels libraries

Composition of kernels into complete applications or We currently assume that the kernels of the scalable parallel algorithms/applications/libraries will be built by experts with a Broader group of programmers (mere mortals ) composing library members into complete applications.

    

Scalable Parallel Components

There are no agreed high-level programming environments for building library members that are broadly applicable. However lower level approaches where experts define parallelism explicitly are available and have clear performance models. These include MPI for messaging or just locks within a single shared memory.

There are several patterns to support here including the collective synchronization of MPI, dynamic irregular thread parallelism needed in search algorithms, and more specialized cases like discrete event simulation. We use Microsoft CCR http://msdn.microsoft.com/robotics/ as it supports both MPI and dynamic threading style of parallelism

         

Composition of Parallel Components

The

composition step has many excellent solutions have the same drastic synchronization and correctness constraints as for scalable kernels Unlike kernel step which has as this does not no very good solutions Task parallelism in languages such as C++, C#, Java and Fortran90; General scripting languages like PHP Perl Python Domain specific environments like Matlab and Mathematica Functional Languages like MapReduce , F# HeNCE, AVS and Khoros from the past and CCA from DoE Web Service/Grid Workflow Pipeline Pilot (from SciTegic) and the LEAD environment built at Indiana University. like Taverna, Kepler, InforSense KDE, Web solutions like Mash-ups and DSS Many scientific applications use MPI for the coarse grain composition as well as fine grain parallelism but this doesn’t seem elegant The new languages from Darpa’s supported.

HPCS program support task parallelism (composition of parallel components) decoupling composition and scalable parallelism will remain popular and must be

    

“Service Aggregation” in SALSA

Kernels and Composition must be supported both inside chips (the multicore problem) and Grids. between machines in clusters (the traditional parallel computing problem) or The scalable parallelism (kernel) problem is typically only interesting on true parallel computers as the algorithms require low communication latency. However composition is similar in both parallel and distributed scenarios and it seems useful to allow the use of Grid and Web 2.0

composition tools for the parallel problem.

This should allow parallel computing to exploit large investment in service programming environments Thus in SALSA we express parallel kernels not as traditional libraries but as (some variant of) services so they can be used by non expert programmers For parallelism expressed in CCR , DSS natural service (composition) model.

represents the

   

Inside the SALSA Services

We generalize the well known CSP (Communicating Sequential Processes) of Hoare to describe the low level approaches to fine grain parallelism as “ L inked S equential A ctivities” in

SALSA

. We use term “ activities ” in SALSA to allow one to build services from either threads , processes (usual MPI choice) or even just other services . We choose term “ linkage ” in SALSA to denote the different ways of synchronizing involve shared memory the parallel activities that may rather than some form of messaging or communication.

There are several engineering and research issues for SALSA

There is the critical and Grids. communication optimization problem area for communication inside chips, clusters

We need to discuss what we mean by services

• • • • • • • • •

Microsoft CCR

Supports exchange of messages between threads using named ports FromHandler: Spawn threads without reading ports Receive: Each handler reads one item from a single port MultipleItemReceive: Each handler reads a prescribed number of items of a given type from a given port. Note items in a port can be general structures but all must have same type.

MultiplePortReceive: Each handler reads a one item of a given type from multiple ports.

JoinedReceive: Each handler reads one item from each of two ports. The items can be of different type.

Choice: Execute a choice of two or more port-handler pairings Interleave: Consists of a set of arbiters (port -- handler pairs) of 3 types that are Concurrent, Exclusive or Teardown (called at end for clean up). Concurrent arbiters are run concurrently but exclusive handlers are http://msdn.microsoft.com/robotics/ 23

MPI Exchange Latency in µs (20-30 µs computation between messaging)

Machine Intel8c:gf12

(8 core 2.33 Ghz) (in 2 chips)

OS

Redhat

Runtime

MPJE (Java)

Grains

Process

Parallelism

8

MPI Exchange Latency

181

Intel8c:gf20

(8 core 2.33 Ghz)

Intel8b

(8 core 2.66 Ghz) Fedora Vista MPICH2 (C) MPICH2: Fast Nemesis MPJE mpiJava MPICH2 MPJE Process Process Process Process Process Process Process 8 8 8 8 8 8 8 40.0

39.3

4.21

157 111 64.2

170

AMD4

(4 core 2.19 Ghz)

Intel4 (4 core 2.8 Ghz)

Fedora Fedora Vista XP Redhat XP XP MPJE mpiJava CCR (C#) MPJE MPJE mpiJava MPICH2 CCR CCR Process Process Thread Process Process Process Process Thread Thread 8 8 8 4 4 4 4 4 4 142 100 20.2

185 152 99.4

39.3

16.3

25.8

Preliminary Results

Parallel Deterministic Annealing Clustering in C# with speed-up of 7.8 (Chemistry) and 7 (GIS) on Intel 2 quad core systems

• •

Analysis of performance of Java, C, C# in MPI and dynamic threading with XP, Vista, Windows Server, Fedora, Redhat on Intel/AMD systems

Study of cache effects coming with MPI thread-based parallelism Study of execution time fluctuations Windows (limiting speed-up to < 8) in

DSS as Service Model

• We view system as a collection of services – in this case

– One to supply data – One to run parallel clustering – One to visualize results – in this by spawning a Google maps browser – Note we are clustering Indiana census data

• DSS is convenient as built on CCR • Messaging overhead around 30-40 µs

0.25

0.2

0.15

0.1

0.05

0 0 0.45

Parallel Multicore GIS Deterministic Annealing Clustering

Parallel Overhead on 8 Threads Intel 8b 10 Clusters

0.4

Overhead = Constant1 + Constant2/n Speedup = 8/(1+Overhead)

0.35

Constant1 = 0.02 to 0.1 (Client Windows) due to thread runtime fluctuations

0.3

0.5

1 1.5

20 Clusters 10000/(Grain Size n = points per core)

2 2.5

3 3.5

4

Parallel Multicore Deterministic Annealing Clustering

0.250

Parallel Overhead for large (2M points) Indiana Census clustering on 8 Threads Intel 8b This fluctuating overhead due to 5-10% runtime fluctuations between threads

0.200

“Constant1”

0.150

0.100

0.050

0.000

0 5

Increasing number of clusters decreases communication/memory bandwidth overheads

10 15 #cluster 20 25 30 35

Parallel Multicore Deterministic Annealing Clustering

0.200

0.180

0.160

0.140

0.120

0.100

0.080

0.060

0.040

0.020

0.000

0 2

Parallel Overhead for subset of PubChem clustering on 8 Threads (Intel 8b) 40,000 points with 1052 binary properties (Census is 2 real valued properties) Increasing number of clusters decreases communication/memory bandwidth overheads

4 6 8 #cluster 10 12 14 16 18

MPI Parallel Divkmeans clustering of PubChem

700 650 600 550 500 450 400 min_size 100 100 100 100 1 1 1 1 100 1000 1000 1000 1000 ncpus 350 300 250 0 10 20 30 Minsize 1 40 50

Number of processors

Minsize 100 60 Minsize 1000

AVIDD Linux cluster, 5,273,852 structures (Pubchem compound collection, Nov 2005)

20 40 60 80 20 40 40 60 80 20 40 60 80 wall_mins 676 444 379 353 462 356 356 339 337 513 376 346 346 walltime 11:16:06 7:24:24 6:18:41 5:53:00 7:41:58 5:56:01 5:55:47 5:38:44 5:36:53 8:32:39 6:16:25 5:46:22 5:45:40 70 80 90

Scaled Speed up Tests

• The full clustering algorithm involves different values of the number of clusters N C as computation progresses • The amount of computation per data point is proportional to N C and so overhead due to memory bandwidth (cache misses) declines as N C increases • We did a set of tests on the clustering kernel with fixed N C • Further we adopted the scaled speed-up approach looking at the performance as a function of number of parallel threads with constant number of data points assigned to each thread – This contrasts with fixed problem size scenario where the number of data points per thread is inversely proportional to number of threads • We plot Run time for same workload per thread divided by number of data points multiplied by number of clusters multiped by time at smallest data set (10,000 data points per thread) • Expect this normalized run time to be independent of number of threads if not for parallel and memory bandwidth overheads – It will decrease as N C increases as number of computations per points fetched from memory increases proportional to N C

Intel 8-core C# with 80 Clusters: Vista Run Time Fluctuations for Clustering Kernel

• 2 Quadcore Processors 0.1

between messaging synchronization points

Standard Deviation/Run Time

0.05

10,000 Datpts 50,000 Datapts 500,000 Datapts 0 0 1 2 3 4 thread 5

Number of Threads

6 7 8

Intel 8 core with 80 Clusters: Redhat Run Time Fluctuations for Clustering Kernel

• This is average of standard deviation of run time of the

80 Cluster(ratio of std to time vs #thread)

8 threads between messaging synchronization points 0.006

Standard Deviation/Run Time

0.004

0.002

10,000 Datapts 50,000 Datapts 500,000 Datapts 0 1 2 3 4 5

Number of Threads

6 7 8

Basic Performance of CCR

CCR Overhead for a computation of 23.76 µs between messaging

Intel8b: 8 Core (μs) Pipeline 1 Number of Parallel Computations 2 3 4 7 8 1.58

2.44

3 2.94

4.5

5.06

Spawned Shift 2.42

3.2

3.38

5.26

5.14

Rendez vous MPI Two Shifts Pipeline Shift Exchange As Two Shifts Exchange 2.48

4.94

3.96

5.9

4.52

6.84

5.78

14.32 19.44

6.82

7.18

4.46

7.4

6.42

5.86

10.86 11.74

11.64

14.16 31.86 35.62

6.94

11.22

13.3

18.78 20.16

30 25 20 Time Microseconds AMD Exch AMD Exch as 2 Shifts AMD Shift 15 10 5 Stages (millions) 0 0 2 4 6 8 10

Overhead (latency) of AMD4 PC with 4 execution threads on MPI style Rendezvous Messaging for Shift and Exchange implemented either as two shifts or as custom CCR pattern

70 60 50 40 Time Microseconds Intel Exch Intel Exch as 2 Shifts Intel Shift 30 20 10 Stages (millions) 0 0 2 4 6 8 10

Overhead (latency) of Intel8b PC with 8 execution threads on MPI style Rendezvous Messaging for Shift and Exchange implemented either as two shifts or as custom CCR pattern

Cache Line Interference

• • • • •

Cache Line Interference

Early implementations of our clustering algorithm showed large fluctuations due to the cache line interference effect discussed here and on next slide in a simple case We have one thread on each core each calculating a sum of same complexity storing result in a common array A with different cores using different array locations Thread i stores sum in A(i) is separation 1 – no variable access interference but cache line interference Thread i stores sum in A(X*i) is separation X Serious degradation if X < 8 (64 bytes) with Windows

– –

Note A is a double (8 bytes) Less interference effect with Linux – especially Red Hat

Cache Line Interference

Machine OS Intel8b Vista Intel8b Vista Intel8b Vista Intel8b Fedora Intel8a XP CCR Intel8a XP Locks Intel8a XP Intel8c Red Hat AMD4 AMD4 AMD4 WinSrvr WinSrvr WinSrvr Run Time C# CCR C# Locks C C C# C# C C C# CCR C# Locks C 1 Time µs versus Thread Array Separation (unit is 8 bytes) Mean Std/ Mean Mean 4 Std/ Mean 8 Mean Std/ Mean 1024 Mean Std/ Mean

8.03 13.0 13.4 .029 .0095 .0047 3.04 3.08 1.69 .059 .0028 .0026 0.884 .0051 0.883 .0043 0.66 .029 0.884 0.883 0.659 .0069 .0036 .0057 1.50 10.6 16.6 16.9 0.441 8.58 8.72 5.65 .01 .033 .016 .0016 .0035 .0080 .0036 .020 0.69 4.16 4.31 2.27 0.423 2.62 2.42 2.69 .21 .041 .0067 .0042 .0031 .081 0.01 .0060 0.307 .0045 1.27 1.27 1.05 .051 .066 0.946 .056 0.423 .0030 0.839 .0031 0.836 .0016 .0013 0.307 1.43 1.27 0.946 0.423 0.838 0.836 1.05 .016 .049 .054 .058 .032 .0031 .0013 .0014 • • •

AMD4 AMD4 AMD4 XP XP XP C# CCR C# Locks C

8.05 8.21 6.10 0.010 0.006 0.026 2.84 2.57 2.95 0.077 0.016 0.017 0.84 0.84 1.05 0.040 0.007 0.019 0.840 0.84 1.05 0.022 0.007 0.017

Note measurements at a separation X of 8 (and values between 8 and 1024 not shown) are essentially identical Measurements at 7 (not shown) are higher than that at 8 (except for Red Hat which shows essentially no enhancement at X<8) If effects due to co-location of thread variables in a 64 byte cache line, the array must be aligned with cache boundaries

In early implementations we found poor X=8 performance expected in words of A split across cache lines

Inter-Service Communication

Note that we are

not

assuming a

uniform implementation of service composition

even if user sees same interface for multicore and a Grid

Good service composition inside a multicore chip can require highly optimized communication mechanisms between the services that minimize memory bandwidth use.

Between systems interoperability could motivate very different mechanisms to integrate services.

Need both MPI/CCR level and Service/DSS level communication optimization

Note bandwidth and latency requirements reduce as one increases the grain size of services

Suggests the smaller services inside closely coupled cores and machines will have stringent communication requirements.

    

Mashups v Workflow?

Mashup Tools are reviewed at http://blogs.zdnet.com/Hinchcliffe/?p=63 Workflow Tools are reviewed by Gannon and Fox http://grids.ucs.indiana.edu/ptliupages/publications/Workflow-overview.pdf

Both include distributed of services scripting in PHP, Python, sh etc. as both implement programming at level Mashups robustness use all types of service interfaces and perhaps do not have the potential (security) of Grid service approach Mashups typically “pure” HTTP ( REST )

43