25
Natively Supporting True One- sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji , K. Gopalakrishnan, R. Thakur, W. Gropp D. K. Panda Dept. of Computer Science, Ohio State University Mathematics and Computer Science, Argonne National Laboratory Dept. of Computer Science, University of Illinois, Urbana Champaign

Natively Supporting True One-sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

Embed Size (px)

Citation preview

Page 1: Natively Supporting True One-sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

Natively Supporting True One-sided

Communication in MPI on Multi-core

Systems with InfiniBand

G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

W. Gropp D. K. Panda

Dept. of Computer Science, Ohio State University

Mathematics and Computer Science, Argonne National Laboratory

Dept. of Computer Science, University of Illinois, Urbana Champaign

Page 2: Natively Supporting True One-sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

Massive Systems & Scalable Applications

• Massive High-end Computing (HEC) Systems available– Systems with few thousand cores are common

– Systems with 10s to 100s of thousands of cores available

• Scalable application communication patterns– Clique-based communication

• Nearest neighbor: Ocean/Climate modeling, PDE solvers

• Cartesian grids: 3DFFT

– Unsynchronized communication• Minimize need to synchronize with other processes

• Non-blocking communication is heavily used

• One-sided communication is getting popular

CCGrid (05/21/2009)

Pavan Balaji, Argonne National Laboratory

Page 3: Natively Supporting True One-sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

Process 1 Process 2 Process 3

Private Virtual

Address

Private Virtual

Address

Private Virtual

Address

Process 0

Private Virtual

Address

One-sided Communication (RMA)

• Popular in many modern programming models– MPI, UPC, Global Arrays

• Idea is to have an easily accessible global address space

together with each process’ virtual address space

CCGrid (05/21/2009)

Pavan Balaji, Argonne National Laboratory

Shared Virtual

Address

Shared Virtual

Address

Shared Virtual

Address

Shared Virtual

Address

Global Address Space

Page 4: Natively Supporting True One-sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

RMA benefits for Applications

• Access to additional address space– Not limited by per-core memory available

– Two sided communication requires data to be explicitly

moved between virtual address spaces

• Tolerant to Load Imbalance– Work stealing is simple and efficient (unsynchronized)

• Lock “global address region”

• Modify required regions

• Unlock “global address region”

CCGrid (05/21/2009)

Pavan Balaji, Argonne National Laboratory

Page 5: Natively Supporting True One-sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

Presentation Layout

• Need for RMA Communication

• State of Art and Prior Work

• Proposed Design

• Experimental Evaluation

• Concluding Remarks and Future Work

CCGrid (05/21/2009)

Pavan Balaji, Argonne National Laboratory

Page 6: Natively Supporting True One-sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

RMA in MPI

• MPI is the dominant programming model for HEC systems– Extremely portable

– MPI (v1) Traditionally relied on two-sided communication• Each process sends data from its virtual address space

• Each process receives data into its virtual address space

• Did not have a notion of a “global address space”

• MPI-2 introduced RMA capability– Each process can use a part of its address space to form a

“global address space” window

– Processes can perform one-sided operations on this window

CCGrid (05/21/2009)

Pavan Balaji, Argonne National Laboratory

Page 7: Natively Supporting True One-sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

Prior Work: Hardware Supported RMA

• Initial implementations

internally relied on two-sided

communication– Loses all benefits of a “one-

sided” programming model

• Our prior work utilized

InfiniBand RDMA and atomic

operations– One-sided communication

truly one-sided

CCGrid (05/21/2009)

Pavan Balaji, Argonne National Laboratory

MPI_Win_lock

Lock(unset)

Compare & Swap

Lock(set)

Lock Acquired

MPI_Get

MPI_Put

MPI_Win_unlock

Compare & Swap

Lock Released

Page 8: Natively Supporting True One-sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

Multicore Systems: Issues and Pitfalls

• Increasing number of cores per node

• Network-based lock/unlock operations not ideal– Network locks go through the network adapter (several

microseconds)

