20
Exploiting InfiniBand and GPUDirect Technology for High Performance Collectives on GPU Clusters Ching-Hsiang Chu [email protected] Department of Computer Science and Engineering The Ohio State University

Exploiting InfiniBand and GPUDirect Technology for High ...hidl.cse.ohio-state.edu/static/media/talks/slide/ching-sc18-booth_3.pdf · A. Venkatesh, H. Subramoni, K. Hamidouche, and

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Exploiting InfiniBand and GPUDirect Technology for High ...hidl.cse.ohio-state.edu/static/media/talks/slide/ching-sc18-booth_3.pdf · A. Venkatesh, H. Subramoni, K. Hamidouche, and

Exploiting InfiniBand and GPUDirectTechnology for High Performance

Collectives on GPU ClustersChing-Hsiang [email protected]

Department of Computer Science and EngineeringThe Ohio State University

Page 2: Exploiting InfiniBand and GPUDirect Technology for High ...hidl.cse.ohio-state.edu/static/media/talks/slide/ching-sc18-booth_3.pdf · A. Venkatesh, H. Subramoni, K. Hamidouche, and

OSU Booth - SC18 2Network Based Computing Laboratory

• Introduction

• Advanced Designs in MVAPICH2-GDR– CUDA-Aware MPI_Bcast

– CUDA-Aware MPI_Allreduce / MPI_Reduce

• Concluding Remarks

Outline

Page 3: Exploiting InfiniBand and GPUDirect Technology for High ...hidl.cse.ohio-state.edu/static/media/talks/slide/ching-sc18-booth_3.pdf · A. Venkatesh, H. Subramoni, K. Hamidouche, and

OSU Booth - SC18 3Network Based Computing Laboratory

Drivers of Modern HPC Cluster Architectures - Hardware

• Multi-core/many-core technologies

• Remote Direct Memory Access (RDMA)-enabled networking (InfiniBand and RoCE)

• Solid State Drives (SSDs), NVM, Parallel Filesystems, Object Storage Clusters• Accelerators (NVIDIA GPGPUs and Intel Xeon Phi)

High Performance Interconnects –InfiniBand (with SR-IOV)

<1usec latency, 200Gbps Bandwidth>Multi-/Many-core Processors

Accelerators / Coprocessors high compute density, high

performance/watt>1 TFlop DP on a chip

SSD, NVMe-SSD, NVRAM

Comet@SDSCStampede2@TACCSierra@LLNL

Page 4: Exploiting InfiniBand and GPUDirect Technology for High ...hidl.cse.ohio-state.edu/static/media/talks/slide/ching-sc18-booth_3.pdf · A. Venkatesh, H. Subramoni, K. Hamidouche, and

OSU Booth - SC18 4Network Based Computing Laboratory

Architectures for Deep Learning (DL)

Multi-core CPUs across nodes Multi-core CPUs + Single GPU across nodes

Multi-core CPUs within a node Multi-core CPUs + Multi-GPU within a node

Multi-core CPUs + Multi-GPU across nodes

(E.g., Sierra/Summit)

IB

Networks

IB Networks

IB Networks

Page 5: Exploiting InfiniBand and GPUDirect Technology for High ...hidl.cse.ohio-state.edu/static/media/talks/slide/ching-sc18-booth_3.pdf · A. Venkatesh, H. Subramoni, K. Hamidouche, and

OSU Booth - SC18 5Network Based Computing Laboratory

• Streaming-like applications on HPC systems

1. Communication (MPI)• Broadcast

• Allreduce/Reduce

2. Computation (CUDA)• Multiple GPU nodes as workers

Streaming-like ApplicationsData Source

SenderHPC resources for real-time analytics

Real-time streaming

WorkerCPUGPU

GPU

WorkerCPUGPU

GPU

WorkerCPUGPU

GPU

WorkerCPUGPU

GPU

WorkerCPUGPU

GPU

Data streaming-like broadcast operations

Page 6: Exploiting InfiniBand and GPUDirect Technology for High ...hidl.cse.ohio-state.edu/static/media/talks/slide/ching-sc18-booth_3.pdf · A. Venkatesh, H. Subramoni, K. Hamidouche, and

OSU Booth - SC18 6Network Based Computing Laboratory

• Computation using GPU

• Communication using MPI– Exchanging partial gradients after each minibatch

– All-to-all (Multi-Source) communications

Ø E.g., MPI_Bcast, MPI_Allreduce

• Challenges– High computation-communication overlap

– Good scalability for upcoming large-scale GPU clusters– No application-level modification

High-performance Deep Learning

GPU Node 1

GPU Node 2 GPU Node 4

GPU Node 3

