Heterogeneous Task Execution Frameworks in Charm++
Michael Robson Parallel Programming Lab Charm Workshop 2016
Heterogeneous Task Execution Frameworks in Charm++ Michael Robson - - PowerPoint PPT Presentation
Heterogeneous Task Execution Frameworks in Charm++ Michael Robson Parallel Programming Lab Charm Workshop 2016 Charm++ GPU Frameworks 2 Accelerator Overview NVIDIA GPUs Programmed with CUDA 1,000s of threads 100s GB/s
Michael Robson Parallel Programming Lab Charm Workshop 2016
2 ¡
3 ¡
4 ¡
5 ¡
6 ¡
7 ¡
8 ¡
9 ¡
10 ¡
11 ¡
12 ¡
– info->hostBuffer = hapi_poolMalloc(size); – info->size = size; – memcpy(info->hostBuffer, data, size); – info->bufferID = -1; – info->transferToDevice = YES; – info->transferFromDevice = NO; – info->freeBuffer = YES;
13 ¡
14 ¡
15 ¡
16 ¡
17 ¡
18 ¡
19 ¡
20 ¡
21 ¡
22 ¡
23 ¡
1 ¡ 1.1 ¡ 1.2 ¡ 1.3 ¡ 1.4 ¡ 1.5 ¡ 1.6 ¡ 1 ¡ 2 ¡ 4 ¡ 8 ¡ Number ¡of ¡Titan ¡nodes ¡
Speedup ¡vs. ¡NAMD ¡2.11 ¡
DHFR ¡(24K ¡atoms) ¡ ApoA1 ¡(92K ¡atoms) ¡
1 ¡ 1.05 ¡ 1.1 ¡ 1.15 ¡ 1.2 ¡ 1.25 ¡ 1.3 ¡ 1.35 ¡ 1 ¡ 2 ¡ 4 ¡ Number ¡of ¡Titan ¡nodes ¡
5.7M ¡atoms ¡
1 ¡ 1.5 ¡ 2 ¡ 2.5 ¡ 3 ¡ 3.5 ¡ 4 ¡ 1 ¡ 2 ¡ 4 ¡ Number ¡of ¡Titan ¡nodes ¡
13K ¡atoms ¡
transposeDataOnGPU(d_data, ¡stream); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡// ¡Transpose ¡data ¡locally ¡ copyDataToPeerDevice(destGPU, ¡d_data, ¡stream); ¡ ¡ ¡ ¡ ¡// ¡Copy ¡data ¡to ¡GPU ¡on ¡same ¡node ¡ cudaStreamSynchronize(stream); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡// ¡Wait ¡for ¡CUDA ¡stream ¡to ¡finish ¡ ¡ PmeMsg* ¡msg ¡= ¡new ¡(0) ¡PmeMsg(); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡// ¡Allocate ¡empty ¡message ¡ pmePencil.recvData(msg); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡// ¡Send ¡message ¡to ¡PE ¡that ¡has ¡“destGPU” ¡ void ¡recvData(PmeMsg* ¡msg) ¡{ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡// ¡Receiving ¡empty ¡message ¡lets ¡PE ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡// ¡know ¡its ¡GPU ¡now ¡has ¡the ¡data ¡in ¡“d_data” ¡ ¡ ¡eWork(d_data, ¡stream); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡// ¡Perform ¡work ¡on ¡data ¡ ¡ ¡… ¡ } ¡
transposeDataOnGPU(d_data, ¡stream); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡// ¡Transpose ¡data ¡locally ¡ ¡ PmeMsg* ¡msg ¡= ¡new ¡(dataSize) ¡PmeMsg(); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡// ¡Create ¡message ¡ copyDataToHost(d_data, ¡msg-‑>data, ¡stream); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡// ¡Copy ¡data ¡to ¡host ¡ cudaStreamSynchronize(stream); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡// ¡Wait ¡for ¡CUDA ¡stream ¡to ¡finish ¡ pmePencil.recvData(msg); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡// ¡Send ¡data ¡to ¡PE ¡on ¡different ¡node ¡ void ¡recvData(PmeMsg* ¡msg) ¡{ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡copyDataToDevice(msg-‑>data, ¡d_data, ¡stream); ¡ ¡ ¡ ¡ ¡ ¡ ¡// ¡Copy ¡data ¡to ¡device ¡buffer ¡d_data ¡ ¡ ¡cudaStreamSynchronize(stream); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡// ¡Wait ¡for ¡CUDA ¡stream ¡to ¡finish ¡ ¡ ¡eWork(d_data, ¡stream); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡// ¡Perform ¡work ¡on ¡data ¡ ¡ ¡…. ¡ } ¡
PmeMsg* ¡msg ¡= ¡new ¡(dataSize) ¡PmeMsg(); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡// ¡Create ¡message, ¡data ¡on ¡device ¡ transposeDataOnGPU(msg-‑>data, ¡stream); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡// ¡Transpose ¡data ¡locally ¡ pmePencil.recvData(msg, ¡stream); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡// ¡Send ¡data ¡using ¡CUDA ¡stream ¡ void ¡recvData(PmeMsg* ¡msg) ¡{ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡eWork(msg-‑>data, ¡stream); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡// ¡Perform ¡work ¡on ¡data ¡ ¡ ¡… ¡ } ¡
32 ¡
33 ¡
34 ¡
35 ¡
36 ¡
37 ¡
Michael Robson mprobson@illinois.edu
38 ¡
39 ¡
– Regular and passsing -mmic option
– ++cpus aka nodesize – repeated for each node – ++ext .mic
– ++usehostname – -br0 – -mic0
40 ¡