/articles/toma

To get this branch, use:
bzr branch http://darksoft.org/webbzr/articles/toma

« back to all changes in this revision

Viewing changes to section_3x_arch.tex

  • Committer: Suren A. Chilingaryan
  • Date: 2017-12-23 08:49:35 UTC
  • Revision ID: csa@suren.me-20171223084935-yg4j912ehufjz6d0
Fix cross-references and some latex complaints

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
 The architecture of nowadays GPUs is rather heterogeneous and includes several types of computational elements organized in SIMD units of different size. The balance of performance is shifting between different types of operations as architectures are get updated. To feed the fast SIMD units with data, a complex hierarchy of memories and caches is introduced. The memory is normally very sensitive to the access patterns and the optimal patterns also differ significantly between the hardware generations~\cite{nvidia2017cudapg}.
14
14
 
15
15
\subsection{Hardware Architecture}
16
 
 The typical GPU consists of several semi-independent Streaming Multiprocessors (SM) which are sharing a global GPU memory and L2 cache~\cite{nvidia2009gf110}. Several DMA engines are included to move the data to/from system memory. Each SM includes task scheduler, computing units, a large register file, a fast on-chip (\emph{shared}) memory, and several different caches. There are a few types of computing units. The number crunching capabilities are provided by a large number of arithmetic units (ALU) also called \emph{Core} units by NVIDIA. ALUs are aimed on a single-precision floating point and integer arithmetic. Some GPUs also include specialized \emph{half precision} and \emph{double precision} units to perform operations with these types faster. There are also architecture-specific units. All NVIDIA devices include Special Function Units (SFU) which are used to quickly compute approximates of transcendent operations. The latest Volta architecture includes \emph{Tensor} units aimed on fast multiplication of small matrices to accelerate deep learning workloads~\ref{nvidia2017v100}. AMD architectures adapt scalar units to track loop counters, etc~\cite{amd2012gcn}. The memory operations are executed by emph{LD/ST} units. The memory is either accessed directly or the \emph{Texture} units are used to perform a fast linear interpolation between the neighboring data elements while loading the data. 
 
16
 The typical GPU consists of several semi-independent Streaming Multiprocessors (SM) which are sharing a global GPU memory and L2 cache~\cite{nvidia2009gf110}. Several DMA engines are included to move the data to/from system memory. Each SM includes task scheduler, computing units, a large register file, a fast on-chip (\emph{shared}) memory, and several different caches. There are a few types of computing units. The number crunching capabilities are provided by a large number of arithmetic units (ALU) also called \emph{Core} units by NVIDIA. ALUs are aimed on a single-precision floating point and integer arithmetic. Some GPUs also include specialized \emph{half precision} and \emph{double precision} units to perform operations with these types faster. There are also architecture-specific units. All NVIDIA devices include Special Function Units (SFU) which are used to quickly compute approximates of transcendent operations. The latest Volta architecture includes \emph{Tensor} units aimed on fast multiplication of small matrices to accelerate deep learning workloads~\cite{nvidia2017v100}. AMD architectures adapt scalar units to track loop counters, etc~\cite{amd2012gcn}. The memory operations are executed by emph{LD/ST} units. The memory is either accessed directly or the \emph{Texture} units are used to perform a fast linear interpolation between the neighboring data elements while loading the data. 
17
17
 
18
18
 The computing units are arranged in several SIMD sets which are able to execute the same instruction on 16 - 64 data elements simultaneously. Several such sets are included in SM and, often, can be utilized in parallel. The dispatch unit of an SM employs data- and instruction-level parallelism to distribute the work-load between all available sets of SIMD units. However, it is architecture depended which combination of instructions can be executed in parallel. The ratio between throughput of different instructions and also shared memory bandwidth varies significantly. Fermi-based GPUs excellent and well-balanced performance of floating-point and integer instructions. Kepler GPUs perform worse if large amount of integer computations are involved, but have very fast texture engine. We summarize the hardware specifications of target GPUs in \tablename~\ref{tbl:gpuspec} and further investigate performance balance of different operations in \tablename~\ref{tbl:gpuratios}. 
19
19
 