Page 7: Exploiting InfiniBand and GPUDirect Technology for High ...hidl.cse.ohio-state.edu/static/media/talks/slide/ching-sc18-booth_3.pdf · A. Venkatesh, H. Subramoni, K. Hamidouche, and

OSU Booth - SC18 7Network Based Computing Laboratory

• Introduction

• Advanced Designs in MVAPICH2-GDR– CUDA-Aware MPI_Bcast

– CUDA-Aware MPI_Allreduce / MPI_Reduce

• Concluding Remarks

Outline

Page 8: Exploiting InfiniBand and GPUDirect Technology for High ...hidl.cse.ohio-state.edu/static/media/talks/slide/ching-sc18-booth_3.pdf · A. Venkatesh, H. Subramoni, K. Hamidouche, and

OSU Booth - SC18 8Network Based Computing Laboratory

IB HCA

CPU

GPU

Source

IB Switch

Header

Data

IB HCA

CPU

GPU

Destination 1Header

Data

IB HCA

CPU

GPU

Destination NHeader

Data

1. IB Gather + GDR Read2. IB Hardware Multicast3. IB Scatter + GDR Write

• For GPU-resident data, using– GPUDirect RDMA (GDR)

– InfiniBand Hardware Multicast (IB-MCAST)

• Overhead– IB UD limit

– GDR limit

Hardware Multicast-based Broadcast

A. Venkatesh, H. Subramoni, K. Hamidouche, and D. K. Panda, “A High Performance Broadcast Design with Hardware Multicast and GPUDirect RDMA for Streaming Applications on InfiniBand Clusters,” in HiPC 2014, Dec 2014.

Page 9: Exploiting InfiniBand and GPUDirect Technology for High ...hidl.cse.ohio-state.edu/static/media/talks/slide/ching-sc18-booth_3.pdf · A. Venkatesh, H. Subramoni, K. Hamidouche, and

OSU Booth - SC18 9Network Based Computing Laboratory

• Heterogeneous Broadcast for streaming applicationsØ Free-up PCIe resources

Hardware Multicast-based Broadcast (con’t)

Node NIB HCA

IB HCA

CPU

GPU

Source

IB Switch

GPU

CPUNode 1

2

2

Multicast steps

C Data

C

IB SL step

3

3Data

1

IB HCAGPU

CPU

Data

C3

3C.-H. Chu, K. Hamidouche, H. Subramoni, A. Venkatesh, B. Elton, and D. K. Panda, "Designing High Performance Heterogeneous Broadcast for Streaming Applications on GPU Clusters, " SBAC-PAD'16, Oct. 26-28, 2016.

Page 10: Exploiting InfiniBand and GPUDirect Technology for High ...hidl.cse.ohio-state.edu/static/media/talks/slide/ching-sc18-booth_3.pdf · A. Venkatesh, H. Subramoni, K. Hamidouche, and

OSU Booth - SC18 10Network Based Computing Laboratory

• Preparing Intermediate buffer (im_buf)– Page-locked (pinned) host buffer

Ø Fast Device-Host data movement

– Allocated at initialization phaseØ Low overhead, one time effort

• Streaming data through host– Fine-tuned chunked data

– Asynchronous copy operations

Ø Three-stage fine-tuned pipeline

IB HCA

CPU

GPU

Source

IB Switch

Header

d_out

1. Data Preparation2. IB Gather 3. IB Hardware Multicast

im_buf

Optimized Broadcast Send

MPI_Bcast(d_out,…)

C.-H. Chu, X. Lu, A. A. Awan, H. Subramoni, J. Hashmi, B. Elton and D. K. Panda., "Efficient and Scalable Multi-Source Streaming Broadcast on GPU Clusters for Deep Learning, " ICPP 2017, Aug 14-17, 2017.

Page 11: Exploiting InfiniBand and GPUDirect Technology for High ...hidl.cse.ohio-state.edu/static/media/talks/slide/ching-sc18-booth_3.pdf · A. Venkatesh, H. Subramoni, K. Hamidouche, and

OSU Booth - SC18 11Network Based Computing Laboratory

• Zero-copy broadcast receive – Pre-posted user buffer (d_in)

– Avoids additional data movement

– Leverages IB Scatter and GDR

features

Ø Low-latency

Ø Free-up PCIe resources for

applications

IB

Switch

IB

HCA

CPU

GPU

Destination 1Header

d_in

IB

HCA

CPU

GPU

Destination NHeader

d_in

IB Hardware MulticastIB Scatter (GDR Write)

Optimized Broadcast ReceiveMPI_Bcast(d_in,…)

C.-H. Chu, X. Lu, A. A. Awan, H. Subramoni, B. Elton, D. K. Panda, "Exploiting

Hardware Multicast and GPUDirect RDMA for Efficient Broadcast," to appear in

