A Softmax computation is commonly used in various types of neural networks and deep learning applications. Examples of neural networks utilizing Softmax are recurrent neural networks, convolutional neural networks, and transformer neural networks.
Conventional computation of Softmax has drawbacks including low memory utilization and being computationally expensive in some aspects. Thus neural network and deep learning applications may benefit from more efficient computation of Softmax.
Transformer neural networks in particular have shown promising results for conversational artificial intelligence (AI) applications. Transformer networks use attention mechanisms that utilize Softmax in both encoder and decoder stages, and may particularly benefit from more efficient Softmax computation.
Deep neural networks (DNNs) are a class of neural network that has emerged as a key approach for solving complex problems across various technical fields, especially those involving deep machine learning. Applications of DNNs have diverse performance, accuracy, and power requirements depending on the implementation. Building dedicated DNNs for the requirements of particular implementations may be cost prohibitive due to high design complexity and manufacturing challenges. Deep neural networks, which also tend to utilize Softmax computations a great deal, may thus also benefit from more efficient Softmax computation.
In some aspects, a system includes one or more processors. The system includes logic that when applied to the one or more processors computes an unnormalized Softmax vector from an input vector by raising elements of the input vector to powers of two and computing an integer vector maximum of the input vector. The system further includes logic that when applied to the one or more processors transforms the unnormalized Softmax vector into a normalized Softmax vector.
In other aspects, an artificial neural network includes one or more feed-forward layers, and one or more Softmax layers coupled to the one or more feed-forward layers. The artificial neural network includes at least one of the Softmax layers configured to compute an unnormalized Softmax vector from an input vector by raising elements of the input vector to powers of two and computing an integer vector maximum of the input vector.
In yet other aspects, a transformer artificial neural network includes a self-attention layer and an encoder-decoder attention layer. Each of the self-attention layer and the encoder-decoder attention layer include a Softmax layer configured to generate an unnormalized Softmax vector from an input vector by raising elements of the input vector to powers of two and computing an integer vector maximum of the input vector.
To easily identify the discussion of any particular element or act, the most significant digit or digits in a reference number refer to the figure number in which that element is first introduced.
In many deep learning applications, it is common to perform inference on a trained model with less precise data representations to increase performance (improve throughput or latency per inference) and reduce computational energy expended per inference. These models may be applied within tensor cores on programmable graphics processing units (GPUs) or in dedicated deep learning accelerators. Some solutions focus on improving the performance of neural network layers by implementing such layers as batched matrix-multiply operations in GPUs. “Neural network” refers to an algorithm or computational system based on a collection of connected units or nodes called artificial neurons, which loosely model the neurons in a biological system. Each connection between neurons, like the synapses in a biological brain, can transmit a signal (an activation) from one artificial neuron to another. An artificial neuron that receives a signal (the input activation) can process it and then signal additional artificial neurons (the output activation) connected to it. “Input activation” refers to an activation received by a neuron in a neural network. “Output activation” refers to an activation output by a neuron in a neural network. An output activation is typically computed based on the input activations to the neuron and the weights applied to the input activations. “Weights” refers to values with which activations are multiplied to increase or decrease the impact of the activation values in an activation function. “Activations” refers to the output values of neurons in a neural network, computed based at least in part on weights input to the neuron and an activation function of the neuron. Activations are also called ‘activation values’.
The core matrix-multiply computations have continued to improve in computational performance with subsequent generations of GPU hardware. Other aspects of deep learning applications have thus become bottlenecks. For example, in many conversational artificial intelligence workloads, such as transformer-based neural networks, Softmax computations may emerge as a bottleneck.
Conversational AI implementations utilizing transformer neural networks may be particularly impacted by poor Softmax performance. At a high level, transformer neural network structures comprise an encoding component, a decoding component, and connections between these components. The encoding component may comprise a stack of multiple encoding stages and the decoding component may comprise a stack of multiple decoding stages, typically of the same number as there are encoding stages. The encoding stages (“encoders” for short) are neural networks and typically may be identical in structure to one another, except they may acquire differences during training (e.g., be trained to have different weights from one another). Likewise the decoding stages (“decoders” for short) may typically all have the same structure except for differences acquired in training. The encoders and decoders may comprise “layers” that perform operations on vector inputs to generate vector or scalar outputs. These vectors may be multidimensional (generally NxMx . . . P, N, M, . . . P>1) and nested, and are commonly referred to as tensors.
Conventional Softmax computation typically involves the following operations: (i) compute a maximum value in an input vector, (ii) apply an exponent to a floating-point or fixed-point number, (iii) perform a summation of exponent values, and (iv) perform a division of the exponent value by the sum. The formula for a conventional Softmax operation is
A computing algorithm for conventional Softmax is:
This algorithm involves multiple accesses to memory and exhibits low operand reuse, sometimes resulting in poor performance. The loop 2:-4: over the vector V (to find the maximum valued member mv of the vector V) involves a vector read from memory; the loop 6:-8: to compute the sum of exponentials involves another; and the loop 9:-11: to normalize V involves yet another.
Implementing the exponent and reciprocal functions in hardware (for speed) may incur high design overhead (circuit area and/or power consumption). For example, exponent and reciprocal functions may be performed in the special function unit (SFU) of a GPU configured with look-up tables (LUTs) with 32-bit floating-point precision. The high circuit area overhead of these components may make replication of SFU units to achieve high throughput prohibitively expensive.
Disclosed herein are embodiments that improve the efficiency of Softmax computation. These solutions may be utilized to implement fast and efficient deep learning inference in transformers and other neural networks. The disclosed Softmax computation comprises reduced precision implementation of various operations, replacing ex with 2x to reduce instruction overhead associated with computing ex, and replacing floating point max computation of vector elements with an integer max computation. One scalable implementation decomposes Softmax into separate UnNormalized Softmax and Normalization operations.
The disclosed approaches compute Softmax by formulating a vector of 2x valued elements. The expression “vector of 2x valued elements” refers to a vector of elements each raised to a power of two, where the exponent of the power of two is computed utilizing an input value x from an input vector of elements. It should be understood that the actual exponent of the power of two, when referring to the “vector of 2x valued elements”, may not actually be x, but rather a value derived from x (e.g., x-xmax), where xmax is a running computed maximum value of the input vector elements.
Also described herein are embodiments of an efficient, tiled DNN processor that utilizes a scalable design. These embodiments may benefit from the disclosed improvements to Softmax computation. The disclosed embodiments comprise beneficial features including: 1) a fully distributed, tile-based architecture, 2) flexible and efficient weight and activation tiling at the processing element (PE) level, chip-level, and in some embodiments, package-level, improving data locality and reducing communication cost, and 3) multi-level dataflows, improving the data reuse and energy efficiency.
The DNN processor embodiments utilize a data path designed to account for the low computation-to-memory ratio of neural network layers. The data path includes, in some implementations, both local and global processing elements. Each local processing element comprises logic to perform localized multiply-accumulation of weights and input activations, and post-processing such as ReLu, MaxPool, Softmax, etc. “Logic” refers to machine memory circuits and non-transitory machine readable media comprising machine-executable instructions (software and firmware), and/or circuitry (hardware) which by way of its material and/or material-energy configuration comprises control and/or procedural signals, and/or settings and values (such as resistance, impedance, capacitance, inductance, current/voltage ratings, etc.), that may be applied to influence the operation of a device. Magnetic media, electronic circuits, electrical and optical memory (both volatile and nonvolatile), and firmware are examples of logic. Logic specifically excludes pure signals or software per se (however does not exclude machine memories comprising software and thereby forming configurations of matter).
Memory buffers in the form of collectors and register files may be disposed into the data path within and/or between processing elements. “Buffer” refers to a memory storing values that are inputs to or results from a calculation. “Collector” refers to a buffer disposed between another buffer and the input or output of a data processor, such as a multiply-accumulate unit. “Multiply-accumulate unit” refers to a data processing circuit that carries out multiply-accumulate operations, which involve computing the product of two numbers and adding that product to an accumulator. Multiply-accumulate units may be referred to herein by their acronym, MAC or MAC unit. A multiply-accumulate unit carries out computations of the form a<-a+(b*c). A vector multiply-accumulate unit computes the product of two vectors using an array of multipliers, then performs a reduction operation by adding all the outputs of multipliers to produce a partial sum, which is then added to an accumulator. “Partial sum” refers to an intermediate multiply-accumulate result in a dot-product-accumulate calculation. “Dot-product-accumulate” refers to the computation of a dot product. A dot product is the sum of the products of the corresponding entries of the two sequences (vectors) of numbers. Dot products are efficiently computed using vector multiply-accumulate units.
The DNN processor embodiments provide a multi-level memory and computation hierarchy that exploits both weight and output activation locality to improve the energy efficiency of neural network execution. Conventional neural network accelerator designs only leverage the reuse opportunity of the innermost execution level (e.g., loop), whereas the disclosed architecture provides a multi-level memory and processing hierarchy to exploit data reuse opportunities across multiple loop levels, thus enabling a diverse set of energy-efficient data flows. For example, instead of capturing temporal reuse only for weights or outputs, multi-level dataflows may be implemented that exploit both weight and partial sum reuse during the execution.
To efficiently implement a particular data flow, each local processing element may utilize one or more collectors (e.g., small register-files): one in front of a weight buffer, another one in front of an accumulation buffer, and another in front of an input activation buffer. “Activation buffer” refers to a memory buffer utilized to store activation values (activations) utilized in a neural network computation. Activations are computed by each neuron in a neural network layer using an activation function, also sometimes called a ‘transfer function’. Activations may be simple binary values (e.g., “1” or “0” representing “ON” or “OFF”) or they may take on a range of values for some activation functions. These collectors filter out (reduce) expensive reads and writes to the weight and partial sum buffers (e.g., SRAMs), leading to an overall energy efficiency improvement. The global processing elements and/or the chip may provide additional storage (e.g., a global or shared register file) and processing capability in the data path of neural network computations.
The disclosed DNN processor embodiments provide a heterogeneous-tile-based computational platform for different types neural network calculations. In addition to dense convolution, many neural networks perform element-wise calculation and depth-wise convolution. To facilitate such computations the architecture includes two general types of processing element. The first type, called local processing elements, specialize in executing dense convolution with significant data reuse. The second type, called global processing elements, provide second-level storage for the local processing elements during dense convolution. In addition, the global processing elements may perform element-wise operations and depth-wise convolution at a low compute-to-memory ratio without communicating large amounts of data through layers of the neural network.
In the specific example depicted, a person 102 speaks into a microphone 110 of a digital device 118, for example to interact with a voice assistant on a mobile phone or home automation device (e.g., Bixby®, Siri®, Alexa®, Google Assistant® etc.), or in an automobile or with a robot. Voice commands or queries are converted into text and/or commands and communicated to IoT devices 106 and/or cloud computer systems 104, for example over a local area network 108 and/or wide area network 112. The conversion of the speech of the person 102 to text and/or commands understood by the IoT devices 106 and/or cloud computer systems 104 may be carried out by one or more neural networks 114 utilizing one or more Softmax layers 116. Examples of neural networks 114 that may be utilized for these purposes include transformer neural networks, recurrent neural networks, convolutional neural networks, and hybrids of these types, as well as other types known in the art.
Results of the last encoder 312 in the encoder stack 308 are provided to the decoder stack 314. The decoder stack 314 as depicted comprises three decoders (decoder 316, decoder 318, and decoder 320) but in practice there may be any manageable number. The encoding results of the final encoder 312 are provided to the first decoder 316 of the decoder stack 314, and the attention results of the final encoder 312 may be fully connected with the encoder-decoder attention layers 504 of each encoder in the decoder stack 314, in one embodiment. The decoder stack 314 operates on the results provided by the encoder stack 308 to generate an output sequence 322 transformation of the input sequence 304. There may typically be linear and Softmax layers (not depicted) at the output of the final decoder 320 stage to produce the output sequence 322.
Generally, attention vectors from any encoder self-attention layer may be provided to any decoder encoder-decoder attention layer. Also the attention layers may be “multi-headed” as known in the art.
Results of the encoder-decoder attention layer 504 are passed to a feed forward neural network 508 that generates outputs to a next decoder stage or final output results (possibly after additional processing by linear and Softmax layers).
Next a scores vector 612 is derived by performing a dot product 614 of the query vectors 606 and key vectors 608. The element values in the scores vector 612 determine how much focus to place on other parts (e.g., tokens) of the input vector while processing a particular token of the input vector. The scores vector 612 is then processed with a Softmax 616 algorithm to normalize the scores so they're all positive and add up to 1. The Softmax scores determine how much each token of the input sequence is expressed at the particular input sequence token position.
A multiply 618 is then performed on value vectors 610 by the Softmax score and the weighted value vectors 610 are summed up (vector summation 620).
In
In
An architecture of an embodiment of an Unnormalized Softmax unit 828 and a Normalization unit 830 is depicted in
The overall input vector for Softmax may be decomposed into smaller vectors that are fed into the Unnormalized Softmax unit 828. These smaller pieces of the overall vector may be processed in parallel by multiple processing elements (e.g., see
The vector integer maximum unit 802 receives the input vector and computes the integer maximum value (LocalMax) among the vector's elements. Each element of the input vector is rounded to an integer and the maximum valued element after rounding and comparison (max comparator 834) is selected as LocalMax. If the input vector is a fraction of the overall vector to Softmax, then the maximum valued element of the vector is a “local” maximum. This local maximum may be shared among other processing elements working on other segments of the overall vector, for comparison and determination of a global maximum for the vector. In one embodiments, a central processor/controller for coordinating execution of the Softmax algorithm across the processing elements may also collect LocalMax values and determine a global maximum value (GlobalMax) for the vector. “Controller” refers to any logic to control the operation of other logic. When a controller is implemented in hardware, it may for example be one of many well-known models of microprocessor, graphics processing unit, or a custom controller implemented using an application-specific integrated circuit (ASIC), a system-on-a-chip (SOC), or in many other manners known in the art. A controller may also be implemented in software or firmware, as computer instructions stored in a volatile memory or a non-volatile memory. Controllers are typically used to coordinate the operation of one or more other components in a system, for example providing signals to the other components to start and stop their operation, or to instruct the other components with particular commands to carry out.
The power-2 computation unit 804 receives the input vector and the LocalMax value computed by the vector integer maximum unit 802. The power-2 computation unit 804 subtracts LocalMax from each element value x of the input vector and then utilizes the linear piecewise computation unit 822 to compute 2(x-LocalMax). A low precision micro-architecture may be implemented to improve the computational efficiency (i.e., reduce the computational complexity) in the power-2 computation unit 804. In one embodiment the input vector elements and LocalMax may be implemented in a low precision (meaning lower than typical floating point or long integers) fixed-point representation with six integer bits and two fractional bits. The linear piecewise computation unit 822 may utilize a fixed-point fractional splitter 824 to direct the fractional bits to the look-up table 832 and the integer bits to left shift 826 logic to generate the power of two value.
The linear piecewise computation unit 822 may be implemented using a look-up table 832 comprising, in one embodiment, four entries and ten bits each. The use of IntMax may simplify, in terms of circuit area, power consumption, and computational speed, both the power-2 computation unit 804 and Normalization unit 830. This may simplify the subtraction operation in the power-2 computation unit 804 from floating point to integer and obviate the need for a linear piecewise (LPW) computation of 2x in the Normalization unit 830.
The unnormalized Softmax values generated by the power-2 computation unit 804 may be reduced sequentially in the reduction unit 806 to compute a sum of powers (PowSum). It will be readily apparent to those of ordinary skill in the art how reduction of PowSum across the overall Softmax vector is sequentially carried out in the reduction unit 806 using the vector element adder 836, power sum selector 816 (to select either the power sum from the vector element adder 836 or from another processing element), right shifter 818, and adder 820.
Similarly, reduction of LocalMax values may be performed using max selector 808 and max comparator 810 and the results stored in memory buffer 812. When the sub-vectors of the Softmax computation are spatially distributed across multiple processing elements, cross-processing element (PE) reduction of local PowSum and IntMax values may be performed and shared among processing elements (via memory buffer 812 and power sum buffer 814) to determine global maximums (GlobalMax) and power sums (GlobalPowSum).
The Normalization unit 830 may receive UnnormedSoftmax (unnormalized Softmax vector), LocalMax, GlobalMax, and GlobalPowSum values as input and perform a normalization operation by first computing a reciprocal of GlobalPowSum using a low-precision LPW reciprocal unit that in one embodiment may be implemented as a LUT of size ten bytes. The final Softmax vector elements may be computed by right shifting UnnormedSoftMax vector elements and multiplying with the reciprocal of GlobalPowSum.
By utilizing reduced bit-width operands and reduced LUTs, the implementation cost (in area, power, and/or speed) of a Softmax computation unit may be considerably reduced from the floating-point SFU used for executing similar functions on traditional GPUs.
An overall deep neural network distributed computation is coordinated by a controller 906 with intermediate values of the computation stored in the local memories of the processing elements 904 or in a global global memory buffer 910. “Global memory buffer” refers to a buffer available for utilization by all or at least a plurality of processing elements on a chip. Tensors, weights, and other values for and from the computation may also be read, at least initially, and written from a memory 912 (e.g., a larger but slower DRAM device).
In one embodiment the controller 906 is configured to coordinate the processing elements 904 to perform an Unnormalized Softmax that is then normalized by a normalization unit 908.
Deep neural network applications can differ significantly in their requirements. For example, typical data center inference applications such as image recognition may prioritize performance and scalability at low latency and may be willing to sacrifice classification accuracy, while inference for autonomous driving workloads may prioritize energy efficiency within real-time constraints while maintaining the best achievable network accuracy. The distributed computing system 900 is a general-purpose architecture that may be configured as an application-specific inference accelerator with performance and power advantages compared to general-purpose solutions.
A multi-die package 1012 embodiment for implementing a DNN accelerator is depicted in
Some or all of the processing elements are local processing elements comprising a weight buffer to receive and store weight values for a deep neural network. “Weight buffer” refers to a buffer storing weight values. The local processing elements comprise an activation buffer to receive activation values for the deep neural network. The weight buffer and activation buffer may be separate elements within each processing element. The local processing elements further comprise a plurality of multiply-accumulate units to combine, in parallel, the weight values and the activation values, to generate partial sums.
The multi-die package 1012 may be configured to distribute the weight values and the activation values among the local processing elements spatially and temporally (over time). The global memory buffer of each chip may act as a second-level buffer for the activation values during computation. “Second-level buffer” refers a memory where values are stored and retrieved from when the values are needed for computation but are not available in the first-level buffer. Herein, the chip global buffer may act as a second-level buffer to the first-level activation buffers of the chip's processing elements. The distribution of weights and activations during computation may be carried out by the chip's controller 1004. The controller 1004 or local controllers of any of the processing elements 1014 may be configured by instructions stored in a memory to carry out various data flows described below. A memory configured in such a manner may conveniently be referred to herein as “logic”. The location of such logic is a design choice. The memory storing such instructions may be any of the memories depicted in the figures, or a different memory not depicted.
The weight buffer 1204 may, in one embodiment, be implemented as a single-ported SRAM storing weigh values. The weight values used by the vector multiply-accumulate units 1202 may be “weight-stationary”, meaning they are not updated each clock cycle, but instead are updated once the output activation values are computed for a particular layer of the deep neural network.
The accumulation memory buffer 1210 may comprise one or more SRAM devices to store the output activations computed by the vector multiply-accumulate units 1202. The router 1208 communicates these output activations and control signals from the processing element 1200 to other processing elements.
The processing element 1200 may perform all operations of convolutional and fully-connected layers of a DNN efficiently, including multiply-accumulate, truncation, scaling, bias addition, ReLU, and pooling (these last five in the post-processor 1212). “Bias addition” refers to inclusion of a bias (e.g., a fixed output value or increment to an output value) for one or more neurons of a neural network layer. Bias addition is a technique for ensuring that at least one neuron of a layer produces a non-zero activation to a next layer when the layer does not detect any features in its inputs. The vector multiply-accumulate units 1202 may operate on the same inputs using different filters. In one embodiment, each of the vector multiply-accumulate units 1202 performs an eight-input-channel dot product and accumulates the result into the accumulation memory buffer 1210 on each clock cycle. The weights stored in the weight buffer 1204 are unchanged until the entire computation of output activations completes. Each processing element 1200 reads the input activations in the activation buffer 1206, performs the multiply-accumulate operations, and writes output activations to the accumulation memory buffer 1210 on every clock cycle. The frequency at which the weight buffer 1204 is accessed depends on the input activation matrix dimensions and the number of filters utilized.
The vector multiply-accumulate units 1202 of each processing element 1200 computes a portion of a wide dot-product-accumulate as a partial result and forwards the partial result to neighboring processing elements. “Neighboring processing element” refers to a processing element at a one-hop distance from another processing element on the data communication network fabric, e.g., the network-on-a-chip or network-on-a-package.
The partial results are transformed into a final result by the post-processor 1212 and communicated to the global buffer 1002. The global buffer 1002 acts as a staging area for the final multiply-accumulate results between layers of the deep neural network.
The accumulation memory buffer 1210 receives outputs from the vector multiply-accumulate units 1202. The central controller 1004 distributes the weight values and activation values among the processing elements and utilizes the global memory buffer as a second-level buffer for the activation values. When processing images, the controller 1004 configures processing by layers of the deep neural network spatially across the processing elements by input/output channel dimensions and temporally by image height/width.
The global buffer 1002 stores both input activations and output activations from the processing elements 1014 for distribution by the aforementioned transceivers to the processing elements via multicast. “Multicast” refers to a group communication mechanism whereby transmission of data is addressed to a group of destination devices (e.g., processing elements) simultaneously. Multicast can implement one-to-many or many-to-many distribution. Each of the processing elements 1014 includes a router 1208 to communicate, in one embodiment, 64 bits of data in, and 64 bits of data out, per clock cycle. This enables accumulation of partial sums for wide dot products that have their computation spatially tiled across the processing elements 1014.
The processing element 1300 includes vector multiply-accumulate units 1202 of which a number N are operational for a given data flow. Each vector multiply accumulate unit 1324 performs V multiplications and additions per clock cycle. Thus, in every clock cycle, the processing element 1300 can multiply a weight matrix of dimensions N×V with an input activation vector of size V, to generate a partial-sum vector of size N. In other words, each of the vector multiply-accumulate units 1202 can perform a V-wide dot product calculation per clock cycle. One or both N and V may be configurable at the controller 1004.
The input activation buffer 1206 has an operational size IA and the weight buffer 1204 has an operational size W. “Operational size” refers to a resource pool available for performing calculations during operation of a device, which may be less than the total or maximum size of the resource pool. The operational size may be configurable using registers or other settings (e.g., for higher performance or less power consumption). One or both W and IA may be configurable at the controller 1004. The accumulation memory buffer 1210 has an operational size of A.
Each of the vector multiply-accumulate units 1202 includes a weight collector 1320 buffer having a configurable depth (e.g., number of distinct registers or addresses in a register file used by the vector multiply-accumulate units 1202 during computations) of WD and a width V×N×WP (WP is also called the weight precision). The input activations have width IAP. Each of the vector multiply-accumulate units 1202 also includes an accumulation collector 1322 having a configurable operational depth AD and width N×AP (AP is also called the accumulator precision). The V-wide dot products and N-sized partial-sum vector may thus be computed by each vector multiply accumulate unit 1324 at mixed precision. Some or all of WD, WP, IAP, AD, and AP may be configurable by the controller 1004.
The weight buffer 1204 read (output) port is WP×N×V bits wide and is able to supply different weight vectors to different ones of the vector multiply-accumulate units 1202. The activation buffer 1206 is IAP×V bits wide because the same IA vector is provided in parallel to all N vector multiply-accumulate units 1202.
The values of V and N may be adjusted to enable an amount of computational parallelism and reuse of weights, for example. Based on the configuration of N and V, other parameters such as W, IA, and A may be adjusted to ensure the vector multiply-accumulate units 1202 stay busy during convolution calculation.
The weight buffer 1204 and the activation buffer 1206 each have an associated address generator (address generator 1314 and address generator 1318, respectively) that generates an address every cycle. “Address generator” refers to logic that calculates address values in a memory for reading or writing data from the address. The ordering of operations carried out by the vector multiply-accumulate units 1202 is controlled by these address generators, which are configurable to support temporal reuse of weights or results in the accumulation collector 1322 across clock cycles for different types of data flows. The depth WD of the weight collector 1320 may be configurable to enable different amounts of temporal reuse of partial sum values, depending on the requirements of the data flow. Likewise, the depth AD of the accumulation collector 1322 may be configurable to enable different amounts of temporal reuse of weight values, depending on the requirements of the data flow.
The processing element 1300 may further comprise an input collector 1328 disposed between the activation buffer 1206 and the vector multiply-accumulate units 1202. An operational depth IC of the input collector 1328 may be configured to set different levels of input activation stationary data flows, as described further below.
Each of the weight buffer 1204 and activation buffer 1206 also have a buffer manager (weight memory buffer manager 1310 and activation memory buffer manager 1312, respectively) responsive to the controller 1214 and determining the availability of data to the vector multiply-accumulate units 1202. The dimensions of the address generators and the granularity of data movement from the weight buffer 1204 and activation buffer 1206 to the vector multiply-accumulate units 1202 may in some embodiments be configurable at the controller 1004.
The accumulation memory buffer 1210 stores partial sums from all N vector multiply-accumulate units 1202 and may be optimized to perform read-modify-write operations every cycle. Partial sums from the N vector multiply-accumulate units 1202 are packed into vectors of width AP×N and stored in the accumulation memory buffer 1210. From there, they can be sent either directly to another processing element for cross-processing element reduction or to the post-processor 1212 to produce final output activations. The post-processor 1212 may provide scaling and quantization operations, and additionally ReLU and pooling operations to enable layer fusion.
Input weights 1302 arrive over the router 1208 and are stored in the weight buffer 1204. Input activations 1304 also arrive over the router 1208 and are stored in the activation buffer 1206. Computed output activations 1326 (after post-processing by the post-processor 1212) or partial sums 1306 from the accumulation memory buffer 1210 are output to the global buffer 1002 or neighboring processing elements, respectively, via the router 1208. Cross-processing-element reductions 1308 from said neighboring processing elements may be received by the router 1208 and are accumulated in the accumulation memory buffer 1210. “Cross-processing-element reduction” refers to the reduction of a partial computational result by a first processing element to a final or more complete computational result by one or more other processing elements.
The data path 1508 to and from the global memory buffer 1502 comprises a register file 1512 which may operate as a collector for one or more of input activations 1518, output activations 1514, and partial sums 1516 to and from local processing elements, according to the requirements of the data flow.
Many neural networks utilize computations such as element-wise calculation and depth-wise convolution for improved overall accuracy. Local processing elements are specialized for executing dense convolution with significant data reuse. The global buffer 1002 may be utilized as the second-level data storage by local processing elements during dense convolution and may also perform computation for element-wise operations and depth-wise convolution. Global processing elements execute computation with low compute-to-memory ratio locally without communicating the data through layers (and hence, chips) of the neural network.
The controller 1504 may be local to each global processing element 1522 or may be implemented by the chip master controller (controller 1004). Likewise, the global memory buffer 1502 may be local to the global processing element 1522 or implemented by the global buffer 1002.
The algorithms and techniques disclosed herein may be executed by computing devices utilizing at least one graphic processing unit (GPU) and/or general purpose data processor (e.g., a ‘central processing unit or CPU). Exemplary architectures is described that may be configured to carry out the techniques disclosed herein on such devices.
The following description may use certain acronyms and abbreviations as follows:
At least one parallel processing unit 2008b module may be configured to accelerate thousands of High Performance Computing (HPC), data center, and machine learning applications. The parallel processing unit 2008b may be configured to accelerate numerous deep learning systems and applications including autonomous vehicle platforms, deep learning, high-accuracy speech, image, and text recognition systems, intelligent video analytics, molecular simulations, drug discovery, disease diagnosis, weather forecasting, big data analytics, astronomy, molecular dynamics simulation, financial modeling, robotics, factory automation, real-time language translation, online search optimizations, and personalized user recommendations, and the like.
As shown in
The NVLink 1616 interconnect enables systems to scale and include at least one parallel processing unit 2008b module combined with at least one CPU, supports cache coherence between the parallel processing unit 2008b modules and CPUs, and CPU mastering. Data and/or commands may be transmitted by the NVLink 1616 through the hub 1606 to/from other units of the parallel processing unit 2008b such as at least one copy engine, a video encoder, a video decoder, a power management unit, etc. (not explicitly shown). The NVLink 1616 is described in more detail in conjunction with
The I/O unit 1602 is configured to transmit and receive communications (e.g., commands, data, etc.) from a host processor (not shown) through the interconnect 1618. The I/O unit 1602 may communicate with the host processor directly via the interconnect 1618 or through at least one intermediate device such as a memory bridge. In an embodiment, the I/O unit 1602 may communicate with at least one other processor, such as at least one parallel processing unit 2008b module via the interconnect 1618. In an embodiment, the I/O unit 1602 implements a Peripheral Component Interconnect Express (PCIe) interface for communications through a PCIe bus and the interconnect 1618 is a PCIe bus. In alternative embodiments, the I/O unit 1602 may implement other types of well-known interfaces for communicating with external devices.
The I/O unit 1602 decodes packets received via the interconnect 1618. In an embodiment, the packets represent commands configured to cause the parallel processing unit 2008b to perform various operations. The I/O unit 1602 transmits the decoded commands to various other units of the parallel processing unit 2008b as the commands may specify. For example, some commands may be transmitted to the front-end unit 1604. Other commands may be transmitted to the hub 1606 or other units of the parallel processing unit 2008b such as at least one copy engine, a video encoder, a video decoder, a power management unit, etc. (not explicitly shown). In other words, the I/O unit 1602 is configured to route communications between and among the various logical units of the parallel processing unit 2008b.
In an embodiment, a program executed by the host processor encodes a command stream in a buffer that provides workloads to the parallel processing unit 2008b for processing. A workload may comprise several instructions and data to be processed by those instructions. The buffer is a region in a memory that is accessible (e.g., read/write) by both the host processor and the parallel processing unit 2008b. For example, the I/O unit 1602 may be configured to access the buffer in a system memory connected to the interconnect 1618 via memory requests transmitted through the interconnect 1618. In an embodiment, the host processor writes the command stream to the buffer and then transmits a pointer to the start of the command stream to the parallel processing unit 2008b. The front-end unit 1604 receives pointers to at least one command stream. The front-end unit 1604 manages the at least one stream, reading commands from the streams and forwarding commands to the various units of the parallel processing unit 2008b.
The front-end unit 1604 is coupled to a scheduler unit 1608 that configures the various general processing cluster 1700 modules to process tasks defined by the at least one stream. The scheduler unit 1608 is configured to track state information related to the various tasks managed by the scheduler unit 1608. The state may indicate which general processing cluster 1700 a task is assigned to, whether the task is active or inactive, a priority level associated with the task, and so forth. The scheduler unit 1608 manages the execution of a plurality of tasks on the at least one general processing cluster 1700 module.
The scheduler unit 1608 is coupled to a work distribution unit 1610 that is configured to dispatch tasks for execution on the general processing cluster 1700 modules. The work distribution unit 1610 may track a number of scheduled tasks received from the scheduler unit 1608. In an embodiment, the work distribution unit 1610 manages a pending task pool and an active task pool for each of the general processing cluster 1700 modules. The pending task pool may comprise a number of slots (e.g., 32 slots) that comprise tasks assigned to be processed by a particular general processing cluster 1700. The active task pool may comprise a number of slots (e.g., 4 slots) for tasks that are actively being processed by the general processing cluster 1700 modules. As a general processing cluster 1700 finishes the execution of a task, that task is evicted from the active task pool for the general processing cluster 1700 and one of the other tasks from the pending task pool is selected and scheduled for execution on the general processing cluster 1700. If an active task has been idle on the general processing cluster 1700, such as while waiting for a data dependency to be resolved, then the active task may be evicted from the general processing cluster 1700 and returned to the pending task pool while another task in the pending task pool is selected and scheduled for execution on the general processing cluster 1700.
The work distribution unit 1610 communicates with the at least one general processing cluster 1700 module via crossbar 1614. The crossbar 1614 is an interconnect network that couples many of the units of the parallel processing unit 2008b to other units of the parallel processing unit 2008b. For example, the crossbar 1614 may be configured to couple the work distribution unit 1610 to a particular general processing cluster 1700. Although not shown explicitly, at least one other unit of the parallel processing unit 2008b may also be connected to the crossbar 1614 via the hub 1606.
The tasks are managed by the scheduler unit 1608 and dispatched to a general processing cluster 1700 by the work distribution unit 1610. The general processing cluster 1700 is configured to process the task and generate results. The results may be consumed by other tasks within the general processing cluster 1700, routed to a different general processing cluster 1700 via the crossbar 1614, or stored in the memory 1612. The results can be written to the memory 1612 via the memory partition unit 1800 modules, which implement a memory interface for reading and writing data to/from the memory 1612. The results can be transmitted to another parallel processing unit 2008b or CPU via the NVLink 1616. In an embodiment, the parallel processing unit 2008b includes a number U of memory partition unit 1800 modules that is equal to the number of separate and distinct memory 1612 devices coupled to the parallel processing unit 2008b. A memory partition unit 1800 is described in further detail in conjunction with
In an embodiment, a host processor executes a driver kernel that implements an application programming interface (API) that enables applications executing on the host processor to schedule operations for execution on the parallel processing unit 2008b. In an embodiment, multiple compute applications are simultaneously executed by the parallel processing unit 2008b and the parallel processing unit 2008b provides isolation, quality of service (QoS), and independent address spaces for the multiple compute applications. An application may generate instructions (e.g., API calls) that cause the driver kernel to generate tasks for execution by the parallel processing unit 2008b. The driver kernel outputs tasks to streams being processed by the parallel processing unit 2008b. Each task may comprise at least one group of related threads, referred to herein as a warp. In an embodiment, a warp comprises 32 related threads that may be executed in parallel. Cooperating threads may refer to a plurality of threads including instructions to perform the task and that may exchange data through shared memory. Threads and cooperating threads are described further in conjunction with
In an embodiment, the operation of the general processing cluster 1700 is controlled by the pipeline manager 1702. The pipeline manager 1702 manages the configuration of the at least one data processing cluster 1706 module for processing tasks allocated to the general processing cluster 1700. In an embodiment, the pipeline manager 1702 may configure at least one of the data processing cluster 1706 modules to implement at least a portion of a graphics rendering pipeline. For example, a data processing cluster 1706 may be configured to execute a vertex shader program on the programmable streaming multiprocessor 1900. The pipeline manager 1702 may also be configured to route packets received from the work distribution unit 1610 to the appropriate logical units within the general processing cluster 1700. For example, some packets may be routed to fixed function hardware units in the pre-raster operations unit 1704 and/or raster engine 1708 while other packets may be routed to the data processing cluster 1706 modules for processing by the primitive engine 1712 or the streaming multiprocessor 1900. In an embodiment, the pipeline manager 1702 may configure at least one of the data processing cluster 1706 modules to implement a neural network model and/or a computing pipeline.
The pre-raster operations unit 1704 is configured to route data generated by the raster engine 1708 and the data processing cluster 1706 modules to a Raster Operations (ROP) unit, described in detail in conjunction with
The raster engine 1708 includes a number of fixed function hardware units configured to perform various raster operations. In an embodiment, the raster engine 1708 includes a setup engine, a coarse raster engine, a culling engine, a clipping engine, a fine raster engine, and a tile coalescing engine. The setup engine receives transformed vertices and generates plane equations associated with the geometric primitive defined by the vertices. The plane equations are transmitted to the coarse raster engine to generate coverage information (e.g., an x, y coverage mask for a tile) for the primitive. The output of the coarse raster engine is transmitted to the culling engine where fragments associated with the primitive that fail a z-test are culled, and transmitted to a clipping engine where fragments lying outside a viewing frustum are clipped. Those fragments that survive clipping and culling may be passed to the fine raster engine to generate attributes for the pixel fragments based on the plane equations generated by the setup engine. The output of the raster engine 1708 comprises fragments to be processed, for example, by a fragment shader implemented within a data processing cluster 1706.
Each data processing cluster 1706 included in the general processing cluster 1700 includes an M-pipe controller 1710, a primitive engine 1712, and at least one streaming multiprocessor 1900 modules. The M-pipe controller 1710 controls the operation of the data processing cluster 1706, routing packets received from the pipeline manager 1702 to the appropriate units in the data processing cluster 1706. For example, packets associated with a vertex may be routed to the primitive engine 1712, which is configured to fetch vertex attributes associated with the vertex from the memory 1612. In contrast, packets associated with a shader program may be transmitted to the streaming multiprocessor 1900.
The streaming multiprocessor 1900 comprises a programmable streaming processor that is configured to process tasks represented by a number of threads. Each streaming multiprocessor 1900 is multi-threaded and configured to execute a plurality of threads (e.g., 32 threads) from a particular group of threads concurrently. In an embodiment, the streaming multiprocessor 1900 implements a Single-Instruction, Multiple-Data (SIMD) architecture where each thread in a group of threads (e.g., a warp) is configured to process a different set of data based on the same set of instructions. All threads in the group of threads execute the same instructions. In another embodiment, the streaming multiprocessor 1900 implements a Single-Instruction, Multiple Thread (SIMT) architecture where each thread in a group of threads is configured to process a different set of data based on the same set of instructions, but where individual threads in the group of threads are allowed to diverge during execution. In an embodiment, a program counter, call stack, and execution state is maintained for each warp, enabling concurrency between warps and serial execution within warps when threads within the warp diverge. In another embodiment, a program counter, call stack, and execution state is maintained for each individual thread, enabling equal concurrency between all threads, within and between warps. When execution state is maintained for each individual thread, threads executing the same instructions may be converged and executed in parallel for maximum efficiency. The streaming multiprocessor 1900 is described in detail in conjunction with
The memory management unit 1716 provides an interface between the general processing cluster 1700 and the memory partition unit 1800. The memory management unit 1716 may provide translation of virtual addresses into physical addresses, memory protection, and arbitration of memory requests. In an embodiment, the memory management unit 1716 provides one or more translation lookaside buffers (TLBs) for performing translation of virtual addresses into physical addresses in the memory 1612.
In an embodiment, the memory interface 1806 implements an HBM2 memory interface and Y equals half U. In an embodiment, the HBM2 memory stacks are located on the same physical package as the parallel processing unit 2008b, providing substantial power and area savings compared with traditional GDDR5 SDRAM systems. In an embodiment, each HBM2 stack includes four memory dies and Y equals 4, with HBM2 stack including two 128-bit channels per die for a total of 8 channels and a data bus width of 1024 bits.
In an embodiment, the memory 1612 supports Single-Error Correcting Double-Error Detecting (SECDED) Error Correction Code (ECC) to protect data. ECC provides improved reliability for compute applications that are sensitive to data corruption. Reliability is especially important in large-scale cluster computing environments where parallel processing unit 2008b modules process extensive datasets and/or run applications for extended periods.
In an embodiment, the parallel processing unit 2008b implements a multi-level memory hierarchy. In an embodiment, the memory partition unit 1800 supports a unified memory to provide a single unified virtual address space for CPU and parallel processing unit 2008b memory, enabling data sharing between virtual memory systems. In an embodiment the frequency of accesses by a parallel processing unit 2008b to memory located on other processors is traced to ensure that memory pages are moved to the physical memory of the parallel processing unit 2008b that is accessing the pages more frequently. In an embodiment, the NVLink 1616 supports address translation services allowing the parallel processing unit 2008b to directly access a CPU's page tables and providing full access to CPU memory by the parallel processing unit 2008b.
In an embodiment, copy engines transfer data between multiple parallel processing unit 2008b modules or between parallel processing unit 2008b modules and CPUs. The copy engines can generate page faults for addresses that are not mapped into the page tables. The memory partition unit 1800 can then service the page faults, mapping the addresses into the page table, after which the copy engine can perform the transfer. In a traditional system, memory is pinned (e.g., non-pageable) for multiple copy engine operations between multiple processors, reducing the available memory. With hardware page faulting, addresses can be passed to the copy engines without worrying if the memory pages are resident, and the copy process is transparent.
Data from the memory 1612 or other system memory may be fetched by the memory partition unit 1800 and stored in the level two cache 1804, which is located on-chip and is shared between the various general processing cluster 1700 modules. As shown, each memory partition unit 1800 includes a portion of the level two cache 1804 associated with a corresponding memory 1612 device. Lower level caches may then be implemented in various units within the general processing cluster 1700 modules. For example, each of the streaming multiprocessor 1900 modules may implement an L1 cache. The L1 cache is private memory that is dedicated to a particular streaming multiprocessor 1900. Data from the level two cache 1804 may be fetched and stored in each of the L1 caches for processing in the functional units of the streaming multiprocessor 1900 modules. The level two cache 1804 is coupled to the memory interface 1806 and the crossbar 1614.
The raster operations unit 1802 performs graphics raster operations related to pixel color, such as color compression, pixel blending, and the like. The raster operations unit 1802 also implements depth testing in conjunction with the raster engine 1708, receiving a depth for a sample location associated with a pixel fragment from the culling engine of the raster engine 1708. The depth is tested against a corresponding depth in a depth buffer for a sample location associated with the fragment. If the fragment passes the depth test for the sample location, then the raster operations unit 1802 updates the depth buffer and transmits a result of the depth test to the raster engine 1708. It will be appreciated that the number of partition memory partition unit 1800 modules may be different than the number of general processing cluster 1700 modules and, therefore, each raster operations unit 1802 may be coupled to each of the general processing cluster 1700 modules. The raster operations unit 1802 tracks packets received from the different general processing cluster 1700 modules and determines which general processing cluster 1700 that a result generated by the raster operations unit 1802 is routed to through the crossbar 1614. Although the raster operations unit 1802 is included within the memory partition unit 1800 in
As described above, the work distribution unit 1610 dispatches tasks for execution on the general processing cluster 1700 modules of the parallel processing unit 2008b. The tasks are allocated to a particular data processing cluster 1706 within a general processing cluster 1700 and, if the task is associated with a shader program, the task may be allocated to a streaming multiprocessor 1900. The scheduler unit 1608 receives the tasks from the work distribution unit 1610 and manages instruction scheduling for one or more thread blocks assigned to the streaming multiprocessor 1900. The scheduler unit 1904 schedules thread blocks for execution as warps of parallel threads, where each thread block is allocated at least one warp. In an embodiment, each warp executes 32 threads. The scheduler unit 1904 may manage a plurality of different thread blocks, allocating the warps to the different thread blocks and then dispatching instructions from the plurality of different cooperative groups to the various functional units (e.g., core 1910 modules, special function unit 1912 modules, and load/store unit 1914 modules) during each clock cycle.
Cooperative Groups is a programming model for organizing groups of communicating threads that allows developers to express the granularity at which threads are communicating, enabling the expression of richer, more efficient parallel decompositions. Cooperative launch APIs support synchronization amongst thread blocks for the execution of parallel algorithms. Traditional programming models provide a single, simple construct for synchronizing cooperating threads: a barrier across all threads of a thread block (e.g., the syncthreads( ) function). However, programmers would often like to define groups of threads at smaller than thread block granularities and synchronize within the defined groups to enable improved performance, design flexibility, and software reuse in the form of collective group-wide function interfaces.
Cooperative Groups enables programmers to define groups of threads explicitly at sub-block (e.g., as small as a single thread) and multi-block granularities, and to perform collective operations such as synchronization on the threads in a cooperative group. The programming model supports clean composition across software boundaries, so that libraries and utility functions can synchronize safely within their local context without having to make assumptions about convergence. Cooperative Groups primitives enable new patterns of cooperative parallelism, including producer-consumer parallelism, opportunistic parallelism, and global synchronization across an entire grid of thread blocks.
A dispatch 1906 unit is configured within the scheduler unit 1904 to transmit instructions to one or more of the functional units. In one embodiment, the scheduler unit 1904 includes two dispatch 1906 units that enable two different instructions from the same warp to be dispatched during each clock cycle. In alternative embodiments, each scheduler unit 1904 may include a single dispatch 1906 unit or additional dispatch 1906 units.
Each streaming multiprocessor 1900 includes a register file 1908 that provides a set of registers for the functional units of the streaming multiprocessor 1900. In an embodiment, the register file 1908 is divided between each of the functional units such that each functional unit is allocated a dedicated portion of the register file 1908. In another embodiment, the register file 1908 is divided between the different warps being executed by the streaming multiprocessor 1900. The register file 1908 provides temporary storage for operands connected to the data paths of the functional units.
Each streaming multiprocessor 1900 comprises L processing core 1910 modules. In an embodiment, the streaming multiprocessor 1900 includes a large number (e.g., 128, etc.) of distinct processing core 1910 modules. Each core 1910 may include a fully-pipelined, single-precision, double-precision, and/or mixed precision processing unit that includes a floating point arithmetic logic unit and an integer arithmetic logic unit. In an embodiment, the floating point arithmetic logic units implement the IEEE 754-2008 standard for floating point arithmetic. In an embodiment, the core 1910 modules include 64 single-precision (32-bit) floating point cores, 64 integer cores, 32 double-precision (64-bit) floating point cores, and 8 tensor cores.
Tensor cores configured to perform matrix operations, and, in an embodiment, one or more tensor cores are included in the core 1910 modules. In particular, the tensor cores are configured to perform deep learning matrix arithmetic, such as convolution operations for neural network training and inferencing. In an embodiment, each tensor core operates on a 4×4 matrix and performs a matrix multiply and accumulate operation D=A′B+C, where A, B, C, and D are 4×4 matrices.
In an embodiment, the matrix multiply inputs A and B are 16-bit floating point matrices, while the accumulation matrices C and D may be 16-bit floating point or 32-bit floating point matrices. Tensor Cores operate on 16-bit floating point input data with 32-bit floating point accumulation. The 16-bit floating point multiply takes 64 operations and results in a full precision product that is then accumulated using 32-bit floating point addition with the other intermediate products for a 4×4×4 matrix multiply. In practice, Tensor Cores are used to perform much larger two-dimensional or higher dimensional matrix operations, built up from these smaller elements. An API, such as CUDA 9 C++ API, exposes specialized matrix load, matrix multiply and accumulate, and matrix store operations to efficiently use Tensor Cores from a CUDA-C++ program. At the CUDA level, the warp-level interface assumes 16×16 size matrices spanning all 32 threads of the warp.
Each streaming multiprocessor 1900 also comprises M special function unit 1912 modules that perform special functions (e.g., attribute evaluation, reciprocal square root, and the like). In an embodiment, the special function unit 1912 modules may include a tree traversal unit configured to traverse a hierarchical tree data structure. In an embodiment, the special function unit 1912 modules may include texture unit configured to perform texture map filtering operations. In an embodiment, the texture units are configured to load texture maps (e.g., a 2D array of texels) from the memory 1612 and sample the texture maps to produce sampled texture values for use in shader programs executed by the streaming multiprocessor 1900. In an embodiment, the texture maps are stored in the shared memory/L1 cache 1918. The texture units implement texture operations such as filtering operations using mip-maps (e.g., texture maps of varying levels of detail). In an embodiment, each streaming multiprocessor 1900 includes two texture units.
Each streaming multiprocessor 1900 also comprises N load/store unit 1914 modules that implement load and store operations between the shared memory/L1 cache 1918 and the register file 1908. Each streaming multiprocessor 1900 includes an interconnect network 1916 that connects each of the functional units to the register file 1908 and the load/store unit 1914 to the register file 1908 and shared memory/L1 cache 1918. In an embodiment, the interconnect network 1916 is a crossbar that can be configured to connect any of the functional units to any of the registers in the register file 1908 and connect the load/store unit 1914 modules to the register file 1908 and memory locations in shared memory/L1 cache 1918.
The shared memory/L1 cache 1918 is an array of on-chip memory that allows for data storage and communication between the streaming multiprocessor 1900 and the primitive engine 1712 and between threads in the streaming multiprocessor 1900. In an embodiment, the shared memory/L1 cache 1918 comprises 128 KB of storage capacity and is in the path from the streaming multiprocessor 1900 to the memory partition unit 1800. The shared memory/L1 cache 1918 can be used to cache reads and writes. One or more of the shared memory/L1 cache 1918, level two cache 1804, and memory 1612 are backing stores.
Combining data cache and shared memory functionality into a single memory block provides the best overall performance for both types of memory accesses. The capacity is usable as a cache by programs that do not use shared memory. For example, if shared memory is configured to use half of the capacity, texture and load/store operations can use the remaining capacity. Integration within the shared memory/L1 cache 1918 enables the shared memory/L1 cache 1918 to function as a high-throughput conduit for streaming data while simultaneously providing high-bandwidth and low-latency access to frequently reused data.
When configured for general purpose parallel computation, a simpler configuration can be used compared with graphics processing. Specifically, the fixed function graphics processing units shown in
The parallel processing unit 2008b may be included in a desktop computer, a laptop computer, a tablet computer, servers, supercomputers, a smart-phone (e.g., a wireless, hand-held device), personal digital assistant (PDA), a digital camera, a vehicle, a head mounted display, a hand-held electronic device, and the like. In an embodiment, the parallel processing unit 2008b is embodied on a single semiconductor substrate. In another embodiment, the parallel processing unit 2008b is included in a system-on-a-chip (SoC) along with one or more other devices such as additional parallel processing unit 2008b modules, the memory 1612, a reduced instruction set computer (RISC) CPU, a memory management unit (MMU), a digital-to-analog converter (DAC), and the like.
In an embodiment, the parallel processing unit 2008b may be included on a graphics card that includes one or more memory devices. The graphics card may be configured to interface with a PCIe slot on a motherboard of a desktop computer. In yet another embodiment, the parallel processing unit 2008b may be an integrated graphics processing unit (iGPU) or parallel processor included in the chipset of the motherboard.
Systems with multiple GPUs and CPUs are used in a variety of industries as developers expose and leverage parallelism in applications such as artificial intelligence computing. High-performance GPU-accelerated systems with tens to many thousands of compute nodes are deployed in data centers, research facilities, and supercomputers to solve ever larger problems. As the number of processing devices within the high-performance systems increases, the communication and data transfer mechanisms need to scale to support the increased bandwidth.
In another embodiment (not shown), the NVLink 1616 provides one or more high-speed communication links between each of the parallel processing unit modules (parallel processing unit 2008a, parallel processing unit 2008b, parallel processing unit 2008c . . . parallel processing unit 2008d) and the central processing unit 2006 and the switch 2004 interfaces between the interconnect 1618 and each of the parallel processing unit modules. The parallel processing unit modules, memory 1612 modules, and interconnect 1618 may be situated on a single semiconductor platform to form a parallel processing module 2002. In yet another embodiment (not shown), the interconnect 1618 provides one or more communication links between each of the parallel processing unit modules and the central processing unit 2006 and the switch 2004 interfaces between each of the parallel processing unit modules using the NVLink 1616 to provide one or more high-speed communication links between the parallel processing unit modules. In another embodiment (not shown), the NVLink 1616 provides one or more high-speed communication links between the parallel processing unit modules and the central processing unit 2006 through the switch 2004. In yet another embodiment (not shown), the interconnect 1618 provides one or more communication links between each of the parallel processing unit modules directly. One or more of the NVLink 1616 high-speed communication links may be implemented as a physical NVLink interconnect or either an on-chip or on-die interconnect using the same protocol as the NVLink 1616.
In the context of the present description, a single semiconductor platform may refer to a sole unitary semiconductor-based integrated circuit fabricated on a die or chip. It should be noted that the term single semiconductor platform may also refer to multi-chip modules with increased connectivity which simulate on-chip operation and make substantial improvements over utilizing a traditional bus implementation. Of course, the various circuits or devices may also be situated separately or in various combinations of semiconductor platforms per the desires of the user. Alternately, the parallel processing module 2002 may be implemented as a circuit board substrate and each of the parallel processing unit modules and/or memory 1612 modules may be packaged devices. In an embodiment, the central processing unit 2006, switch 2004, and the parallel processing module 2002 are situated on a single semiconductor platform.
In an embodiment, the signaling rate of each NVLink 1616 is 20 to 25 Gigabits/second and each parallel processing unit module includes six NVLink 1616 interfaces (as shown in
In an embodiment, the NVLink 1616 allows direct load/store/atomic access from the central processing unit 2006 to each parallel processing unit module's memory 1612. In an embodiment, the NVLink 1616 supports coherency operations, allowing data read from the memory 1612 modules to be stored in the cache hierarchy of the central processing unit 2006, reducing cache access latency for the central processing unit 2006. In an embodiment, the NVLink 1616 includes support for Address Translation Services (ATS), enabling the parallel processing unit module to directly access page tables within the central processing unit 2006. One or more of the NVLink 1616 may also be configured to operate in a low-power mode.
The exemplary processing system 2100 also includes input devices 2108, the parallel processing module 2002, and display devices 2106, e.g. a CRT (cathode ray tube), LCD (liquid crystal display), LED (light emitting diode), plasma display or the like. User input may be received from the input devices 2108, e.g., keyboard, mouse, touchpad, microphone, and the like. Each of the foregoing modules and/or devices may even be situated on a single semiconductor platform to form the exemplary processing system 2100. Alternately, the various modules may also be situated separately or in various combinations of semiconductor platforms per the desires of the user.
Further, the exemplary processing system 2100 may be coupled to a network (e.g., a telecommunications network, local area network (LAN), wireless network, wide area network (WAN) such as the Internet, peer-to-peer network, cable network, or the like) through a network interface 2104 for communication purposes.
The exemplary processing system 2100 may also include a secondary storage (not shown). The secondary storage includes, for example, a hard disk drive and/or a removable storage drive, representing a floppy disk drive, a magnetic tape drive, a compact disk drive, digital versatile disk (DVD) drive, recording device, universal serial bus (USB) flash memory. The removable storage drive reads from and/or writes to a removable storage unit in a well-known manner.
Computer programs, or computer control logic algorithms, may be stored in the main memory 2102 and/or the secondary storage. Such computer programs, when executed, enable the exemplary processing system 2100 to perform various functions. The main memory 2102, the storage, and/or any other storage are possible examples of computer-readable media.
The architecture and/or functionality of the various previous figures may be implemented in the context of a general computer system, a circuit board system, a game console system dedicated for entertainment purposes, an application-specific system, and/or any other desired system. For example, the exemplary processing system 2100 may take the form of a desktop computer, a laptop computer, a tablet computer, servers, supercomputers, a smart-phone (e.g., a wireless, hand-held device), personal digital assistant (PDA), a digital camera, a vehicle, a head mounted display, a hand-held electronic device, a mobile phone device, a television, workstation, game consoles, embedded system, and/or any other type of logic.
While various embodiments have been described above, it should be understood that they have been presented by way of example only, and not limitation. Thus, the breadth and scope of an embodiment should not be limited by any of the above-described exemplary embodiments, but should be defined in accordance with the following claims and their equivalents.
An application writes model data for a scene (e.g., a collection of vertices and attributes) to a memory such as a system memory or memory 1612. The model data defines each of the objects that may be visible on a display. The application then makes an API call to the driver kernel that requests the model data to be rendered and displayed. The driver kernel reads the model data and writes commands to the one or more streams to perform operations to process the model data. The commands may reference different shader programs to be implemented on the streaming multiprocessor 1900 modules of the parallel processing unit 2008b including one or more of a vertex shader, hull shader, domain shader, geometry shader, and a pixel shader. For example, one or more of the streaming multiprocessor 1900 modules may be configured to execute a vertex shader program that processes a number of vertices defined by the model data. In an embodiment, the different streaming multiprocessor 1900 modules may be configured to execute different shader programs concurrently. For example, a first subset of streaming multiprocessor 1900 modules may be configured to execute a vertex shader program while a second subset of streaming multiprocessor 1900 modules may be configured to execute a pixel shader program. The first subset of streaming multiprocessor 1900 modules processes vertex data to produce processed vertex data and writes the processed vertex data to the level two cache 1804 and/or the memory 1612. After the processed vertex data is rasterized (e.g., transformed from three-dimensional data into two-dimensional data in screen space) to produce fragment data, the second subset of streaming multiprocessor 1900 modules executes a pixel shader to produce processed fragment data, which is then blended with other processed fragment data and written to the frame buffer in memory 1612. The vertex shader program and pixel shader program may execute concurrently, processing different data from the same scene in a pipelined fashion until all of the model data for the scene has been rendered to the frame buffer. Then, the contents of the frame buffer are transmitted to a display controller for display on a display device.
The graphics processing pipeline 2200 is an abstract flow diagram of the processing steps implemented to generate 2D computer-generated images from 3D geometry data. As is well-known, pipeline architectures may perform long latency operations more efficiently by splitting up the operation into a plurality of stages, where the output of each stage is coupled to the input of the next successive stage. Thus, the graphics processing pipeline 2200 receives input data 601 that is transmitted from one stage to the next stage of the graphics processing pipeline 2200 to generate output data 2204. In an embodiment, the graphics processing pipeline 2200 may represent a graphics processing pipeline defined by the OpenGL® API. As an option, the graphics processing pipeline 2200 may be implemented in the context of the functionality and architecture of the previous Figures and/or any subsequent Figure(s).
As shown in
The data assembly 2206 stage receives the input data 2202 that specifies vertex data for high-order surfaces, primitives, or the like. The data assembly 2206 stage collects the vertex data in a temporary storage or queue, such as by receiving a command from the host processor that includes a pointer to a buffer in memory and reading the vertex data from the buffer. The vertex data is then transmitted to the vertex shading 2208 stage for processing.
The vertex shading 2208 stage processes vertex data by performing a set of operations (e.g., a vertex shader or a program) once for each of the vertices. Vertices may be, e.g., specified as a 4-coordinate vector (e.g., <x, y, z, w>) associated with one or more vertex attributes (e.g., color, texture coordinates, surface normal, etc.). The vertex shading 2208 stage may manipulate individual vertex attributes such as position, color, texture coordinates, and the like. In other words, the vertex shading 2208 stage performs operations on the vertex coordinates or other vertex attributes associated with a vertex. Such operations commonly including lighting operations (e.g., modifying color attributes for a vertex) and transformation operations (e.g., modifying the coordinate space for a vertex). For example, vertices may be specified using coordinates in an object-coordinate space, which are transformed by multiplying the coordinates by a matrix that translates the coordinates from the object-coordinate space into a world space or a normalized-device-coordinate (NCD) space. The vertex shading 2208 stage generates transformed vertex data that is transmitted to the primitive assembly 2210 stage.
The primitive assembly 2210 stage collects vertices output by the vertex shading 2208 stage and groups the vertices into geometric primitives for processing by the geometry shading 2212 stage. For example, the primitive assembly 2210 stage may be configured to group every three consecutive vertices as a geometric primitive (e.g., a triangle) for transmission to the geometry shading 2212 stage. In some embodiments, specific vertices may be reused for consecutive geometric primitives (e.g., two consecutive triangles in a triangle strip may share two vertices). The primitive assembly 2210 stage transmits geometric primitives (e.g., a collection of associated vertices) to the geometry shading 2212 stage.
The geometry shading 2212 stage processes geometric primitives by performing a set of operations (e.g., a geometry shader or program) on the geometric primitives. Tessellation operations may generate one or more geometric primitives from each geometric primitive. In other words, the geometry shading 2212 stage may subdivide each geometric primitive into a finer mesh of two or more geometric primitives for processing by the rest of the graphics processing pipeline 2200. The geometry shading 2212 stage transmits geometric primitives to the viewport SCC 2214 stage.
In an embodiment, the graphics processing pipeline 2200 may operate within a streaming multiprocessor and the vertex shading 2208 stage, the primitive assembly 2210 stage, the geometry shading 2212 stage, the fragment shading 2218 stage, and/or hardware/software associated therewith, may sequentially perform processing operations. Once the sequential processing operations are complete, in an embodiment, the viewport SCC 2214 stage may utilize the data. In an embodiment, primitive data processed by one or more of the stages in the graphics processing pipeline 2200 may be written to a cache (e.g. L1 cache, a vertex cache, etc.). In this case, in an embodiment, the viewport SCC 2214 stage may access the data in the cache. In an embodiment, the viewport SCC 2214 stage and the rasterization 2216 stage are implemented as fixed function circuitry.
The viewport SCC 2214 stage performs viewport scaling, culling, and clipping of the geometric primitives. Each surface being rendered to is associated with an abstract camera position. The camera position represents a location of a viewer looking at the scene and defines a viewing frustum that encloses the objects of the scene. The viewing frustum may include a viewing plane, a rear plane, and four clipping planes. Any geometric primitive outside of the viewing frustum may be culled (e.g., discarded) because the geometric primitive does not contribute to the final rendered scene. Any geometric primitive that is partially inside the viewing frustum and partially outside the viewing frustum may be clipped (e.g., transformed into a new geometric primitive that is enclosed within the viewing frustum. Furthermore, geometric primitives may each be scaled based on a depth of the viewing frustum. Potentially visible geometric primitives are then transmitted to the rasterization 2216 stage.
The rasterization 2216 stage converts the 3D geometric primitives into 2D fragments (e.g. capable of being utilized for display, etc.). The rasterization 2216 stage may be configured to utilize the vertices of the geometric primitives to setup a set of plane equations from which various attributes can be interpolated. The rasterization 2216 stage may also compute a coverage mask for a plurality of pixels that indicates whether one or more sample locations for the pixel intercept the geometric primitive. In an embodiment, z-testing may also be performed to determine if the geometric primitive is occluded by other geometric primitives that have already been rasterized. The rasterization 2216 stage generates fragment data (e.g., interpolated vertex attributes associated with a particular sample location for each covered pixel) that are transmitted to the fragment shading 2218 stage.
The fragment shading 2218 stage processes fragment data by performing a set of operations (e.g., a fragment shader or a program) on each of the fragments. The fragment shading 2218 stage may generate pixel data (e.g., color values) for the fragment such as by performing lighting operations or sampling texture maps using interpolated texture coordinates for the fragment. The fragment shading 2218 stage generates pixel data that is transmitted to the raster operations 2220 stage.
The raster operations 2220 stage may perform various operations on the pixel data such as performing alpha tests, stencil tests, and blending the pixel data with other pixel data corresponding to other fragments associated with the pixel. When the raster operations 2220 stage has finished processing the pixel data (e.g., the output data 2204), the pixel data may be written to a render target such as a frame buffer, a color buffer, or the like.
It may be appreciated that one or more additional stages may be included in the graphics processing pipeline 2200 in addition to or in lieu of one or more of the stages described above. Various implementations of the abstract graphics processing pipeline may implement different stages. Furthermore, one or more of the stages described above may be excluded from the graphics processing pipeline in some embodiments (such as the geometry shading 2212 stage). Other types of graphics processing pipelines are contemplated as being within the scope of the present disclosure. Furthermore, any of the stages of the graphics processing pipeline 2200 may be implemented by one or more dedicated hardware units within a graphics processor such as parallel processing unit 2008b. Other stages of the graphics processing pipeline 2200 may be implemented by programmable hardware units such as the streaming multiprocessor 1900 of the parallel processing unit 2008b.
The graphics processing pipeline 2200 may be implemented via an application executed by a host processor, such as a CPU. In an embodiment, a device driver may implement an application programming interface (API) that defines various functions that can be utilized by an application in order to generate graphical data for display. The device driver is a software program that includes a plurality of instructions that control the operation of the parallel processing unit 2008b. The API provides an abstraction for a programmer that lets a programmer utilize specialized graphics hardware, such as the parallel processing unit 2008b, to generate the graphical data without requiring the programmer to utilize the specific instruction set for the parallel processing unit 2008b. The application may include an API call that is routed to the device driver for the parallel processing unit 2008b. The device driver interprets the API call and performs various operations to respond to the API call. In some instances, the device driver may perform operations by executing instructions on the CPU. In other instances, the device driver may perform operations, at least in part, by launching operations on the parallel processing unit 2008b utilizing an input/output interface between the CPU and the parallel processing unit 2008b. In an embodiment, the device driver is configured to implement the graphics processing pipeline 2200 utilizing the hardware of the parallel processing unit 2008b.
Various programs may be executed within the parallel processing unit 2008b in order to implement the various stages of the graphics processing pipeline 2200. For example, the device driver may launch a kernel on the parallel processing unit 2008b to perform the vertex shading 2208 stage on one streaming multiprocessor 1900 (or multiple streaming multiprocessor 1900 modules). The device driver (or the initial kernel executed by the parallel processing unit 2008b) may also launch other kernels on the parallel processing unit 2008b to perform other stages of the graphics processing pipeline 2200, such as the geometry shading 2212 stage and the fragment shading 2218 stage. In addition, some of the stages of the graphics processing pipeline 2200 may be implemented on fixed unit hardware such as a rasterizer or a data assembler implemented within the parallel processing unit 2008b. It may be appreciated that results from one kernel may be processed by one or more intervening fixed function hardware units before being processed by a subsequent kernel on a streaming multiprocessor 1900.
Various functional operations described herein may be implemented in logic that is referred to using a noun or noun phrase reflecting said operation or function. For example, an association operation may be carried out by an “associator” or “correlator”. Likewise, switching may be carried out by a “switch”, selection by a “selector”, and so on.
Within this disclosure, different entities (which may variously be referred to as “units,” “circuits,” other components, etc.) may be described or claimed as “configured” to perform one or more tasks or operations. This formulation—[entity] configured to [perform one or more tasks]—is used herein to refer to structure (i.e., something physical, such as an electronic circuit). More specifically, this formulation is used to indicate that this structure is arranged to perform the one or more tasks during operation. A structure can be said to be “configured to” perform some task even if the structure is not currently being operated. A “credit distribution circuit configured to distribute credits to a plurality of processor cores” is intended to cover, for example, an integrated circuit that has circuitry that performs this function during operation, even if the integrated circuit in question is not currently being used (e.g., a power supply is not connected to it). Thus, an entity described or recited as “configured to” perform some task refers to something physical, such as a device, circuit, memory storing program instructions executable to implement the task, etc. This phrase is not used herein to refer to something intangible.
The term “configured to” is not intended to mean “configurable to.” An unprogrammed FPGA, for example, would not be considered to be “configured to” perform some specific function, although it may be “configurable to” perform that function after programming.
Reciting in the appended claims that a structure is “configured to” perform one or more tasks is expressly intended not to invoke 35 U.S.C. § 112(f) for that claim element. Accordingly, claims in this application that do not otherwise include the “means for” [performing a function] construct should not be interpreted under 35 U.S.C § 112(f).
As used herein, the term “based on” is used to describe one or more factors that affect a determination. This term does not foreclose the possibility that additional factors may affect the determination. That is, a determination may be solely based on specified factors or based on the specified factors as well as other, unspecified factors. Consider the phrase “determine A based on B.” This phrase specifies that B is a factor that is used to determine A or that affects the determination of A. This phrase does not foreclose that the determination of A may also be based on some other factor, such as C. This phrase is also intended to cover an embodiment in which A is determined based solely on B. As used herein, the phrase “based on” is synonymous with the phrase “based at least in part on.”
As used herein, the phrase “in response to” describes one or more factors that trigger an effect. This phrase does not foreclose the possibility that additional factors may affect or otherwise trigger the effect. That is, an effect may be solely in response to those factors, or may be in response to the specified factors as well as other, unspecified factors. Consider the phrase “perform A in response to B.” This phrase specifies that B is a factor that triggers the performance of A. This phrase does not foreclose that performing A may also be in response to some other factor, such as C. This phrase is also intended to cover an embodiment in which A is performed solely in response to B.
As used herein, the terms “first,” “second,” etc. are used as labels for nouns that they precede, and do not imply any type of ordering (e.g., spatial, temporal, logical, etc.), unless stated otherwise. For example, in a register file having eight registers, the terms “first register” and “second register” can be used to refer to any two of the eight registers, and not, for example, logical registers 0 and 1 specifically.
When used in the claims, the term “or” is used as an inclusive or and not as an exclusive or. For example, the phrase “at least one of x, y, or z” means any one of x, y, and z, as well as any combination thereof.
As used herein, a recitation of “and/or” with respect to two or more elements should be interpreted to mean only one element, or a combination of elements. For example, “element A, element B, and/or element C” may include only element A, only element B, only element C, element A and element B, element A and element C, element B and element C, or elements A, B, and C. In addition, “at least one of element A or element B” may include at least one of element A, at least one of element B, or at least one of element A and at least one of element B. Further, “at least one of element A and element B” may include at least one of element A, at least one of element B, or at least one of element A and at least one of element B.
The subject matter of the present disclosure is described with specificity herein to meet statutory requirements. However, the description itself is not intended to limit the scope of this disclosure. Rather, the claimed subject matter may also be embodied in other ways, to include different steps or combinations of steps similar to the ones described in this document, in conjunction with other present or future technologies. Moreover, although the terms “step” and/or “block” may be used herein to connote different elements of methods employed, the terms should not be interpreted as implying any particular order among or between various steps herein disclosed unless and except when the order of individual steps is explicitly described.
Having thus described illustrative embodiments in detail, it may be apparent that modifications and variations are possible without departing from the scope of the disclosure as claimed. The scope of disclosed subject matter is not limited to the depicted embodiments but is rather set forth in the following Claims.
This application claims priority and benefit under 35 U.S.C. 119(e) to U.S. Application Ser. No. 62/817,413, filed on Mar. 12, 2019, the contents of which are incorporated herein by reference in their entirety.
Number | Date | Country | |
---|---|---|---|
63071968 | Aug 2020 | US |