68
68
\item Mention that 128-bit loads are causing bank conflicts on Fermi and AMD, but not on a newer architectures. (again \ref{section:alurec_shmem}, benchmark?)
69
69
\item Describe the test and show some numbers illustrating that the number of shared memory transactions is reduced similarly to texture fetches if groups of 4 consecutive threads are requesting less data. The practical effect is discussed in the end of \sectionname~\ref{section:alurec_shmem}.
70
70
\item Optional: Talk about constant memory and L1 and L1.5 caches. Not only latency is lower, but Kepler has double bandwidth from L1. Present a chart showing CMem performance vs. size (standard cache-study plot). We can also reference it in some paper if I remember correctly. If skipped, remove a few sentences from \sectionname~\ref{section:newtex_ld64}. They are not that important for the text flow.
71
 
\item Optional: Mention that on AMD and Kepler constant and shared memory can be used in parallel. But not on other NVIDIA architecture. We actually never relayed on this information and can skip.
72
71
\end{itemize}
73
72
 
74
73
 
75
 
\subsection{Instruction Level Parallelism}
 
74
\subsection{Instruction Level Parallelism}\label{section:ilp}
76
75
 Each SM is equipped with different types of execution units and is able to schedule multiple operations in parallel. ALU is most common element of the architecture. All ALUs of SM are organized in several SIMD sets which can be used independently. There are fewer units of other types, but they are also able to run independent workload in parallel with ALU units. SM includes one or more \emph{warp schedulers} which execute instructions of resident warps on the available SIMD units. Each scheduler is able to issue either a single instruction per-clock or at each clock to \emph{dual-issue} two independent instructions from the same warp. Normally, there is enough schedulers to utilize the available ALUs completely even if only a single instruction is executed per cycle.  SM processor of  Kepler generation, however, includes 6 sets of ALUs, but only 4 warp schedulers~\cite{nvidia2012gk110}. Consequently, the dual-issue is a strict requirement for optimal performance. The VLIW architecture used on the older AMD GPUs has a significantly different scheduling model and requires 4 or 5 independent instructions in the flow for optimal performance~\cite{zhang2011ati}. 
77
76
 %Even if schedulers are able to utilize all ALU elements without relying on dual-issue, only the ability to intermix different types of operations in the flow and make them independent of each other would allow to load all available types of SIMD units.
78
77
 
91
90
\item Optional: Shall we discuss partitions? Probably not. I was not able to successfully target partition in Hybrid kernel. So, I am not mentioning them in the main part. 
92
91
\item Optional: Even if there are independent units, not all instructions can be scheduled in parallel. Shall we mention this? We don't reference this fact later on.
93
92
\item Using this information we were able to achieve a significant performance improvement on Kepler architecture by balancing SFU and ALU operations as explained in \sectionname~\ref{section:alu_fancy}. The effect is even higher on Pascal where we balance the load applied to the texture units and shared memory, see \sectionname~\ref{section:hyrbid}
 
93
\item Optional: Mention that on AMD and Kepler constant and shared memory can be used in parallel. But not on other NVIDIA architecture. We actually never relayed on this information and can skip. This is referenced in ALU model, \sectionname~\ref{section:modelling}. Assuming there is no parallelism at all would not change the balance significantly. So, we can skip it here and redo the model.
94
94
\end{itemize}
95
95
 
96
96
\input{table_3x_bench}
101
101
To enable parallel data transfer and computations, double buffering technique along with asynchronous CUDA/OpenCL API are typically used. And the CUDA/OpenCL events are used for synchronization.
102
102
 
103
103
 Besides the master DMA engines used for communication with the host memory, the professional series of GPUs also support a slave DMA operation. Other devices on the PCIe bus are able to write data directly into the GPU memory. 
104
 
This feature is supported on NVIDIA Tesla cards using GPUDirect technology since the Kepler micro-architecture and on GCN-based AMD FirePro cards using DirectGMA technology~\cite{nvidia2016gpudirect,amd2016directgma}. The GPUDirect technology is introduced in several MPI frameworks to speed-up communication in Infiniband networks~\cite{xxx}.
 
104
This feature is supported on NVIDIA Tesla cards using GPUDirect technology since the Kepler micro-architecture and on GCN-based AMD FirePro cards using DirectGMA technology~\cite{nvidia2017gpudirect,amd2011directgma}. The GPUDirect technology is introduced in several MPI frameworks to speed-up communication in Infiniband networks~\cite{nvidia2013mpi}.
105
105
 
106
106
\subsection{Summary}
107
107
Compared to the GT200, the Fermi architecture significantly improved the arithmetic capabilities. However, the performance of the texture units has not improved accordingly. The Kepler architecture largely restored the performance of the texture engine. However, the throughput of integer operations has not improved much. Some operations are even got slower compared to Fermi. For optimal performance, the dual-issue become a necessity.