Sparse computation mechanism for machine learning
Through the sparse matrix processing mechanism, the parallel capability of the graphics processor is used to identify and process non-zero elements, detect and compress sparse data segments, and solve the problem of inefficient efficiency of existing systems when processing sparse matrices, and realize more efficient computing resources Utilization and processing speed.
Patent Information
- Application Number
- CN201810310968.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2017-04-09
- Filing Date
- 2018-04-09
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2038-04-09
AI Technical Summary
Existing parallel graphics data processing systems are inefficient when processing sparse matrices, and cannot fully utilize the parallel processing capabilities of graphics processors, resulting in wasted computing resources and extended processing time.
The sparse matrix processing mechanism is adopted, and multiplication scheduling of zero-value operands is identified and blocked by the scheduler. The pattern tracking logic detects the sparse data segments, compresses the sparse matrix and stores it in the sparse compression buffer, and partitions the execution unit to improve processing efficiency.
It significantly improves the efficiency of sparse matrix processing, reduces the processing load of the graphics processor, optimizes the utilization of computing resources, and shortens the processing time.
Smart Images

Figure CN108694692B_ABST
Abstract
Description
Technical Field
[0001] Embodiments relate generally to data processing, and more particularly to data processing via a general purpose graphics processing unit. Background Art
[0002] Current parallel graphics data processing includes systems and methods developed for performing specific operations on graphics data, such as, for example, linear interpolation, tessellation, rasterization, texture mapping, depth testing, etc. Traditionally, graphics processors have used fixed-function compute units to process graphics data; however, recently, portions of graphics processors have become programmable, enabling such processors to support a wider variety of operations for processing vertex and fragment data.
[0003] To further improve performance, graphics processors typically implement processing techniques (such as pipelining) that attempt to process as much graphics data in parallel as possible throughout different parts of the graphics pipeline. Parallel graphics processors with a single instruction multiple thread (SIMT) architecture are designed to maximize the amount of parallel processing in the graphics pipeline. In a SIMT architecture, groups of parallel threads attempt to execute program instructions together synchronously as often as possible to improve processing efficiency. A general overview of software and hardware for a SIMT architecture can be found in Shane Cook's CUDA Programming ( CUDA Programming ), Chapter 3, pp. 37-51 (2013). BRIEF DESCRIPTION OF THE DRAWINGS
[0004] In order to understand the above-recorded features of the present embodiment in detail, the above briefly summarized embodiments may be described in more detail by reference to the embodiments, some of which are shown in the accompanying drawings. However, it should be noted that the drawings only show typical embodiments and are therefore not to be considered as limiting the scope thereof.
[0005] Figure 1 is a block diagram illustrating a computer system configured to implement one or more aspects of the embodiments described herein;
[0006] Figures 2A-2D shows a parallel processor component according to an embodiment;
[0007] Figure 3A-3B is a block diagram of a graphics multiprocessor according to an embodiment;
[0008] Figures 4A-4F An exemplary architecture is shown in which multiple GPUs are communicatively coupled to multiple multi-core processors;
[0009] Figure 5 shows a graphics processing pipeline according to an embodiment;
[0010] Figure 6 A computing device using a sparse computing mechanism according to an embodiment is shown;
[0011] Fig. 7A An exemplary matrix multiplication is shown;
[0012] Figure 7B One embodiment of processing elements with a sparse scheduler is shown;
[0013] Figure 7C One embodiment of a sparse tracker is shown;
[0014] Fig.7D &7E shows an embodiment of a graphics processor;
[0015] Figure 8 shows a machine learning software stack according to an embodiment;
[0016] Fig. 9 A highly parallel general purpose graphics processing unit is shown according to an embodiment;
[0017] Fig.10 A multi-GPU computing system according to an embodiment is shown;
[0018] Figures 11A-11B The layers of an exemplary deep neural network are shown;
[0019] Fig.12 An exemplary recurrent neural network is shown;
[0020] Fig.13 shows the training and deployment of a deep neural network;
[0021] Fig.14 is a block diagram illustrating distributed learning;
[0022] Fig.15 An exemplary inference system on a chip (SOC) suitable for performing inference using a trained model is shown;
[0023] Fig.16 is a block diagram of a processing system according to an embodiment;
[0024] Fig.17 is a block diagram of a processor according to an embodiment;
[0025] Fig.18 is a block diagram of a graphics processor according to an embodiment;
[0026] Fig.19 is a block diagram of a graphics processing engine of a graphics processor in accordance with some embodiments;
[0027] Fig. 20is a block diagram of a graphics processor provided by an additional embodiment;
[0028] Fig.21 Thread execution logic is shown, which includes an array of processing elements employed in some embodiments;
[0029] Fig. 22 is a block diagram illustrating a graphics processor instruction format according to some embodiments;
[0030] Fig.23 is a block diagram of a graphics processor according to another embodiment;
[0031] Figures 24A-24B shows a graphics processor command format and command sequence according to some embodiments;
[0032] Fig.25 An exemplary graphical software architecture for a data processing system according to some embodiments is shown;
[0033] Fig.26 is a block diagram showing an IP core development system according to an embodiment;
[0034] Fig. 27 is a block diagram illustrating an exemplary system-on-chip integrated circuit according to an embodiment;
[0035] Fig.28 is a block diagram illustrating an additional exemplary graphics processor; and
[0036] Fig.29 is a block diagram illustrating an additional exemplary graphics processor of a system on a chip integrated circuit according to an embodiment. DETAILED DESCRIPTION
[0037] In an embodiment, a mechanism for executing a sparse matrix processing mechanism is disclosed. In some embodiments, the processing mechanism includes a processing element, the processing element includes a scheduler, the scheduler is used to identify operands with zero values and prevent the scheduling of operands with zero values in a multiplication unit. In other embodiments, the processing mechanism includes pattern tracking logic, the pattern tracking logic is used to detect one or more sparse data segments in a storage block of data and record the address location of each detected sparse data segment. In still other embodiments, for processing, the processing mechanism compresses the sparse matrix and stores one or more frequently used sparse matrices in a sparse compression buffer for execution. In a further embodiment, the processing mechanism partitions a plurality of execution units (EUs) and assigns each partition of the EU to an execution thread associated with a neural network layer.
[0038] In the following description, many specific details are set forth to provide a more comprehensive understanding. However, it will be apparent to one of ordinary skill in the art that the embodiments described herein may be practiced without one or more of these specific details. In other instances, well-known features have not been described to avoid obscuring the details of the present embodiment.
[0039] System Overview
[0040] Figure 1 1 is a block diagram illustrating a computing system configured to implement one or more aspects of the embodiments described herein. The computing system 100 includes a processing subsystem 101 having one or more processors 102 and a system memory 104, the one or more processors 102 communicating with the system memory 104 via an interconnect path that may include a memory hub 105. The memory hub 105 may be a separate component within a chipset component, or may be integrated within the one or more processors 102. The memory hub 105 is coupled to an I / O subsystem 111 via a communication link 106. The I / O subsystem 111 includes an I / O hub 107 that may enable the computing system 100 to receive input from one or more input devices 108. Additionally, the I / O hub 107 may enable a display controller to provide output to one or more display devices 110A, which may be included in the one or more processors 102. In one embodiment, the one or more display devices 110A coupled to the I / O hub 107 may include local, internal, or embedded display devices.
[0041] In one embodiment, the processing subsystem 101 includes one or more parallel processors 112, which are coupled to the memory hub 105 via a bus or other communication link 113. The communication link 113 can be one of any number of standard-based communication link technologies or protocols (such as, but not limited to, PCI Express), or can be a vendor-specific communication interface or communication structure. In one embodiment, the one or more parallel processors 112 form a computationally focused parallel or vector processing system that includes a large number of processing cores and / or processing clusters (such as, a many-in-one (MIC) processor). In one embodiment, the one or more parallel processors 112 form a graphics processing subsystem that can output pixels to one of the one or more display devices 110A coupled via the I / O hub 107. The one or more parallel processors 112 may also include a display controller and display interface (not shown) to enable direct connection to one or more display devices 110B.
[0042] Within the I / O subsystem 111, a system storage unit 114 may be connected to the I / O hub 107 to provide a storage mechanism for the computing system 100. An I / O switch 116 may be used to provide an interface mechanism to enable connection between the I / O hub 107 and other components, such as a network adapter 118 and / or a wireless network adapter 119 that may be integrated into the platform, and various other devices that may be added via one or more plug-in devices 120. The network adapter 118 may be an Ethernet adapter or another wired network adapter. The wireless network adapter 119 may include one or more of the following: Wi-Fi, Bluetooth, near field communication (NFC), or another network device including one or more wireless radios.
[0043] The computing system 100 may include other components not explicitly shown, including USB or other port connections, optical storage drives, video capture devices, and the like, which may also be connected to the I / O hub 107. Figure 1 The communication paths interconnecting the various components in the system may be implemented using any suitable protocol, such as a PCI (Peripheral Component Interconnect) based protocol (e.g., PCI Express) or any other bus or point-to-point communication interface and / or protocol (such as, NV-Link high-speed interconnect, or interconnect protocols known in the art).
[0044] In one embodiment, the one or more parallel processors 112 incorporate circuits optimized for graphics and video processing (including, for example, video output circuits) and constitute a graphics processing unit (GPU). In another embodiment, the one or more parallel processors 112 incorporate circuits optimized for general-purpose processing while maintaining the underlying computing architecture described in more detail herein. In yet another embodiment, the components of the computing system 100 may be integrated on a single integrated circuit along with one or more other system elements. For example, the one or more parallel processors 112, the memory hub 105, the processor 102, and the I / O hub 107 may be integrated into a system-on-chip (SoC) integrated circuit. Alternatively, the components of the computing system 100 may be integrated into a single package to form a system-in-package (SIP) configuration. In one embodiment, at least a portion of the components of the computing system 100 may be integrated into a multi-chip module (MCM), which may be interconnected with other multi-chip modules into a modular computing system.
[0045] It will be appreciated that the computing system 100 shown herein is illustrative and that variations and modifications are possible. The connection topology, including the number and arrangement of bridges, the number of processor(s) 102, and the number of parallel processor(s) 112, may be modified as desired. For example, in some embodiments, the system memory 104 is connected to the processor(s) 102 directly rather than through a bridge, while other devices communicate with the processor(s) 102 and the system memory 104 via the memory hub 105. In other alternative topologies, the parallel processor(s) 112 are connected to the I / O hub 107 or directly to one of the processor(s) 102, rather than to the memory hub 105. In other embodiments, the I / O hub 107 and the memory hub 105 may be integrated into a single chip. Some embodiments may include two or more groups of processors 102 attached via multiple sockets, which may be coupled to two or more instances of the parallel processor(s) 112.
[0046] Some of the specific components shown herein are optional and may not be included in all implementations of computing system 100. For example, any number of plug-in cards or peripheral devices may be supported, or some components may be eliminated. In addition, some architectures may be different from those described above. Figure 1 Different terminology is used for components that are similar to those shown in FIG. 1. For example, in some architectures, memory hub 105 may be referred to as a north bridge, while I / O hub 107 may be referred to as a south bridge.
[0047] Figure 2A 200 according to an embodiment. The various components of the parallel processor 200 may be implemented using one or more integrated circuit devices, such as a programmable processor, an application specific integrated circuit (ASIC), or a field programmable gate array (FPGA). According to an embodiment, the parallel processor 200 shown is Figure 1 A variation of one or more parallel processors 112 is shown in .
[0048] In one embodiment, the parallel processor 200 includes a parallel processing unit 202. The parallel processing unit includes an I / O unit 204, which is capable of communicating with other devices (including other instances of the parallel processing unit 202). The I / O unit 204 can be directly connected to other devices. In one embodiment, the I / O unit 204 is connected to other devices via the use of a hub or switch interface (such as a memory hub 105). The connection between the memory hub 105 and the I / O unit 204 forms a communication link 113. Within the parallel processing unit 202, the I / O unit 204 is connected to a host interface 206 and a memory crossbar 216, wherein the host interface 206 receives commands for performing processing operations and the memory crossbar 216 receives commands for performing memory operations.
[0049] When host interface 206 receives command buffers via I / O unit 204, host interface 206 may direct work operations for executing those commands to front end 208. In one embodiment, front end 208 is coupled to scheduler 210, which is configured to distribute commands or other work items to processing cluster array 212. In one embodiment, scheduler 210 ensures that processing cluster array 212 is properly configured and in a valid state before tasks are distributed to processing clusters of processing cluster array 212.
[0050] Processing cluster array 212 may include up to "N" processing clusters (e.g., cluster 214A, cluster 214B, up to cluster 214N). Each cluster 214A-214N of processing cluster array 212 may execute a large number of concurrent threads. Scheduler 210 may use various scheduling and / or work distribution algorithms to assign work to clusters 214A-214N of processing cluster array 212, which may vary depending on the workload generated for each type of program or calculation. Scheduling may be handled dynamically by scheduler 210, or may be assisted in part by compiler logic during compilation of program logic configured for execution by processing cluster array 212.
[0051] In one embodiment, different clusters 214A-214N of processing cluster array 212 may be assigned to process different types of programs, or to perform different types of calculations.
[0052] Processing cluster array 212 may be configured to perform various types of parallel processing operations. In one embodiment, processing cluster array 212 is configured to perform general-purpose parallel computing operations. For example, processing cluster array 212 may include logic for performing processing tasks including filtering video and / or audio data, and / or modeling operations (including physical operations), and performing data transformations.
[0053] In one embodiment, processing cluster array 212 is configured to perform parallel graphics processing operations. In embodiments where parallel processor 200 is configured to perform graphics processing operations, processing cluster array 212 may include additional logic for supporting the execution of such graphics processing operations, including but not limited to texture sampling logic for performing texture operations, and tessellation logic and other vertex processing logic. In addition, processing cluster array 212 may be configured to execute graphics processing related shader programs, such as but not limited to vertex shaders, tessellation shaders, geometry shaders, and pixel shaders. Parallel processing unit 202 may transfer data from system memory via I / O unit 204 for processing. During processing, the transferred data may be stored in on-chip memory (e.g., parallel processor memory 222) during processing and then written back to system memory.
[0054] In one embodiment, when parallel processing unit 202 is used to perform graphics processing, scheduler 210 can be configured to divide the processing workload into tasks of approximately equal size to better enable the distribution of graphics processing operations to multiple clusters 214A-214N in processing cluster array 212. In some embodiments, multiple portions of processing cluster array 212 can be configured to perform different types of processing. For example, a first portion can be configured to perform vertex shading and topology generation, a second portion can be configured to perform tessellation and geometry shading, and a third portion can be configured to perform pixel shading or other screen space operations to generate a rendered image for display. Intermediate data generated by one or more of clusters 214A-214N can be stored in a buffer to allow the intermediate data to be transferred between clusters 214A-214N for further processing.
[0055] During operation, the processing cluster array 212 may receive processing tasks to be performed via the scheduler 210, which receives commands defining the processing tasks from the front end 208. For graphics processing operations, the processing tasks may include command and state parameters defining how data is to be processed (e.g., what program is to be executed) and indices of the data to be processed (e.g., surface (patch) data, primitive data, vertex data, and / or pixel data). The scheduler 210 may be configured to obtain an index corresponding to a task, or may receive an index from the front end 208. The front end 208 may be configured to ensure that the processing cluster array 212 is configured to a valid state before initiating a workload specified by an incoming command buffer (e.g., a batch buffer, a push buffer, etc.).
[0056] Each of the one or more instances of the parallel processing unit 202 may be coupled to a parallel processor memory 222. The parallel processor memory 222 may be accessed via a memory crossbar 216, which may receive memory requests from the processing cluster array 212 and the I / O unit 204. The memory crossbar 216 may access the parallel processor memory 222 via a memory interface 218. The memory interface 218 may include a plurality of partition units (e.g., partition unit 220A, partition unit 220B, up to partition unit 220N), which may each be coupled to a portion (e.g., memory unit) of the parallel processor memory 222. In one implementation, the number of partition units 220A-220N is configured to be equal to the number of memory units, such that the first partition unit 220A has a corresponding first memory unit 224A, the second partition unit 220B has a corresponding memory unit 224B, and the Nth partition unit 220N has a corresponding Nth memory unit 224N. In other embodiments, the number of partition units 220A-220N may not be equal to the number of memory devices.
[0057] In various embodiments, the memory units 224A-224N may include various types of memory devices, including dynamic random access memory (DRAM) or graphics random access memory, such as synchronous graphics random access memory (SGRAM), including graphics double data rate (GDDR) memory. In one embodiment, the memory units 224A-224N may also include 3D stacked memory, including but not limited to high bandwidth memory (HBM). Those skilled in the art will recognize that the specific implementation of the memory units 224A-224N may vary and may be selected from one of various conventional designs. Rendering targets (such as frame buffers or texture maps) may be stored across the memory units 224A-224N, allowing the partition units 220A-220N to write multiple portions of each rendering target in parallel to efficiently use the available bandwidth of the parallel processor memory 222. In some embodiments, local instances of the parallel processor memory 222 may be excluded to facilitate the unified memory design of the system memory to be utilized in conjunction with the local cache memory.
[0058] In one embodiment, any of the clusters 214A-214N of the processing cluster array 212 can process data to be written to any of the memory units 224A-224N within the parallel processor memory 222. The memory crossbar 216 can be configured to transfer the output of each cluster 214A-214N to any partition unit 220A-220N or another cluster 214A-214N, which can perform additional processing operations on the output. Each cluster 214A-214N can communicate with the memory interface 218 through the memory crossbar 216 to read from or write to various external memory devices. In one embodiment, the memory crossbar 216 has a connection to the memory interface 218 to communicate with the I / O unit 204, as well as a connection to a local instance of the parallel processor memory 222, thereby enabling the processing units within different processing clusters 214A-214N to communicate with the system memory or other memory that is not local to the parallel processing unit 202. In one embodiment, the memory crossbar switch 216 may use virtual channels to separate traffic flows between the clusters 214A-214N and the partition units 220A-220N.
[0059] Although a single instance of parallel processing unit 202 is shown in parallel processor 200, any number of instances of parallel processing unit 202 may be included. For example, multiple instances of parallel processing unit 202 may be provided on a single plug-in card, or multiple plug-in cards may be interconnected. Different instances of parallel processing unit 202 may be configured to interoperate even if the different instances have different numbers of processing cores, different amounts of local parallel processor memory, and / or other configuration differences. For example and in one embodiment, some instances of parallel processing unit 202 may include higher precision floating point units relative to other instances. Systems that incorporate one or more instances of parallel processing unit 202 or parallel processor 200 may be implemented in a variety of configurations and form factors, including but not limited to desktop, laptop, or handheld personal computers, servers, workstations, game consoles, and / or embedded systems.
[0060] Figure 2B is a block diagram of a partition unit 220 according to an embodiment. In one embodiment, the partition unit 220 is Figure 2A 2 is an example of one of the partition units 220A-220N of the processor. As shown, the partition unit 220 includes an L2 cache 221, a frame buffer interface 225, and an ROP 226 (raster operation unit). The L2 cache 221 is a read / write cache that is configured to perform load and store operations received from the memory crossbar switch 216 and the ROP 226. Read misses and urgent write-back requests are output by the L2 cache 221 to the frame buffer interface 225 for processing. Dirty updates may also be sent to the frame buffer via the frame buffer interface 225 for opportunistic processing. In one embodiment, the frame buffer interface 225 interfaces with one of the memory units in the parallel processor memory, such as the memory units 224A-224N of FIG. 2 (e.g., within the parallel processor memory 222).
[0061] In graphics applications, ROP 226 is a processing unit that performs raster operations such as stencil, z-test, blending, and the like. ROP 226 then outputs processed graphics data that is stored in graphics memory. In some embodiments, ROP 226 includes compression logic that compresses z or color data written to memory and decompresses z or color data read from memory. In some embodiments, ROP 226 is included within each processing cluster (e.g., clusters 214A-214N of FIG. 2 ) rather than within partition unit 220. In such embodiments, read and write requests for pixel data rather than pixel fragment data are transmitted through memory crossbar 216.
[0062] The processed graphics data may be displayed on a display device such as Figure 1 100), is routed for further processing by the processor(s) 102, or is routed for processing by the processor(s) 102. Figure 2A One of the processing entities within parallel processor 200 further processes.
[0063] Figure 2C 2 is a block diagram of a processing cluster 214 within a parallel processing unit according to an embodiment. In one embodiment, the processing cluster is an instance of one of the processing clusters 214A-214N of FIG. 2. The processing cluster 214 can be configured to execute many threads in parallel, wherein the term "thread" refers to an instance of a specific program executed on a specific set of input data. In some embodiments, without providing multiple independent instruction units, a single instruction multiple data (SIMD) instruction issuance technique is used to support the parallel execution of a large number of threads. In other embodiments, a public instruction unit configured to issue instructions to a group of processing engines within each of the processing clusters is used, and a single instruction multiple thread (SIMT) technique is used to support the parallel execution of a large number of generally synchronized threads. Unlike the SIMD execution regime (wherein all processing engines usually execute the same instruction), SIMT execution allows different threads to more easily pass through a given thread program along a divergent execution path. It will be understood by those skilled in the art that the SIMD processing regime represents a functional subset of the SIMT processing regime.
[0064] The operation of the processing cluster 214 can be controlled via a pipeline manager 232, which distributes processing tasks to SIMT parallel processors. The pipeline manager 232 receives instructions from the scheduler 210 of Figure 2 and manages the execution of those instructions via the graphics multiprocessor 234 and / or the texture unit 236. The graphics multiprocessor 234 shown is an exemplary instance of a SIMT parallel processor. However, various types of SIMT parallel processors of different architectures can be included in the processing cluster 214. One or more instances of the graphics multiprocessor 234 can be included in the processing cluster 214. The graphics multiprocessor 234 can process data, and a data crossbar 240 can be used to distribute the processed data to one of multiple possible destinations (including other shader units). The pipeline manager 232 can facilitate the distribution of processed data by specifying the destination of the processed data to be distributed via the data crossbar 240.
[0065] Each graphics multiprocessor 234 within a processing cluster 214 may include the same set of function execution logic (e.g., arithmetic logic units, load-store units, etc.). The function execution logic may be configured in a pipelined manner, in which a new instruction may be issued before a previous instruction is completed. The function execution logic supports a wide variety of operations, including integer and floating point arithmetic, comparison operations, Boolean operations, bit-shifting, and calculation of various algebraic functions. In one embodiment, the same functional unit hardware may be utilized to perform different operations, and any combination of functional units may exist.
[0066] The instructions transmitted to the processing cluster 214 constitute threads. A group of threads executed across a group of parallel processing engines is a thread group. A thread group executes the same program on different input data. Each thread in a thread group can be assigned to a different processing engine in the graphics multiprocessor 234. A thread group may include fewer threads than the number of processing engines in the graphics multiprocessor 234. When a thread group includes fewer threads than the number of processing engines, one or more of the processing engines may be idle during the cycle in which the thread group is being processed. A thread group may also include more threads than the number of processing engines in the graphics multiprocessor 234. When a thread group includes more threads than the number of processing engines in the graphics multiprocessor 234, processing may be performed on consecutive clock cycles. In one embodiment, multiple thread groups may be executed concurrently on the graphics multiprocessor 234.
[0067] In one embodiment, the graphics multiprocessor 234 includes an internal cache memory for performing load and store operations. In one embodiment, the graphics multiprocessor 234 can abandon the internal cache and use the cache memory (e.g., L1 cache 308) within the processing cluster 214. Each graphics multiprocessor 234 also has access to the L2 cache within the partition unit (e.g., partition unit 220A-220N of Figure 2) that is shared in all processing clusters 214 and can be used to transfer data between threads. The graphics multiprocessor 234 can also access off-chip global memory, which can include one or more of the local parallel processor memory and / or system memory. Any memory outside the parallel processing unit 202 can be used as global memory. Embodiments (wherein the processing cluster 214 includes multiple instances of the graphics multiprocessor 234) can share common instructions and data, which can be stored in the L1 cache 308.
[0068] Each processing cluster 214 may include an MMU 245 (memory management unit) configured to map virtual addresses into physical addresses. In other embodiments, one or more instances of the MMU 245 may reside within the memory interface 218 of FIG. 2 . The MMU 245 includes: a set of page table entries (PTEs) for mapping virtual addresses of tiles (more on tiling) to physical addresses; and optionally a cache line index. The MMU 245 may include an address translation lookaside buffer (TLB) or cache that may reside within the graphics multiprocessor 234 or L1 cache or processing cluster 214. Physical addresses are processed to distribute surface data access locality, thereby allowing efficient request interleaving in partition units. The cache line index can be used to determine whether a request for a cache line is a hit or a miss.
[0069] In graphics and computing applications, the processing clusters 214 may be configured such that each graphics multiprocessor 234 is coupled to a texture unit 236 for performing texture mapping operations, such as determining texture sample locations, reading texture data, and filtering texture data. Texture data is read from an internal texture L1 cache (not shown) or in some embodiments from an L1 cache within the graphics multiprocessor 234, and retrieved from an L2 cache, local parallel processor memory, or system memory, as needed. Each graphics multiprocessor 234 outputs a processed task to a data crossbar 240 to provide the processed task to another processing cluster 214 for further processing or to store the processed task in an L2 cache, local parallel processor memory, or system memory via a memory crossbar 216. A preROP 242 (e.g., a pre-raster operation unit) is configured to receive data from the graphics multiprocessor 234, direct the data to a ROP unit, which may be located with a partition unit (e.g., partition units 220A-220N of FIG. 2 ) as described herein. The preROP 242 unit may perform optimizations for color blending, organize pixel color data, and perform address translations.
[0070] It will be appreciated that the core architecture described herein is illustrative and that variations and modifications are possible. Any number of processing units (e.g., graphics multiprocessor 234, texture unit 236, preROP 242, etc.) may be included within a processing cluster 214. Furthermore, while only one processing cluster 214 is shown, a parallel processing unit as described herein may include any number of instances of a processing cluster 214. In one embodiment, each processing cluster 214 may be configured to operate independently of other processing clusters 214 using separate and distinct processing units, L1 caches, etc.
[0071] Figure 2D A graphics multiprocessor 234 is shown according to one embodiment. In such embodiments, the graphics multiprocessor 234 is coupled to the pipeline manager 232 of the processing cluster 214. The graphics multiprocessor 234 has an execution pipeline that includes, but is not limited to, an instruction cache 252, an instruction unit 254, an address mapping unit 256, a register file 258, one or more general purpose graphics processing unit (GPGPU) cores 262, and one or more load / store units 266. The GPGPU cores 262 and the load / store units 266 are coupled to a cache memory 272 and a shared memory 270 via a memory and cache interconnect 268.
[0072] In one embodiment, the instruction cache 252 receives a stream of instructions to be executed from the pipeline manager 232. The instructions are cached in the instruction cache 252 and dispatched by the instruction unit 254 for execution. The instruction unit 254 can dispatch instructions into thread groups (e.g., warps), where each thread of the thread group is assigned to a different execution unit within the GPGPU core 262. Instructions can access any of the local, shared, or global address spaces by specifying an address within the unified address space. The address mapping unit 256 can be used to convert addresses in the unified address space into distinct memory addresses that can be accessed by the load / store unit 266.
[0073] The register file 258 provides a set of registers for the functional units of the graphics multiprocessor 324. The register file 258 provides temporary storage for operands for the data paths of the functional units (e.g., GPGPU core 262, load / store unit 266) connected to the graphics multiprocessor 324. In one embodiment, the register file 258 is divided between each of the functional units so that each functional unit is allocated a dedicated portion of the register file 258. In one embodiment, the register file 258 is divided between different warps executed by the graphics multiprocessor 324.
[0074] The GPGPU cores 262 may each include a floating point unit (FPU) and / or an integer arithmetic logic unit (ALU), the FPU and integer ALU being used to execute instructions of the graphics multiprocessor 324. Depending on the embodiment, the GPGPU cores 262 may be similar in architecture, or may be different in architecture. For example and in one embodiment, the first portion of the GPGPU core 262 includes a single-precision FPU and an integer ALU, while the second portion of the GPGPU core includes a double-precision FPU. In one embodiment, the FPU may implement the IEEE 754-2008 standard for floating-point arithmetic, or may be capable of variable-precision floating-point arithmetic. The graphics multiprocessor 324 may additionally include one or more fixed-function or special-function units to perform specific functions (such as copying rectangles or pixel blending operations). In one embodiment, one or more of the GPGPU cores may also include fixed or special-function logic.
[0075] The memory and cache interconnect 268 is an interconnect network that connects each of the functional units of the graphics multiprocessor 234 to the register file 258 and to the shared memory 270. In one embodiment, the memory and cache interconnect 268 is a crossbar interconnect that allows the load / store unit 266 to implement load and store operations between the shared memory 270 and the register file 258. The register file 258 can operate at the same frequency as the GPGPU core 262, so that data transfer between the GPGPU core 262 and the register file 258 is very low latency. The shared memory 270 can be used to enable communication between threads executed on the functional units within the graphics multiprocessor 234. The cache memory 272 can be used, for example, as a data cache to cache texture data communicated between the functional units and the texture unit 236. The shared memory 270 can also be used as a program-managed cache. Threads executing on the GPGPU core 262 can programmatically store data in the shared memory in addition to the automatically cached data stored in the cache memory 272.
[0076] Figure 3A-3B Additional graphics multiprocessors are shown according to an embodiment. The graphics multiprocessors 325, 350 shown are Figure 2C The illustrated graphics multiprocessors 325, 350 may be configured as streaming multiprocessors (SMs) capable of executing a large number of execution threads simultaneously.
[0077] Figure 3A A graphics multiprocessor 325 is shown according to an additional embodiment. The graphics multiprocessor 325 is Figure 2DThe graphics multiprocessor 234 includes multiple additional instances of execution resource units. For example, the graphics multiprocessor 325 may include multiple instances of instruction units 332A-332B, register files 334A-334B, and texture units 344A-344B. The graphics multiprocessor 325 also includes multiple groups of graphics or computing execution units (e.g., GPGPU cores 336A-336B, GPGPU cores 337A-337B, GPGPU cores 338A-338B) and multiple groups of load / store units 340A-340B. In one embodiment, the execution resource unit has a common instruction cache 330, texture and / or data cache memory 342, and shared memory 346. Various components can communicate via an interconnect structure 327. In one embodiment, the interconnect structure 327 includes one or more crossbar switches to enable communication between various components of the graphics multiprocessor 325.
[0078] Figure 3B A graphics multiprocessor 350 according to an additional embodiment is shown. The graphics processor includes multiple sets of execution resources 356A-356D, wherein each set of execution resources includes multiple instruction units, register files, GPGPU cores, and load storage units, such as Figure 2D and Figure 3A . Execution resources 356A-356D may work in concert with texture units 360A-360D for texture operations while sharing instruction cache 354 and shared memory 362. In one embodiment, execution resources 356A-356D may share multiple instances of instruction cache 354 and shared memory 362 as well as texture and / or data cache memories 358A-358B. The various components may be communicated to one another via a communication protocol similar to Figure 3A The interconnect structure 327 and the interconnect structure 352 communicate with each other.
[0079] Those skilled in the art will understand that Figure 1 , 2A The architectures described in Figures 2-2D and 3A-3B are illustrative and non-limiting with respect to the scope of the present embodiments. Thus, without departing from the scope of the embodiments described herein, the techniques described herein may be implemented on any properly configured processing unit, including but not limited to one or more mobile application processors, one or more desktop or server central processing units (CPUs) (including multi-core CPUs), one or more parallel processing units (such as parallel processing unit 202 of Figure 2), and one or more graphics processors or special purpose processing units.
[0080] In some embodiments, a parallel processor or GPGPU as described herein is communicatively coupled to a host / processor core to accelerate graphics operations, machine learning operations, pattern analysis operations, and various general-purpose GPU (GPGPU) functions. The GPU may be communicatively coupled to the host processor / core via a bus or another interconnect (e.g., a high-speed interconnect such as PCIe or NVLink). In other embodiments, the GPU may be integrated on the same package or chip as the core and communicatively coupled to the core via an internal processor bus / interconnect (i.e., inside the package or chip). Regardless of the manner in which the GPU is connected, the processor core can assign work to the GPU in the form of a sequence of commands / instructions contained in a work descriptor. The GPU then uses dedicated circuits / logic to efficiently process these commands / instructions.
[0081] Technologies for GPU to host processor interconnect
[0082] Figure 4A An exemplary architecture is shown in which multiple GPUs 410-413 are communicatively coupled to multiple multi-core processors 405-406 via high-speed links 440-443 (e.g., buses, point-to-point interconnects, etc.). In one embodiment, the high-speed links 440-443 support 4GB / s, 30GB / s, 80GB / s, or higher communication throughputs, depending on the implementation. Various interconnect protocols may be used, including but not limited to PCIe 4.0 or 5.0 and NVLink 2.0. However, the underlying principles of the invention are not limited to any specific communication protocol or throughput.
[0083] Additionally, in one embodiment, two or more of the GPUs 410-413 are interconnected via high-speed links 444-445, which may be implemented using the same or different protocols / links as used for high-speed links 440-443. Similarly, two or more of the multi-core processors 405-406 may be connected via high-speed link 433, which may be a symmetric multiprocessor (SMP) bus operating at 20 GB / s, 30 GB / s, 120 GB / s, or higher. Alternatively, Figure 4A All communications between the various system components shown in can be achieved using the same protocol / links (eg, through a common interconnect structure). However, as mentioned, the underlying principles of the invention are not limited to any specific type of interconnect technology.
[0084] In one embodiment, each multi-core processor 405-406 is communicatively coupled to a processor memory 401-402 via a memory interconnect 430-431, respectively, and each GPU 410-413 is communicatively coupled to a GPU memory 420-423 via a GPU memory interconnect 450-453, respectively. The memory interconnects 430-431 and 450-453 may utilize the same or different memory access technologies. By way of example and not limitation, the processor memory 401-402 and the GPU memory 420-423 may be volatile memory, such as dynamic random access memory (DRAM) (including stacked DRAM), graphics DDR SDRAM (GDDR) (e.g., GDDR5, GDDR6), or high bandwidth memory (HBM), and / or may be non-volatile memory, such as 3D XPoint or Nano-Ram. In one embodiment, a portion of the memory may be volatile memory, and another portion may be non-volatile memory (e.g., using a two-level memory (2LM) hierarchy).
[0085] As described below, although the various processors 405-406 and GPUs 410-413 may be physically coupled to specific memories 401-402, 420-423, respectively, a unified memory architecture may be implemented in which the same virtual system address space (also referred to as an "effective address" space) is distributed across all of the various physical memories. For example, the processor memories 401-402 may each include 64GB of system memory address space, and the GPU memories 420-423 may each include 32GB of system memory address space (yielding a total of 256GB of addressable memory in this example).
[0086] Figure 4B Additional details are shown for the interconnection between the multi-core processor 407 and the graphics acceleration module 446 according to one embodiment. The graphics acceleration module 446 may include one or more GPU chips integrated on a line card that is coupled to the processor 407 via the high-speed link 440. Alternatively, the graphics acceleration module 446 may be integrated on the same package or chip as the processor 407.
[0087] The processor 407 shown includes multiple cores 460A-460D, each of which has a translation lookaside buffer 461A-461D and one or more caches 462A-462D. The core may include various other components (e.g., instruction acquisition unit, branch prediction unit, decoder, execution unit, reorder buffer, etc.) for executing instructions and processing data, which are not shown to avoid obscuring the underlying principles of the present invention. Caches 462A-462D may include level 1 (L1) and level 2 (L2) caches. In addition, one or more shared caches 426 may be included in the cache hierarchy and shared by multiple groups of cores 460A-460D. For example, one embodiment of the processor 407 includes 24 cores, each of which has its own L1 cache, twelve shared L2 caches, and twelve shared L3 caches. In this embodiment, one of the L2 and L3 caches is shared by two adjacent cores. The processor 407 and the graphics accelerator integrated module 446 are connected to the system memory 441, which may include the processor memories 401-402.
[0088] The coherence of data and instructions stored in the various caches 462A-462D, 456 and the system memory 441 is maintained via inter-core communications over the coherence bus 464. For example, each cache may have cache coherence logic / circuitry associated therewith to communicate over the coherence bus 464 in response to a detected read or write to a particular cache line. In one implementation, a cache snooping protocol is implemented over the coherence bus 464 to snoop cache accesses. Cache snooping / coherence techniques are well understood by those skilled in the art and will not be described in detail herein to avoid obscuring the underlying principles of the present invention.
[0089] In one embodiment, the proxy circuit 425 communicatively couples the graphics acceleration module 446 to the coherence bus 464, thereby allowing the graphics acceleration module 446 to participate in the cache coherence protocol as a peer of the core. Specifically, the interface 435 provides connectivity to the proxy circuit 425 through a high-speed link 440 (e.g., a PCIe bus, NVLink, etc.), and the interface 437 connects the graphics acceleration module 446 to the link 440.
[0090] In one implementation, the accelerator integrated circuit 436 provides cache management, memory access, context management, and interrupt management services on behalf of the multiple graphics processing engines 431, 432, N of the graphics acceleration module 446. The graphics processing engines 431, 432, N may each include a separate graphics processing unit (GPU). Alternatively, the graphics processing engines 431, 432, N may include different types of graphics processing engines within the GPU, such as a graphics execution unit, a media processing engine (e.g., a video encoder / decoder), a sampler, and a blit engine. In other words, the graphics acceleration module may be a GPU with multiple graphics processing engines 431-432, N, or the graphics processing engines 431-432, N may be individual GPUs integrated on a common package, line card, or chip.
[0091] In one embodiment, the accelerator integrated circuit 436 includes a memory management unit (MMU) 439 for performing various memory management functions, such as virtual to physical memory translation (also known as effective to real memory translation) and memory access protocols for accessing the system memory 441. The MMU 439 may also include a translation lookaside buffer (TLB) (not shown) for caching virtual / effective to physical / real address translations. In one implementation, the cache 438 stores commands and data for efficient access by the graphics processing engines 431-432, N. In one embodiment, the data stored in the cache 438 and the graphics memory 433-434, N is kept consistent with the core caches 462A-462D, 456 and the system memory 411. As mentioned, this may be achieved via proxy circuitry 425, which participates in cache coherence mechanisms on behalf of cache 438 and memories 433-434, N (e.g., sending updates related to modifications / accesses of cache lines on processor caches 462A-462D, 456 to cache 438, and receiving updates from cache 438).
[0092] A set of registers 445 stores context data for threads executed by the graphics processing engines 431-432, N, and context management circuitry 448 manages thread contexts. For example, context management circuitry 448 may perform save and restore operations during context switching to save and restore contexts of various threads (e.g., where a first thread is saved and a second thread is stored so that the second thread can be executed by the graphics processing engine). For example, upon context switching, context management circuitry 448 may store current register values to a designated area in memory (e.g., identified by a context pointer). It may then restore the register values upon returning to the context. In one embodiment, interrupt management circuitry 447 receives and processes interrupts received from system devices.
[0093] In one implementation, virtual / effective addresses from the graphics processing engine 431 are converted to real / physical addresses in the system memory 411 by the MMU 439. One embodiment of the accelerator integrated circuit 436 supports multiple (e.g., 4, 8, 16) graphics accelerator modules 446 and / or other accelerator devices. The graphics accelerator module 446 may be dedicated to a single application executed on the processor 407, or may be shared between multiple applications. In one embodiment, a virtualized graphics execution environment is presented in which the resources of the graphics processing engines 431-432, N are shared with multiple applications or virtual machines (VMs). The resources may be subdivided into "slices" that are allocated to the VMs and / or applications based on the processing requirements and priorities associated with the different VMs and / or applications.
[0094] Thus, the accelerator integrated circuit acts as a bridge to the system of graphics acceleration module 446 and provides address translation and system memory cache services. In addition, the accelerator integrated circuit 436 can provide virtualization facilities for the host processor to manage virtualization, interrupts, and memory management of the graphics processing engine.
[0095] Since the hardware resources of the graphics processing engines 431-432, N are explicitly mapped to the real address space seen by the host processor 407, any host processor can directly address these resources using effective address values. In one embodiment, one function of the accelerator integrated circuit 436 is the physical separation of the graphics processing engines 431-432, N so that they appear to the system as independent units.
[0096] As mentioned, in the illustrated embodiment, one or more graphics memories 433-434, M are respectively coupled to each of the graphics processing engines 431-432, N. The graphics memories 433-434, M store instructions and data being processed by each of the graphics processing engines 431-432, N. The graphics memories 433-434, M may be volatile memory, such as DRAM (including stacked DRAM), GDDR memory (e.g., GDDR5, GDDR6), or HBM, and / or may be non-volatile memory, such as 3D XPoint or Nano-Ram.
[0097] In one embodiment, to reduce data traffic on link 440, biasing techniques are used to ensure that the data stored in graphics memory 433-434, M is the data that will be used most frequently by graphics processing engines 431-432, N and preferably not used (at least not frequently) by cores 460A-460D. Similarly, the biasing mechanism attempts to keep data needed by a core (and preferably not graphics processing engines 431-432, N) in system memory 411 and the core's cache 462A-462D, 456.
[0098] Figure 4C Another embodiment is shown in which an accelerator integrated circuit 436 is integrated within the processor 407. In this embodiment, the graphics processing engines 431-432, N communicate directly to the accelerator integrated circuit 436 via the interface 437 and the interface 435 (again, which may utilize any form of bus or interface protocol) through the high-speed link 440. The accelerator integrated circuit 436 may perform operations related to Figure 4B The same operations as those described, but at potentially higher throughput given their close proximity to the coherency bus 462 and caches 462A-462D, 426.
[0099] One embodiment supports different programming models, including a dedicated process programming model (without graphics acceleration module virtualization) and a shared programming model (with virtualization). The latter may include a programming model controlled by the accelerator integrated circuit 436 and a programming model controlled by the graphics acceleration module 446.
[0100] In one embodiment of a dedicated process model, the graphics processing engines 431-432, N are dedicated to a single application or process under a single operating system. A single application can funnel another application's requests to the graphics engines 431-432, N, thereby providing virtualization within a VM / partition.
[0101] In a dedicated process programming model, graphics processing engines 431-432, N can be shared by multiple VM / application partitions. The shared model requires a hypervisor to virtualize graphics processing engines 431-432, N to allow access by each operating system. For a single partition system without a hypervisor, graphics processing engines 431-432, N are owned by the operating system. In both cases, the operating system can virtualize graphics processing engines 431-432, N to provide access to each process or application.
[0102] For the shared programming model, the graphics acceleration module 446 or each graphics processing engine 431-432, N uses a process handle to select a process element. In one embodiment, the process element is stored in the system memory 411 and is addressable using the effective address to real address conversion technology described herein. The process handle can be an implementation-specific value provided to the host process when registering its context with the graphics processing engine 431-432, N (i.e., calling the system software to add the process element to the process element linked list). The lower 16 bits of the process handle can be the offset of the process element within the process element linked list.
[0103] Figure 4D An exemplary accelerator integrated slice 490 is shown. As used herein, a "slice" includes a specified portion of the processing resources of the accelerator integrated circuit 436. The application effective address space 482 within the system memory 411 stores process elements 483. In one embodiment, the process element 483 is stored in response to a GPU call 481 from an application 480 executed on the processor 407. The process element 483 contains the process state of the corresponding application 480. The work descriptor (WD) 484 contained in the process element 483 can be a single job requested by the application, or can contain a pointer to a job queue. In the latter case, the WD 484 is a pointer to the job request queue in the address space 482 of the application.
[0104] Graphics acceleration module 446 and / or individual graphics processing engines 431-432, N may be shared by all processes or a subset of processes in the system. Embodiments of the present invention include infrastructure for setting process state and sending WD 484 to graphics acceleration module 446 to start a job in a virtualized environment.
[0105] In one implementation, the dedicated process programming model is implementation specific. In this model, a single process owns the graphics acceleration module 446 or individual graphics processing engine 431. Since the graphics acceleration module 446 is owned by a single process, when the graphics acceleration module 446 is assigned, the hypervisor initializes the accelerator integrated circuit 436 for the owning partition and the operating system initializes the accelerator integrated circuit 436 for the owning process.
[0106] In operation, the WD acquisition unit 491 in the accelerator integrated slice 490 acquires the next WD 484, which includes an indication of work to be completed by one of the graphics processing engines of the graphics acceleration module 446. Data from WD484 can be stored in registers 445 and used by MMU 439, interrupt management circuit 447, and / or context management circuit 446 as shown. For example, one embodiment of MMU 439 includes a segment / page walk circuit for accessing a segment / page table 486 within an OS virtual address space 485. Interrupt management circuit 447 can handle interrupt events 492 received from graphics acceleration module 446. When performing graphics operations, the effective address 493 generated by the graphics processing engine 431-432, N is converted to a real address by MMU 439.
[0107] In one embodiment, the same set of registers 445 is replicated for each graphics processing engine 431-432, N, and / or graphics acceleration module 446, and can be initialized by a hypervisor or operating system. Each of these replicated registers can be included in an accelerator integrated slice 490. Exemplary registers that can be initialized by a hypervisor are shown in Table 1.
[0108] Table 1 - Registers initialized by the hypervisor
[0109] 1 Slice Control Register 2 Real address (RA) dispatched process area pointer 3 Permission Mask Override Register 4 Interrupt vector table entry offset 5 Interrupt Vector Table Entry Limits 6 Status Register 7 Logical Partition ID 8 Real Address (RA) Hypervisor Accelerator Utilizing Record Pointers 9 Storage Description Register
[0110] Example registers that may be initialized by the operating system are shown in Table 2.
[0111] Table 2 - Registers initialized by the operating system
[0112] 1 Process and thread identities 2 Effective Address (EA) context save / restore pointer 3 Virtual Address (VA) Accelerator Utilizes Record Pointers 4 Virtual Address (VA) Segment Table Pointer 5 Permission masking 6 Job Descriptor
[0113] In one embodiment, each WD 484 is specific to a particular graphics acceleration module 446 and / or graphics processing engine 431-432, N. It contains all the information needed for the graphics processing engine 431-432, N to complete its work, or it may be a pointer to a memory location of a command queue where the application has set up work to be done.
[0114] Figure 4E Additional details of one embodiment of a sharing model are shown. This embodiment includes a hypervisor real address space 498 in which a process element list 499 is stored. The hypervisor real address space 498 is accessible via a hypervisor 496 that virtualizes a graphics acceleration module engine for an operating system 495.
[0115] The shared programming model allows all processes or subsets of processes from all partitions or subsets of partitions in the system to use the graphics acceleration module 446. There are two programming models where the graphics acceleration module 446 is shared by multiple processes and partitions: time-slice shared and graphics directed shared.
[0116] In this model, the hypervisor 496 owns the graphics acceleration module 446 and makes its functionality available to all operating systems 495. In order for the graphics acceleration module 446 to support virtualization by the hypervisor 496, the graphics acceleration module 446 may comply with the following requirements: 1) The application's job requests must be autonomous (i.e., no state needs to be maintained between jobs), or the graphics acceleration module 446 must provide a context save and restore mechanism. 2) The application's job requests are guaranteed to be completed within a specified amount of time by the graphics acceleration module 446 (including any transition failures), or the graphics acceleration module 446 provides the ability to preempt the processing of a job. 3) When operating in a directed sharing programming model, the graphics acceleration module 446 must be guaranteed fairness between processes.
[0117] In one embodiment, for the shared model, the application 480 is required to use the graphics acceleration module 446 type, work descriptor (WD), permission mask register (AMR) value and context save / restore region pointer (CSRP) to make an operating system 495 system call. The graphics acceleration module 446 type describes the acceleration function targeted for the system call. The graphics acceleration module 446 type can be a system-specific value. The WD is formatted specifically for the graphics acceleration module 446 and can be in the form of a graphics acceleration module 446 command, an effective address pointer to a user-defined structure, an effective address pointer to a command queue, or any other data structure used to describe the work to be completed by the graphics acceleration module 446. In one embodiment, the AMR value is the AMR state to be used for the current process. The value passed to the operating system is similar to the application of setting the AMR. If the accelerator integrated circuit 436 and the graphics acceleration module 446 implementation do not support the user permission mask override register (UAMOR), the operating system can apply the current UAMOR value to the AMR value and then pass the AMR in the hypervisor call. Optionally, the hypervisor 496 may apply the current privilege mask overwrite register (AMOR) value before placing the AMR into the process element 483. In one embodiment, the CSRP is one of the registers 445 that contains the effective address of an area in the application's address space 482 for the graphics acceleration module 446 to save and restore context state. This pointer is optional if state does not need to be saved between jobs or when a job is preempted. The context save / restore area may be pinned system memory.
[0118] Upon receiving the system call, the operating system 495 may verify that the application 480 has been registered and has been given permission to use the graphics acceleration module 446. The operating system 495 then calls the hypervisor 496 with the information shown in Table 3.
[0119] Table 3 – OS to Hypervisor call parameters
[0120] 1 Job Descriptor (WD) 2 Authority Mask Register (AMR) value (potentially masked) 3 Effective Address (EA) Context Save / Restore Region Pointer (CSRP) 4 Process ID (PID) and optional thread ID (TID) 5 Virtual Address (VA) Accelerator Utilization Record Pointer (AURP) 6 Virtual address of the storage segment table pointer (SSTP) 7 Logical Interrupt Service Number (LISN)
[0121] Upon receiving the hypervisor call, the hypervisor 496 verifies that the operating system 495 has registered and has been given permission to use the graphics acceleration module 446. The hypervisor 496 then places the process element 483 into a linked list of process elements of the corresponding graphics acceleration module 446 type. The process element may include the information shown in Table 4.
[0122] Table 4 - Process element information
[0123] 1 Job Descriptor (WD) 2 Authority Mask Register (AMR) value (potentially masked) 3 Effective Address (EA) Context Save / Restore Region Pointer (CSRP) 4 Process ID (PID) and optional thread ID (TID) 5 Virtual Address (VA) Accelerator Utilization Record Pointer (AURP) 6 Virtual address of the storage segment table pointer (SSTP) 7 Logical Interrupt Service Number (LISN) 8 Interrupt vector table derived from hypervisor call parameters 9 Status Register (SR) Value 10 Logical Partition ID (LPID) 11 Real Address (RA) Hypervisor Accelerator Utilizing Record Pointers 12 Storage Descriptor Register (SDR)
[0124] In one embodiment, the hypervisor initializes the plurality of accelerator integrated slice 490 registers 445 .
[0125] like Figure 4F As shown in, one embodiment of the present invention uses a unified memory addressable via a common virtual memory address space, and the common virtual memory address is used to access physical processor memory 401-402 and GPU memory 420-423. In this implementation, operations performed on GPU 410-413 use the same virtual / effective memory address space to access processor memory 401-402 and vice versa, thereby simplifying programmability. In one embodiment, the first part of the virtual / effective address space is allocated to processor memory 401, the second part is allocated to second processor memory 402, the third part is allocated GPU memory 420, and so on. The entire virtual / effective memory space (sometimes referred to as the effective address space) is thus distributed across each of processor memory 401-402 and GPU memory 420-423, allowing any processor or GPU to access any physical memory (with a virtual address mapped to the memory).
[0126] In one embodiment, bias / coherency management circuits 494A-494E within one or more of MMUs 439A-439E ensure cache coherency between the caches of the host processor (e.g., 405) and GPUs 410-413, as well as biasing techniques that indicate physical memory where certain types of data should be stored. Figure 4FMultiple instances of bias / consistency management circuits 494A- 494E are shown in , but bias / consistency circuits may be implemented within an MMU of one or more host processors 405 and / or within an accelerator integrated circuit 436 .
[0127] One embodiment allows the use of shared virtual memory (SVM) technology to access GPU-attached memory 420-423 and map it as part of system memory without suffering the typical performance drawbacks associated with full system cache coherence. The ability to access GPU-attached memory 420-423 as system memory without heavy cache coherence overhead provides a beneficial operating environment for GPU offloading. This arrangement allows host processor 405 software to set operands and access calculation results without the overhead of traditional I / O DMA data copying. Such traditional copies involve driver calls, interrupts, and memory-mapped I / O (MMIO) accesses, which are all inefficient relative to simple memory accesses. At the same time, the ability to access GPU-attached memory 420-423 without cache coherence overhead can be critical to the runtime of offloaded calculations. In the case of having a substantial stream write memory business, for example, the cache coherence overhead can significantly reduce the effective write bandwidth seen by GPU 410-413. The efficiency of operand setup, the efficiency of result access, and the efficiency of GPU computation all play a role in determining the effectiveness of GPU offloading.
[0128] In one implementation, the selection between GPU bias and host processor bias is driven by a bias tracker data structure. A bias table may be used, for example, which may be a page granular structure including 1 or 2 bits per GPU attached memory page (i.e., controlled at the granularity of a memory page). The bias table may be implemented in a stolen memory range of one or more GPU attached memories 420-423, with or without a bias cache in the GPUs 410-413 (e.g., to cache frequently / recently used entries of the bias table). Alternatively, the entire bias table may be maintained within the GPU.
[0129] In one implementation, the bias table entry associated with each access to the GPU-attached memory 420-423 is accessed before actually accessing the GPU memory, resulting in the following operations. First, local requests from the GPU 410-413 to find its page in the host bias are forwarded directly to the corresponding GPU memory 420-423. The local request from the GPU is forwarded to the processor 405 (e.g., via a high-speed link as discussed above). In one embodiment, the request from the processor 405 (the request to find the requested page in the host processor bias) completes a request similar to a normal memory read. Alternatively, the request for the GPU biased page can be forwarded to the GPU 410-413. Then, if the GPU is not currently using the page, the GPU can transfer the page to the host processor bias.
[0130] The bias state of a page may be changed by a software-based mechanism, a hardware-assisted software-based mechanism, or, for a limited set of situations, a purely hardware-based mechanism.
[0131] One mechanism for changing the bias state employs an API call (e.g., OpenCL) which in turn calls the GPU's device driver, which in turn sends a message (or enqueues a command descriptor) to the GPU, instructing it to change the bias state and perform a cache flush operation in the host for some transitions. The cache flush operation is required for transitions from host processor 405 bias to GPU bias, but not for the reverse transition.
[0132] In one embodiment, cache coherency is maintained by temporarily rendering GPU bias pages that are not cacheable by host processor 405. To access these pages, processor 405 may request access from GPU 410, which may or may not be immediately granted, depending on the implementation. Therefore, to reduce communication between processor 405 and GPU 410, it is ensured that GPU bias pages are those pages that are needed by the GPU but not by host processor 405 and vice versa.
[0133] Graphics processing pipeline
[0134] Figure 5 2. A graphics processing pipeline 500 is shown according to an embodiment. In one embodiment, a graphics processor may implement the illustrated graphics processing pipeline 500. The graphics processor may be included in a parallel processing subsystem as described herein (such as the parallel processor 200 of FIG. 2), which in one embodiment is Figure 12 . Various parallel processing systems may implement the graphics processing pipeline 500 via one or more instances of a parallel processing unit (e.g., parallel processing unit 202 of FIG. 2 ) as described herein. For example, a shader unit (e.g., graphics multiprocessor 234 of FIG. 3 ) may be configured to perform the functions of one or more of a vertex processing unit 504, a tessellation control processing unit 508, a tessellation evaluation processing unit 512, a geometry processing unit 516, and a fragment / pixel processing unit 524. The functions of the data assembler 502, the primitive assemblers 506, 514, 518, the tessellation unit 510, the rasterizer 522, and the raster operation unit 526 may also be performed by other processing engines within a processing cluster (e.g., processing cluster 214 of FIG. 3 ) and corresponding partition units (e.g., partition units 220A-220N of FIG. 2 ). The graphics processing pipeline 500 may also be implemented using dedicated processing units for one or more functions. In one embodiment, one or more portions of the graphics processing pipeline 500 may be executed by parallel processing logic within a general purpose processor (e.g., a CPU). In one embodiment, one or more portions of the graphics processing pipeline 500 may access on-chip memory (e.g., such as parallel processor memory 222 in FIG. 2 ) via a memory interface 528, which may be an example of the memory interface 218 of FIG. 2 .
[0135] In one embodiment, the data assembler 502 is a processing unit that collects vertex data for surfaces and primitives. The data assembler 502 then outputs the vertex data, including vertex attributes, to the vertex processing unit 504. The vertex processing unit 504 is a programmable execution unit that executes a vertex shader program to light and transform vertex data as specified by the vertex shader program. The vertex processing unit 504 reads data stored in a cache, local or system memory for use in processing vertex data, and the vertex processing unit 504 can be programmed to transform vertex data from an object-based coordinate representation to a world space coordinate space or a normalized device coordinate space.
[0136] A first instance of primitive assembler 506 receives vertex attributes from vertex processing unit 50. Primitive assembler 506 reads the stored vertex attributes as needed and builds graphics primitives for processing by tessellation control processing unit 508. Graphics primitives include triangles, line segments, points, patches, etc. as supported by various graphics processing application programming interfaces (APIs).
[0137] The tessellation control processing unit 508 treats the input vertices as control points for the geometric patch. The control points are transformed from an input representation from the patch (e.g., a basis of the patch) to a representation suitable for use in surface evaluation by the tessellation evaluation processing unit 512. The tessellation control processing unit 508 may also calculate tessellation factors for the edges of the geometric patch. The tessellation factors are applied to a single edge and quantize the view-dependent level of detail associated with the edge. The tessellation unit 510 is configured to receive the tessellation factors for the edges of the patch and tessellate the patch into a plurality of geometric primitives such as lines, triangles, or quadrilateral primitives, which are transmitted to the tessellation evaluation processing unit 512. The tessellation evaluation processing unit 512 operates on the parameterized coordinates of the subdivided patch to generate a surface representation and vertex attributes for each vertex associated with the geometric primitive.
[0138] A second instance of primitive assembler 514 receives vertex attributes from tessellation evaluation processing unit 512, reads stored vertex attributes as needed, and builds graphics primitives for processing by geometry processing unit 516. Geometry processing unit 516 is a programmable execution unit that executes geometry shader programs to transform graphics primitives received from primitive assembler 514 as specified by the geometry shader programs. In one embodiment, geometry processing unit 516 is programmed to subdivide a graphics primitive into one or more new graphics primitives and to compute parameters for rasterizing the new graphics primitives.
[0139] In some embodiments, the geometry processing unit 516 may add or delete elements in the geometry stream. The geometry processing unit 516 outputs parameters and vertices specifying new graphics primitives to the primitive assembler 518. The primitive assembler 518 receives the parameters and vertices from the geometry processing unit 516 and constructs graphics primitives for processing by the viewport scaling, picking and clipping unit 520. The geometry processing unit 516 reads data stored in the parallel processor memory or the system memory for use in processing geometry data. The viewport scaling, picking and clipping unit 520 performs clipping, picking and viewport scaling, and outputs the processed graphics primitives to the rasterizer 522. The rasterizer 522 may perform depth picking and other depth-based optimizations. The rasterizer 522 also performs scan conversion on the new graphics primitives to generate fragments, and outputs those fragments and associated coverage data to the fragment / pixel processing unit 524. The rasterizer 522 scan converts the new graphics primitives and outputs the fragments and coverage data to the fragment / pixel processing unit 524.
[0140] The fragment / pixel processing unit 524 is a programmable execution unit configured to execute a fragment shader program or a pixel shader program. The fragment / pixel processing unit 524 transforms the fragments or pixels received from the rasterizer 522 as specified by the fragment or pixel shader program. For example, the fragment / pixel processing unit 524 can be programmed to perform the following operations to generate shaded fragments or pixels output to the raster operation unit 526, including but not limited to texture mapping, shading, blending, texture correction, and perspective correction. The fragment / pixel processing unit 524 can read data stored in a parallel processor memory or a system memory for use in processing fragment data. The fragment or pixel shader program can be configured to shade at a sample, pixel, tile, or other granularity (depending on the sampling rate configured for the processing unit).
[0141] Raster operations unit 526 is a processing unit that performs raster operations including, but not limited to, stenciling, z-testing, blending, and the like, and outputs pixel data as processed graphics data for storage in graphics memory (e.g., as Figure 1 The raster operations unit 526 may be configured to compress the z or color data written to the memory and to decompress the z or color data read from the memory.
[0142] Figure 6 An embodiment of a computing device 600 that employs a sparse matrix processing mechanism is shown. The computing device 600 (e.g., a smart wearable device, a virtual reality (VR) device, a head mounted display (HMD), a mobile computer, an Internet of Things (IoT) device, a laptop computer, a desktop computer, a server computer, etc.) can be used with Figure 1 The data processing system 100 is the same as that of the data processing system 100, and therefore, for the sake of brevity, clarity and ease of understanding, the above reference Figure 1-5 Many of the details described are not further discussed or repeated below. As shown, in one embodiment, computing device 600 is shown as hosting a sparse matrix processing mechanism 610 .
[0143] As shown, in one embodiment, the sparse matrix processing mechanism 610 may be hosted by the GPU 614. However, in other embodiments, the sparse matrix processing mechanism 610 may be hosted in the graphics driver 616. In still other embodiments, the sparse matrix processing mechanism 610 may be hosted by or part of the firmware of the central processing unit ("CPU" or "application processor") 612. For brevity, clarity, and ease of understanding, throughout the remainder of this document, the sparse matrix processing mechanism 610 may be discussed as part of the graphics driver 616; however, the embodiments are not limited thereto.
[0144] In yet another embodiment, the sparse matrix processing mechanism 610 may be hosted as software or firmware logic by the operating system 606. In yet further embodiments, the sparse matrix processing mechanism 610 may be partially and simultaneously hosted by multiple components of the computing device 600, such as one or more of the graphics driver 616, the GPU 614, the GPU firmware, the CPU 612, the CPU firmware, the operating system 606, and / or the like. It is contemplated that the sparse matrix processing mechanism 610, or one or more of its components, may be implemented as hardware, software, and / or firmware.
[0145] Throughout this document, the term "user" may be referred to interchangeably as a "viewer," "observer," "person," "individual," "end-user," and / or the like. Note that throughout this document, terms like "graphics domain" may be referred to interchangeably with "graphics processing unit," "graphics processor," or simply "GPU," and similarly, "CPU domain" or "host domain" may be referred to interchangeably with "computer processing unit," "application processor," or simply "CPU."
[0146] The computing device 600 may include any number and type of communication devices, such as a large computing system (e.g., a server computer, a desktop computer, etc.), and may further include a set-top box (e.g., an Internet-based cable TV set-top box, etc.), a device based on a global positioning system (GPS), etc. The computing device 600 may include a mobile computing device used as a communication device, such as a cellular phone including a smart phone, a personal digital assistant (PDA), a tablet computer, a laptop computer, an e-reader, a smart TV, a TV platform, a wearable device (e.g., glasses, watches, bracelets, smart cards, jewelry, clothing articles, etc.), a media player, etc. For example, in one embodiment, the computing device 600 may include a mobile computing device that employs a computer platform that hosts an integrated circuit (“IC”) such as a system on a chip (“SoC” or “SOC”), which integrates various hardware and / or software components of the computing device 600 on a single chip.
[0147] As shown, in one embodiment, computing device 600 may include any number and types of hardware and / or software components such as, but not limited to, a GPU 614, a graphics driver (also referred to as a "GPU driver," "graphics driver logic," "driver logic," a user mode driver (UMD), UMD, user mode driver framework (UMDF), UMDF, or simply "driver") 616, a CPU 612, memory 608, network devices, drivers, etc., and input / output (I / O) sources 604 such as a touch screen, touch panel, touchpad, a virtual or conventional keyboard, a virtual or conventional mouse, ports, connectors, etc.
[0148] The computing device 600 may include an operating system (OS) 606 that serves as an interface between the hardware and / or physical resources of the computing device 600 and a user. It is contemplated that the CPU 612 may include one or more processors, such as Figure 1 The processor(s) 102 may include one or more graphics processors (or multiple processors), while the GPU 614 may include one or more graphics processors (or multiple processors).
[0149] It is noted that throughout this document, terms like "node", "computing node", "server", "server device", "cloud computer", "cloud server", "cloud server computer", "machine", "host machine", "device", "computing device", "computer", "computing system" and the like may be used interchangeably. It is further noted that throughout this document, terms like "application", "software application", "program", "software program", "package", "software software package" and the like may be used interchangeably. Likewise, throughout this document, terms like "job", "input", "request", "message" and the like may be used interchangeably.
[0150] As envisioned and as referenced Figure 1-5 As further described, some of the processes of the graphics pipeline described above are implemented in software, while others are implemented in hardware. The graphics pipeline may be implemented in a graphics coprocessor design, wherein the CPU 612 is designed to work with a GPU 614 that may be included in or co-located with the CPU 612. In one embodiment, the GPU 614 may employ any number and type of conventional software and hardware logic for performing conventional functions related to graphics rendering, as well as novel software and hardware logic for executing any number and type of instructions.
[0151] As mentioned above, the memory 608 may include random access memory (RAM) containing an application database having object information. Figure 1 The memory hub 105 of the CPU 612 can access the data in the RAM and forward it to the GPU 614 for graphics pipeline processing. The RAM may include double data rate RAM (DDR RAM), extended data output RAM (EDO RAM), etc. The CPU 612 interacts with the hardware graphics pipeline to share the graphics pipeline functionality.
[0152] The processed data is stored in a buffer in the hardware graphics pipeline, and state information is stored in memory 608. The resulting image is then transferred to an I / O source 604, such as a display component for displaying the image. It is contemplated that the display device can be of various types, such as a cathode ray tube (CRT), a thin film transistor (TFT), a liquid crystal display (LCD), an organic light emitting diode (OLED) array, etc., to display information to a user.
[0153] Memory 608 includes a pre-allocated buffer (eg, frame buffer) area; however, one of ordinary skill in the art will appreciate that the embodiments are not limited thereto and any memory accessible to the lower graphics pipeline may be used. Computing device 600 may further include, for example, Figure 1 The input / output (I / O) control hub (ICH) 107 referenced therein may serve as one or more I / O sources 604, etc.
[0154] The CPU 612 may include one or more processors for executing instructions in order to perform whatever software routines are implemented by the computing system. Instructions frequently involve some type of operation performed on data. Both data and instructions may be stored in the system memory 608 and any associated caches. Caches are typically designed to have a shorter latency than the system memory 608; for example, the cache may be integrated into the same (one or more) silicon chips as the (one or more) processors, and / or constructed with faster static RAM (SRAM) cells, while the system memory 608 may be constructed with slower dynamic RAM (DRAM) cells. By tending to store more frequently used instructions and data in the cache rather than in the system memory 608, the overall performance efficiency of the computing device 600 is improved. It is contemplated that in some embodiments, the GPU 614 may exist as part of the CPU 612 (such as part of a physical CPU package), in which case the memory 608 may be shared by the CPU 612 and the GPU 614 or kept separate.
[0155] The system memory 608 may be made available to other components within the computing device 600. For example, in a software program implementation, any data (e.g., input graphics data) received from various interfaces to the computing device 600 (e.g., keyboard and mouse, printer port, local area network (LAN) port, modem port, etc.) or any data retrieved from the internal storage elements of the computing device 600 (e.g., hard disk drive) is often temporarily queued in the system memory 608 before being operated on by one or more processors. Similarly, data that the software program determines should be sent from the computing device 600 to an external entity through one of the computing system interfaces or should be stored in an internal storage element is often temporarily queued in the system memory 608 before it is sent or stored.
[0156] Further, for example, the ICH may be used to ensure that such data is properly transferred between system memory 608 and its appropriate corresponding computing system interface (and internal storage if the computing system is so designed), and may have a bidirectional point-to-point link between itself and the observed I / O sources / devices 604. Similarly, the MCH may be used to manage various competing requests for access to system memory 608 between the CPU 612 and GPU 614, interfaces and internal storage elements, which may occur closely in time with each other.
[0157] I / O sources 604 may include one or more I / O devices implemented to transfer data to / from computing device 600 (e.g., a network adapter); or, in the case of large-scale non-volatile storage devices, to transfer data within computing device 600 (e.g., a hard drive). User input devices including alphanumeric and other keys may be used to communicate information and command selections to GPU 614. Another type of user input device is a cursor control (such as a mouse, trackball, touch screen, touch pad, or cursor direction keys) for communicating direction information and command selections to GPU 614 and for controlling cursor movement on a display device. The camera and microphone array of computer device 600 may be used to observe gestures, record audio and video, and reference receiving and transmitting visual and audio commands.
[0158] The computing device 600 may further include (one or more) network interfaces for providing access to networks such as LAN, wide area network (WAN), metropolitan area network (MAN), personal area network (PAN), Bluetooth, cloud network, mobile network (e.g., third generation (3G), fourth generation (4G), etc.), intranet, Internet, etc. The (one or more) network interfaces may include, for example, a wireless network interface having an antenna (which may represent one or more antennas). The (one or more) network interfaces may also include, for example, a wired network interface for communicating with a remote device via a network cable, which may be, for example, an Ethernet cable, a coaxial cable, a fiber optic cable, a serial cable, or a parallel cable.
[0159] The network interface(s) may provide access to a LAN, for example, by complying with IEEE 802.11b and / or IEEE 802.11g standards, and / or the wireless network interface may provide access to a personal area network, for example, by complying with the Bluetooth standard. Other wireless network interfaces and / or protocols may also be supported, including previous and subsequent versions of standards. In addition to or in lieu of communication via wireless LAN standards, the network interface(s) may also provide wireless communication using, for example, a time division multiple access (TDMA) protocol, a global system for mobile communications (GSM) protocol, a code division multiple access (CDMA) protocol, and / or any other type of wireless communication protocol.
[0160] The network interface(s) may include one or more communication interfaces, such as a modem, a network interface card, or other well-known interface devices, such as those used to couple to an Ethernet, a token ring network, or other types of physical wired or wireless attachments intended to, for example, provide a communication link that supports a LAN or WAN. In this way, the computer system may also be coupled to multiple peripheral devices, clients, control surfaces, consoles, or servers via conventional network architectures (including, for example, an intranet or the Internet).
[0161] It is to be appreciated that for some implementations, a system with fewer or more configurations than the examples described above may be preferred. Thus, the configuration of computing device 600 may vary between implementations depending on numerous factors such as price constraints, performance requirements, technological improvements, or other circumstances. Examples of electronic device or computer system 600 may include, without limitation, a mobile device, a personal digital assistant, a mobile computing device, a smart phone, a cellular phone, a handheld device, a one-way pager, a two-way pager, a messaging device, a computer, a personal computer (PC), a desktop computer, a laptop computer, a notebook computer, a handheld computer, a tablet computer, a server, a server array or server farm, a web server, a network server, an Internet server, a workstation, a minicomputer, a main frame computer, a supercomputer, a network appliance, a web appliance, a distributed computing system, a multiprocessor system, a processor-based system, a consumer electronics product, a programmable consumer electronics product, a television, a digital television, a set-top box, a wireless access point, a base station, a subscriber station, a mobile subscriber center, a radio network controller, a router, a hub, a gateway, a bridge, a switch, a machine, or a combination thereof.
[0162] Embodiments may be implemented as any one or a combination of the following: one or more microchips or integrated circuits interconnected using a motherboard, hardwired logic, software stored by a memory device and executed by a microprocessor, firmware, an application specific integrated circuit (ASIC), and / or a field programmable gate array (FPGA). The term "logic" may include, by way of example, software or hardware and / or a combination of software and hardware.
[0163] Embodiments may be provided, for example, as a computer program product that may include one or more machine-readable media having machine-executable instructions stored thereon that, when executed by one or more machines such as a computer, a network of computers, or other electronic devices, may cause the one or more machines to perform operations in accordance with the embodiments described herein. Machine-readable media may include, but are not limited to, floppy disks, optical disks, CD-ROMs (compact disk-read only memory), and magneto-optical disks, ROMs, RAMs, EPROMs (erasable programmable read-only memory), EEPROMs (electrically erasable programmable read-only memory), magnetic or optical cards, flash memory, or other types of media / machine-readable media suitable for storing machine-executable instructions.
[0164] In addition, embodiments may be downloaded as a computer program product, wherein the program may be transferred from a remote computer (e.g., a server) to a requesting computer (e.g., a client) via a communication link (e.g., a modem and / or a network connection) by one or more data signals embodied in and / or modulated by a carrier wave or other propagation medium.
[0165] Sparse matrix multiplication operations are important in a variety of applications involving neural networks. A sparse matrix is a matrix in which most of the elements are zero (or some other mathematically irrelevant value). Sparse matrices are often the result of received image data indicating that the image contains useless information. Matrix multiplication is typically performed using a block-wise approach, such as Fig. 7A . Thus, a conventional GPU takes two input matrix boxes as input and produces an output matrix box. However, when operating on sparse matrices, most of these input boxes contain zero values, which do not contribute to the cumulative result in the output matrix (e.g., multiplication by zero produces zero). According to one embodiment, the sparse matrix processing mechanism 610 includes a scheduler 613 that dynamically identifies operands that have zero values in the matrix being processed.
[0166] Figure 7B One embodiment of such a scheduler 613 included within a GPU processing element 700 is shown. Figure 7B As shown in , processing element 700 includes logic 701 for reading operands contained in received instructions. Also included are computational units 702 and write result logic 703. In one embodiment, scheduler 613 detects and identifies memory locations of operands having zero values. In such embodiments, when an instruction is received at GPU 614, scheduler 613 retrieves the stored operand values from memory (or cache).
[0167] Once retrieved, a determination is made as to whether the operand value is zero. Upon determining that the operand value is zero, the scheduler 613 blocks the scheduling of multiplications for those operands at the multiplication unit 702. Thus, only non-zero operands are scheduled and processed at the computation unit 702, while zero values are written by the scheduler 703 to the write result logic 703 for zero operands. Although shown as resident within the logic 701, other embodiments may feature the scheduler 703 resident outside of the logic 701.
[0168] In a further embodiment, the sparse matrix processing mechanism 610 further includes a sparse pattern tracker 615 for detecting one or more sparse data segments (e.g., sparsity patterns) within a stored data block and using the patterns to convert potential dense matrix calculations into sparse calculations. In one embodiment, the sparse pattern tracker 615 detects sparsity patterns in data (e.g., image data) stored in memory / cache.
[0169] Future deep learning systems are expected to store billions of images to be processed. Typically, images can be broken down into segments that depict useful vs. unimportant information. For example, if half of an image is empty, this information may be tracked at the memory level (e.g., via a memory controller), at the page level (in the OS), or at the cache hierarchy level. This information is useful during the execution of an application in order to eliminate the need to perform computations on unimportant (or sparse) empty segments.
[0170] Figure 7C One embodiment of a sparse pattern tracker 615 is shown, which includes pattern recognition logic 708 and sparse segments (or segment logic) 709. According to one embodiment, the pattern recognition logic 708 performs a bounding box operation on a data block by paging through the image data stored in memory to determine the similarity of various segments within the data block. Data segments within bounding boxes with the same value can be considered sparse data.
[0171] In one embodiment, pattern recognition logic 708 coordinates with a memory controller to track data stored in a memory device. In other embodiments, pattern recognition logic 708 tracks information at a cache hierarchy level. In still other embodiments, pattern recognition logic 708 tracks information at a page table level via OS 606. In a further embodiment, pattern recognition logic 708 may be implemented to parse a large amount of dense data to determine a segment that may be processed as a sparse operation. As a result, segment logic 709 records the address location of the sparse segment identified by pattern recognition logic 708. In one embodiment, sparse segment 709 includes a pointer to a sparse segment component. As discussed above, the matrix multiplication of a sparse operation may be bypassed, thereby reducing the processing load on GPU 614.
[0172] In still further embodiments, sparse matrix processing mechanism 610 comprises compression logic 617, and it is used for compressing sparse matrix.In such embodiments, based on sparse index (for example, defined by % of non-zero entries in matrix), dynamically generate compressed sparse matrix representation.In this embodiment, can adopt the non-zero value pointed to by row and column index to represent the compressed format of sparse matrix.
[0173] According to one embodiment, compression logic 617 receives the sparse segments defined by pattern recognition logic 708 and determines whether the data meets a predetermined threshold for being considered sparse. For example, when it is determined that Y number of entries within an MxN matrix are zero values, the matrix may be considered sparse. Compression logic 617 compresses the matrix determined to be sparse and stores the compressed matrix in a sparse compression buffer for execution on GPU 614.
[0174] Fig.7D One embodiment of a GPU 614 is shown that includes a sparse compression buffer 712 and multiple execution units (EUs) 710. In one embodiment, the sparse compression buffer 712 includes compressed sparse matrix storage entries 712 (0)-712 (n) that are processed by the EUs 710. In such embodiments, compression logic 717 stores frequently used sparse matrices. Prior to processing by the EUs 710, the compression logic 617 decompresses the compressed matrices back to their original format. In one embodiment, the same compressed matrix can be used by all EUs 710 for threads to be executed. However, in other embodiments, each EU 710 can use a unique sparse matrix for calculations. Therefore, frequently accessed sparse matrices are stored and read locally to avoid transferring data from the cache via a long interconnect.
[0175] The GPU 614 may be implemented to perform other deep learning operations. For example, the GPU 614 may perform layer processing of a neural network. A frequently executed pattern in almost all deep neural networks is a convolution (C) layer followed by a bias (B) layer, followed by a rectified linear unit (ReLu (R)) layer, followed by a pooling (P) layer. Most systems today execute these layers one after the other (e.g., on a GPU, C, B, R, and P are mapped as individual kernels), or as two separate kernels mapped as a fused CBR followed by P.
[0176] In both scenarios, more than one kernel call is required; thus incurring additional data transfer overhead. According to one embodiment, GPU 614 is configured so that EUs are partitioned and assigned to perform certain functions, and have intermediate results forwarded between them to achieve high throughput. Fig. 7E One embodiment of a GPU 614 with partitioned EUs 720 is shown.
[0177] like Fig. 7E As shown in FIG. 1 , EU 720 (1)-720 (10) is assigned to execute convolutional layer threads, while EU 720 (11)-720 (13), EU 720 (14)-720 (16), and EU 720 (17)-720 (19) respectively execute bias, ReLu, and pooling layer threads. Further, data between layer EUs 720 are forwarded. For example, by setting up a pipeline, data from C can be pushed to the cache level of B as soon as it is completed.
[0178] According to one embodiment, the partitioning and allocation of EU 720 may be established in advance based on domain knowledge. In such embodiments, the computational mechanism EU 720 may be statically partitioned so that the EU allocation remains the same during the life of a particular application. In other embodiments, EU 720 may be optimally partitioned for each call executed by GPU 614. In still other embodiments, the configuration may be dynamic so that it changes by thread group during dispatch. In still further embodiments, partitioning may be implemented to perform processing of other types of neural network layers (in addition to C, B, R, and P layers) by determining a common pattern and setting up a pipeline to execute them faster on the GPU rather than executing them individually.
[0179] Machine Learning Overview
[0180] A machine learning algorithm is an algorithm that can learn based on a set of data. Embodiments of machine learning algorithms can be designed to model high-level abstractions within a data set. For example, an image recognition algorithm can be used to determine which of several categories a given input belongs to; a regression algorithm can output a numerical value given an input; and a pattern recognition algorithm can be used to generate translated text or perform text-to-speech and / or speech recognition.
[0181] One example type of machine learning algorithm is a neural network. There are many types of neural networks; one simple type of neural network is a feedforward network. A feedforward network can be implemented as an acyclic graph in which nodes are arranged in layers. Typically, a feedforward network topology includes an input layer and an output layer separated by at least one hidden layer. The hidden layer transforms the input received by the input layer into a representation useful for generating output in the output layer. The nodes of the network are fully connected to the nodes in the adjacent layers via edges, but there are no edges between the nodes within each layer. Data received at the nodes of the input layer of the feedforward network is propagated (i.e., "fed forward") to the nodes of the output layer via an activation function, which calculates the state of the nodes of each successive layer in the network based on coefficients ("weights"), which are respectively associated with each of the edges connecting the layers. Depending on the specific model represented by the algorithm being executed, the output from the neural network algorithm can take a variety of forms.
[0182] Before a machine learning algorithm can be used to model a particular problem, the algorithm is trained using a training data set. Training a neural network involves selecting a network topology, using a set of training data representing the problem modeled by the network, and adjusting weights until the network model performs with minimal error for all instances of the training data set. For example, during a supervised learning training process for a neural network, the output generated by the network in response to an input representing an instance in the training data set is compared to the "correct" labeled output for the instance, an error signal representing the difference between the output and the labeled output is calculated, and when the error signal is propagated back through the layers of the network, the weights associated with the connections are adjusted to minimize the error. The network is considered "trained" when the error for each output generated from an instance of the training data set is minimized.
[0183] The accuracy of a machine learning algorithm may be significantly affected by the quality of the data set used to train the algorithm. The training process can be computationally intensive and can take a significant amount of time on a conventional general-purpose processor. Therefore, many types of machine learning algorithms are trained using parallel processing hardware. This is particularly useful for optimizing the training of neural networks, as the calculations performed when adjusting the coefficients in a neural network themselves naturally lend themselves to parallel implementation. In particular, many machine learning algorithms and software applications have been adapted to use parallel processing hardware within general-purpose graphics processing devices.
[0184] Figure 8 800 is a generalized diagram of a machine learning software stack 800. The machine learning application 802 may be configured to train a neural network using a training data set or to implement machine intelligence using a trained deep neural network. The machine learning application 802 may include specialized software that may be used to train a neural network prior to deployment and / or training and inference functions for the neural network. The machine learning application 802 may implement any type of machine intelligence, including but not limited to image recognition, mapping and localization, autonomous navigation, speech synthesis, medical imaging, or language translation.
[0185] Hardware acceleration for machine learning applications 802 can be enabled via a machine learning framework 804. The machine learning framework 804 can provide a library of machine learning primitives. Machine learning primitives are basic operations that machine learning algorithms typically perform. Without the machine learning framework 804, developers of machine learning algorithms would be required to create and optimize the main computational logic associated with the machine learning algorithm, and then re-optimize the computational logic when a new parallel processor is developed. Instead, machine learning applications can be configured to use primitives provided by the machine learning framework 804 to perform necessary calculations. Exemplary primitives include tensor convolutions, activation functions, and pooling, which are computational operations performed when training a convolutional neural network (CNN). The machine learning framework 804 can also provide primitives to implement basic linear algebra subroutines, such as matrix and vector operations, performed by many machine learning algorithms.
[0186] The machine learning framework 804 may process input data received from the machine learning application 802 and generate appropriate inputs to the computation framework 806. The computation framework 806 may abstract the basic instructions provided to the GPGPU driver 808 to enable the machine learning framework 804 to take advantage of hardware acceleration via the GPGPU hardware 810 without requiring the machine learning framework 804 to be intimately familiar with the architecture of the GPGPU hardware 810. In addition, the computation framework 806 may enable hardware acceleration for the machine learning framework 804 across multiple types and generations of GPGPU hardware 810.
[0187] GPGPU machine learning acceleration
[0188] Fig. 9 A highly parallel general purpose graphics processing unit 900 is illustrated in accordance with an embodiment. In one embodiment, a general purpose processing unit (GPGPU) 900 may be configured to be particularly efficient at processing the type of computational workload associated with training deep neural networks. Additionally, a GPGPU 900 may be directly linked to other instances of a GPGPU to create a multi-GPU cluster to improve the speed of training particularly deep neural networks.
[0189] GPGPU 900 includes a host interface 902 for enabling connection to a host processor. In one embodiment, host interface 902 is a PCI Express interface. However, the host interface may also be a vendor-specific communication interface or communication structure. GPGPU 900 receives commands from the host processor and distributes execution threads associated with those commands to a set of computing clusters 906A-H using a global scheduler 904. Computing clusters 906A-H share cache memory 908. Cache memory 908 may act as a high-level cache in cache memory within computing clusters 906A-H.
[0190] GPGPU 900 includes memory 914A-B, which is coupled to computing cluster 906A-H via a set of memory controllers 912A-B. In various embodiments, memory 914A-B may include various types of memory devices, including dynamic random access memory (DRAM) or graphics random access memory, such as synchronous graphics random access memory (SGRAM), including graphics double data rate (GDDR) memory. In one embodiment, memory units 224A-224N may also include 3D stacked memory, including but not limited to high bandwidth memory (HBM).
[0191] In one embodiment, each computing cluster GPLAB06A-H includes a set of graphics multiprocessors such as Figure 4A The graphics multiprocessor 400 of the computing cluster includes multiple types of integer and floating point logic units that can perform computational operations at a range of precisions, including precisions suitable for machine learning computations. For example and in one embodiment, at least a subset of the floating point units in each of the computing clusters 906A-H can be configured to perform 16-bit or 32-bit floating point operations, while a different subset of the floating point units can be configured to perform 64-bit floating point operations.
[0192] Multiple instances of GPGPU 900 can be configured to operate as a computing cluster. The communication mechanism used by the computing cluster for synchronization and data exchange varies across embodiments. In one embodiment, multiple instances of GPGPU 900 communicate through a host interface 902. In one embodiment, GPGPU 900 includes an I / O hub 909 that couples GPGPU 900 to a GPU link 910, which enables direct connection to other instances of GPGPU. In one embodiment, GPU link 910 is coupled to a dedicated GPU to GPU bridge, which enables communication and synchronization between multiple instances of GPGPU 900. In one embodiment, GPU link 910 is coupled to a high-speed interconnect to transfer data to other GPGPUs or parallel processors and receive data. In one embodiment, multiple instances of GPGPU 900 are located in a separate data processing system and communicate via a network device, which can be accessed via a host interface 902. In one embodiment, in addition to or as a replacement for the host interface 902, GPU link 910 can be configured to enable connection to a host processor.
[0193] Although the illustrated configuration of the GPGPU 900 can be configured to train a neural network, one embodiment provides an alternative configuration of the GPGPU 900 that can be configured for deployment within a high-performance or low-power inference platform. In the inference configuration, the GPGPU 900 includes fewer computing clusters 906A-H relative to the training configuration. In addition, the memory technology associated with the memory 914A-B may be different between the inference configuration and the training configuration. In one embodiment, the inference configuration of the GPGPU 900 can support inference-specific instructions. For example, the inference configuration can provide support for one or more 8-bit integer dot product instructions, which are typically used during inference operations for deployed neural networks.
[0194] Fig.10 A multi-GPU computing system 1000 is illustrated according to an embodiment. The multi-GPU computing system 1000 may include a processor 1002 coupled to a plurality of GPGPUs 1006A-D via a host interface switch 1004. In one embodiment, the host interface switch 1004 is a PCI express switch device that couples the processor 1002 to a PCI express bus, through which the processor 1002 can communicate with the set of GPGPUs 1006A-D. Each of the plurality of GPGPUs 1006A-D may be Fig. 9 1006A-D can be interconnected via a set of high-speed point-to-point GPU-to-GPU links 1016. The high-speed GPU-to-GPU links can be connected via dedicated GPU links (such as Fig. 9 1004) is connected to each of the GPGPUs 1006A-D. P2P GPU link 1016 enables direct communication between each of the GPGPUs 1006A-D without requiring communication through a host interface bus to which the processor 1002 is connected. In the case where GPU-to-GPU traffic involves a P2P GPU link, the host interface bus can still be used for system memory access or communication with other instances of the multi-GPU computing system 1000, for example, via one or more network devices. Although in the illustrated embodiment GPGPUs 1006A-D are connected to the processor 1002 via a host interface switch 1004, in one embodiment the processor 1002 includes direct support for P2P GPU link 1016 and can be directly connected to the GPGPUs 1006A-D.
[0195] Machine Learning Neural Network Implementation
[0196] The computing architecture provided by the embodiments described herein can be configured to perform parallel processing of a type particularly suitable for training and deploying neural networks for machine learning. A neural network can be generalized as a network of functions with graph relationships. As is known in the art, there are many types of neural network implementations used in machine learning. One exemplary type of neural network is a feedforward network as previously described.
[0197] The second exemplary type of neural network is a convolutional neural network (CNN). A CNN is a specialized feed-forward neural network for processing data with a known grid-like topology, such as image data. As a result, CNNs are commonly used for computational vision and image recognition applications, but they can also be used for other types of pattern recognition, such as speech and language processing. The nodes in the input layer of a CNN are organized into a set of "filters" (feature detectors inspired by the receptive fields found in the retina), and the output of each set of filters is propagated to nodes in successive layers of the network. The calculations for a CNN include applying a convolution mathematical operation to each filter to produce the output of that filter. A convolution is a specialized type of mathematical operation performed by two functions to produce a third function, which is a modified version of one of the two original functions. In convolutional network terminology, the first function of the convolution can be referred to as the input, and the second function can be referred to as the convolution kernel. The output can be referred to as a feature map. For example, the input to a convolutional layer can be a multidimensional data array that defines the various color components of the input image. The convolution kernel can be a multidimensional parameter array, where the parameters are adapted by a training process for the neural network.
[0198] A recurrent neural network (RNN) is a type of feedforward neural network that includes feedback connections between layers. RNNs enable modeling of sequence data by sharing parameter data across different parts of the neural network. The architecture of an RNN includes loops. A loop represents the effect of the current value of a variable on its own value at a future time, as at least a portion of the output data from the RNN is used as feedback for processing subsequent inputs in the sequence. This feature makes RNNs particularly useful for language processing due to the mutable nature that language data can include.
[0199] The figures described below present exemplary feedforward, CNN, and RNN networks, and describe the general process for training and deploying each of those types of networks, respectively. It will be understood that these descriptions are exemplary and non-limiting with respect to any specific embodiments described herein, and that the concepts illustrated can be generally applied to deep neural networks and machine learning techniques in general.
[0200] The exemplary neural network described above can be used to perform deep learning. Deep learning is machine learning performed using a deep neural network. In contrast to shallow neural networks that include only a single hidden layer, the deep neural network used in deep learning is an artificial neural network composed of multiple hidden layers. Training deeper neural networks is generally more computationally intensive. However, the additional hidden layers of the network enable multi-step pattern recognition, which results in reduced output errors relative to shallow machine learning techniques.
[0201] The deep neural networks used in deep learning typically include a front-end network to perform feature recognition coupled to a back-end network representing a mathematical model, which can perform operations (e.g., object classification, speech recognition, etc.) based on the feature representations provided to the model. Deep learning enables machine learning to be performed without requiring handcrafted feature engineering to be performed on the model. Instead, deep neural networks can learn features based on statistical structures or correlations within the input data. The learned features can be provided to a mathematical model, which can map the detected features to outputs. The mathematical model used by the network is generally specialized for a specific task to be performed, and different models will be used to perform different tasks.
[0202] Once a neural network is structured, a learning model can be applied to the network to train the network to perform a specific task. The learning model describes how to adjust the weights within the model to reduce the network's output error. Backpropagation of errors is a common method for training neural networks. An input vector is presented to the network for processing. The output of the network is compared to the desired output using a loss function, and an error value is calculated for each neuron in the output layer. The error values are then propagated backwards until each neuron has an associated error value that roughly represents its contribution to the original output. The network can then learn from those errors using an algorithm such as the stochastic gradient descent algorithm to update the weights of the neural network.
[0203] Fig.11A -B illustrates an exemplary convolutional neural network. Fig.11A The diagram shows the various layers within a CNN. Fig.11AAs shown in , an exemplary CNN for modeling image processing can receive an input 1102, which describes the red, green, and blue (RGB) components of an input image. The input 1102 can be processed by multiple convolutional layers (e.g., convolutional layer 1104, convolutional layer 1106). The outputs from the multiple convolutional layers can be optionally processed by a set of fully connected layers 1108. The neurons in the fully connected layer have full connections to all activation functions in the previous layer, as previously described for the feedforward network. The output from the fully connected layer 1108 can be used to generate output results from the network. Matrix multiplication can be used instead of convolution to calculate the activation within the fully connected layer 1108. Not all CNN implementations use the fully connected layer 1108. For example, in some implementations, the convolutional layer 1106 can generate the output of the CNN.
[0204] The convolutional layers are sparsely connected, which is different from the traditional neural network configuration found in the fully connected layer 1108. Traditional neural network layers are fully connected so that each output unit interacts with each input unit. However, the convolutional layers are sparsely connected because the output of the convolution of the domain (rather than the corresponding state value of each node in the domain) is input to the nodes of the subsequent layer, as shown. The kernel associated with the convolutional layer performs a convolution operation, the output of which is sent to the next layer. The dimensionality reduction performed within the convolutional layer is one aspect that enables CNNs to scale to process large images.
[0205] Fig. 11B Illustrated are exemplary computational stages within a convolutional layer of a CNN. An input 1112 to a convolutional layer of a CNN may be processed in three stages of a convolutional layer 1114. The three stages may include a convolution stage 1116, a detector stage 1118, and a pooling stage 1120. The convolutional layer 1114 may then output data to a successive convolutional layer. The final convolutional layer of the network may generate output feature map data or provide input to a fully connected layer, for example to generate a classification value for input to the CNN.
[0206] Several convolutions are performed in parallel in the convolution stage 1116 to produce a set of linear activations. The convolution stage 1116 may include an affine transformation, which is any transformation that can be specified as a linear transformation plus a translation. Affine transformations include rotations, translations, scaling, and combinations of these transformations. The convolution stage calculates the output of a function (e.g., a neuron) connected to a specific region in the input, which can be determined as a local region associated with the neuron. The neuron calculates the dot product between the weight of the neuron and the region in the local input to which the neuron is connected. The output from the convolution stage 1116 defines a set of linear activations processed by successive stages of the convolution layer 1114.
[0207] The linear activations may be processed by the detector stage 1118. In the detector stage 1118, each linear activation is processed by a non-linear activation function. The non-linear activation function increases the non-linear nature of the overall network without affecting the receptive field of the convolutional layer. Several types of non-linear activation functions may be used. One particular type is the rectified linear unit (ReLU), which is defined as f(x) =max( 0 , x ) such that the activation is thresholded at zero.
[0208] The pooling stage 1120 uses a pooling function that replaces the output of the convolution layer 1106 with summary statistics of nearby outputs. The pooling function can be used to introduce translation invariance into the neural network so that small translations of the input do not change the pooled output. The invariance of local translations can be useful in scenarios where the presence of a feature in the input data is more important than the exact location of the feature. Various types of pooling functions can be used during the pooling stage 1120, including maximum pooling, average pooling, and l2-norm pooling. In addition, some CNN implementations do not include a pooling stage. Instead, such implementations replace and additional convolution stages with an increased stride relative to the previous convolution stage.
[0209] The output from the convolutional layer 1114 may then be processed by the next layer 1122. The next layer 1122 may be an additional convolutional layer or one of the fully connected layers 1108. For example, Fig.11A The first convolutional layer 1104 can output to the second convolutional layer 1106, and the second convolutional layer can output to the first layer in the fully connected layer 1108.
[0210] Fig.12An exemplary recurrent neural network 1200 is illustrated. In a recurrent neural network (RNN), the previous state of the network affects the output of the current state of the network. A variety of functions can be used to establish RNNs in a variety of ways. The use of RNNs generally revolves around the use of mathematical models to predict the future based on previous input sequences. For example, RNNs can be used to perform statistical language modeling to predict upcoming words given a previous word sequence. The illustrated RNN 1200 can be described as having an input layer 1202 that receives an input vector, a hidden layer 1204 for implementing a recursive function, a feedback mechanism 1205 for enabling a 'memory' of a previous state, and an output layer 1206 for outputting a result. The RNN 1200 operates based on time steps. The state of the RNN at a given time step is affected based on the previous time step via the feedback mechanism 1205. For a given time step, the state of the hidden layer 1204 is defined by the previous state and the input at the current time step. The initial input (x1) at the first time step can be processed by the hidden layer 1204. The second input (x2) can be processed by the hidden layer 1204 using the state information determined during the processing of the initial input (x1). The given state can be calculated as s t = f ( Ux t + W t-1 ),in U and W is the parameter matrix. The function f Usually nonlinear, such as the hyperbolic tangent function (Tanh) or the modified function f(x) = max( 0 , x However, the specific mathematical function used in hidden layer 1204 may vary depending on the specific implementation details of RNN 1200.
[0211] In addition to the basic CNN and RNN networks described, variations of those networks can also be enabled. An example RNN variant is the Long Short Term Memory (LSTM) RNN. LSTM RNN is able to learn long-term dependencies that may be necessary for processing longer language sequences. A variant of CNN is the Convolutional Deep Belief Network, which has a structure similar to that of a CNN and is trained in a manner similar to that of a Deep Belief Network. A Deep Belief Network (DBN) is a generative neural network consisting of multiple layers of random (stochastic) variables. A DBN can be trained layer by layer using greedy unsupervised learning. The learned weights of the DBN can then be used to provide a pre-trained neural network by determining a set of optimal initial weights for the neural network.
[0212] Fig.13The training and deployment of a deep neural network is illustrated. Once a given network has been structured for a task, the neural network is trained using a training data set 1302. Various training frameworks have been developed to enable hardware acceleration of the training process. For example, Figure 8 The machine learning framework 804 can be configured as a training framework 1304. The training framework 1304 can be hooked up to the untrained neural network 1306 and enable the untrained neural network to be trained using the parallel processing resources described herein to generate a trained neural network 1308.
[0213] To start the training process, initial weights can be chosen randomly or by pre-training with a deep belief network. A training cycle is then performed in a supervised or unsupervised manner.
[0214] Supervised learning is a learning method in which training is performed as a mediation operation, such as when the training data set 1302 includes an input paired with an expected output of the input, or when the training data set includes an input with a known output and the output of the neural network is manually graded. The network processes the input and compares the generated output with a set of expected or desired outputs. The error is then back-propagated through the system. The training framework 1304 can be adjusted to adjust the weights that control the untrained neural network 1306. The training framework 1304 can provide tools to monitor how well the untrained neural network 1306 converges toward a model suitable for generating the correct answer based on the known input data. The training process occurs repeatedly when the weights of the network are adjusted to improve the output generated by the neural network. The training process can continue until the neural network reaches a statistically expected accuracy associated with the trained neural network 1308. The trained neural network 1308 can then be deployed to implement any number of machine learning operations.
[0215] Unsupervised learning is a learning method in which a network attempts to train itself using unlabeled data. Thus, for unsupervised learning, the training data set 1302 will include input data without any associated output data. The untrained neural network 1306 can learn groupings within the unlabeled inputs and can determine how individual inputs relate to the overall data set. Unsupervised training can be used to generate a self-organizing map, which is a type of trained neural network 1307 that is able to perform operations useful in reducing the dimensionality of the data. Unsupervised training can also be used to perform anomaly detection, which allows identification of data points in the input data set that deviate from normal data patterns.
[0216] Variations of supervised and unsupervised training may also be employed. Semi-supervised learning is a technique in which the training data set 1302 includes a mixture of labeled and unlabeled data of the same distribution. Incremental learning is a variation of supervised learning in which input data is used continuously to further train the model. Incremental learning enables a trained neural network 1308 to adapt to new data 1312 without forgetting the knowledge instilled into the network during initial training.
[0217] Whether supervised or unsupervised, the training process for particularly deep neural networks may be too computationally intensive for a single computing node. The training process can be accelerated using a distributed network of computing nodes rather than using a single computing node.
[0218] Fig.14 is a block diagram illustrating distributed learning. Distributed learning is a training model that uses multiple distributed computing nodes to perform supervised or unsupervised training of a neural network. The distributed computing nodes can each include one or more host processors and one or more of general processing nodes, such as a highly parallel general-purpose graphics processing unit 900 as shown in FIG. 900. As illustrated, distributed learning can perform model parallelism 1402, data parallelism 1404, or a combination of model and data parallelism 1404.
[0219] In model parallelization 1402, different computing nodes in a distributed system can perform training computations for different parts of a single network. For example, each layer of a neural network can be trained by a different processing node of the distributed system. The benefits of model parallelism include the ability to scale to particularly large models. Splitting the computations associated with different layers of a neural network enables training of very large neural networks where the weights of all layers will not fit into the memory of a single computing node. In some instances, model parallelism can be particularly useful in performing unsupervised training of large neural networks.
[0220] In data parallelization 1404, different nodes of the distributed network have complete instances of the model, and each node receives a different portion of the data. The results from different nodes are then combined. Although different methods for data parallelization are possible, data parallel training methods all require techniques for combining results and synchronizing model parameters between each node. Exemplary methods for combining data include parameter averaging and update-based data parallelization. Parameter averaging trains each node on a subset of the training data, and sets global parameters (e.g., weights, biases) to the average value of the parameters from each node. Parameter averaging uses a central parameter server that maintains parameter data. Update-based data parallelism is similar to parameter averaging, except that updates to the model are transmitted instead of transmitting parameters from the node to the parameter server. In addition, update-based data parallelism can be performed in a decentralized manner, where updates are compressed and transmitted between nodes.
[0221] For example, the combined model and data parallelism 1406 can be implemented in a distributed system where each computing node includes multiple GPUs. Each node can have a complete instance of the model, with separate GPUs within each node used to train different parts of the model.
[0222] Distributed training has increased overhead relative to training on a single machine. However, the parallel processors and GPGPUs described herein can each implement various techniques for reducing the overhead of distributed training, including techniques for enabling high-bandwidth GPU-to-GPU data transfer and accelerated remote data synchronization.
[0223] Example Machine Learning Applications
[0224] Machine learning can be applied to solve a variety of technical problems, including but not limited to computer vision, autonomous driving and navigation, speech recognition, and language processing. Computer vision has traditionally been one of the most active research areas for machine learning applications. The application range of computer vision is from reproducing human visual capabilities (such as recognizing faces) to creating new categories of visual capabilities. For example, a computer vision application can be configured to recognize sound waves from vibrations induced in objects visible in a video. Parallel processor-accelerated machine learning enables the use of significantly larger training data sets than previously feasible training data sets to train computer vision applications, and enables the use of low-power parallel processors to deploy inference systems.
[0225] Parallel processor-accelerated machine learning has autonomous driving applications, including lane and road sign recognition, obstacle avoidance, navigation, and driving control. Accelerated machine learning techniques can be used to train a driving model based on a data set that defines the appropriate response to a specific training input. The parallel processors described herein can enable rapid training of increasingly complex neural networks for autonomous driving solutions and enable the deployment of low-power inference processors in mobile platforms suitable for integration into autonomous vehicles.
[0226] Deep neural networks accelerated by parallel processors have enabled machine learning methods for automatic speech recognition (ASR). ASR involves creating a function that computes the most likely speech sequence given a sequence of input sounds. Accelerated machine learning using deep neural networks has enabled the replacement of hidden Markov models (HMMs) and Gaussian mixture models (GMMs) previously used for ASR.
[0227] Parallel processor accelerated machine learning can also be used to accelerate natural language processing. Automatic learning programs can use statistical inference algorithms to produce models that are robust to erroneous or unfamiliar inputs. Exemplary natural language processor applications include automatic machine translation between human languages.
[0228] The parallel processing platform for machine learning can be divided into a training platform and a deployment platform. The training platform is generally highly parallel and includes optimizations to accelerate multi-GPU single-node training and multi-node multi-GPU training. Exemplary parallel processors suitable for training include the highly parallel general-purpose graphics processing unit 900 of Figure 900 and the multi-GPU computing system 1000 of Figure 1000. In contrast, the deployed machine learning platform generally includes a low-power parallel processor suitable for use in products such as cameras, autonomous robots, and autonomous vehicles.
[0229] Fig.15An exemplary inference system on chip (SOC) 1500 suitable for performing inference using a trained model is illustrated. The SOC 1500 may integrate processing components including a media processor 1502, a visual processor 1504, a GPGPU 1506, and a multi-core processor 1508. The SOC 1500 may additionally include an on-chip memory 1505 that may enable a shared on-chip data pool accessible by each of the processing components. The processing components may be optimized for low-power operation to enable deployment to a variety of machine learning platforms, including autonomous vehicles and autonomous robots. For example, an implementation of the SOC 1500 may be used as part of a master control system for an autonomous vehicle. In the case where the SOC 1500 is configured for use in an autonomous vehicle, the SOC is designed and configured to comply with the relevant functional safety standards of the deployment jurisdiction.
[0230] During operation, the media processor 1502 and the visual processor 1504 can work in unison to accelerate computer vision operations. The media processor 1502 can enable low latency decoding of multiple high-resolution (e.g., 4K, 8K) video streams. The decoded video streams can be written to a buffer in the on-chip memory 1505. The visual processor 1504 can then parse the decoded video and perform preliminary processing operations on the frames of the decoded video in preparation for processing the frames of the decoded video using the trained image recognition model. For example, the visual processor 1504 can accelerate the convolution operations for CNN used to perform image recognition on high-resolution video data, while the back-end model calculations are performed by the GPGPU 1506.
[0231] The multi-core processor 1508 may include control logic to facilitate sequencing and synchronization of shared memory operations and data transfers performed by the media processor 1502 and the vision processor 1504. The multi-core processor 1508 may also act as an application processor to execute software applications that may use the inference computing capabilities of the GPGPU 1506. For example, at least a portion of navigation and driving logic may be implemented in software executed on the multi-core processor 1508. Such software may issue computational workloads directly to the GPGPU 1506, or may issue computational workloads to the multi-core processor 1508, which may offload at least a portion of those operations to the GPGPU 1506.
[0232] GPGPU 1506 may include a computing cluster, such as a low-power configuration of computing clusters 906A-906H within a highly parallel general-purpose graphics processing unit 900. The computing cluster within GPGPU 1506 may support instructions that are specifically optimized to perform inference calculations on trained neural networks. For example, GPGPU 1506 may support instructions for performing low-precision calculations such as 8-bit and 4-bit integer vector operations.
[0233] Additional Exemplary Graphics Processing Systems
[0234] Details of the embodiments described above may be incorporated into the graphics processing system and apparatus described below. Figure 16-29 The graphics processing systems and devices of illustrative embodiments illustrate alternative systems and graphics processing hardware that may implement any and all of the techniques described above.
[0235] Additional Exemplary Graphics Processing System Overview
[0236] Fig.16 16 is a block diagram of a processing system 1600 according to an embodiment. In various embodiments, the system 1600 includes one or more processors 1602 and one or more graphics processors 1608, and may be a server system, a single processor desktop system, or a multi-processor workstation system having a large number of processors 1602 or processor cores 1607. In one embodiment, the system 1600 is a processing platform incorporated within a system-on-chip (SoC) integrated circuit for use in a mobile, handheld, or embedded device.
[0237] Embodiments of system 1600 may include or be incorporated into: a server-based gaming platform, a gaming console (including gaming and media consoles, mobile gaming consoles, handheld gaming consoles, or online gaming consoles). In some embodiments, system 1600 is a mobile phone, a smart phone, a tablet computing device, or a mobile Internet device. Data processing system 1600 may also include, be coupled to, or be integrated into: a wearable device, such as a smart watch wearable device, a smart eye wearable device, an augmented reality device, or a virtual reality device. In some embodiments, data processing system 1600 is a television or set-top box device having one or more processors 1602 and a graphical interface generated by one or more graphics processors 1608.
[0238] In some embodiments, the one or more processors 1602 each include one or more processor cores 1607 for processing instructions, which when executed perform operations of the system and user software. In some embodiments, each of the one or more processor cores 1607 is configured to process a specific instruction set 1609. In some embodiments, the instruction set 1609 can facilitate complex instruction set computing (CISC), reduced instruction set computing (RISC), or computing via very long instruction words (VLIW). Multiple processor cores 1607 can each process different instruction sets 1609, which may include instructions for facilitating emulation of other instruction sets. The processor core 1607 may also include other processing devices, such as a digital signal processor (DSP).
[0239] In some embodiments, the processor 1602 includes a cache memory 1604. Depending on the architecture, the processor 1602 may have a single internal cache or multiple levels of internal cache. In some embodiments, the cache memory is shared among various components of the processor 1602. In some embodiments, the processor 1602 also uses an external cache (e.g., a level 3 (L3) cache or a last level cache (LLC)) (not shown), which may be shared among the processor core 1607 using known cache coherence techniques. A register file 1606 is additionally included in the processor 1602, which may include different types of registers (e.g., integer registers, floating point registers, status registers, and instruction pointer registers) for storing different types of data. Some registers may be general purpose registers, while other registers may be specific to the design of the processor 1602.
[0240] In some embodiments, the processor 1602 is coupled to a processor bus 1610 component for transmitting communication signals (such as address, data or control signals) between the processor 1602 and other components in the system 1600. In one embodiment, the system 1600 uses an exemplary 'hub' system architecture, including a memory controller hub 1616 and an input output (I / O) controller hub 1630. The memory controller hub 1616 facilitates communication between memory devices and other components of the system 1600, while the I / O controller hub (ICH) 1630 provides connections to the I / O devices via a local I / O bus. In one embodiment, the logic of the memory controller hub 1616 is integrated within the processor.
[0241] The memory device 1620 may be a dynamic random access memory (DRAM) device, a static random access memory (SRAM) device, a flash memory device, a phase change memory device, or some other memory device having suitable properties to act as a process memory. In one embodiment, the memory device 1620 may operate as a system memory of the system 1600 to store data 1622 and instructions 1621 for use when the one or more processors 1602 execute applications or processes. The memory controller hub 1616 is also coupled to an optional external graphics processor 1612, which may communicate with one or more graphics processors 1608 in the processor 1602 to perform graphics and media operations.
[0242] In some embodiments, the ICH 1630 enables peripheral devices to connect to the memory device 1620 and the processor 1602 via a high-speed I / O bus. The I / O peripheral devices include, but are not limited to, an audio controller 1646, a firmware interface 1628, a wireless transceiver 1626 (e.g., Wi-Fi, Bluetooth), a data storage device 1624 (e.g., a hard drive, flash memory, etc.), and a traditional I / O controller 1640 for coupling traditional (e.g., Personal System 2 (PS / 2)) devices to the system. One or more Universal Serial Bus (USB) controllers 1642 connect input devices (such as a keyboard and mouse 1644 combination). A network controller 1634 may also be coupled to the ICH 1630. In some embodiments, a high-performance network controller (not shown) is coupled to the processor bus 1610. It will be appreciated that the system 1600 shown is exemplary and not limiting, as other types of data processing systems configured in different ways may also be used. For example, the I / O controller hub 1630 may be integrated within the one or more processors 1602 , or the memory controller hub 1616 and the I / O controller hub 1630 may be integrated into a discreet external graphics processor, such as the external graphics processor 1612 .
[0243] Fig.17 is a block diagram of an embodiment of a processor 1700 having one or more processor cores 1702A- 1702N, an integrated memory controller 1714 , and an integrated graphics processor 1708 . Fig.17Those elements having the same reference numbers (or names) as those of any other figure herein may operate or function in any manner similar to that described elsewhere herein, but are not limited thereto. Processor 1700 may include additional cores up to and including additional core 1702N represented by a dashed box. Each of processor cores 1702A-1702N includes one or more internal cache units 1704A-1704N. In some embodiments, each processor core is also capable of accessing one or more shared cache units 1706.
[0244] Internal cache units 1704A-1704N and shared cache unit 1706 represent a cache memory hierarchy within processor 1700. The cache memory hierarchy may include at least one level of instruction and data cache within each processor core and one or more levels of shared intermediate level caches (such as level 2 (L2), level 3 (L3), level 4 (L4), or other levels of cache), where the highest level cache in front of external memory is classified as LLC. In some embodiments, cache coherence logic maintains coherence between the various cache units 1706 and 1704A-1704N.
[0245] In some embodiments, the processor 1700 may also include a set of one or more bus controller units 1716 and a system agent core 1710. The one or more bus controller units 1716 manage a set of peripheral buses, such as one or more peripheral component interconnect buses (e.g., PCI, PCI Express). The system agent core 1710 provides management functionality for various processor components. In some embodiments, the system agent core 1710 includes one or more integrated memory controllers 1714 to manage access to various external memory devices (not shown).
[0246] In some embodiments, one or more of the processor cores 1702A-1702N include support for simultaneous multithreading. In such embodiments, the system agent core 1710 includes components for coordinating and operating the cores 1702A-1702N during multithreaded processing. The system agent core 1710 may additionally include a power control unit (PCU) that includes logic and components for regulating the power state of the processor cores 1702A-1702N and the graphics processor 1708.
[0247] In some embodiments, the processor 1700 further includes a graphics processor 1708 for performing graphics processing operations. In some embodiments, the graphics processor 1708 is coupled to a set of shared cache units 1706 and a system agent core 1710 (including the one or more integrated memory controllers 1714). In some embodiments, a display controller 1711 is coupled to the graphics processor 1708 to drive the graphics processor output to one or more coupled displays. In some embodiments, the display controller 1711 can be a separate module coupled to the graphics processor via at least one interconnect, or can be integrated within the graphics processor 1708 or the system agent core 1710.
[0248] In some embodiments, a ring-based interconnect unit 1712 is used to couple the internal components of the processor 1700. However, alternative interconnect units may be used, such as point-to-point interconnects, switched interconnects, or other technologies, including those well known in the art. In some embodiments, the graphics processor 1708 is coupled to the ring interconnect 1712 via an I / O link 1713.
[0249] Exemplary I / O links 1713 represent at least one of a variety of I / O interconnects, including an on-package I / O interconnect that facilitates communication between various processor components and high-performance embedded memory modules 1718, such as eDRAM modules. In some embodiments, each of processor cores 1702A-1702N and graphics processor 1708 use embedded memory modules 1718 as a shared last-level cache.
[0250] In some embodiments, processor cores 1702A-1702N are homogeneous cores that execute the same instruction set architecture. In another embodiment, processor cores 1702A-1702N are heterogeneous in terms of instruction set architecture (ISA), wherein one or more of processor cores 1702A-1702N execute a first instruction set, while at least one of the other cores executes a subset of the first instruction set or a different instruction set. In one embodiment, processor cores 1702A-1702N are heterogeneous in terms of microarchitecture, wherein one or more cores with relatively higher power consumption are coupled with one or more power cores with lower power consumption. In addition, processor 1700 may be implemented on one or more chips or as a SoC integrated circuit having the components shown in addition to other components.
[0251] Fig.181 is a block diagram of a graphics processor 1800, which may be a discrete graphics processing unit, or may be a graphics processor integrated with multiple processing cores. In some embodiments, the graphics processor communicates via a memory-mapped I / O interface to registers on the graphics processor and with commands placed into processor memory. In some embodiments, the graphics processor 1800 includes a memory interface 1814 for accessing memory. The memory interface 1814 may be an interface to local memory, one or more internal caches, one or more shared external caches, and / or to system memory.
[0252] In some embodiments, the graphics processor 1800 also includes a display controller 1802 for driving display output data to a display device 1820. The display controller 1802 includes hardware for one or more overlapping planes of the display and a composition of multiple layers of video or user interface elements. In some embodiments, the graphics processor 1800 includes a video codec engine 1806 for encoding, decoding, or transcoding media to, from, or between one or more media encoding formats, including but not limited to: Moving Picture Experts Group (MPEG) formats (such as MPEG-2), Advanced Video Coding (AVC) formats (such as H.264 / MPEG-4 AVC), and Society of Motion Picture & Television Engineers (SMPTE) 421M / VC-1, and Joint Photographic Experts Group (JPEG) formats (such as JPEG, and Motion JPEG (MJPEG) formats).
[0253] In some embodiments, graphics processor 1800 includes a block map transfer (BLIT) engine 1804 for performing two-dimensional (2D) rasterizer operations, including, for example, bit boundary block transfers. However, in one embodiment, 2D graphics operations are performed using one or more components of a graphics processing engine (GPE) 1810. In some embodiments, GPE 1810 is a compute engine for performing graphics operations, including three-dimensional (3D) graphics operations and media operations.
[0254] In some embodiments, GPE 1810 includes a 3D pipeline 1812 for performing 3D operations, such as rendering three-dimensional images and scenes using processing functions that act on 3D primitive shapes (e.g., rectangles, triangles, etc.). 3D pipeline 1812 includes programmable and fixed function elements that perform various tasks within the element and / or spawn execution threads to 3D / media subsystem 1815. While 3D pipeline 1812 can be used to perform media operations, embodiments of GPE 1810 also include a media pipeline 1816 that is specifically used to perform media operations, such as video post-processing and image enhancement.
[0255] In some embodiments, the media pipeline 1816 includes fixed-function or programmable logic units for performing one or more specialized media operations (such as video decoding acceleration, video deinterlacing, and video encoding acceleration) instead of or on behalf of the video codec engine 1806. In some embodiments, the media pipeline 1816 additionally includes a thread generation unit to generate threads for execution on the 3D / media subsystem 1815. The generated threads perform calculations for the media operations on one or more graphics execution units included in the 3D / media subsystem 1815.
[0256] In some embodiments, the 3D / media subsystem 1815 includes logic for executing threads generated by the 3D pipeline 1812 and the media pipeline 1816. In one embodiment, the pipeline sends thread execution requests to the 3D / media subsystem 1815, which includes thread dispatch logic for arbitrating and dispatching various requests for available thread execution resources. The execution resources include an array of graphics execution units for processing 3D and media threads. In some embodiments, the 3D / media subsystem 1815 includes one or more internal caches for thread instructions and data. In some embodiments, the subsystem also includes shared memory (including registers and addressable memory) to share data between threads and store output data.
[0257] Graphics processing engine
[0258] Fig.19 is a block diagram of a graphics processing engine 1910 of a graphics processor in accordance with some embodiments. In one embodiment, the graphics processing engine (GPE) 1910 is Fig.18 A version of the GPE 1810 is shown in FIG. Fig.19 Elements having the same reference number (or name) as elements of any other figure in this document may operate or function in any manner similar to that described elsewhere in this document, but are not limited to such. Fig.18 1910. The 3D pipeline 1812 and the media pipeline 1816 of the GPE 1910. The media pipeline 1816 is optional in some embodiments of the GPE 1910 and may not be explicitly included in the GPE 1910. For example and in at least one embodiment, separate media and / or image processors are coupled to the GPE 1910.
[0259] In some embodiments, the GPE 1910 is coupled to or includes a command streamer 1903 that provides a command stream to the 3D pipeline 1812 and / or the media pipeline 1816. In some embodiments, the command streamer 1903 is coupled to a memory, which may be a system memory, or one or more of an internal cache memory and a shared cache memory. In some embodiments, the command streamer 1903 receives commands from the memory and sends the commands to the 3D pipeline 1812 and / or the media pipeline 1816. The commands are instructions obtained from a ring buffer storing commands for the 3D pipeline 1812 and the media pipeline 1816. In one embodiment, the ring buffer may further include a batch command buffer storing batches of multiple commands. The commands for the 3D pipeline 1812 may also include references to data stored in the memory, such as, but not limited to, vertex and geometry data for the 3D pipeline 1812 and / or image data and memory objects for the media pipeline 1816. The 3D pipeline 1812 and the media pipeline 1816 process commands and data by performing operations via logic within the respective pipelines or by dispatching one or more execution threads to the graphics core array 1914 .
[0260] In various embodiments, the 3D pipeline 1812 can execute one or more shader programs, such as vertex shaders, geometry shaders, pixel shaders, fragment shaders, compute shaders, or other shader programs, by processing instructions and dispatching execution threads to the graphics core array 1914. The graphics core array 1914 provides a unified execution resource block. The multi-purpose execution logic (e.g., execution unit) within the graphics core array 1914 includes support for various 3D API shader languages and can execute multiple simultaneous execution threads associated with multiple shaders.
[0261] In some embodiments, graphics core array 1914 also includes execution logic for performing media functions such as video and / or image processing. In one embodiment, in addition to graphics processing operations, the execution unit also includes general logic that can be programmed to perform parallel general computing operations. The general logic can be connected to Fig.16 (multiple) processor cores 1607 or Fig.17The general logic within the processor cores 1702A-1702N in the processor cores 1702A-1702N performs processing operations in parallel or in combination.
[0262] Output data generated by threads executing on the graphics core array 1914 can output data to memory in a unified return buffer (URB) 1918. URB 1918 can store data for multiple threads. In some embodiments, URB 1918 can be used to send data between different threads executing on the graphics core array 1914. In some embodiments, URB 1918 can also be used for synchronization between fixed function logic within shared function logic 1920 and threads on the graphics core array.
[0263] In some embodiments, graphics core array 1914 is scalable such that the array includes a variable number of graphics cores, each with a variable number of execution units based on the target power and performance level of GPE 1910. In one embodiment, execution resources are dynamically scalable such that execution resources can be enabled or disabled as needed.
[0264] The graphics core array 1914 is coupled to a shared function logic 1920, which includes a plurality of resources shared between the graphics cores in the graphics core array. The shared functions within the shared function logic 1920 are hardware logic units that provide specialized supplementary functions to the graphics core array 1914. In various embodiments, the shared function logic 1920 includes, but is not limited to, a sampler 1921, math 1922, and inter-thread communication (ITC) 1923 logic. In addition, some embodiments implement one or more caches 1925 within the shared function logic 1920. The shared functions are implemented in the case where the demand for a given specialized function is insufficient to be included within the graphics core array 1914. Alternatively, a single instantiation of the specialized function is implemented as an independent entity in the shared function logic 1920 and shared between execution resources within the graphics core array 1914. The exact set of functions shared between the graphics core array 1914 and included within the graphics core array 1914 varies between embodiments.
[0265] Execution Unit
[0266] Fig. 20 is a block diagram of another embodiment of a graphics processor 2000 . Fig. 20 Elements in FIG. 1 having the same reference number (or name) as elements of any other figure herein may operate or function in any manner similar to that described elsewhere herein, but are not limited thereto.
[0267] In some embodiments, graphics processor 2000 includes ring interconnect 2002, pipeline front end 2004, media engine 2037, and graphics cores 2080A-2080N. In some embodiments, ring interconnect 2002 couples the graphics processor to other processing units, including other graphics processors or one or more general-purpose processor cores. In some embodiments, the graphics processor is one of many processors integrated into a multi-core processing system.
[0268] In some embodiments, the graphics processor 2000 receives batches of commands via the ring interconnect 2002. The incoming commands are interpreted by the command streamer 2003 in the pipeline front end 2004. In some embodiments, the graphics processor 2000 includes scalable execution logic for performing 3D geometry processing and media processing via the graphics cores 2080A-2080N. For 3D geometry processing commands, the command streamer 2003 supplies the commands to the geometry pipeline 2036. For at least some media processing commands, the command streamer 2003 supplies the commands to the video front end 2034, which is coupled to the media engine 2037. In some embodiments, the media engine 2037 includes a video quality engine (VQE) 2030 for video and image post-processing and a multi-format encoding / decoding (MFX) 2033 engine for providing hardware accelerated media data encoding and decoding. In some embodiments, the geometry pipeline 2036 and the media engine 2037 each generate execution threads for thread execution resources provided by at least one graphics core 2080A.
[0269] In some embodiments, the graphics processor 2000 includes scalable thread execution resources featuring modular cores 2080A-2080N (sometimes referred to as core slices), each modular core having multiple sub-cores 2050A-550N, 2060A-2060N (sometimes referred to as core sub-slices). In some embodiments, the graphics processor 2000 can have any number of graphics cores 2080A to 2080N. In some embodiments, the graphics processor 2000 includes a graphics core 2080A, which has at least a first sub-core 2050A and a second sub-core 2060A. In other embodiments, the graphics processor is a low-power processor with a single sub-core (e.g., 2050A). In some embodiments, the graphics processor 2000 includes multiple graphics cores 2080A-2080N, each graphics core including a group of first sub-cores 2050A-2050N and a group of second sub-cores 2060A-2060N. Each sub-core in the group of first sub-cores 2050A-2050N includes at least a first group of execution units 2052A-2052N and a media / texture sampler 2054A-2054N. Each sub-core in the group of second sub-cores 2060A-2060N includes at least a second group of execution units 2062A-2062N and a sampler 2064A-2064N. In some embodiments, each sub-core 2050A-2050N, 2060A-2060N shares a group of shared resources 2070A-2070N. In some embodiments, the shared resources include a shared cache memory and a pixel operation logic. Other shared resources may also be included in various embodiments of the graphics processor.
[0270] Fig.21 Thread execution logic 2100 is shown, including an array of processing elements employed in some embodiments of a GPE. Fig.21 Those elements in FIG. 1 having the same reference numbers (or names) as elements of any other figure herein may operate or function in any manner similar to that described elsewhere herein, but are not limited thereto.
[0271] In some embodiments, the thread execution logic 2100 includes a shader processor 2102, a thread dispatcher 2104, an instruction cache 2106, a scalable execution unit array (including a plurality of execution units 2108A-2108N), a sampler 2110, a data cache 2112, and a data port 2114. In one embodiment, the scalable execution unit array can be dynamically scaled by enabling or disabling one or more execution units (e.g., any one of execution units 2108A, 2108B, 2108C, 2108D, up to 2108N-1 and 2108N) based on the computational requirements of the workload. In one embodiment, the included components are interconnected via an interconnect structure that links to each of the components. In some embodiments, the thread execution logic 2100 includes one or more connections to a memory (such as a system memory or a cache memory) through one or more of the instruction cache 2106, the data port 2114, the sampler 2110, and the execution units 2108A-2108N. In some embodiments, each execution unit (e.g., 2108A) is an independently programmable general purpose computing unit capable of executing multiple simultaneous hardware threads while processing multiple data elements in parallel for each thread. In various embodiments, execution unit arrays 2108A-2108N are scalable to include any number of individual execution units.
[0272] In some embodiments, execution units 2108A-2108N are primarily used to execute shader programs. Shader processor 2102 can process various shader programs and dispatch execution threads associated with the shader programs via thread dispatcher 2104. In one embodiment, thread dispatcher includes logic for arbitrating thread initiation requests from graphics and media pipelines and instantiating the requested threads on one or more execution units in execution units 2108A-2108N. For example, the geometry pipeline (e.g., Fig. 20 2036) can dispatch vertex, tessellation or geometry shaders to thread execution logic 2100 ( Fig.21 ) for processing. In some embodiments, thread dispatcher 2104 may also handle runtime thread spawning requests from executing shader programs.
[0273] In some embodiments, the execution units 2108A-2108N support an instruction set including native support for many standard 3D graphics shader instructions, so that shader programs from graphics libraries (e.g., Direct 3D and OpenGL) are executed with minimal conversion. The execution units support vertex and geometry processing (e.g., vertex programs, geometry programs, vertex shaders), pixel processing (e.g., pixel shaders, fragment shaders), and general processing (e.g., compute and media shaders). Each of the execution units 2108A-2108N has the ability of multi-issue single instruction multiple data (SIMD) execution, and multi-threaded operation enables efficient execution environment in the face of high latency memory access. Each hardware thread within each execution unit has a dedicated high-bandwidth register file and associated independent thread state. For pipelines with integer, single and double precision floating point operations, SIMD branching capabilities, logical operations, transcendental operations, and other miscellaneous operations, execution is multiple issues per clock. While waiting for data from memory or one of the shared functions, dependency logic within execution units 2108A-2108N puts the waiting thread to sleep until the requested data has returned. While the waiting thread is sleeping, hardware resources may be dedicated to processing other threads. For example, during a delay associated with a vertex shader operation, an execution unit may execute operations of a pixel shader, a fragment shader, or another type of shader program including a different vertex shader.
[0274] Each of the execution units 2108A-2108N operates on an array of data elements. The number of data elements is the "execution size" or number of lanes for an instruction. An execution lane is a logical unit used for flow control, data element access, and masked execution within an instruction. The number of lanes may be independent of the number of physical arithmetic logic units (ALUs) or floating point units (FPUs) of a particular graphics processor. In some embodiments, the execution units 2108A-2108N support integer and floating point data types.
[0275] The execution unit instruction set includes SIMD instructions. Various data elements can be stored in registers as compact data types, and the execution unit will process various elements based on the data size of the element. For example, when operating on a 256-bit wide vector, the 256-bit vector is stored in a register, and the execution unit operates on the vector as four separate 64-bit compact data elements (data elements of quadruple word length (QW) size), eight separate 32-bit compact data elements (data elements of double word length (DW) size), sixteen separate 16-bit compact data elements (data elements of word length (W) size), or thirty-two separate 8-bit data elements (data elements of byte (B) size). However, different vector widths and register sizes are possible.
[0276] One or more internal instruction caches (e.g., 2106) are included in the thread execution logic 2100 to cache thread instructions for the execution unit. In some embodiments, one or more data caches (e.g., 2112) are included to cache thread data during thread execution. In some embodiments, a sampler 2110 is included to provide texture sampling for 3D operations and media sampling for media operations. In some embodiments, the sampler 2110 includes specialized texture or media sampling functionality to process texture or media data during the sampling process before providing the sampled data to the execution unit.
[0277] During execution, the graphics and media pipeline sends thread initiation requests to the thread execution logic 2100 via thread generation and dispatch logic. Once the group of geometric objects has been processed and rasterized into pixel data, the pixel processor logic (e.g., pixel shader logic, fragment shader logic, etc.) within the shader processor 2102 is called to further calculate output information and cause the results to be written to the output surface (e.g., color buffer, depth buffer, stencil printing buffer, etc.). In some embodiments, the pixel shader or fragment shader calculates the values of various vertex attributes to be interpolated across the rasterized objects. In some embodiments, the pixel processor logic within the shader processor 2102 then executes the pixel or fragment shader program supplied by the application programming interface (API). In order to execute the shader program, the shader processor 2102 dispatches the thread to the execution unit (e.g., 2108A) via the thread dispatcher 2104. In some embodiments, the pixel shader 2102 uses the texture sampling logic in the sampler 2110 to access the texture data in the texture map stored in the memory. Arithmetic operations performed on texture data and input geometry data operate on the pixel color data for each geometry fragment, or discard one or more pixels from further processing.
[0278] In some embodiments, data port 2114 provides a memory access mechanism for thread execution logic 2100 to output processed data to memory for processing on the graphics processor output pipeline. In some embodiments, data port 2114 includes or is coupled to one or more cache memories (e.g., data cache 2112) to cache data for memory access via the data port. Fig. 22is a block diagram illustrating a graphics processor instruction format 2200 according to some embodiments. In one or more embodiments, a graphics processor execution unit supports an instruction set having instructions in multiple formats. Solid line boxes show components that are typically included in an execution unit instruction, while dashed lines include components that are optional or included only in a subset of instructions. In some embodiments, the instruction format 2200 described and illustrated are macroinstructions in that they are instructions supplied to the execution unit, as opposed to micro-operations derived from instruction decoding (once the instruction is processed).
[0279] In some embodiments, the graphics processor execution unit natively supports instructions in 128-bit instruction format 2210. 64-bit compact instruction format 2230 is available for some instructions based on the selected instruction, instruction options, and the number of operands. Native 128-bit instruction format 710 provides access to all instruction options, while some options and operations are limited to 64-bit format 2230. The native instructions available in 64-bit format 2230 vary with the embodiment. In some embodiments, instructions are partially compacted using a set of index values in index field 2213. The execution unit hardware references a set of compact tables based on the index values, and uses the compact table output to reconstruct native instructions in 128-bit instruction format 2210.
[0280] For each format, the instruction opcode 2212 defines the operation to be performed by the execution unit. The execution unit executes each instruction in parallel across multiple data elements of each operand. For example, in response to an addition instruction, the execution unit performs a simultaneous addition operation across each color channel representing a texture element or a picture element. By default, the execution unit executes each instruction across all data channels of the operand. In some embodiments, the instruction control field 2214 enables control of certain execution options such as channel selection (e.g., prediction) and data channel ordering (e.g., swizzling). For instructions in the 128-bit instruction format 2210, the execution size field 2216 limits the number of data channels that will be executed in parallel. In some embodiments, the execution size field 2216 is not available for use in the 64-bit compact instruction format 2230.
[0281] Some execution unit instructions have up to three operands, including two source operands src0 2220, src1 2222 and one destination 2218. In some embodiments, the execution unit supports dual destination instructions, where one of the destinations is implicit. Data manipulation instructions may have a third source operand (e.g., SRC2 2224), where the instruction opcode 2212 determines the number of source operands. The last source operand of an instruction may be an immediate (e.g., hard-coded) value passed by the instruction.
[0282] In some embodiments, the 128-bit instruction format 2210 includes access / addressing mode information 2226, which specifies, for example, whether direct register addressing mode or indirect register addressing mode is used. When direct register addressing mode is used, the register address of one or more operands is provided directly through bits in the instruction.
[0283] In some embodiments, the 128-bit instruction format 2210 includes an access / addressing mode field 2226, which specifies an addressing mode and / or access mode for the instruction. In one embodiment, the access mode is used to define the data access alignment for the instruction. Some embodiments support access modes including 16-byte aligned access modes and 1-byte aligned access modes, wherein the byte alignment of the access mode determines the access alignment of the instruction operands. For example, when in the first mode, the instruction may use byte-aligned addressing for the source and destination operands, and when in the second mode, the instruction may use 16-byte aligned addressing for all source and destination operands.
[0284] In one embodiment, the addressing mode portion of the access / addressing mode field 2226 determines whether the instruction will use direct or indirect addressing. When direct register addressing mode is used, the bits in the instruction directly provide the register address of one or more operands. When indirect register addressing mode is used, the register address of one or more operands can be calculated based on the address immediate field and the address register value in the instruction.
[0285] In some embodiments, instructions are grouped based on the opcode 2212 bit field to simplify opcode decoding 2240. For 8-bit opcodes, bits 4, 5, and 6 allow the execution unit to determine the type of opcode. The precise opcode grouping shown is only an example. In some embodiments, the move and logic opcode group 2242 includes data movement and logic instructions (e.g., move (mov), compare (cmp)). In some embodiments, the move and logic group 2242 shares five most significant bits (MSBs), wherein the move (mov) instruction adopts the form of 0000xxxxb, and the logic instruction adopts the form of 0001xxxxb. The flow control instruction group 2244 (e.g., call, jump (jmp)) includes instructions in the form of 0010xxxxb (e.g., 0x20). The miscellaneous instruction group 2246 includes a mixture of instructions, which includes synchronization instructions (e.g., wait, send) in the form of 0011xxxxb (e.g., 0x30). The parallel math instruction group 2248 includes component-wise arithmetic instructions (e.g., add, multiply (mul)) in the form of 0100xxxxb (e.g., 0x40). The parallel math group 2248 performs arithmetic operations in parallel across data lanes. The vector math group 2250 includes arithmetic instructions (e.g., dp4) in the form of 0101xxxxb (e.g., 0x50). The vector math group performs arithmetic such as dot product operations on vector operands.
[0286] Graphics Pipeline
[0287] Fig.23 is a block diagram of another embodiment of a graphics processor 2300 . Fig.23 Elements in FIG. 1 having the same reference number (or name) as elements of any other figure herein may operate or function in any manner similar to that described elsewhere herein, but are not limited thereto.
[0288] In some embodiments, the graphics processor 2300 includes a graphics pipeline 2320, a media pipeline 2330, a display engine 2340, a thread execution logic 2350, and a rendering output pipeline 2370. In some embodiments, the graphics processor 2300 is a graphics processor within a multi-core processing system that includes one or more general-purpose processing cores. The graphics processor is controlled by register writes to one or more control registers (not shown) or via commands issued to the graphics processor 2300 via a ring interconnect 2302. In some embodiments, the ring interconnect 2302 couples the graphics processor 2300 to other processing components, such as other graphics processors or general-purpose processors. Commands from the ring interconnect 2302 are interpreted by a command stream transmitter 2303, which supplies instructions to individual components of the graphics pipeline 2320 or the media pipeline 2330.
[0289] In some embodiments, command streamer 2303 directs the operation of vertex fetcher 2305, which reads vertex data from memory and executes vertex processing commands provided by command streamer 2303. In some embodiments, vertex fetcher 2305 provides vertex data to vertex shader 2307, which performs coordinate space transformation and lighting operations on each vertex. In some embodiments, vertex fetcher 2305 and vertex shader 2307 execute vertex processing instructions by dispatching execution threads to execution units 2352A-2352B via thread dispatcher 2331.
[0290] In some embodiments, execution units 2352A-2352B are arrays of vector processors with instruction sets for performing graphics and media operations. In some embodiments, execution units 2352A-2352B have an attached L1 cache 2351 specific for each array or shared between arrays. The cache can be configured as a data cache, an instruction cache, or a single cache that is partitioned to contain data and instructions in different partitions.
[0291] In some embodiments, the graphics pipeline 2320 includes a tessellation component for performing hardware accelerated tessellation of 3D objects. In some embodiments, the programmable hull shader 811 configures the tessellation operation. The programmable domain shader 817 provides back-end evaluation of the tessellation output. The tessellation 2313 operates at the direction of the hull shader 2311 and contains dedicated logic for generating a set of detailed geometric objects based on a coarse geometric model that is provided as input to the graphics pipeline 2320. In some embodiments, if tessellation is not used, the tessellation components (e.g., the hull shader 2311, the tessellation 2313, and the domain shader 2317) can be bypassed.
[0292] In some embodiments, the complete geometric object may be processed by the geometry shader 2319 via one or more threads dispatched to execution units 2352A-2352B, or may proceed directly to the clipper 2329. In some embodiments, the geometry shader operates on entire geometric objects (rather than patches or vertices of vertices as in previous stages of the graphics pipeline). If tessellation is disabled, the geometry shader 2319 receives input from the vertex shader 2307. In some embodiments, if the tessellation unit is disabled, the geometry shader 2319 may be programmed by a geometry shader program to perform geometry tessellation.
[0293] Before rasterization, the clipper 2329 processes the vertex data. The clipper 2329 can be a programmable clipper or a fixed function clipper with clipping and geometry shader functions. In some embodiments, the rasterizer and depth test component 2373 in the render output pipeline 2370 dispatches pixel shaders to convert geometric objects into their pixel-by-pixel representations. In some embodiments, the pixel shader logic is included in the thread execution logic 2350. In some embodiments, the application can bypass the rasterizer and depth test component 2373 and access the unrasterized vertex data via the stream out unit 2323.
[0294] The graphics processor 2300 has an interconnect bus, interconnect structure, or some other interconnect mechanism that allows data and messages to be passed among the main components of the processor. In some embodiments, the execution units 2352A-2352B and associated cache(s) 2351, texture and media samplers 2354, and texture / sampler cache 2358 are interconnected via data ports 2356 to perform memory accesses and communicate with the rendering output pipeline components of the processor. In some embodiments, the samplers 2354, caches 2351, 2358, and execution units 2352A-2352B each have separate memory access paths.
[0295] In some embodiments, the rendering output pipeline 2370 includes a rasterizer and depth test component 2373, which converts vertex-based objects into associated pixel-based representations. In some embodiments, the rasterizer logic includes a windower / masker unit for performing fixed-function triangle and line rasterization. An associated rendering cache 2378 and depth cache 2379 are also available in some embodiments. The pixel operation component 2377 performs pixel-based operations on data, although in some examples, pixel operations associated with 2D operations (e.g., bit block maps are transferred using blending) are performed by the 2D engine 2341, or replaced by the display controller 2343 using overlapping display planes at display time. In some embodiments, a shared L3 cache 2375 can be used for all graphics components, allowing data to be shared without using main system memory.
[0296] In some embodiments, the graphics processor media pipeline 2330 includes a media engine 2337 and a video front end 2334. In some embodiments, the video front end 2334 receives pipeline commands from the command streamer 2303. In some embodiments, the media pipeline 2330 includes a separate command streamer. In some embodiments, the video front end 2334 processes the media commands before sending them to the media engine 2337. In some embodiments, the media engine 2337 includes thread generation functionality for generating threads for dispatching to the thread execution logic 2350 via the thread dispatcher 2331.
[0297] In some embodiments, the graphics processor 2300 includes a display engine 2340. In some embodiments, the display engine 2340 is external to the processor 2300 and is coupled to the graphics processor via the ring interconnect 2302, or some other interconnect bus or structure. In some embodiments, the display engine 2340 includes a 2D engine 2341 and a display controller 2343. In some embodiments, the display engine 2340 contains dedicated logic that can operate independently of the 3D pipeline. In some embodiments, the display controller 2343 is coupled to a display device (not shown), which can be a system-integrated display device (such as in a laptop computer), or can be an external display device attached via a display device connector.
[0298] In some embodiments, graphics pipeline 2320 and media pipeline 2330 can be configured to perform operations based on multiple graphics and media programming interfaces, and are not specific to any one application programming interface (API). In some embodiments, driver software for graphics processor converts API calls specific to specific graphics or media libraries into commands that can be processed by graphics processor. In some embodiments, support is provided for Open Graphics Library (OpenGL), Open Computing Language (OpenCL), and / or Vulkan graphics and computing API all from Khronos Group. In some embodiments, support can also be provided for Direct3D library from Microsoft Corporation. In some embodiments, a combination of these libraries can be supported. Support can also be provided for open source computer vision library (OpenCV). If mapping from the pipeline of future API to the pipeline of graphics processor can be performed, future API with compatible 3D pipeline will also be supported.
[0299] Graphics Pipeline Programming
[0300] Fig.24A is a block diagram of a graphics processor command format 2400 according to some embodiments. Fig. 24Bis a block diagram of a graphics processor command sequence 2410 according to an embodiment. Fig.24A The solid-line boxes in show components that are generally included in the graphics command, while the dashed lines include components that are optional or included only in a subset of the graphics commands. Fig.24A The exemplary graphics processor command format 2400 includes a data field for identifying the target client 2402 of the command, a command operation code (opcode) 2404, and associated data for the command 2406. In some commands, a sub-opcode 2405 and a command size 2408 are also included.
[0301] In some embodiments, client 2402 specifies a client unit of a graphics device that processes command data. In some embodiments, a graphics processor command parser checks the client field of each command to adjust further processing of the command and routes the command data to an appropriate client unit. In some embodiments, a graphics processor client unit includes a memory interface unit, a rendering unit, a 2D unit, a 3D unit, and a media unit. Each client unit has a corresponding processing pipeline for processing commands. Once a command is received by a client unit, the client unit reads an opcode 2404 and (if present) a sub-opcode 2405 to determine the operation to be performed. The client unit uses the information in data field 2406 to execute the command. For some commands, an explicit command size 2408 is expected to specify the size of the command. In some embodiments, the command parser automatically determines the size of at least some of the commands in the command based on the command opcode. In some embodiments, the commands are aligned via multiples of a double word length.
[0302] Fig. 24B An exemplary graphics processor command sequence 2410 is shown in the flowchart in FIG. 2410. In some embodiments, software or firmware of a data processing system featuring an embodiment of a graphics processor uses a version of the command sequence shown to set up, execute, and terminate a set of graphics operations. The sample command sequence is shown and described for exemplary purposes only, as embodiments are not limited to these particular commands or this command sequence. In addition, the commands may be issued as a batch of commands in a command sequence so that the graphics processor will process the sequence of commands at least partially simultaneously.
[0303] In some embodiments, the graphics processor command sequence 2410 may begin with a pipeline dump clear command 2412 to cause any active graphics pipeline to complete the current pending commands of the pipeline. In some embodiments, the 3D pipeline 2422 and the media pipeline 2424 do not operate simultaneously. The pipeline dump clear is performed to cause the active graphics pipeline to complete any pending commands. In response to the pipeline dump clear, the command parser for the graphics processor will suspend command processing until the active drawing engine completes the pending operation and the related read cache is invalid. Optionally, any data marked as 'dirty' in the rendering cache can be dumped and cleared to memory. In some embodiments, the pipeline dump clear command 2412 can be used for pipeline synchronization or before the graphics processor is placed in a low power state.
[0304] In some embodiments, when a command sequence requires the graphics processor to explicitly switch between pipelines, pipeline select command 2413 is used. In some embodiments, pipeline select command 2413 is required only once within an execution context before issuing pipeline commands unless the context is to issue commands for both pipelines. In some embodiments, pipeline flush command 2412 is required immediately prior to a pipeline switch via pipeline select command 2413.
[0305] In some embodiments, pipeline control commands 2414 configure the graphics pipeline for operation and are used to program 3D pipeline 2422 and media pipeline 2424. In some embodiments, pipeline control commands 2414 configure the pipeline state for the active pipeline. In one embodiment, pipeline control commands 2414 are used for pipeline synchronization and for clearing data from one or more cache memories within the active pipeline before processing a batch of commands.
[0306] In some embodiments, a set of return buffers for the corresponding pipeline to write data is configured using return buffer state commands 2416. Some pipeline operations require the allocation, selection, or configuration of one or more return buffers into which the operation writes intermediate data during processing. In some embodiments, the graphics processor also uses one or more return buffers to store output data and perform cross-thread communication. In some embodiments, return buffer state 2416 includes selecting the size and number of return buffers to use for a set of pipeline operations.
[0307] The remaining commands in the command sequence differ based on the active pipeline for operation. Based on pipeline determination 2420 , the command sequence is tailored for either 3D pipeline 2422 , which starts with 3D pipeline state 2430 , or media pipeline 2424 , which starts with media pipeline state 2440 .
[0308] The commands for configuring the 3D pipeline state 2430 include 3D state setting commands for the following: vertex buffer state, vertex element state, constant color state, depth buffer state, and other state variables that will be configured before processing 3D primitive commands. The values of these commands are determined at least in part based on the specific 3D API in use. In some embodiments, the 3D pipeline state 2430 commands can also selectively disable or bypass certain pipeline elements (if those elements will not be used).
[0309] In some embodiments, 3D primitives 2432 commands are used to submit 3D primitives to be processed by the 3D pipeline. The commands and associated parameters passed to the graphics processor via the 3D primitives 2432 are forwarded to the vertex acquisition function in the graphics pipeline. The vertex acquisition function uses the 3D primitives 2432 command data to generate a vertex data structure. The vertex data structure is stored in one or more return buffers. In some embodiments, 3D primitives 2432 commands are used to perform vertex operations on the 3D primitives via vertex shaders. In order to process vertex shaders, the 3D pipeline 2422 dispatches the shader execution thread to the graphics processor execution unit.
[0310] In some embodiments, the 3D pipeline 2422 is triggered via an execution 2434 command or event. In some embodiments, a register write triggers the command execution. In some embodiments, the execution is triggered via a 'go' or 'kick' command in a command sequence. In one embodiment, the command execution is triggered using a pipeline synchronization command to dump and clear the command sequence through the graphics pipeline. The 3D pipeline will perform geometry processing for 3D primitives. Once the operation is completed, the resulting geometric object is rasterized and the pixel engine colors the resulting pixels. Additional commands for controlling pixel shading and pixel backend operations may also be included for those operations.
[0311] In some embodiments, when performing media operations, the graphics processor command sequence 2410 follows the media pipeline 2424 path. Generally, the specific use and manner of programming for the media pipeline 2424 depends on the media or computing operation to be performed. During media decoding, specific media decoding operations can be offloaded to the media pipeline. In some embodiments, the media pipeline can also be bypassed and media decoding can be performed in whole or in part (using resources provided by one or more general processing cores). In one embodiment, the media pipeline also includes elements for general purpose graphics processor unit (GPGPU) operations, wherein the graphics processor is used to perform SIMD vector operations using compute shader programs that do not explicitly involve the rendering of graphics primitives.
[0312] In some embodiments, the media pipeline 2424 is configured in a similar manner to the 3D pipeline 2422. A set of commands for configuring the media pipeline state 2440 are dispatched or placed into a command queue prior to the media object commands 2442. In some embodiments, the media pipeline state commands 2440 include data for configuring the media pipeline elements that will be used to process the media objects. This includes data for configuring the video decoding and video encoding logic within the media pipeline (such as encoding or decoding formats). In some embodiments, the media pipeline state commands 2440 also support the use of one or more pointers to "indirect" state elements that contain a batch of state settings.
[0313] In some embodiments, media object commands 2442 supply pointers to media objects for processing by the media pipeline. The media object includes a memory buffer containing video data to be processed. In some embodiments, all media pipeline states must be valid before issuing media object commands 2442. Once the pipeline states are configured and media object commands 2442 are queued, the media pipeline 2424 is triggered via an execute command 2444 or an equivalent execution event (e.g., a register write). The output from the media pipeline 2424 can then be post-processed by operations provided by the 3D pipeline 2422 or the media pipeline 2424. In some embodiments, GPGPU operations are configured and executed in a manner similar to media operations.
[0314] Graphics software architecture
[0315] Fig.25An exemplary graphics software architecture for data processing system 2500 is shown in accordance with some embodiments. In some embodiments, the software architecture includes 3D graphics application 2510, operating system 2520, and at least one processor 2530. In some embodiments, processor 2530 includes graphics processor 2532 and one or more general purpose processor cores 2534. Graphics application 2510 and operating system 2520 are each executed in system memory 2550 of the data processing system.
[0316] In some embodiments, the 3D graphics application 2510 includes one or more shader programs, which include shader instructions 2512. The shader language instructions can be in a high-level shader language, such as a high-level shader language (HLSL) or an OpenGL shader language (GLSL). The application also includes executable instructions 2514 in a machine language suitable for execution by a general-purpose processor core 2534. The application also includes graphics objects 2516 defined by vertex data.
[0317] In some embodiments, the operating system 2520 is a Microsoft® Windows® operating system, a proprietary UNIX-like operating system, or an open source UNIX-like operating system (using a variation of the Linux kernel) from Microsoft Corporation. The operating system 2520 may support a graphics API 2522, such as a Direct3D API, an OpenGL API, or a Vulkan API. When the Direct3D API is in use, the operating system 2520 uses a front-end shader compiler 2524 to compile any shader instructions 2512 using HLSL into a lower-level shader language. The compilation may be a just-in-time (JIT) compilation, or the application may precompile the shader. In some embodiments, during the compilation of the 3D graphics application 2510, a high-level shader is compiled into a low-level shader. In some embodiments, the shader instructions 2512 are provided in an intermediate form, such as a standard portable intermediate representation version used by the Vulkan API.
[0318] In some embodiments, the user mode graphics driver 2526 includes a backend shader compiler 2527 for converting shader instructions 2512 into hardware specific representations. When the OpenGL API is in use, the shader instructions 2512 in the GLSL high level language are passed to the user mode graphics driver 2526 for compilation. In some embodiments, the user mode graphics driver 2526 uses the operating system kernel mode function 2528 to communicate with the kernel mode graphics driver 2529. In some embodiments, the kernel mode graphics driver 2529 communicates with the graphics processor 2532 to dispatch commands and instructions.
[0319] IP Core Implementation
[0320] One or more aspects of at least one embodiment may be implemented by representative code stored on a machine-readable medium, which represents and / or defines logic within an integrated circuit such as a processor. For example, a machine-readable medium may include instructions representing various logic within a processor. When read by a machine, the instructions may cause the machine to make logic for performing the techniques described herein. Such representations (referred to as "IP cores") are reusable units of logic for an integrated circuit that may be stored on a tangible machine-readable medium as a hardware model describing the structure of the integrated circuit. The hardware model may be supplied to various consumers or manufacturing facilities, which load the hardware model on a manufacturing machine that manufactures the integrated circuit. The integrated circuit may be manufactured so that the circuit performs the operations described in association with any embodiment described herein.
[0321] Fig.2626 is a block diagram showing an IP core development system 2600 according to an embodiment, which can be used to manufacture an integrated circuit to perform an operation. The IP core development system 2600 can be used to generate a modular, reusable design that can be incorporated into a larger design or used to build an entire integrated circuit (e.g., a SOC integrated circuit). The design facility 2630 can generate a software simulation 2610 of the IP core design using a high-level programming language (e.g., C / C++). The software simulation 2610 can be used to design, test, and verify the behavior of the IP core using a simulation model 2612. The simulation model 2612 can include functional, behavioral, and / or timing simulations. A register transfer level (RTL) design 2615 can then be created or synthesized from the simulation model 2612. The RTL design 2615 is an abstraction of the behavior of an integrated circuit (including associated logic executed using the modeled digital signals) that models the flow of digital signals between hardware registers. In addition to the RTL design 2615, a lower-level design at the logic level or transistor level can also be created, designed, or synthesized. Therefore, the specific details of the initial design and simulation can vary.
[0322] The RTL design 2615 or equivalent may be further synthesized by the design facility into a hardware model 2620, which may be in a hardware description language (HDL) or some other representation of physical design data. The HDL may be further simulated or tested to verify the IP core design. The IP core design may be stored using a non-volatile memory 2640 (e.g., a hard disk, a flash memory, or any non-volatile storage medium) for delivery to a third-party fabrication facility 2665. Alternatively, the IP core design may be transmitted (e.g., via the Internet) via a wired connection 2650 or a wireless connection 2660. The fabrication facility 2665 may then fabricate an integrated circuit based at least in part on the IP core design. The fabricated integrated circuit may be configured to perform operations in accordance with at least one embodiment described herein.
[0323] Exemplary System-on-Chip Integrated Circuit
[0324] Figure 27-29 An exemplary integrated circuit and related graphics processor that can be made using one or more IP cores according to various embodiments described herein are shown. In addition to what is shown, other logic and circuits may also be included, including additional graphics processors / cores, peripheral interface controllers, or general purpose processor cores.
[0325] Fig. 272700, which may be fabricated using one or more IP cores. The exemplary integrated circuit 2700 includes one or more application processors 2705 (e.g., CPUs), at least one graphics processor 2710, and may additionally include an image processor 2715 and / or a video processor 2720, any of which may be modular IP cores from the same or multiple different design facilities. The integrated circuit 2700 includes peripheral or bus logic including a USB controller 2725, a UART controller 2730, an SPI / SDIO controller 2735, an I 2 S / I 2 C controller 2740. In addition, the integrated circuit may include a display device 2745, which is coupled to one or more of a high-definition multimedia interface (HDMI) controller 2750 and a mobile industry processor interface (MIPI) display interface 2755. Storage may be provided by a flash memory subsystem 2760 (including flash memory and a flash memory controller). A memory interface may be provided via a memory controller 2765 for accessing SDRAM or SRAM memory devices. Some integrated circuits additionally include an embedded security engine 2770.
[0326] Fig.28 28 is a block diagram illustrating an exemplary graphics processor 2810 of a system-on-chip integrated circuit that may be fabricated using one or more IP cores in accordance with an embodiment. The graphics processor 2810 may be Fig. 27 A variation of the graphics processor 2710 of FIG. The graphics processor 2810 includes a vertex processor 2805 and one or more fragment processors 2815A-2815N (e.g., 2815A, 2815B, 2815C, 2815D to 2815N-1 and 2815N). The graphics processor 2810 can execute different shader programs via separate logic, such that the vertex processor 2805 is optimized to perform operations for vertex shader programs, while the one or more fragment processors 2815A-2815N perform fragment (e.g., pixel) shading operations for fragment or pixel shader programs. The vertex processor 2805 performs the vertex processing stage of the 3D graphics pipeline and generates primitives and vertex data. The (multiple) fragment processors 2815A-2815N use the primitives and vertex data generated by the vertex processor 2805 to generate a frame buffer displayed on a display device. In one embodiment, the fragment processor(s) 2815A-2815N are optimized to execute fragment shader programs as provided in the OpenGL API, which can be used to perform similar operations as pixel shader programs as provided in the Direct 3D API.
[0327] The graphics processor 2810 additionally includes one or more memory management units (MMUs) 2820A-2820B, cache(s) 2825A-2825B, and circuit interconnect(s) 2830A-2830B. The one or more MMUs 2820A-2820B provide virtual to physical address mappings for the graphics processor 2810, including for the vertex processor 2805 and / or the fragment processor(s) 2815A-2815N, which may reference vertex or image / texture data stored in memory in addition to the vertex or image / texture data stored in the one or more caches 2825A-2825B. In one embodiment, the one or more MMUs 2820A-2820B may be synchronized with other MMUs within the system, including with Fig. 27 One or more MMUs associated with the one or more application processors 2705, image processors 2715, and / or video processors 2720 enable each processor 2705-2720 to participate in a shared or unified virtual memory system. According to an embodiment, the one or more circuit interconnects 2830A-2830B enable the graphics processor 2810 to interface with other IP cores within the SoC via an internal bus of the SoC or via a direct connection.
[0328] Fig.29 is a block diagram illustrating an additional exemplary graphics processor 2910 of a system-on-chip integrated circuit that may be fabricated using one or more IP cores in accordance with an embodiment. The graphics processor 2910 may be Fig. 27 A variation of the graphics processor 2710 of FIG. The graphics processor 2910 includes Fig.28 The one or more MMUs 2820A-2820B, cache(s) 2825A-2825B, and circuit interconnect(s) 2830A-2830B of the integrated circuit 2800.
[0329] Graphics processor 2910 includes one or more shader cores 2915A-2915N (e.g., 2915A, 2915B, 2915C, 2915D, 2915E, 2915F through 2915N-1 and 2915N) that provide a unified shader core architecture in which a single core or type or core can execute all types of programmable shader code, including shader program code for implementing vertex shaders, fragment shaders, and / or compute shaders. The exact number of shader cores present may vary among embodiments and implementations. In addition, the graphics processor 2910 includes an inter-core task manager 2905, which acts as a thread dispatcher for dispatching execution threads to one or more shader cores 2915A-2915N, and a tiling unit 2918 for accelerating tiling operations for tile-based rendering, wherein rendering operations for a scene are subdivided in image space, for example, for exploiting local spatial coherence within a scene or for optimizing use of internal caches.
[0330] This disclosure / application provides the following technical solutions:
[0331] 1. An apparatus for facilitating processing of sparse matrices, comprising:
[0332] Graphics processing unit, including:
[0333] A plurality of processing units, each comprising one or more processing elements, wherein the one or more processing elements include:
[0334] Logic, used to read operands;
[0335] a multiplication unit for multiplying two or more operands; and
[0336] A scheduler is configured to identify operands having a value of zero and to prevent scheduling of the operands having the value of zero in the multiplication unit.
[0337] 2. A device as described in technical solution 1, wherein the scheduler schedules non-zero value operands in the multiplication unit.
[0338] 3. An apparatus as described in technical solution 2, wherein when the operand is received at the logic for reading the operand, the scheduler retrieves the stored operand value.
[0339] 4. The device as described in technical solution 3 further includes a write result logic, which is used to write the result of the product of the two or more operands in the multiplication unit, wherein the scheduler writes a zero value to the write result logic for an operand having a zero value.
[0340] 5. The device as described in technical solution 1 further includes pattern tracking logic, which is used to detect one or more sparse data segments in the stored data block.
[0341] 6. The device as described in technical solution 5, wherein the pattern tracking logic further includes pattern recognition logic, and the pattern recognition logic is used to perform a bounding box operation on the data block to determine the similarity of the data.
[0342] 7. An apparatus as described in technical solution 6, wherein the pattern recognition logic tracks data stored in a memory device.
[0343] 8. An apparatus as described in technical solution 6, wherein the pattern recognition logic tracks data stored in a cache memory device.
[0344] 9. A device as described in technical solution 6, wherein the pattern recognition logic tracks data stored in a page table.
[0345] 10. A device as described in technical solution 5, wherein the pattern tracking logic further includes an address location for recording each detected sparse data segment.
[0346] 11. The device according to technical solution 1 further comprises:
[0347] Logic for detecting compressed sparse matrices; and
[0348] A sparse compression buffer for storing the compressed sparse matrix.
[0349] 12. A device as described in technical solution 11, wherein the compressed sparse matrix is dynamically generated based on a sparse index.
[0350] 13. An apparatus as described in technical solution 12, wherein the compressed sparse matrix includes a sparse matrix that is frequently processed in the one or more processing units.
[0351] 14. A device comprising:
[0352] Graphics processor, including:
[0353] multiple execution units (EUs); and
[0354] Logic for partitioning the multiple EUs and assigning each partition of the EU to execute threads associated with a neural network layer.
[0355] 15. The device of technical solution 14, wherein the partition of EU comprises:
[0356] The first partition of threads assigned to execute convolutional layers;
[0357] a second partition assigned to execute bias layer threads;
[0358] a third partition assigned to execute the rectified linear unit layer threads; and
[0359] The fourth partition assigned to execute pooling layer threads.
[0360] 16. A device as described in technical solution 14, wherein the logic for partitioning the multiple EUs shares the execution results between each neural network layer.
[0361] 17. A method for facilitating processing of sparse matrices, comprising:
[0362] receiving an operand at a processing element;
[0363] determining whether one or more of the operands has a value of zero; and
[0364] The operand is prevented from being dispatched at the multiplication unit when it is determined that the operand has a value of zero.
[0365] 18. The method as described in Technical Solution 17 further includes scheduling a multiplication involving the operand in the multiplication unit when it is determined that the operand has a non-zero value.
[0366] 19. The method as described in Technical Solution 17 further includes detecting one or more sparse data segments in the stored data blocks.
[0367] 20. A method as described in technical solution 19, wherein detecting the one or more sparse data segments in the stored data block includes performing a bounding box operation on the data block to determine the similarity of the data.
[0368] 21. The method as described in Technical Solution 19 further includes recording the address location of each detected sparse data segment.
[0369] Some embodiments relate to Example 1, which includes an apparatus for facilitating processing of sparse matrices, the apparatus including multiple processing units each including one or more processing elements, the one or more processing elements including logic for reading operands, a multiplication unit for multiplying two or more operands, and a scheduler for identifying operands having zero values and preventing scheduling of the operands having the zero values in the multiplication unit.
[0370] Example 2 includes the subject matter of Example 1, wherein the scheduler schedules non-zero valued operands in the multiplication unit
[0371] Example 3 includes the subject matter of Examples 1 and 2, wherein the scheduler retrieves a stored operand value when the operand is received at the logic for reading operands.
[0372] Example 4 includes the subject matter of Examples 1-3, further comprising write result logic for writing a result of a product of the two or more operands in the multiplication unit, wherein the scheduler writes a zero value to the write result logic for an operand having a zero value.
[0373] Example 5 includes the subject matter of Examples 1-4, further comprising pattern tracking logic to detect one or more sparse data segments in a stored data block.
[0374] Example 6 includes the subject matter of Examples 1-5, wherein the pattern tracking logic further comprises pattern recognition logic to perform bounding box operations on the data blocks to determine similarity of the data.
[0375] Example 7 includes the subject matter of Examples 1-6, wherein the pattern recognition logic tracks data stored in a memory device.
[0376] Example 8 includes the subject matter of Examples 1-7, wherein the pattern recognition logic tracks data stored in a cache memory device.
[0377] Example 9 includes the subject matter of Examples 1-8, wherein the pattern recognition logic tracks data stored in a page table.
[0378] Example 10 includes the subject matter of Examples 1-9, wherein the pattern tracking logic further comprises recording an address location of each detected sparse data segment.
[0379] Example 11 includes the subject matter of Examples 1-10, further comprising logic for detecting a compressed sparse matrix, and a sparse compression buffer for storing the compressed sparse matrix.
[0380] Example 12 includes the subject matter of Examples 1-11, wherein the compressed sparse matrix is dynamically generated based on a sparse index.
[0381] Example 13 includes the subject matter of Examples 1-12, wherein the compressed sparse matrix comprises a sparse matrix that is frequently processed at the one or more processing units.
[0382] Some embodiments relate to Example 14, which includes a device comprising a graphics processor, the graphics processor comprising a plurality of execution units (EUs), and logic for partitioning the plurality of EUs and assigning each partition of the EU to execute threads associated with a neural network layer.
[0383] Example 15 includes the subject matter of Example 14, wherein the partitions of the EU include a first partition assigned to execute convolutional layer threads, a second partition assigned to execute bias layer threads, a third partition assigned to execute rectified linear unit layer threads, and a fourth partition assigned to execute pooling layer threads.
[0384] Example 16 includes the subject matter of Examples 14 and 15, wherein the logic for partitioning the multiple EUs shares execution results between each neural network layer.
[0385] Some embodiments relate to Example 17, which includes a method for facilitating processing of a sparse matrix, the method comprising receiving operands at a processing element, determining whether one or more of the operands have a zero value, and preventing the operands from being dispatched at a multiplication unit when it is determined that the operands have a zero value.
[0386] Example 18 includes the subject matter of Example 17, further comprising scheduling a multiplication involving the operand in the multiplication unit when it is determined that the operand has a non-zero value.
[0387] Example 19 includes the subject matter of Examples 17 and 18, further comprising detecting one or more sparse data segments in the stored data block.
[0388] Example 20 includes the subject matter of Examples 17-19, wherein detecting the one or more sparse data segments in the stored data block comprises performing a bounding box operation on the data block to determine similarity of the data.
[0389] Example 21 includes the subject matter of Examples 17-20, further comprising recording the address location of each detected sparse data segment.
[0390] The foregoing description and drawings are to be regarded in an illustrative rather than a restrictive sense. It will be appreciated by those skilled in the art that various modifications and changes may be made to the embodiments described herein without departing from the broader spirit and scope of the invention as set forth in the appended claims.
Claims
1. An apparatus for facilitating processing of sparse matrices, comprising: A graphics processor, the graphics processor comprising one or more processing elements, the one or more processing elements comprising: Logic, used to read operands; a multiplication unit for multiplying two or more operands; as well as a scheduler for identifying operands having a value of zero and preventing scheduling of said operands having said value of zero in said multiplication unit; The graphics processor further comprises: logic for compressing the sparse matrix; a sparse compression buffer for storing the compressed sparse matrix for execution in the graphics processor; multiple execution units (EUs); and Logic to partition the plurality of EUs and assign each partition of the EU to execute threads associated with a neural network layer, wherein the partitions of the EUs comprise: The first partition of threads assigned to execute convolutional layers; a second partition assigned to execute bias layer threads; a third partition assigned to execute the rectified linear unit layer threads; and The fourth partition assigned to execute the pooling layer threads, The compressed sparse matrix is dynamically generated based on a sparse index, wherein the sparse index is defined as a percentage of non-zero entries of the sparse matrix.
2. The apparatus of claim 1, wherein the scheduler schedules non-zero operands in the multiplication unit.
3. The apparatus of claim 2, wherein the scheduler retrieves a stored operand value when the operand is received at the logic for reading operands.
4. The apparatus of claim 3 , further comprising write result logic for writing a result of the product of the two or more operands in the multiplication unit, wherein the scheduler writes a zero value to the write result logic for an operand having a zero value.
5. The apparatus of claim 1, further comprising pattern tracking logic for detecting one or more sparse data segments in a stored data block.
6. The apparatus of claim 5, wherein the pattern tracking logic further comprises segment logic for recording an address location of each detected sparse data segment.
7. The apparatus of claim 1, wherein the compressed sparse matrix comprises a sparse matrix frequently processed at the one or more processing elements.
8. A device comprising: Graphics processor, including: Multiple Execution Units (EUs); as well as logic to partition the plurality of EUs and assign each partition of the EU to execute a thread associated with a neural network layer, The EU's sub-regions include: The first partition of threads assigned to execute convolutional layers; a second partition assigned to execute bias layer threads; a third partition assigned to execute the rectified linear unit layer threads; and The fourth partition assigned to execute pooling layer threads.
9. The apparatus of claim 8, wherein the logic for partitioning the plurality of EUs shares execution results between each neural network layer.
10. A method for facilitating processing of a sparse matrix, comprising: receiving an operand at a processing element; determining whether one or more of the operands has a value of zero; preventing dispatch of an operand at a multiplication unit when it is determined that the operand has a value of zero; compressing the sparse matrix; storing the compressed sparse matrix for execution in a graphics processor, the graphics processor comprising: a plurality of execution units (EUs); and logic to partition the plurality of EUs and assign each partition of the EU to execute a thread associated with a neural network layer; The convolutional layer thread is executed by the first partition of EU; The bias layer thread is executed by the second partition of the EU; The rectified linear unit layer thread is executed by the third partition of EU; as well as The pooling layer thread is executed by the fourth partition of EU. The compressed sparse matrix is dynamically generated based on a sparse index, wherein the sparse index is defined as a percentage of non-zero entries of the sparse matrix.
11. The method of claim 10, further comprising scheduling a multiplication involving the operand at the multiplication unit when the operand is determined to have a non-zero value.
12. The method of claim 10, further comprising detecting one or more sparse data segments in the stored data block.
13. The method of claim 12, further comprising recording the address location of each detected sparse data segment.
14. An apparatus for facilitating processing of a sparse matrix, comprising: means for receiving operands at a processing element; means for determining whether one or more of said operands has a value of zero; means for preventing dispatch of the operand at the multiplication unit when the operand is determined to have a zero value; means for compressing said sparse matrix; Means for storing a compressed sparse matrix for execution in a graphics processor, the graphics processor comprising: a plurality of execution units (EUs); and logic to partition the plurality of EUs and assign each partition of the EU to execute a thread associated with a neural network layer; means for executing convolutional layer threads by a first partition of the EU; means for executing bias layer threads by a second partition of the EU; means for executing a modified linear unit layer thread by a third partition of the EU; as well as A component for executing pooling layer threads by the fourth partition of the EU, The compressed sparse matrix is dynamically generated based on a sparse index, wherein the sparse index is defined as a percentage of non-zero entries of the sparse matrix.
15. The apparatus of claim 14, further comprising means for scheduling a multiplication involving the operand in the multiplication unit when the operand is determined to have a non-zero value.
16. The apparatus of claim 14, further comprising means for detecting one or more sparse data segments in a stored data block.
17. The apparatus of claim 16, further comprising means for recording the address location of each detected sparse data segment.
18. A computer readable medium having stored thereon instructions which, when executed, cause a computing system to perform the method according to any one of claims 10-13.
19. A computer program product having stored thereon instructions which, when executed, cause a computing system to perform the method according to any one of claims 10 to 13.