• CPU locks useful when on the same node– Uses CPU atomic instructions: few hundred nanoseconds

• Problem:– Network locks and CPU locks are unaware of each other

– No atomicity guarantee between the two

CCGrid (05/21/2009)

Pavan Balaji, Argonne National Laboratory

Page 9: Natively Supporting True One-sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

Our Focus in this Paper

• To provide true one-sided communication capabilities

within the node as well as outside

• To propose a design that achieves two seemingly

contradictory goals:– Take advantage of network hardware atomic operations for

efficient inter-node RMA

– Take advantage of CPU atomic operations for efficient intra-

node RMA

CCGrid (05/21/2009)

Pavan Balaji, Argonne National Laboratory

Page 10: Natively Supporting True One-sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

Presentation Layout

• Need for RMA Communication

• State of Art and Prior Work

• Proposed Design

• Experimental Evaluation

• Concluding Remarks and Future Work

CCGrid (05/21/2009)

Pavan Balaji, Argonne National Laboratory

Page 11: Natively Supporting True One-sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

Towards a Hybrid Lock Design

• Goal:– Use network locks for inter-node RMA

– Use CPU locks for intra-node RMA

• Caveat:– No atomicity guarantee between network and CPU locks

• Hybrid approach:– At any point lock is either CPU based or Network based

• Network mode locks always go through the network– Loopback if needed (inefficient !)

• CPU mode locks always go through the CPU– Using two-sided communication if needed (inefficient !)

CCGrid (05/21/2009)

Pavan Balaji, Argonne National Laboratory

Page 12: Natively Supporting True One-sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

Migrating Locks

CCGrid (05/21/2009)

Pavan Balaji, Argonne National Laboratory

(4) Modify Lock Mechanism

NETWORKLOCK

CPULOCK

WINDOW

NODE AP3

P0

P2P1

(5) Grant Lock

(2) Request Lock

(3) Acquire CPU and Network Locks

(1) Compare & Swap returns CPU Lock Mode

LOCK MODE: CPUP11

LOCK MODE: Network

Synchronization only required during migration of lock “type”

All other operations are truly one-sided

Page 13: Natively Supporting True One-sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

Migration Policy

• Lock Migration Policy:– When should we use a network lock vs. a CPU lock

• Different policies possible:– Communication pattern history

– User-specified priority

– Native hardware capabilities (performance of network lock

as compared to CPU lock)

• We use a simple approach:– Migrate lock on first conflicting request

CCGrid (05/21/2009)

Pavan Balaji, Argonne National Laboratory

Page 14: Natively Supporting True One-sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

Presentation Layout

• Need for RMA Communication

• State of Art and Prior Work

• Proposed Design

• Experimental Evaluation

• Concluding Remarks and Future Work

CCGrid (05/21/2009)

Pavan Balaji, Argonne National Laboratory

Page 15: Natively Supporting True One-sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

Experimental Testbed

• 8-node AMD Barcelona Cluster– Each node 4 processors, each with 4 1.95GHz cores

– 64KB per-core dedicated L1 cache

– 512KB per-core dedicated L2 cache

– 2MB per-processor dedicated L3 cache

– 16GB RAM

• Network configuration:– InfiniBand ConnectX DDR (MT25418) adapters

– PCIe Gen1 x8

– Mellanox Infiniscale III 24-port fully non-blocking switch

CCGrid (05/21/2009)

Pavan Balaji, Argonne National Laboratory

Page 16: Natively Supporting True One-sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

Overview of MVAPICH and MVAPICH2

• High Performance MPI for InfiniBand and iWARP Clusters– MVAPICH (MPI-1) and MVAPICH2 (MPI-2): Available since 2002

– Derived from the MPICH2 implementation from Argonne• MVAPICH2 shares upper-level code and includes IB/iWARP

specific enhancements

– Used by more than 900 organizations in 48 countries (registered

with OSU); More than 29,000 downloads from OSU web site

– Empowering many TOP500 production clusters (Nov ‘08 listing)• 62,976-core cluster (Ranger) at TACC (6th rank)