IEEE Transactions on Parallel and Distributed Systems (TPDS).

Page 12: Exploiting InfiniBand and GPUDirect Technology for High ...hidl.cse.ohio-state.edu/static/media/talks/slide/ching-sc18-booth_3.pdf · A. Venkatesh, H. Subramoni, K. Hamidouche, and

OSU Booth - SC18 12Network Based Computing Laboratory

• Proposed Intra-node Topology-Aware Broadcast– CUDA InterProcess Communication (IPC)

Broadcast on Multi-GPU systems

Node 1

IB Switch

GPU 0 GPU 1 GPU N

Node NGPU

CPU

Source

GPU

CPU

CPU

1 2

Multicast steps

cudaMemcpy(Device ↔ Device)

2

C.-H. Chu, K. Hamidouche, H. Subramoni, A. Venkatesh, B. Elton, and D. K. Panda, "Designing High Performance Heterogeneous Broadcast for Streaming Applications on GPU Clusters, " SBAC-PAD'16, Oct. 26-28, 2016.

Page 13: Exploiting InfiniBand and GPUDirect Technology for High ...hidl.cse.ohio-state.edu/static/media/talks/slide/ching-sc18-booth_3.pdf · A. Venkatesh, H. Subramoni, K. Hamidouche, and

OSU Booth - SC18 13Network Based Computing Laboratory

• @ RI2 cluster, 16 GPUs, 1 GPU/node

1

10

100

1000

10000

4K

8K

16

K

32

K

64

K

12

8K

25

6K

51

2K

1M

2M

4M

8M

16

M

Late

ncy

s)

Message Size (bytes)

MV2-GDR-Knomial MV2-GDR-RingMCAST-GDR MCAST-GDR-Opt

Benchmark Evaluation

1

10

100

1000

10000

2 4 8 16

Late

ncy

s)

Number of GPU nodes

2 MB Message

MV2-GDR-Knomial MV2-GDR-RingMCAST-GDR MCAST-GDR-Opt

Lower is better

Near-Constant65%

• Provide near-constant latency over the system sizes • Reduces up to 65% of latency for large messages

Hit GDR read limit

C.-H. Chu, X. Lu, A. A. Awan, H. Subramoni, J. Hashmi, B. Elton and D.

K. Panda., "Efficient and Scalable Multi-Source Streaming Broadcast

on GPU Clusters for Deep Learning, " ICPP 2017, Aug 14-17, 2017.

Page 14: Exploiting InfiniBand and GPUDirect Technology for High ...hidl.cse.ohio-state.edu/static/media/talks/slide/ching-sc18-booth_3.pdf · A. Venkatesh, H. Subramoni, K. Hamidouche, and

OSU Booth - SC18 14Network Based Computing Laboratory

0

2

4

6

8

10P

ea

k

Stre

amin

g

Pe

ak

Stre

amin

g

Pe

ak

Stre

amin

g

4 GPU Nodes 8 GPUs Nodes 16 GPU Nodes

Th

rou

gh

pu

t (G

B/s

)

Knomial-GDR

Ring-GDR-Pipeline

TA-Zcpy-MCAST-GDR-Pipeline

• IB-MCAST + GDR + IPC-based MPI_Bcast schemes

– Stable high throughput compared to existing schemes

Streaming Workload @ RI2 (16 GPUs) & CSCS (88 GPUs)

C.-H. Chu, X. Lu, A. A. Awan, H. Subramoni, B. Elton, D. K.

Panda, "Exploiting Hardware Multicast and GPUDirect

RDMA for Efficient Broadcast," to appear in IEEE Transactions on Parallel and Distributed Systems (TPDS).

0

0.5

1

1.5

2

2.5

3

3.5

4

4.5

5

Peak

Stre

amin

g

Peak

Stre

amin

g

Peak

Stre

amin

g

Peak

Stre

amin

g

11 GPUs 22 GPUs 44 GPUs 88 GPUs

Page 15: Exploiting InfiniBand and GPUDirect Technology for High ...hidl.cse.ohio-state.edu/static/media/talks/slide/ching-sc18-booth_3.pdf · A. Venkatesh, H. Subramoni, K. Hamidouche, and

OSU Booth - SC18 15Network Based Computing Laboratory

• CUDA-Aware Microsoft Cognitive Toolkit (CA-CNTK) without modification

Performance Benefits with CNTK Deep Learning Framework @ RI2 cluster, 16 GPUs

15% 24%

• Reduces up to 24%, 15%, 18% of latency for AlexNet, VGG, and ResNet-50 models

• Higher improvement is expected for larger system sizes

0

0.5

1

1.5

8 16 8 16 8 16

AlexNet VGG ResNet-50

Spee

dup

Scale (Number of GPU nodes)

