
9
2
7
25
Node 2
Node 4
Node 7
Node 9
Node 25
(a) Neighbor Aggregation (b) Node Feature Tensor
4
Node Feature
Figure 2: (a) A simple example of GCN training on single
node. (b) An illustration of node features in memory. The
neighboring nodes’ features are scattered in memory.
representing real-world relational information in social networks
and e-commerce. The capability to build high-quality recommender
systems on graphs is indispensable to multiple businesses. In these
graph data structures, the data which we need to access is often
not coalesced together, but scattered in memory (Figure 1 (b)).
One of the most successful adaptations of deep neural network
models to graph data is Graph Convolutional Network (GCN) [
22
].
The core idea of GCN is to create node embeddings by iteratively
aggregating neighboring nodes’ attributes using neural networks.
Due to its neighboring node’s attribute lookup, training GCN re-
quires accessing multiple scattered locations in memory. In Figure 2
(a), we show a simple example of GCN training. To generate the
embedding of node 4, we traverse the input graph and aggregate
node 4’s features alongside the features of all neighboring nodes in
the node feature tensor. The example that we show here is only a
toy example. In real-world graphs, each node can be connected to
thousands of nodes. To collect relational information from those
neighboring nodes, we may need to access thousands of scattered
locations in memory. Without a doubt, such data access patterns
make the traditional block data transfer method ineective.
In this work, we propose a processor-oriented, software-dened
data communication architecture. Instead of using DMA engines,
we program GPU cores to directly access host memory with zero-
copy memory access. This approach allows the application devel-
opers to direct the GPU cores to exactly the locations that hold
the data needed for computation. Conventional wisdom may still
argue that since the node feature data is in host memory, CPU has
signicant bandwidth advantage over GPUs and therefore DMA
should be a better option because CPU can quickly gather the sparse
features on the y. However, recent work has shown that the ability
to issue a massive number of concurrent memory accesses enables
GPUs to tolerate latency eectively when accessing complicated
data structures like graphs that reside in host memory [
28
]. There-
fore, in GCN training, if GPUs can make targeted ne-grain host
memory accesses for sparse features while fully utilizing system in-
terconnect (e.g., PCIe) bandwidth, the proposed approach can oer
signicant advantage over the DMA approach. The removal of CPU
gathering stage not only shortens data access latency for GPUs,
but also greatly reduces the CPU and host memory utilization (Fig-
ure 3). Ooading CPU workloads to GPUs also helps on training
Contiguous Buffer
CPU
GPU
DMA Read
Write
DMA-based (Block Transfer) Approach
Zero-Copy-based Approach (This work)
Feature Tensor
CPU
GPU
Host
Host
Feature Tensor
Read
66.7% Memory
bandwidth saving
Lower end-to-end
data transfer latency
Zero-Copy
Read
Busy
Idle
Figure 3: Workload comparison between DMA-based
method and the proposed zero-copy-based method.
GCN with multiple GPUs as we can prevent the CPU becoming the
bottleneck with increasing number of workers.
In order to propose the GPU-oriented data communication ar-
chitecture for GCN training, we address three major questions in
this work. First, can zero-copy memory access fully utilize PCIe
bandwidth while training GCN considering the long latency for
accessing host memory? Second, what would be the price of con-
suming GPU cores for zero-copy memory access? Finally, after
resolving the above two questions, can we show real end-to-end
application performance benet from our method?
In this work, we answer all three questions. First, to maintain
the best possible PCIe packet eciency with zero-copy memory
access, we propose an automatic data access alignment optimiza-
tion in GPU data indexing kernel. With our optimization, zero-copy
PCIe bandwidth can match up to 93% of block transfer PCIe band-
width. Second, we propose a novel CUDA multi-process service
(MPS) [
37
] based resource provisioning optimization to minimize
GPU resource consumption of zero-copy memory accesses. Based
on careful investigation of PCIe protocol and GPU architecture,
we conclude that we can saturate PCIe even if only a few number
of GPU cores are generating zero-copy accesses. Therefore, our
optimization isolates only small portion of GPU resources for the
zero-copy accesses and leaves the rest for computationally intense
workloads.
Finally, we build an end-to-end zero-copy GCN training ow in
PyTorch. To enable zero-copy memory access, we devise a new class
of tensor called "unied tensor". This tensor provides an address
mapping of host memory for GPUs so they can directly access host
memory with zero-copy accesses. By simply declaring multiple uni-
ed tensor instances for multiple GPUs, our GCN training ow can
also support zero-copy access in multi-GPU training environment.
2088
评论