• 18,176-core cluster (Chinook) at PNNL (20th rank)

– Available with software stacks of many server vendors including

Open Fabrics Enterprise Distribution (OFED)

CCGrid (05/21/2009)

Pavan Balaji, Argonne National Laboratory

Page 17: Natively Supporting True One-sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

Intra-node Performance

Two-Sided One-Sided Hybrid0

1

2

3

4

5

6

7

8

2.16

6.76

0.620000000000001

Baseline Intra-node Performance

Tim

e (

us

)

0 10 100 10000

2

4

6

8

10

12

14Remote Computation

Two-Sided

One-Sided

Hybrid

Compute Units (iterations)

Ex

ec

uti

on

Tim

e (

us

)

CCGrid (05/21/2009)

Pavan Balaji, Argonne National Laboratory

Page 18: Natively Supporting True One-sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

Contention Measurements

2 4 8 160

5

10

15

20

25Network Contention

Two-Sided

One-Sided

Hybrid

Number of Cores

La

ten

cy

(u

s)

1 2 3 4 5 6 7 80

10

20

30

40

50

60

70Lock Contention

Number of Contending Processes

La

ten

cy

(u

s)

CCGrid (05/21/2009)

Pavan Balaji, Argonne National Laboratory

Page 19: Natively Supporting True One-sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

Migration Overhead

0 2 4 8 16 32 64 1000

1

2

3

4

5

6

7

8

9

10

Internode

Intranode

Lock Migration Percentage

Lo

ck

/Un

loc

k L

ate

nc

y

CCGrid (05/21/2009)

Pavan Balaji, Argonne National Laboratory

Page 20: Natively Supporting True One-sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

Emulated mpiBLAST Communication Kernel

4 8 16 32 640

50

100

150

200

250

300

Two-Sided

One-Sided

Hybrid

System size (cores)

Ex

ec

uti

on

Tim

e (

us

)

CCGrid (05/21/2009)

Pavan Balaji, Argonne National Laboratory

Page 21: Natively Supporting True One-sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

Presentation Layout

• Need for RMA Communication

• State of Art and Prior Work

• Proposed Design

• Experimental Evaluation

• Concluding Remarks and Future Work

CCGrid (05/21/2009)

Pavan Balaji, Argonne National Laboratory

Page 22: Natively Supporting True One-sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

Concluding Remarks and Future Work

• Proposed a new design for MPI RMA optimized for high-

speed networks and multicore architectures– Uses InfiniBand RDMA and atomics for internode RMA

– Uses CPU atomic primitives for intranode RMA

• Significantly improved performance in benchmarks as well

as real application kernels

• Future Work:– Study on other architectures such as Blue Gene/P

– Different migration policies

– Evaluation on various other applications

CCGrid (05/21/2009)

Pavan Balaji, Argonne National Laboratory

Page 23: Natively Supporting True One-sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

Thank You!

Email Contacts:

G. Santhanaraman: [email protected]

P. Balaji: [email protected]

K. Gopalakrishnan: [email protected]

R. Thakur: [email protected]

W. Gropp: [email protected]

D. K. Panda: [email protected]

Project Websites:

http://mvapich.cse.ohio-state.edu

http://www.mcs.anl.gov/research/projects/mpich2

CCGrid (05/21/2009)

Pavan Balaji, Argonne National Laboratory

Page 24: Natively Supporting True One-sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

Backup Slides

CCGrid (05/21/2009)

Pavan Balaji, Argonne National Laboratory

Page 25: Natively Supporting True One-sided Communication in MPI on Multi-core Systems with InfiniBand G. Santhanaraman, P. Balaji, K. Gopalakrishnan, R. Thakur,

Inter-node Performance

4 8 16 32 640

50

100

150

200

250

300

350

400

Two-Sided

One-Sided

Hybrid

Number of Nodes

Tim

e (

us

)

CCGrid (05/21/2009)

Pavan Balaji, Argonne National Laboratory