CA-CNTK - Image ClassificationKnomial-GDR Ring-GDR-Pipeling Zcpy-MCAST-GDR-Pipeline

C.-H. Chu, X. Lu, A. A. Awan, H. Subramoni, B. Elton, D. K.

Panda, "Exploiting Hardware Multicast and GPUDirect

RDMA for Efficient Broadcast," to appear in IEEE

Transactions on Parallel and Distributed Systems (TPDS).

Page 16: Exploiting InfiniBand and GPUDirect Technology for High ...hidl.cse.ohio-state.edu/static/media/talks/slide/ching-sc18-booth_3.pdf · A. Venkatesh, H. Subramoni, K. Hamidouche, and

OSU Booth - SC18 16Network Based Computing Laboratory

• Existing designs1. Explicit copy the data from GPU to host memory

2. Host-to-Host communication to remote processes

3. Perform computation on CPU

4. Explicit copy the data from host to GPU memory

• Proposed designs1. GPU-to-GPU communication

• NVIDIA GPUDirect RDMA (GDR)

• Pipeline through host for large msg

2. Perform computation on GPU• Efficient CUDA kernels

CUDA-Aware MPI_Allreduce

CPU

Host Memory

GPU

PCIe IB Adapter

CPU

Host Memory

GPU

PCIeIB Adapter1

2

3

4

1

2

Node BNode A

Expensive!

Expensive!

Fast

Good for small data Relative slow for large data

Page 17: Exploiting InfiniBand and GPUDirect Technology for High ...hidl.cse.ohio-state.edu/static/media/talks/slide/ching-sc18-booth_3.pdf · A. Venkatesh, H. Subramoni, K. Hamidouche, and

OSU Booth - SC18 17Network Based Computing Laboratory

Benchmark Evaluation @ RI2 cluster, 16 GPUs

0.001

0.01

0.1

1

10

100

1000

8 32 128

512 2K 8K 32K

128K

512K 2M 8M 32M

128M

Late

ncy

(ms)

Message Size (Bytes)

MPI NCCL2 MPI-Opt

[1] C. Chu, K. Hamidouche, A. Venkatesh, A. A. Awan and D. K. Panda, "CUDA Kernel Based Collective Reduction Operations on Large-scale GPU Clusters," in CCGrid’16, Cartagena, 2016, pp. 726-735.[2] Awan AA, Bedorf J, Chu CH, Subramoni H, Panda DK. Scalable Distributed DNN Training using TensorFlow and CUDA-Aware MPI: Characterization, Designs, and Performance Evaluation. arXiv preprint arXiv:1810.11112. 2018 Oct 25.

0

5

10

15

20

25

64K 128K 256K 512K 1M 2M 4M

Late

ncy

(ms)

Message Size (Bytes)

Default

RD-DD

BRB-DD

Page 18: Exploiting InfiniBand and GPUDirect Technology for High ...hidl.cse.ohio-state.edu/static/media/talks/slide/ching-sc18-booth_3.pdf · A. Venkatesh, H. Subramoni, K. Hamidouche, and

OSU Booth - SC18 18Network Based Computing Laboratory

• Introduction

• Advanced Designs in MVAPICH2-GDR– CUDA-Aware MPI_Bcast

– CUDA-Aware MPI_Allreduce / MPI_Reduce

• Concluding Remarks

Outline

Page 19: Exploiting InfiniBand and GPUDirect Technology for High ...hidl.cse.ohio-state.edu/static/media/talks/slide/ching-sc18-booth_3.pdf · A. Venkatesh, H. Subramoni, K. Hamidouche, and

OSU Booth - SC18 19Network Based Computing Laboratory

• High-performance broadcast schemes to leverage GDR and IB-

MCAST features for streaming and deep learning applications– Optimized streaming design for large messages transfers

– High-performance reliability support for IB-MCAST

• High-performance CUDA-Aware Allreduce for deep learning

– Efficient reduction kernel on GPUs

Ø These features are included in MVAPICH2-GDR 2.3Ø http://mvapich.cse.ohio-state.edu/Ø http://mvapich.cse.ohio-state.edu/userguide/gdr/2.3/

Concluding Remarks

Page 20: Exploiting InfiniBand and GPUDirect Technology for High ...hidl.cse.ohio-state.edu/static/media/talks/slide/ching-sc18-booth_3.pdf · A. Venkatesh, H. Subramoni, K. Hamidouche, and

OSU Booth - SC18 20Network Based Computing Laboratory

Thank You!

Network-Based Computing Laboratoryhttp://nowlab.cse.ohio-state.edu/

The MVAPICH2 Projecthttp://mvapich.cse.ohio-state.edu/

• Join us for more tech talks from MVAPICH2 team– http://mvapich.cse.ohio-state.edu/talks/

MVAPICH