Sparse matrix optimizer
By optimizing processing tile sizes based on data sparsity within a matrix accelerator, the efficiency and throughput of neural network processing in graphics processor systems are enhanced, addressing existing limitations in fixed and programmable execution units.
Patent Information
- Application Number
- JP2020159658
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2019-12-11
- Filing Date
- 2020-09-24
- Publication Date
- 2025-05-08
- Estimated Expiration
- 2040-09-24
AI Technical Summary
Current neural network processing systems, particularly those utilizing graphics processors, face challenges in maximizing throughput and efficiency due to limitations in fixed function units and programmable execution units.
The proposed solution involves optimizing the processing tile size based on data sparsity using a matrix accelerator, which examines matrix data and adjusts the tile size to enhance processing efficiency.
This approach leads to improved throughput and efficiency in neural network processing by optimizing tile sizes according to data sparsity, thereby maximizing the utilization of both fixed and programmable execution units.
Smart Images

Figure 0007672803000002 
Figure 0007672803000003 
Figure 0007672803000004
Abstract
Description
[Background technology]
[0001] A neural network can be modeled as a collection of neurons connected in an acyclic graph. A neural network can take an input (a single vector) and transform that input through a series of hidden layers. Each hidden layer consists of a set of neurons, each fully connected to all neurons in the previous layer, and neurons within a single layer function completely independently and do not share any connections. A convolutional neural network (CNN) is similar to a standard neural network. Each neuron takes several inputs, performs a dot product, and optionally follows nonlinearities. However, a CNN is explicitly tailored to process input image data. Based on the raw image data input, the network outputs a classification score for the input data.
[0002] A parallel data processing system configured to perform neural network processing may include a graphics processor. The graphics processor may be configured to perform specific operations on the graphics data, such as linear interpolation, tessellation, rasterization, texture mapping, depth testing, and the like. Portions of the graphics processor may be programmable, allowing such processors to support a wide range of operations for processing vertex and fragment data. Fully programmable execution units within the graphics processor may be utilized to perform various parallel processing operations. However, to maximize throughput, the graphics processor may use special fixed function units to perform some operations. [Brief description of the drawings]
[0003] So that the above-mentioned features of the present embodiments can be understood in detail, a further particular description of the embodiments briefly summarized above can be made by reference to the embodiments, some of which are illustrated in the accompanying drawings, which should be noted, however, that the accompanying drawings merely illustrate typical embodiments and therefore should not be considered as limiting the scope thereof.
[0004] [Figure 1] FIG. 1 is a block diagram of a processing system according to one embodiment.
[0005] [Figure 2A] FIG. 1 illustrates a computing system and graphics processor provided by embodiments described herein. [Figure 2B] FIG. 1 illustrates a computing system and graphics processor provided by embodiments described herein. [Figure 2C] FIG. 1 illustrates a computing system and graphics processor provided by embodiments described herein. [Figure 2D] FIG. 1 illustrates a computing system and graphics processor provided by embodiments described herein.
[0006] [Figure 3A] FIG. 2 is a block diagram of an additional graphics processor and computation accelerator architecture provided by an embodiment. [Figure 3B] FIG. 2 is a block diagram of an additional graphics processor and computation accelerator architecture provided by an embodiment. [Figure 3C] FIG. 2 is a block diagram of an additional graphics processor and computation accelerator architecture provided by an embodiment.
[0007] [Figure 4]FIG. 2 is a block diagram of a graphics processing engine of a graphics processor according to some embodiments.
[0008] [Figure 5A] FIG. 5 illustrates thread execution logic 500 including an array of processing elements used within a graphics processor core, according to an embodiment. [Figure 5B] FIG. 5 illustrates thread execution logic 500 including an array of processing elements used within a graphics processor core, according to an embodiment.
[0009] [Figure 6] FIG. 6 illustrates an additional execution unit 600 according to one embodiment.
[0010] [Figure 7] A block diagram illustrating a graphics processor instruction format according to some embodiments.
[0011] [Figure 8] FIG. 2 is a block diagram of a graphics processor according to another embodiment.
[0012] [Figure 9A] FIG. 2 illustrates a graphics processor command format and command sequence according to some embodiments. [Figure 9B] FIG. 2 illustrates a graphics processor command format and command sequence according to some embodiments.
[0013] [Figure 10] FIG. 2 illustrates an exemplary graphics software architecture for a data processing system according to some embodiments.
[0014] [Figure 11A] FIG. 1 illustrates an integrated circuit package assembly, according to one embodiment. [Figure 11B]FIG. 1 illustrates an integrated circuit package assembly, according to one embodiment. [Figure 11C] FIG. 1 illustrates an integrated circuit package assembly, according to one embodiment. [Figure 11D] FIG. 1 illustrates an integrated circuit package assembly, according to one embodiment.
[0015] [Figure 12] 1 is a block diagram illustrating an exemplary system-on-chip integrated circuit, according to one embodiment.
[0016] [Figure 13A] FIG. 2 is a block diagram illustrating an additional exemplary graphics processor. [Figure 13B] FIG. 2 is a block diagram illustrating an additional exemplary graphics processor.
[0017] [Figure 14] FIG. 1 illustrates a machine learning software stack according to one embodiment.
[0018] [Figure 15A] FIG. 1 illustrates layers of an example deep neural network. [Figure 15B] FIG. 1 illustrates layers of an example deep neural network.
[0019] [Figure 16] FIG. 1 illustrates an example recurrent neural network.
[0020] [Figure 17] FIG. 1 illustrates training and deployment of a deep neural network.
[0021] [Figure 18] FIG. 2 is a block diagram showing distributed learning.
[0022] [Figure 19] FIG. 1 is a block diagram of a data processing system according to one embodiment.
[0023] [Figure 20] FIG. 2 illustrates a matrix operation performed by an instruction pipeline according to one embodiment.
[0024] [Figure 21] FIG. 2 illustrates one embodiment of tiled matrix data.
[0025] [Figure 22A] FIG. 1 illustrates an embodiment of a sub-block. [Figure 22B] FIG. 1 illustrates an embodiment of a sub-block. [Figure 22C] FIG. 1 illustrates an embodiment of a sub-block.
[0026] [Figure 23A] FIG. 2 illustrates an embodiment of a systolic pipeline. [Figure 23B] FIG. 2 illustrates an embodiment of a systolic pipeline.
[0027] [Figure 24] FIG. 1 is a flow diagram illustrating one embodiment for performing a tiling optimization. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0028] In an embodiment, the matrix accelerator examines the matrix data it receives and optimizes the processing tile size based on the sparsity of the data.
[0029] System Overview 1 is a block diagram of a processing system 100 according to one embodiment. System 100 may be used in a single processor desktop system, a multiprocessor workstation system, or a server system having multiple processors 102 or processor cores 107. In one embodiment, system 100 is a processing platform embedded in a system-on-chip (SoC) integrated circuit for use in mobile, handheld or embedded devices, such as in Internet of Things (IoT) devices with wired or wireless connectivity to local or wide area networks.
[0030] In one embodiment, the system 100 can include, be coupled to, or be integrated into a server-based gaming platform; a game console, including a game and media console; a mobile gaming console, a handheld game console, or an online game console. In some embodiments, the system 100 is part of a mobile Internet-connected device, such as a mobile phone, a smart phone, a tablet computing device, or a laptop with low internal storage capacity. The processing system 100 can also include, be coupled to, or be integrated into a wearable device, such as a smart watch wearable device; smart eyewear or clothing that is enhanced with augmented reality (AR) or virtual reality (VR) capabilities to provide visual, audio, or haptic output to an augmented real-world visual, audio, or haptic experience, or to otherwise provide text, audio, graphics, video, holographic images or video, or haptic feedback; other augmented reality (AR) devices; or other virtual reality (VR) devices. In some embodiments, the processing system 100 includes or is part of a television or a set-top box device. In one embodiment, system 100 may include, be coupled to, or be integrated into a self-propelled vehicle, such as a bus, a tractor trailer, a car, a motor or electric power cycle, an airplane, or a grinder (or any combination thereof), which may use system 100 to process the sensed environment around the vehicle.
[0031] In some embodiments, the one or more processors 102 each include one or more processor cores 107 that process instructions that, when executed, perform operations for system or user software. In some embodiments, at least one of the one or more processor cores 107 is configured to process a particular instruction set 109. In some embodiments, the instruction set 109 may facilitate Complex Instruction Set Computing (CISC), Reduced Instruction Set Computing (RISC), or Very Long Instruction Word (VLIW) computations. One or more processor cores 107 may process different instruction sets 109, which may include instructions that facilitate emulation of other instruction sets. Processor cores 107 may also include other processing devices, such as digital signal processors (DSPs).
[0032] In some embodiments, the processor 102 includes a cache memory 104. Depending on the architecture, the processor 102 may have a single internal core or multiple levels of internal cache. In some embodiments, the cache memory is shared among various components of the processor 102. In some embodiments, the processor 102 also uses an external cache (e.g., a level 3 (L3) cache or a last level cache (LLC)) (not shown). The external cache may be shared among the processor cores 107 using known coherency techniques. In addition, a register file 106 may be included within the processor 102, which may include different types of registers for storing several types of data (e.g., integer registers, floating point registers, status registers, and an instruction pointer register). Some registers may be general purpose registers, while other registers may be specific to the design of the processor 102.
[0033] In some embodiments, the one or more processors 102 are coupled to one or more interface buses 110 to carry communication signals, such as address, data, or control signals, between the processors 102 and other components in the system 100. The interface bus 110, in one embodiment, may be a processor bus, such as a version of a Direct Media Interface (DMI) bus. However, the processor bus is not limited to a DMI bus and may include one or more peripheral component interconnect buses (e.g., PCI, PCI Express), memory buses, or other types of interface buses. In one embodiment, the processor 102 includes an integrated memory controller 116 and platform controller hub 130. The memory controller 116 facilitates communication between memory devices and other components of the system 100, while the platform controller hub (PCH) 130 provides connectivity to I / O devices via a local I / O bus.
[0034] The memory device 120 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 any other memory device with suitable capabilities to function as a process memory. In one embodiment, the memory device 120 may operate as a system memory for the system 100 and store data 122 and instructions 121 for use when the one or more processors 102 execute applications or processes. The memory controller 116 also couples to an optional external graphics processor 118. The external graphics processor 118 may communicate with the graphics processor 108 in the processor 102 to perform graphics and media operations. In some embodiments, graphics, media, and / or compute operations may be facilitated by an accelerator 112. The accelerator 112 is a co-processor that may be configured to perform a special set of graphics, media, or compute operations. For example, in one embodiment, the accelerator 112 is a matrix multiplication accelerator used to optimize machine learning or compute operations. In one embodiment, accelerator 112 is a ray-tracing accelerator that may be used to perform ray-tracing operations in conjunction with graphics processor 108. In one embodiment, external accelerator 119 may be used instead of or in conjunction with accelerator 112.
[0035] In some embodiments, a display device 111 may be connected to the processor 102. The display device 111 may be one or more of an internal display device, such as in a mobile electronic device or laptop device, or an external display device attached via a display interface (e.g., DisplayPort, etc.). In one embodiment, the display device 111 may be a head mounted display (HMD), such as a stereoscopic display device for use in virtual reality (VR) or augmented reality (AR) applications.
[0036] In some embodiments, the platform controller hub 130 allows peripherals to connect to the memory device 120 and the processor 102 via a high-speed I / O bus. The I / O peripherals include, but are not limited to, an audio controller 146, a network controller 134, a firmware interface 128, a wireless transceiver 126, a touch sensor 125, and a data storage device 124 (e.g., non-volatile memory, volatile memory, hard disk drive, flash memory, NAND, 3D NAND, 3D XPoint, etc.). The data storage device 124 can be connected via a storage interface (e.g., SATA) or via a peripheral bus such as a peripheral component interconnect bus (e.g., PCI, PCI Express). The touch sensor 125 can include a touch screen sensor, a pressure sensor, or a fingerprint sensor. The wireless transceiver 126 can be a Wi-Fi transceiver, a Bluetooth transceiver, or a mobile network transceiver such as a 3G, 4G, 5G, or LTE (Long-Term Evolution) transceiver. Firmware interface 128 can communicate with system firmware and can be, for example, a unified extensible firmware interface (UEFI). Network controller 134 can enable network connectivity to a wired network. In some embodiments, a high performance network controller (not shown) couples to interface bus 110. Audio controller 146, in one embodiment, is a multi-channel high definition audio controller. In one embodiment, system 100 includes an optional legacy I / O controller 140 for coupling legacy (e.g., Personal System 2 (PS / 2)) devices to the system. Platform controller hub 130 can also connect to one or more universal serial bus (USB) controllers 142 for connecting input devices such as a keyboard and mouse combination 143, a camera 144, or other USB input devices.
[0037] It will be appreciated that the illustrated system 100 is exemplary and not limiting, and other types of data processing systems configured differently may be used. For example, examples of memory controller 116 and platform controller hub 130 may be integrated into a discreet external graphics processor, such as external graphics processor 118. In one embodiment, platform controller hub 130 and / or memory controller 116 may be external to one or more processors 102. For example, system 100 may include external memory controller 116 and platform controller hub 130. Platform controller hub 130 may be configured as a memory controller hub and a peripheral controller hub in a system chipset that communicates with processor 102.
[0038] For example, a circuit board ("sled") may be used on which CPUs, memory, and other components are placed and designed to enhance thermal performance. In some examples, processing components such as processors are placed on the top side of the sled, while near memory such as DIMMs are placed on the bottom side of the sled. As a result of the enhanced airflow provided by this design, the components may operate at higher frequencies and power levels than typical systems, thereby improving performance. Additionally, the sleds are configured to blindly mate with power and data communication cables in the rack, thereby enhancing their ability to be quickly removed, upgraded, reinstalled, and / or replaced. Similarly, the individual components placed on the sled, such as the processors, accelerators, memory, and data storage, are configured to be easily upgraded due to their increased spacing from one another. In an exemplary embodiment, the components further include hardware attestation features that attest to their authenticity.
[0039] A data center may utilize a single network architecture ("fabric") that supports multiple other network architectures, including Ethernet and Omni-Path. Threads may be coupled to switches via optional fiber that provides higher bandwidth and lower latency than typical twisted pair cabling (e.g., Cat5, Cat5e, Cat6, etc.). Due to the high bandwidth, low latency interconnect and network architecture, data centers may pool resources such as memory, accelerators (e.g., GPUs, graphics accelerators, FPGAs, ASICs, neural network and / or artificial intelligence accelerators, etc.) and data storage devices that are physically disaggregated during use and provide them to computational resources (e.g., processors) as needed, allowing the computational resources to access the pooled resources as if they were local.
[0040] A power source or power resource can provide voltage and / or current to system 100 or any component or system described herein. In one example, the power source includes an AC-DC (alternating current to direct current) adapter that plugs into an electrical outlet. Such AC power can be a renewable energy (e.g., solar power) source. In one example, the power source includes a DC power source, such as an external AC-DC converter. In one example, the power source or power supply includes contactless charging hardware that charges by proximity to a charging field. In one example, the power source can include an internal battery, an alternating current source, a motion-based power source, a solar power source, or a fuel cell source.
[0041] Figures 2A-2D illustrate a computing system and graphics processor provided by embodiments described herein. Elements of Figures 2A-2D having the same reference number (or name) as elements of any other figure herein may operate or function in a manner similar to that described elsewhere herein, but are not limited to such.
[0042] 2A is a block diagram of an embodiment of a processor 200 having one or more processor cores 202A-202N, an integrated memory controller 214, and an integrated graphics processor 208. The processor 200 may include additional cores, including up to additional core 202N, represented by a dashed box. Each of the processor cores 202A-202N includes one or more internal cache units 204A-204N. In some embodiments, each processor core also has access to one or more shared cache units 206. The internal cache units 204A-204N and the shared cache unit 206 represent a cache memory hierarchy within the processor 200. 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 mid-level cache, such as level 2 (L2), level 3 (L3), level 4 (L4), or other levels of cache, if the highest level cache before the external memory is classified as LLC. In some embodiments, cache coherency logic maintains coherency between the various cache units 206 and 204A-204N.
[0043] In some embodiments, processor 200 may also include a set of one or more bus controller units 216 and a system agent core 210. The one or more bus controller units 216 manage a set of peripheral buses, such as one or more PCI or PCI Express buses. System agent core 210 provides management functions for various processor components. In some embodiments, system agent core 210 includes one or more integrated memory controllers 214 to manage access to various external memory devices (not shown).
[0044] In some embodiments, one or more of the processor cores 202A-202N include support for simultaneous multithreading. In such embodiments, the system agent core 210 includes components for coordinating and operating the cores 202A-202N during multithreaded processing. The system agent core 210 may further include a power control unit (PCU), which includes logic and components for regulating the power state of the processor cores 202A-202N and the graphics processor 208.
[0045] In some embodiments, processor 200 further includes a graphics processor 208 that performs graphics processing operations. In some embodiments, graphics processor 208 couples to a system agent core 210 that includes a set of shared cache units 206 and one or more integrated memory controllers 214. In some embodiments, system agent core 210 also includes a display controller 211 that drives the graphics processor output to one or more coupled displays. In some embodiments, display controller 211 may be a separate module coupled to the graphics processor via at least one interconnect or may be integrated within graphics processor 208.
[0046] In some embodiments, a ring-based interconnect unit 212 is used to couple the internal components of processor 200. However, alternative interconnect units may be used, such as a point-to-point interconnect, a switched interconnect, or other technologies, including those known in the art. In some embodiments, graphics processor 208 couples to ring interconnect 212 via I / O link 213.
[0047] The illustrated I / O link 213 represents at least one of a number of different I / O interconnects, including an on package I / O interconnect, that facilitates communication between various processor components and a high performance embedded memory module 218, such as an eDRAM module. In some embodiments, each of the processor cores 202A-202N and the graphics processor 208 may use the embedded memory module 218 as a shared last level cache.
[0048] In some embodiments, the processor cores 202A-202N are homogenous cores that execute the same instruction set architecture. In another embodiment, the processor cores 202A-202N are heterogeneous with respect to instruction set architecture, where one or more of the processor cores 202A-202N execute a first instruction set and at least one of the other cores executes a subset of the first instruction set or a different instruction set. In one embodiment, the processor cores 202A-202N are heterogeneous with respect to microarchitecture, where one or more cores having a relatively high power consumption are combined with one or more power cores having a lower power consumption. In one embodiment, the processor cores 202A-202N are heterogeneous with respect to computational capabilities. Additionally, the processor 200 can be implemented on one or more chips or as a SoC integrated circuit having the illustrated components in addition to other components.
[0049] FIG. 2B is a block diagram of hardware logic of a graphics processor core 219 according to some embodiments described herein. Elements of FIG. 2B having the same reference number (or name) as elements of any other figure herein may operate or function in a similar manner as described elsewhere herein, but are not limited to such. The graphics processor core 219, sometimes also referred to as a core slice, may be one or more graphics cores in a modular graphics processor. The graphics processor core 219 is an example of one graphics core slice, and a graphics processor as described herein may include multiple graphics core slices based on target power and performance envelopes. Each graphics processor core 219 may include a fixed function block 230 coupled with multiple sub-cores 221A-221F, also referred to as sub-slices. The multiple sub-cores 221A-221F include modular blocks of general purpose and fixed function logic.
[0050] In some embodiments, fixed function block 230 includes a geometry / fixed function pipeline 231, which may be shared by all sub-cores within graphics processor core 219, for example in a lower performance and / or lower power graphics processor implementation. In various implementations, geometry / fixed function pipeline 231 includes a 3D fixed function pipeline (e.g., 3D pipeline 312 in FIGS. 3 and 4 described below), a video front end unit, a thread spawner and thread dispatcher, and a unified return buffer manager that manages a unified return buffer (e.g., unified return buffer 418 in FIG. 4 described below).
[0051] In one embodiment, the fixed function block 230 also includes a graphics SoC interface 232, a graphics microcontroller 233, and a media pipeline 234. The graphics SoC interface 232 provides an interface between the graphics processor core 219 and other processor cores in the system-on-chip integrated circuit. The graphics microcontroller 233 is a programmable sub-processor that can be configured to manage various functions of the graphics processor core 219, including thread dispatch, scheduling, and pre-emption. The media pipeline 234 (e.g., media pipeline 316 of FIGS. 3 and 4) includes logic that facilitates decoding, encoding, pre-processing, and / or post-processing of multimedia data, including image and video data. The media pipeline 234 implements media operations via requests to computation or sampling logic within the sub-cores 221-221F.
[0052] In one embodiment, the SoC interface 232 enables the graphics processor core 219 to communicate with a general purpose application processor core (e.g., a CPU) and / or with other components in the SoC, including memory hierarchy elements such as shared last level cache memory, system RAM, and / or embedded on-chip or on-package DRAM. The SoC interface 232 also enables communication with fixed function devices in the SoC, such as a camera imaging pipeline, and enables the use and / or implementation of global memory atomics that may be shared between the graphics processor core 219 and the CPUs in the SoC. The SoC interface 232 may also implement power management controls for the graphics processor core 219, and enables an interface between the clock domain of the graphics core 219 and other clock domains in the SoC. In one embodiment, the SoC interface 232 enables receipt of command buffers from a command streamer and a global thread dispatcher configured to provide commands and instructions to each of one or more graphics cores in the graphics processor. Commands and instructions may be dispatched to the media pipeline 234 when media operations are to be performed, or to the geometry and fixed function pipelines (e.g., geometry and fixed function pipelines 231, geometry and fixed function pipelines 237) when graphics processing operations are to be performed.
[0053] Graphics microcontroller 233 may be configured to perform various scheduling and management tasks for graphics processor core 219. In one embodiment, graphics microcontroller 233 may perform graphics and / or compute workload scheduling for various graphics parallel engines in execution unit (EU) arrays 222A-222F, 224A-224F in sub-cores 221A-221F. In this scheduling model, host hardware running on a CPU core of the SoC including graphics processor core 219 may present a workload to one of multiple graphic processor doorbells, which initiates a scheduling operation on the appropriate graphics engine. Scheduling operations include determining which workload should run next, presenting the workload to a command streamer, pre-empting existing workloads running on the engines, monitoring the progress of the workload, and notifying host software when the workload is completed. In one embodiment, graphics microcontroller 233 can also facilitate low power or idle states for graphics processor core 219, providing graphics processor core 219 with the ability to save and restore registers within graphics processor core 219 across low power state transitions independent of the operating system and / or graphics driver software on the system.
[0054] Graphics processor core 219 may have up to N modular sub-cores, more or less than the illustrated sub-cores 221A-221F. For each set of N sub-cores, graphics processor core 219 may also include shared function logic 235, shared and / or cache memory 236, geometry / fixed function pipeline 237, and additional fixed function logic 238 that accelerates various graphics and computational processing operations. Shared function logic 235 may include logic units associated with shared function logic 420 of FIG. 4 (e.g., sampler, math, and / or inter-thread communication logic) that may be shared by each of the N sub-cores in graphics processor core 219. Shared and / or cache memory 236 may be a last level cache for the set of N sub-cores 221A-221F in graphics processor core 219, and may also function as a shared memory accessible by multiple sub-cores. Geometry / fixed function pipeline 237 may be included in fixed function block 230 in place of geometry / fixed function pipeline 231 and may include the same or similar logical units.
[0055] In one embodiment, graphics processor core 219 includes additional fixed function logic 238, which may include various fixed function acceleration logic for use by graphics processor core 219. In one embodiment, additional fixed function logic 238 includes an additional geometry pipeline for use with position only shading. In position only shading, there are two geometry pipelines: a full geometry pipeline in geometry / fixed function pipeline 238, 231, and a cull pipeline, which is an additional geometry pipeline that may be included in additional fixed function logic 238. In one embodiment, the cull pipeline is a reduced version of the full geometry pipeline. The full pipeline and the cull pipeline may run different instances of the same application, with each instance having a separate context. Position only shading may hide long cull runs of discarded triangles, allowing shading to complete sooner in some instances. For example, in one embodiment, because the cull pipeline only fetches and shades position attributes of vertices without performing pixel rasterization and rendering to a frame buffer, the cull pipeline logic in additional fixed function logic 238 can execute position shaders in parallel with the main application and generally produce significant results sooner than the full pipeline. The cull pipeline can use the significant results generated to calculate visibility information for all triangles, regardless of whether they have been culled or not. The full pipeline (which in this example may also be referred to as the replay pipeline) can use the visibility information to skip culled triangles and shade only visible triangles that are ultimately passed to the rasterization phase.
[0056] In one embodiment, additional fixed function logic 238 may also include machine learning acceleration logic, such as fixed function matrix multiplication logic, for implementations that include optimizations for machine learning training or inference.
[0057] Each of the graphics sub-cores 221A-221F includes a set of execution resources that can be used to execute graphics, media, and compute operations in response to requests by the graphics pipeline, media pipeline, or shader pipeline. The graphics sub-cores 221A-221F include a number of EU arrays 222A-222F, 224A-224F, thread dispatch and inter-thread communication (TD / IC) logic 223A-223F, 3D (e.g., texture) samplers 225A-225F, media samplers 206A-206F, shader processors 227A-227F, and shared local memory (SLM) 228A-228F. The EU arrays 222A-222F, 224A-224F each include a number of execution units. The execution units are general purpose graphics processing units capable of performing fractional and integer / fixed point logic operations in service of graphics, media or compute operations including graphics, media or compute shader programs. The TD / IC logic 223A-223F performs local thread dispatch and thread control operations for the execution units in the sub-cores and facilitates communication between threads executing on the execution units of the sub-cores. The 3D samplers 225A-225F can read textures or other 3D graphics related data into memory. The 3D samplers can read texture data differently based on the configured sample state and the texture format associated with a given texture. The media samplers 206A-206F can perform similar read operations based on the type and format associated with the media data. In one embodiment, each graphics sub-core 221A-221F can alternatively include a unified 3D and media sampler. Threads executing on execution units within each of the sub-cores 221A-221F can use shared local memory 228A-228F within each sub-core, allowing threads executing within a thread group to execute using a common pool of on-chip memory.
[0058] 2C illustrates a graphics processing unit (GPU) 239 that includes a dedicated set of graphics processing resources arranged into multi-core groups 240A-240N. Details of only a single multi-core group 240A are provided, but it will be appreciated that other multi-core groups 240B-240N may be equipped with the same or similar graphics processing resources.
[0059] As shown, multi-core group 240A may include a set of graphics cores 243, a set of tensor cores 244, and a set of ray tracing cores 245. Scheduler / dispatcher 241 schedules and dispatches the graphics thread for execution on the various cores 243, 244, 245. A set of register files 242 store operand values used by cores 243, 244, 245 when executing the graphics thread. These may include, for example, integer registers for storing integer values, floating point registers for storing floating point values, vector registers for storing packed data elements (integer and / or floating point data elements), and tile registers for storing tensor / matrix values. In one embodiment, the tile registers are implemented as a combined set of vector registers.
[0060] One or more combined level 1 (L1) cache and shared memory units 247 store graphics data such as texture data, vertex data, pixel data, ray data, bounding volume data, etc. locally within each multicore group 240A. One or more texture units 247 may also be used to perform texturing operations such as texture mapping and sampling. A level 2 (L2) cache 253, shared by all or a subset of the multicore groups 240A-240N, stores graphics data and / or data for multiple simultaneous graphics threads. As shown, the L2 cache 253 may be shared across multiple multicore groups 240A-240N. One or more memory controllers 248 couple the GPU 239 to memory 249. The memory 249 may be system memory (e.g., DRAM) and / or dedicated graphics memory (e.g., GDDR6 memory).
[0061] Input / output (I / O) circuitry 250 couples GPU 239 to one or more I / O devices 252, such as a digital signal processor (DSP), a network controller, or a user input device. An on-chip interconnect may be used to couple I / O device 252 to GPU 239 and memory 249. One or more I / O memory management units (IOMMUs) 251 of I / O circuitry 250 directly couple I / O device 252 to system memory 249. In one embodiment, IOMMU 251 manages multiple sets of page tables that map virtual addresses to physical addresses in system memory 249. In this embodiment, I / O device 252, CPU 246, and GPU 239 may share the same virtual address space.
[0062] In one implementation, IOMMU 251 supports virtualization. In this case, it may manage a first set of page tables that map guest / graphics virtual addresses to guest / graphics physical addresses and a second set of page tables that map guest / graphics physical addresses to system / host physical addresses (e.g., in system memory 249). The base addresses of each of the first and second sets of page tables may be stored in control registers and swapped out on a context switch (e.g., so that a new context is provided with access to the associated set of page tables). Although not shown in FIG. 2C, each of cores 243, 244, 245 and / or multicore groups 240A-240N may include translation lookaside buffers (TLBs) to cache guest virtual to guest physical, guest physical to host physical, and guest virtual to host physical translations.
[0063] In one embodiment, CPU 246, GPU 239 and I / O devices 252 are integrated onto a single semiconductor chip and / or chip package. The illustrated memory 249 may be integrated onto the same chip or may be coupled to memory controller 248 via an off-chip interface. In one implementation, memory 249 comprises GDDR6 memory that shares the same virtual address space as other physical system level memory, although the underlying principles of the invention are not limited to this particular implementation.
[0064] In one embodiment, tensor cores 244 include multiple execution units specifically designed to perform matrix operations. Matrix operations are basic computational operations used to perform deep learning operations. For example, simultaneous matrix multiplication operations may be used for neural network training and inference. Tensor cores 244 may perform matrix processing using a variety of operand precisions, including single precision floating point (e.g., 32 bits), half precision floating point (e.g., 16 bits), integer word (16 bits), byte (8 bits), and half byte (4 bits). In one embodiment, the neural network implementation extracts features of each rendered scene and potentially combines details from multiple frames to construct a high-quality final image.
[0065] In a deep learning implementation, parallel matrix multiplication operations may be scheduled for implementation on the tensor cores 244. Training neural networks, in particular, requires a significant number of matrix dot-product operations. To process the inner product formulation of N×N×N matrix multiplication, the tensor cores 244 may include at least N dot-product processing elements. Before starting the matrix multiplication, one entire matrix is loaded into a tile register, and at least one row of a second matrix is loaded in each of the N cycles. In each cycle, there are N dot products to be processed.
[0066] Matrix elements may be stored in different precisions, including 16-bit words, 8-bit bytes (e.g., INT8), and 4-bit half-bytes (e.g., INT4), depending on the particular implementation. Different precision modes can be specified for tensor cores 244 to ensure that the most efficient precision is used for different workloads (e.g., to infer workloads that can tolerate quantization to bytes and half-bytes).
[0067] In one embodiment, ray tracing core 245 accelerates ray tracing operations for both real-time ray tracing and non-real-time ray tracing implementations. In particular, ray tracing core 245 includes ray traversal / intersection circuitry to perform ray traversal using bounding volume hierarchies (BVH) and identify intersections between rays and primitives enclosed within the BVH volumes. Ray tracing core 245 may also include circuitry for performing depth testing and culling (e.g., using a Z-buffer or similar arrangement). In one implementation, ray tracing core 245 performs traversal and intersection operations in conjunction with image denoising techniques described herein, at least some of which may be executed on tensor core 244. For example, in one embodiment, tensor core 244 implements a deep learning neural network to perform denoising of frames generated by ray tracing core 245. However, the CPU 246, the graphics core 243 and / or the ray tracing core 245 may implement all or part of the denoising and / or deep learning algorithms.
[0068] Additionally, as discussed above, a distributed approach to denoising may be used, in which the GPU 239 resides in a computing device that is coupled to other computing devices via a network or high-speed interconnect. In this embodiment, the interconnected computing devices share neural network learning / training data, improving the speed at which the overall system learns to perform denoising for different types of image frames and / or different graphics applications.
[0069] In one embodiment, the ray tracing core 245 handles all BVH traversal and ray-primitive intersections, preventing the graphics core 243 from being overloaded with thousands of instructions per ray. In an embodiment, each ray tracing core 245 includes a first set of specialized circuitry to perform bounding box tests (e.g., for traversal operations) and a second set of specialized circuitry to perform ray-triangle intersection tests (e.g., intersecting rays being traversed). Thus, in one embodiment, the multi-core group 240A can simply initiate a ray probe, and the ray tracing cores 245 perform the ray traversal and intersections independently and return hit data (e.g., hit, no hit, multiple hits, etc.) to the thread context. While the ray tracing core 245 performs the traversal and intersection operations, the other cores 243, 244 are freed to perform other graphics or computational work.
[0070] In one embodiment, each ray tracing core 245 includes a traversal unit that performs BVH test operations and an intersection unit that performs ray-primitive intersection tests. The intersection unit generates and provides a "hit," "no hit," or "multiple hit" response to the appropriate thread. During traversal and intersection operations, the execution resources of other cores (e.g., graphics core 243 and tensor core 244) are freed up to perform other types of graphics work.
[0071] In one particular embodiment described below, a hybrid rasterization / ray tracing approach is used in which work is distributed between the graphics core 243 and the ray tracing core 245.
[0072] In one embodiment, the ray tracing core 245 (and / or other cores 243, 244) includes hardware support for a ray tracing instruction set such as Microsoft's DirectX Ray Tracing (DXR), including the DispatchRays command, as well as Ray Generation, closest-hit, any-hit, and miss shaders that enable allocation of a unique set of shaders and textures for each object. Another ray tracing platform that may be supported by the ray tracing core 245, graphics core 243, and tensor core 224 is Vulkan 1.1.85. However, it should be noted that the principles underlying the present invention are not limited to any particular ray tracing ISA.
[0073] In general, the various cores 245, 244, 243 may support a ray tracing instruction set that includes the following instructions / functions: ray generation, closest hit, any hit, ray-primitive intersection, per-primitive and hierarchical bounding box construction, miss, visit, and exception. More specifically, one embodiment includes ray tracing instructions that perform the following functions:
[0074] Ray Generation - A ray generation command can be executed for each pixel, sample or other user-defined work allocation.
[0075] Closest Hit - The closest hit instruction may be executed to find the closest intersection point of a ray with a primitive in the scene.
[0076] Any Hit - The any hit instruction identifies multiple intersections between a ray and primitives in the scene, potentially identifying a new nearest intersection point.
[0077] The Intersection-intersection instruction performs a ray-primitive intersection test and outputs the result.
[0078] Per-primitive Bounding box Construction - This instruction constructs a bounding box around a given primitive or group of primitives (e.g., when constructing a new BVH or other acceleration data structure).
[0079] Miss - indicates that the ray misses all geometry in the scene or a specified region of the scene.
[0080] Visit - indicates the children volumes that the ray will traverse.
[0081] Exceptions - Contains various types of exception handlers (e.g., called for various error conditions).
[0082] 2D is a block diagram of a general purpose graphics processing unit (GPGPU) 270 that may be configured as a graphics processor and / or computation accelerator according to embodiments described herein. GPGPU 270 may be interconnected with a host processor (e.g., one or more CPUs 246) and memories 271, 272 via one or more system and / or memory buses. In one embodiment, memory 271 is a system memory that may be shared with one or more CPUs 246, and memory 272 is a device memory dedicated to GPGPU 272. In one embodiment, components within GPCPU 270 and device memory 272 may be mapped to memory addresses accessible to one or more CPUs 246. Access to memories 271 and 272 may be facilitated via memory controller 268. In one embodiment, memory controller 268 includes an internal direct memory access (DMA) controller 269 or may include logic to perform operations that would otherwise be performed by a DMA controller.
[0083] GPGPU 270 includes multiple cache memories, at least some of which may be classified as cache memories, including L2 cache 253, L1 cache 254, instruction cache 255, and shared memory 256. GPGPU 270 also includes multiple compute units 260A-260N. Each compute unit 260A-260N includes a set of vector registers 261, scalar registers 262, vector logic unit 263, and scalar logic unit 264. Compute units 260A-260N may also include local shared memory 265 and program counter 266. Compute units 260A-260N may be coupled with constant cache 267 that may be used to store constant data. Constant data is data that does not change during execution of kernel or shader programs executing on GPCPU 270. In one embodiment, constant cache 267 is a scalar data cache and cached data that may be fetched directly into scalar registers 262.
[0084] During operation, one or more CPUs 246 can write commands to registers or memory in GPGPU 270 that are mapped to an accessible address space. Command processor 257 can read commands from registers or memory to determine how these commands are processed in GPGPU 270. A thread dispatcher can then be used to dispatch threads to computational units 260A-N to execute these commands. Each computational unit 260A-N can execute threads independently of the other computational units. In addition, each computational unit 260A-N can be independently configured for conditional computation and can conditionally output the results of the computation to memory. Command processor 257 can interrupt one or more CPUs 246 upon completion of submitted commands.
[0085] Figures 3A-3C are block diagrams of additional graphics processor and computation accelerator structures provided by embodiments described herein. Elements in Figures 3A-3C having the same reference numbers (or names) as elements in any other figure herein may operate or function in a similar manner as described elsewhere herein, but are not limited to such.
[0086] 3A is a block diagram of a graphics processor 300. Graphics processor 300 may be a separate graphics processing unit or may be a graphics processor integrated with multiple processing cores or other semiconductor devices, such as, but not limited to, memory devices and network interfaces. In some embodiments, the graphics processor may communicate with registers on the graphics processor and commands located in the processor memory via a memory-mapped I / O interface. In some embodiments, graphics processor 300 includes a memory interface 314 to access memory. Memory interface 314 may be an interface to local memory, one or more internal caches, one or more shared external caches, and / or system memory.
[0087] In some embodiments, the graphics processor 300 also includes a display controller 302 that drives display output data to a display device 318. The display controller 302 includes hardware for one or more overlay planes for the display and composition of multiple layers of video or user interface elements. The display device 318 can be an internal or external display device. In one embodiment, the display device 318 is a head-mounted display device, such as a virtual reality (VR) display device or an augmented reality (AR) display device. In some embodiments, the graphics processor 300 includes a video encoding engine 306 that encodes, decodes, or transcodes media to, from, or between one or more media encoding formats. Such media encoding formats include, but are 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, H.265 / HEVC, Alliance for Open Media (AOMedia) V8, V9, and Society of Motion Picture & Television Engineers (SMPTE) 421M / VC-1 and Joint Photographic Experts Group (JPEG) formats such as JPEG and Motion JPEG (MPEG) formats.
[0088] In some embodiments, graphics processor 300 includes a block image transfer (BLIT) engine 304 that performs 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) 310. In some embodiments, GPE 310 is a computational engine for performing graphics operations, including three-dimensional (3D) graphics and media operations.
[0089] In some embodiments, GPE 310 includes a 3D pipeline 312 for performing 3D operations such as rendering three-dimensional images and scenes using processing functions that operate on 3D primitive shapes (e.g., rectangles, triangles, etc.). 3D pipeline 312 includes programmable and fixed function elements that perform various tasks within components and / or spawn execution threads for 3D / media subsystem 315. While 3D pipeline 312 can be used to perform media operations, embodiments of GPE 310 also include a media pipeline 316 that is used to perform media operations such as video post-processing and image enhancement, among others.
[0090] In some embodiments, the media pipeline 316 includes fixed function or programmable logic units that perform one or more specialized media operations, such as video decode acceleration, video deinterlacing, and video encode acceleration in place of or on behalf of the video encoding engine 306. In some embodiments, the media pipeline 316 further includes a thread spawning unit that spawns threads for execution for the 3D / media subsystem 315. The spawned threads perform computations for the media operations for one or more graphics execution units included within the 3D / media subsystem 315.
[0091] In some embodiments, the 3D / media subsystem 315 includes logic for executing threads spawned by the 3D pipeline 312 and the media pipeline 316. In one embodiment, the pipelines send thread execution requests to the 3D / media subsystem 315, which includes thread dispatch logic for arbitrating and dispatching the various requests to available thread execution resources. The execution resources include an array of graphics execution units that process the 3D and media threads. In some embodiments, the 3D / media subsystem 315 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, for sharing data between threads and storing output data.
[0092] FIG. 3B illustrates a graphics processor 320 having a tiled architecture according to an embodiment described herein. In one embodiment, the graphics processor 320 includes a graphics processing engine cluster 322 having multiple instances of the graphics processing engine 310 of FIG. 3A in graphics engine tiles 310A-310D. Each of the graphics engine tiles 310A-310D can be interconnected via a set of interconnects 323A-323F. Each of the graphics engine tiles 310A-310D can also be connected to memory modules or memory devices 326A-326D via memory interconnects 325A-325D. The memory devices 326A-326D can use any graphics memory technology. For example, the memory devices 326A-326D can be graphics double data rate (GDDR) memory. The memory devices 326A-326D, in one embodiment, are high-bandwidth memory (HBM) modules that may be on-die with their respective graphics engine tiles 310A-310D. In one embodiment, the memory devices 326A-326D are stacked memory devices that may be stacked on top of their respective graphics engine tiles 310A-310D. In one embodiment, each graphics engine tile 310A-310D and associated memory 326A-326D resides on a separate chiplet that is bonded to a base die or base substrate, as described in further detail in Figures 11B-11D.
[0093] The graphics processing engine cluster 322 may be connected to an on-chip or on-package fabric interconnect 324. The fabric interconnect 324 may enable communication between the graphics engine tiles 310A-310D and components such as the video codec 306 and one or more copy engines 304. The copy engines 304 may be used to move data out of, into, and between the memory devices 326A-326D and the graphics processor 320 (e.g., system memory). The fabric interconnect 324 may also be used to interconnect the graphics engine tiles 310A-310D. The graphics processor 310 may optionally include a display controller 302 that enables connection to an external display device 318. The graphics processor may be configured as a graphics or computation accelerator. In an accelerator configuration, the display controller 302 and the display device 318 may be omitted.
[0094] Graphics processor 320 may be connected to a host system via host interface 328. Host interface 328 may enable communication between graphics processor 320, system memory, and / or other system components. Host interface 328 may be, for example, a PCI Express bus or another type of host system interface.
[0095] FIG. 3C illustrates a computation accelerator 330 according to an embodiment described herein. The computation accelerator 330 may include structural similarities to the graphics processor 320 of FIG. 3B and is optimized for computation acceleration. The computation engine cluster 332 may include a set of computation engine tiles 340A-340D that include execution engines optimized for parallel or vector-based general-purpose computation operations. In some embodiments, the computation engine tiles 340A-340D do not include fixed-function graphics processing logic, but in one embodiment, one or more of the computation engine tiles 340A-340D may include logic to perform media acceleration. The computation engine tiles 340A-340D may be connected to memories 326A-326D via memory interconnects 325A-325D. The memories 326A-326D and memory interconnects 325A-325D may be of similar technology to those in the graphics processor 320, or may be different. The graphics computation engine tiles 340A-340D may also be interconnected via a set of tile interconnects 323A-323F, which may be connected to and / or interconnected by the fabric interconnect 324. In one embodiment, the computation accelerator 330 includes a large L3 cache, which may be configured as a device-wide cache. The computation accelerator 330 may also be connected to a host processor and memory via a host interface 328 in a manner similar to the graphics processor 320 of FIG. 3B.
[0096] Graphics Processing Engine FIG. 4 is a block diagram of a graphics processing engine 410 of a graphics processor, according to some embodiments. In one embodiment, the graphics processing engine (GPE) 410 is a version of the GPE 310 illustrated in FIG. 3A and may represent the graphics engine tiles 310A-310D of FIG. 3B. Elements of FIG. 4 having the same reference numbers (or names) as elements of any other figure herein may operate or function in a similar manner as described elsewhere herein, but are not limited to such. For example, the 3D pipeline 312 and media pipeline 316 of FIG. 3A are illustrated. The media pipeline 316 is optional in some embodiments of the GPE 410 and may not be explicitly included within the GPE 410. For example, in at least one embodiment, a separate media and / or image processor is coupled to the GPE 410.
[0097] In some embodiments, the GPE 410 is coupled to or includes a command streamer 403. The command streamer 403 provides a command stream to the 3D pipeline 312 and / or the media pipeline 316. In some embodiments, the command streamer 403 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 403 receives commands from the memory and sends the commands to the 3D pipeline 312 and / or the media pipeline 316. The commands are directives fetched from a ring buffer that stores commands for the 3D pipeline 312 and the media pipeline 316. In one embodiment, the ring buffer may further include a batch command buffer that stores a batch of multiple commands. The commands for the 3D pipeline 312 may also include references to data stored within the system, such as, but not limited to, vertex and geometry data for the 3D pipeline 312 and / or image data and memory objects for the media pipeline 316. The 3D pipeline 312 and the media pipeline 316 process commands and data by executing operations through logic within the respective pipelines or by dispatching one or more threads to the graphics core array 414. In one embodiment, the graphics core array 414 includes one or more blocks of graphics cores (e.g., graphics core 415A, graphics core 415B), each block including one or more graphics cores. Each graphics core includes a set of graphics execution resources, including general-purpose and graphics-specific execution logic to perform graphics and computation operations, as well as fixed-function texture processing and / or machine learning and artificial intelligence acceleration logic.
[0098] In various embodiments, the 3D pipeline 312 may include fixed function and programmable logic that processes 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 414. The graphics core array 414 provides a unified block of execution resources for use in processing these shader programs. General purpose execution logic (e.g., execution units) within the graphics cores 415A-145B of the graphics core array 414 includes support for a variety of 3D API shader languages and can execute multiple concurrent threads of execution associated with multiple shaders.
[0099] In some embodiments, graphics core array 414 includes execution logic to perform media functions such as video and / or image processing. In one embodiment, the execution unit includes general purpose logic that is programmable to perform parallel general purpose computing operations in addition to graphics processing operations. The general purpose logic can perform processing operations in parallel with or together with the general purpose logic in processor core 107 of FIG. 1 and cores 202A-202N of FIG. 2A.
[0100] Output data generated by threads executing on graphics core array 414 may output the data to memory in unified return buffer (URB) 418. URB 418 may store data for multiple threads. In some embodiments, URB 418 may be used to transmit data between different threads executing on graphics core array 414. In some embodiments, URB 418 may also be used for synchronization between threads on the graphics core array and fixed function logic in shared function logic 420.
[0101] In some embodiments, graphics core array 414 is scalable such that it contains a variable number of graphics cores, each having a variable number of execution units based on the GPE 410 target power and performance levels. In one embodiment, the execution resources are dynamically scalable such that execution resources can be enabled or disabled as needed.
[0102] The graphics core array 414 couples to shared functionality logic 420, which includes multiple resources shared among the graphics cores in the graphics core array. The shared functionality in the shared functionality logic 420 is a hardware logic unit that provides specialized auxiliary functions to the graphics core array 414. In various embodiments, the shared functionality logic 420 includes, but is not limited to, sampler 421, math 422, and inter-thread communication (ITC) 423 logic. Additionally, some embodiments implement one or more caches 425 in the shared functionality logic 420.
[0103] Shared functionality is implemented at least when the requirements for a given particular functionality are insufficient for inclusion within the graphics core array 414. Instead, a single instantiation of that particular functionality is implemented as a standalone entity within the shared functionality logic 420 and shared among the execution resources within the graphics core array 414. The exact set of functionality shared among and included within the graphics core array 414 varies by embodiment. In some embodiments, specific shared functionality within the shared functionality logic 420 that is used extensively by the graphics core array 414 may be included within the shared functionality logic 416 within the graphics core array 414. In various embodiments, the shared functionality logic 416 within the graphics core array 414 may include some or all of the logic within the shared functionality logic 420. In one embodiment, all logic elements within the shared functionality logic 420 may be duplicated within the shared functionality logic 416 of the graphics core array 414. In one embodiment, the shared function logic 420 is omitted in favor of the shared function logic 416 in the graphics core array 414 .
[0104] Execution Unit 5A-5B illustrate thread execution logic 500 including an array of processing elements used within a graphics processor core, according to an embodiment described herein. Elements of FIG. 5A-5B having the same reference numbers (or names) as elements of any other figures herein may operate or function in a similar manner as described elsewhere herein, but are not limited to such. FIG. 5A-5B show an overview of thread execution logic 500, which may represent hardware logic exemplified in each of sub-cores 221A-221F of FIG. 2B. FIG. 5A represents an execution unit within a general-purpose graphics processor, while FIG. 5B represents an execution unit that may be used within a computational accelerator.
[0105] As illustrated in FIG. 5A, in some embodiments, the thread execution logic 500 includes a shader processor 502, a thread dispatcher 504, an instruction cache 506, a scalable execution unit array including multiple execution units 508A-508N, a sampler 510, a shared local memory 511, a data cache 512, and a data port 514. In one embodiment, the scalable execution unit can be dynamically scaled by enabling or disabling one or more execution units (e.g., any of execution units 508A, 508B, 508C, 508N-1-508N) based on the computational requirements of a workload. In one embodiment, the included components are interconnected via an interconnect fabric that links each of the components. In some embodiments, the thread execution logic 500 includes one or more connections to memory, such as system memory or cache memory, through one or more of the instruction cache 506, the data port 514, the sampler 510, and the execution units 508A-508B. In some embodiments, each execution unit (e.g., 508A) is a stand-alone, programmable, general-purpose computational unit capable of executing multiple simultaneous hardware threads while processing multiple data elements in parallel for each thread. In various embodiments, the array of execution units 508A-508N is scalable to include any number of individual execution units.
[0106] In some embodiments, the execution units 508A-508N are primarily used to execute shader programs. The shader processor 502 executes various shader programs and can dispatch execution threads associated with the shader programs via a thread dispatcher 504. In one embodiment, the thread dispatcher includes logic that arbitrates thread initiation requests from the graphics and media pipelines and instantiates the requested threads in one or more execution threads within the execution units 508A-508B. For example, the geometry pipeline can dispatch vertex, tessellation, or geometry shaders to thread execution logic for processing. In some embodiments, the thread dispatcher 504 can also handle run-time thread spawning requests from executing shader programs.
[0107] In some embodiments, the execution units 508A-508N support an instruction set that includes 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 translation. 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-purpose processing (e.g., compute and media shaders). Each of the execution units 508A-508N is capable of multi-issue single instruction multiple data (SIMD) execution, and multithreaded operations enable an efficient execution environment despite higher latency memory accesses. Each hardware thread within each execution unit has a dedicated high-bandwidth register file and associated independent thread state. Execution is multi-issue per clock into a pipeline capable of integer, single and double precision floating point arithmetic, SIMD branch functions, logical operations, transcendental operations, and other miscellaneous operations. While waiting for data from memory or one of the shared functions, dependency logic within the execution units 508A-508N causes the waiting thread to sleep until the requested data is 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, the execution unit may execute operations for another type of shader program, including a pixel shader, a fragment shader, or a different vertex shader. Various embodiments may be applied to execution using Single Instruction Multiple Threads (SIMT) as an alternative to or in addition to using SIMD.References to a SIMD core or operation may also apply to SIMT or SIMD in combination with SIMT.
[0108] Each execution unit in execution units 508A-508N operates on an array of data elements. The number of data elements is the "execution size" or number of channels for an instruction. An execution channel is a logical unit of execution for data element access, masking, and flow control within an instruction. The number of channels may be independent of the number of physical arithmetic logic units (ALUs) or floating point units (FPUs) for a particular graphics processor. In some embodiments, execution units 508A-508N support integer and floating point data types.
[0109] The execution unit instruction set includes SIMD instructions. Various data elements can be stored in registers as packed data types, and the execution unit will process the various elements based on the data size of the elements. For example, when operating on a 256-bit wide vector, 256 bits of the vector are stored in registers, and the execution unit operates on the vector as four separate 54-bit packed data elements (Quad-Word (QW) size data elements), eight separate 32-bit packed data elements (Double-Word (DW) size data elements), sixteen separate 16-bit packed data elements (Word (W) size data elements), or thirty-two separate 8-bit data elements (Byte (B) size data elements). However, different vector widths and register sizes are possible.
[0110] In one embodiment, one or more execution units may be combined into a fused execution unit with thread control logic (507A-507N) common to the fused EU. Multiple EUs may be fused into an EU group. Each EU in a fused EU group may be configured to execute a separate SIMD hardware thread. The number of EUs in a fused EU group may vary depending on the embodiment. In addition, various SIMD widths may be implemented per EU, including but not limited to SIMD8, SIMD16, and SIMD32. Each fused graphics execution unit 509A-509N includes at least two units. For example, fused execution unit 509A includes a first EU 508A, a second EU 508B, and thread control logic 507A common to the first EU 508A and the second EU 508B. The thread control logic 507A controls the threads executed in the fused graphics execution unit 509A and enables each EU in the fused execution units 509A-509N to execute using a common instruction pointer register.
[0111] One or more internal instruction caches (e.g., 506) are included in the thread execution logic 500 for caching thread instructions for the execution units. In some embodiments, one or more data caches (e.g., 512) are included for caching thread data during thread execution. Threads executing on the execution logic 500 may also explicitly store managed data in the shared local memory 511. In some embodiments, a sampler 510 is included to provide texture sampling for 3D operations and media sampling for media operations. In some embodiments, the sampler 510 includes special texture or media sampling functionality to process the texture or media data during the sampling process before providing the sampled data to the execution units.
[0112] During execution, the graphics and media pipeline sends thread start requests to the thread execution logic 500 via the thread spawning and dispatch logic. Once a group of geometric objects has been processed and rasterized into pixel data, pixel processor logic (e.g., pixel shader logic, fragment shader logic, etc.) within the shader processor 502 is invoked to further compute output information and write the results to output surfaces (e.g., color buffers, depth buffers, stencil buffers, etc.). In some embodiments, the pixel shader or fragment shader computes values for various vertex attributes that are to be interpolated across the rasterized objects. In some embodiments, the pixel processor logic within the shader processor 502 then executes application programming interface (API)-supplied pixel or fragment shader programs. To execute shader programs, the shader processor 502 dispatches threads via the thread dispatcher 504 to execution units (e.g., 508A). In some embodiments, the shader processor 502 uses texture sampling logic within the sampler 510 to access texture data of texture maps stored in memory. Arithmetic operations on the texture data and the input geometry data compute pixel color data for each geometric fragment or discard one or more pixels from further processing.
[0113] In some embodiments, the data port 514 provides a memory access mechanism for the thread execution logic 500 and outputs processed data to memory for further processing in the graphics processor output pipeline. In some embodiments, the data port 514 includes or is coupled to one or more cache memories (e.g., data cache 512) to cache data for memory access via the data port.
[0114] In one embodiment, the execution logic 500 may also include a ray tracer 505 that may provide ray tracing acceleration functionality. The ray tracer 505 may support a ray tracing instruction set that includes instructions / functions for ray generation. The ray tracing instruction set may be similar to or different from the ray tracing instruction set supported by the ray tracing core 245 of FIG. 2C.
[0115] 5B illustrates exemplary internal details of execution unit 508 according to an embodiment. GSU 508 may include an instruction fetch unit 537, a general register file array (GRF) 524, an architectural register file array (ARF) 526, a thread arbiter 522, a send unit 530, a branch unit 532, a set of SIMD floating point units (FPUs) 534, and in one embodiment, a dedicated integer SIMD ALU 535. GRF 524 and ARF 526 include a set of general and architectural register files associated with each concurrent hardware thread that may be active within GSU 508. In one embodiment, per thread architectural state is maintained within ARF 526, while data used during thread execution is stored in GRF 524. Execution state of each thread, including each thread's instruction pointer, may be held in thread-specific registers within ARF 526.
[0116] In one embodiment, the graphics execution unit 508 has an architecture that is a combination of simultaneous multi-threading (SMT) and fine-grained interleaved multi-threading (IMT). The architecture has a modular structure that can be tuned at design time based on the target number of simultaneous threads and the number of registers per execution unit, where the execution unit resources are divided across the logic used to execute multiple simultaneous threads. The number of logical threads that can be executed by the graphics execution unit 508 is not limited to the number of hardware threads, and multiple logical threads can be assigned to each hardware thread.
[0117] In one embodiment, the graphics execution unit 508 can co-issue multiple instructions. Each of the multiple instructions may be a different instruction. The thread arbiter 522 of the graphics execution unit thread 508 can dispatch the instruction to one of the send unit 530, the branch unit 532, or the SIMD FPU 534 for execution. Each execution thread can access 128 general purpose registers in the GRF 528, where each register can store 32 bytes accessible as a SIMD 8-element vector of 32-bit data elements. In one embodiment, each execution unit thread has access to 4K bytes in the GRF 524, although the embodiment is not so limited and more or less register resources may be provided in other embodiments. In one embodiment, the graphics execution unit 508 is divided into seven hardware threads that can independently perform computational operations, although the number of threads per execution unit may vary depending on the embodiment. For example, in one embodiment, up to 16 hardware threads are supported. In an embodiment where seven threads may access 4K bytes, GRF 524 can store a total of 28K bytes. If 16 threads may access 4K bytes, GRF 524 can store a total of 64K bytes. Flexible addressing modes allow registers to be addressed together, efficiently building wider registers or representing strided rectangular block data structures.
[0118] In one embodiment, memory operations, sampler operations, and other longer latency system communications are dispatched via "send" instructions executed by a message passing send unit 530. In one embodiment, branch instructions are dispatched to a dedicated branch unit 532 to facilitate SIMD divergence and eventual convergence.
[0119] In one embodiment, the graphics execution unit 508 includes one or more SIMD floating point units (FPUs) 534 that perform floating point operations. In one embodiment, the FPUs 534 can SIMD execute up to M number of 32-bit decimal (or integer) operations or SIMD execute up to 2M 16-bit integer or 16-bit floating point operations. In one embodiment, at least one of the FPUs provides extended computational capabilities to support high throughput transcendental math functions and double precision 54-bit floating point. In some embodiments, a set of 8-bit integer SIMD ALUs 535 are also present and may be specifically optimized to perform operations associated with machine learning computations.
[0120] In one embodiment, an array of multiple instances of the graphics execution unit 508 can be instantiated in a graphics sub-core grouping (e.g., a sub-slice). For scalability, product designers can select the exact number of execution units per sub-core grouping. In one embodiment, the execution unit 508 can execute instructions across multiple execution channels. In a further embodiment, each thread executing on the graphics execution unit 508 executes on a different channel.
[0121] FIG. 6 illustrates an additional execution unit 600 according to one embodiment. The execution unit 600 may be a computationally optimized execution unit for use in the compute engine tiles 340A-340D in FIG. 3C, for example, but is not so limited. Variations of the execution unit 600 may also be used in the graphics engine tiles 310A-310D, such as in FIG. 3B. In one embodiment, the execution unit 600 includes a thread control unit 601, a thread state unit 602, an instruction fetch / prefetch unit 603, and an instruction decode unit 604. The register execution unit 600 further includes a register file 606 that stores registers that can be allocated to hardware threads within the execution unit. In addition, the execution unit 600 further includes a send unit 607 and a branch unit 608. In one embodiment, the send unit 607 and the branch unit 608 may operate similarly to the send unit 530 and the branch unit 532 of the graphics execution unit 508 of FIG. 5B.
[0122] The execution unit 600 also includes a computation unit 610 that includes multiple different types of functional units. In one embodiment, the computation unit 610 includes an ALU unit 611 that includes an array of arithmetic logic units. The ALU unit 611 can be configured to perform 64-bit, 32-bit, and 16-bit integer and floating point operations. The integer and floating point operations may be performed simultaneously. The computation unit 610 can also include a systolic array 612 and a math unit 613. The systolic array 612 includes a W-width and D-depth network of data processing units that can be used to perform vector or other data parallel operations in a systolic manner. In one embodiment, the systolic array 612 can be configured to perform matrix operations such as a matrix dot product operation. In one embodiment, the systolic array 612 supports 16-bit floating point operations, as well as 8-bit and 4-bit integer operations. In one embodiment, the systolic array 612 can be configured to accelerate machine learning operations. In such an embodiment, systolic array 612 may be configured to support the bfloat 16-bit floating point format. In one embodiment, math unit 613 may be included to perform a particular subset of mathematical operations in a more efficient and lower power manner than ALU unit 611. Math unit 613 may include variations of math logic that may be found in the shared functional logic of a graphics processing engine provided by other embodiments (e.g., math logic 422 of shared functional logic 420 of FIG. 4). In one embodiment, math unit 613 may be configured to perform 32-bit and 64-bit floating point operations.
[0123] The thread control unit 601 includes logic to control the execution of threads in the execution units. The thread control unit 601 may include thread arbitration logic to start, stop, and preempt the execution of threads in the execution units 600. The thread state unit 602 may be used to store thread states for threads assigned to execute on the execution units 600. Storing thread states in the execution units 600 allows for rapid preemption of threads when they become blocked or idle. The instruction fetch / prefetch unit 603 may cache instructions from an instruction cache of a higher level of execution logic (e.g., instruction cache 506 in FIG. 5A). The instruction fetch / prefetch unit 603 may also issue prefetch requests for instructions to be loaded into the instruction cache based on an analysis of currently executing threads. The instruction decode unit 604 may be used to decode instructions to be executed by the computation units. In one embodiment, the instruction decode unit 604 may be used as a secondary decoder to decode complex instructions into constituent micro-operations.
[0124] Execution unit 600 further includes a register file 606 that may be used by hardware threads executing on execution unit 600. Registers in register file 606 may be divided across logic used to execute multiple simultaneous threads in compute units 610 of execution unit 600. The number of logical threads that may be executed by graphics execution unit 600 is not limited to the number of hardware threads, and multiple logical threads may be assigned to each hardware thread. The size of register file 606 may vary across embodiments based on the number of hardware threads supported. In one embodiment, register renaming may be used to dynamically assign registers to hardware threads.
[0125] 7 is a block diagram illustrating a graphics processor instruction format 700, according to some embodiments. In one or more embodiments, a graphics processor execution unit supports an instruction set having instructions in multiple formats. The solid lined boxes illustrate components that are typically included in execution unit instructions, while the dotted lines include components that are optional or included in only a subset of the instructions. In some embodiments, the instruction format 700 described and illustrated are microinstructions, in that they are instructions that are supplied to the execution units, as opposed to micro-operations that result from an instruction decode after an instruction has been processed.
[0126] In some embodiments, the graphics processor execution units natively support instructions in 128-bit instruction format 710. A 64-bit compressed instruction format 730 is available for some instructions based on the selected instruction, instruction options, and number of operands. The native 128-bit instruction format 710 provides access to all instruction options, while some options and operations are restricted in 64-bit format 730. The native instructions available in 64-bit format 730 vary by embodiment. In some embodiments, the instruction is partially compressed using a set of index values in index field 713. The execution unit hardware looks up a set of compression tables based on the index values and uses the output of the compression tables to reconstruct the native instruction in 128-bit instruction format 710. Other sizes and formats of instructions may be used.
[0127] For each format, the instruction opcode 712 defines the operation that the execution unit is to perform. The execution unit executes each instruction in parallel across multiple data elements of each operand. For example, in response to an add instruction, the execution unit performs a simultaneous add operation across each color channel representing a texture or picture element. By default, the execution unit executes each instruction across all data channels of an operand. In some embodiments, the instruction control field 714 allows control over certain execution options such as channel selection (e.g., predication) and data channel order (e.g., swizzle). For instructions in the 128-bit instruction format 710, the exec-size field 716 limits the number of data channels that will be executed in parallel. In some embodiments, the exec-size field 716 is not available for use in the 64-bit compressed instruction format 730.
[0128] Some execution unit instructions have up to three operands, including two source operands, src0 720, src1 722, and one destination 718. In some embodiments, the execution units support dual destination instructions, in which case one of the destinations is implied. Data manipulation instructions may have a third source operand (e.g., SRC2 724), in which case the instruction opcode 712 determines the number of source operands. The final source operand of an instruction may be an immediate (e.g., hard-coded) value passed with the instruction.
[0129] In some embodiments, the 128-bit instruction format 710 includes an access / address mode field 726 that specifies, for example, whether a direct or indirect register addressing mode is used. When a direct register addressing mode is used, the register addresses of one or more operands are provided directly by bits in the instruction.
[0130] In some embodiments, the 128-bit instruction format 710 includes an access / address mode field 726 that specifies an address mode and / or an 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 a 16-byte aligned access mode and a 1-byte aligned access mode, where the byte alignment of the access mode determines the access alignment of the instruction operands. For example, in a first mode, the instruction may use byte-aligned addressing for source and destination operands, and in a second mode, the instruction may use 16-byte aligned addressing for all source and destination operands.
[0131] In one embodiment, the address mode portion of the access / address mode field 726 determines whether the instruction uses direct or indirect addressing. When the direct register addressing mode is used, bits in the instruction directly provide the register address of one or more operands. When the indirect register addressing mode is used, the register address of one or more operands may be calculated based on an address register value and an address immediate field in the instruction.
[0132] In some embodiments, instructions are grouped based on opcode 712 bit fields to simplify opcode decode 740. For an 8-bit opcode, bits 4, 5, and 6 allow the execution unit to determine the type of opcode. The exact opcode groupings shown are merely examples. In some embodiments, the move and logical opcode group 742 includes data movement and logical instructions (e.g., move (mov), compare (cmp)). In some embodiments, the move and logical group 742 share five most significant bits (MSBs), where move (mov) instructions are of the form 0000xxxxb and logical instructions are of the form 0001xxxxb. The flow control instruction group 744 (e.g., call, jump (jmp)) are instructions of the form 0010xxxxb (e.g., 0x20). The miscellaneous instruction group 746 includes a mix of instructions, including synchronization instructions (e.g., wait, send) in the format of 0011xxxxb (e.g., 0x30). The parallel math instruction group 748 includes component-wise arithmetic instructions (e.g., add, multiply (mul)) in the format of 0100xxxxb (e.g., 0x40). The parallel math group 748 performs arithmetic operations in parallel across data channels. The vector math group 750 includes arithmetic instructions (e.g., dp4) in the format of 0101xxxxb (e.g., 0x50). The vector math group performs arithmetic such as dot product calculations on vector operands. In one embodiment, the illustrated opcode decode 740 can be used to determine which portion of the execution unit is used to execute the decoded instruction. For example, some instructions may be designed as systolic instructions that are to be executed by a systolic array. Other instructions, such as ray tracing instructions (not shown), may be routed to a ray tracing core or ray tracing logic within a slice or portion of the execution logic.
[0133] Graphics Pipeline Figure 8 is a block diagram of another embodiment of a graphics processor 800. Elements of Figure 8 having the same reference numbers (or names) as elements of any other figure herein may operate or function in a similar manner as described elsewhere herein, but are not limited to such.
[0134] In some embodiments, graphics processor 800 includes a geometry pipeline 820, a media pipeline 830, a display engine 840, thread execution logic 850, and a render output pipeline 870. In some embodiments, graphics processor 800 is a graphics processor in 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 graphics processor 800 via a ring interconnect 802. In some embodiments, ring interconnect 802 couples graphics processor 800 to other processing components, such as other graphics processors or general-purpose processors. Commands from ring interconnect 802 are interpreted by command streamer 803. Command streamer 803 supplies instructions to individual components of geometry pipeline 820 or media pipeline 830.
[0135] In some embodiments, command streamer 803 directs the operation of vertex fetcher 805, which reads vertex data from memory and executes vertex processing commands provided by command streamer 803. In some embodiments, vertex fetcher 807 provides vertex data to vertex shader 807, which performs coordinate space transformation and lighting operations for each vertex. In some embodiments, vertex fetcher 805 and vertex shader 807 execute vertex processing instructions by dispatching execution threads to execution units 852A-852B via thread dispatcher 831.
[0136] In some embodiments, the execution units 852A-852B are an array of vector processors with an instruction set for performing graphics and media operations. In some embodiments, the execution units 852A-852B have an associated L1 cache 851 that is local to each array or shared between the arrays. The cache may be configured as a data cache, an instruction cache, or a single cache that is partitioned to contain data and instructions in different partitions.
[0137] In some embodiments, the geometry pipeline 820 includes a tessellation component that performs hardware accelerated tessellation of 3D objects. In some embodiments, a programmable hull shader 811 configures the tessellation operations. A programmable domain shader 817 provides back-end evaluation of the tessellation output. A tessellator 813 operates at the hull shader 811's direction and includes special purpose logic that generates a set of detailed geometric objects based on a coarse geometric model provided as input to the geometry pipeline 820. In some embodiments, the tessellation components (e.g., hull shader 811, tessellator 813, and domain shader 817) can be bypassed if tessellation is not used.
[0138] In some embodiments, a complete geometric object may be executed by a one or more thread geometry shader 819 via one or more threads dispatched to execution units 852A-852B, or may be processed directly to the clipper 829. In some embodiments, the geometry shader operates on entire geometry objects, rather than vertices or patches of vertices as in earlier stages of the graphics pipeline. The geometry shader 819 receives input from the vertex shader 807 if tessellation is disabled. In some embodiments, the geometry shader 819 is programmable by a geometry shader program to perform geometry tessellation if the tessellation units are disabled.
[0139] Prior to rasterization, a clipper 829 processes the vertex data. The clipper 829 may be a fixed function clipper or a programmable clipper with clipping and geometry shader functionality. In some embodiments, a rasterizer and depth test component 873 in the render output pipeline 870 dispatches pixel shaders to convert geometric objects into per pixel representations. In some embodiments, pixel shader logic is included in the thread execution logic 850. In some embodiments, an application can bypass the rasterizer and depth test component 873 and access non-rasterized vertex data via the stream-out unit 823.
[0140] Graphics processor 800 includes an interconnect bus, interconnect fabric, or some other interconnect mechanism that allows for the passing of data and messages between the major components of the processor. In some embodiments, execution units 852A-852B and associated logic units (e.g., L1 cache 851, sampler 854, texture cache 858, etc.) interconnect via data port 856 to perform memory accesses and communicate with the render output pipeline components of the processor. In some embodiments, sampler 854, caches 851, 858, and execution units 852A-852B each have a separate memory access path. In one embodiment, texture cache 858 may also be configured as a sampler cache.
[0141] In some embodiments, the render output pipeline 870 includes a rasterizer and depth test component 873 that converts vertex-based objects into an associated pixel-based representation. In some embodiments, the rasterizer logic includes a windower / masker unit that performs fixed function triangle and line rasterization. In some embodiments, an associated render cache 878 and depth cache 879 are also available. A pixel operations component 877 performs pixel-based operations on the data, although in some instances pixel operations associated with 2D operations (e.g. bit block image transfer with blending) are performed by the 2D engine 841 or substituted at display time by the display controller 843 using an overlay display surface. In some embodiments, a shared L3 cache 875 is available to all graphics components, allowing sharing of data without using main system memory.
[0142] In some embodiments, the graphics processor media pipeline 830 includes a media engine 837 and a video front end 834. In some embodiments, the video front end 834 receives pipeline commands from the command streamer 803. In some embodiments, the media pipeline 830 includes a separate command streamer. In some embodiments, the video front end 834 processes the media commands before sending the commands to the media engine 837. In some embodiments, the media engine 837 includes a thread spawning function that spawns threads for dispatch to the thread execution logic 850 via the thread dispatcher 831.
[0143] In some embodiments, graphics processor 800 includes a display engine 840. In some embodiments, display engine 840 is external to processor 800 and couples to the graphics processor via ring interconnect 802 or some other interconnect bus or fabric. In some embodiments, display engine 840 includes a 2D engine 841 and a display controller 843. In some embodiments, display engine 840 includes special purpose logic that can operate independently of the 3D pipeline. In some embodiments, display controller 843 couples to a display device (not shown). The display device may be a system integrated display device such as that found in a laptop computer, or an external display device attached via a display device connector.
[0144] In some embodiments, the geometry pipeline 820 and the media pipeline 830 are configurable 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 the graphics processor translates API calls specific to a particular graphics or media library into commands that can be processed by the graphics processor. In some embodiments, the graphics processor provides support for the Open Graphics Library (OpenGL), Open Computing Language (OpenCL), and Vulkan graphics and compute APIs, all from the Khronos group. In some embodiments, support may also be provided for the Direct3D library from Microsoft Corporation. In some embodiments, combinations of these libraries may be supported. Support may also be provided for the open source computer vision library (OpenCV). Future APIs with compatible 3D pipelines will also be supported if a mapping can be created from the future API's pipeline to the graphics processor's pipeline.
[0145] Graphics Pipeline Programming Figure 9A is a block diagram illustrating a graphics processor command format 900 according to some embodiments. Figure 9B is a block diagram illustrating a graphics processor command sequence 910 according to one embodiment. The solid lined boxes in Figure 9A indicate components that are typically included in a graphics command, while the dashed lines include components that are optional or included only in a subset of graphics commands. The example graphics processor command format 900 of Figure 9A includes data fields that identify a client 902, a command operation code (opcode) 904, and data for the command 906. In some commands, a sub-opcode 905 and a command size 908 are also included.
[0146] In some embodiments, the client 902 specifies a client unit of the graphics device that will process the command data. In some embodiments, the graphics processor command parser examines the client field of each command to set conditions on further processing of the command and route the command data to the appropriate client unit. In some embodiments, the graphics processor client units include a memory interface unit, a render unit, a 2D unit, a 3D unit, and a media unit. Each client unit has a corresponding processing pipeline that processes the command. When a command is received by a client unit, the client unit reads the opcode 904 and, if present, the sub-opcode 905 to determine the operation to perform. The client unit executes the command using the information in the data field 906. For some commands, an explicit command size 908 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 based on the command opcode. In some embodiments, the commands are aligned via doubleword multiples. Other command formats can also be used.
[0147] The flow diagram of Figure 9B illustrates an example graphics processor command sequence 910. In some embodiments, software or firmware of a data processing system featuring an embodiment of a graphics processor uses a version of the illustrated command sequence to set up, execute, and terminate a set of graphics operations. The sample command sequence is shown and described for illustrative purposes only, as embodiments are not limited to these particular commands or this command sequence. Furthermore, commands may be issued as a batch of commands in a command sequence such that the graphics processor will process the sequence of commands at least partially concurrently.
[0148] In some embodiments, the graphics processor command sequence 910 may begin with a pipeline flush command 912 to cause any active graphics pipelines to complete any currently pending commands for the pipeline. In some embodiments, the 3D pipeline 922 and the media pipeline 924 do not operate simultaneously. The pipeline flush is performed to cause the active graphics pipelines to complete any pending commands. In response to the pipeline flush, the command parser for the graphics processor will suspend command processing until the active drawing engines complete pending operations and the associated read caches are invalidated. Optionally, any data marked as "dirty" in the render cache may be flushed to memory. In some embodiments, the pipeline flush command 912 may be used for pipeline synchronization or before placing the graphics processor in a low power state.
[0149] In some embodiments, the pipeline select command 913 is used when a command sequence requires the graphics processor to explicitly switch between pipelines. In some embodiments, the pipeline select command 913 is only needed once within an execution context, before issuing a pipeline command, unless the context issues commands to both pipelines. In some embodiments, a pipeline flush command 912 is needed immediately before switching pipelines via the pipeline select command 913.
[0150] In some embodiments, pipeline control commands 914 are used to configure the graphics pipeline for operation and to program the 3D pipeline 922 and the media pipeline 924. In some embodiments, pipeline control commands 914 configure the pipeline state for an active pipeline. In one embodiment, pipeline control commands 914 are used for pipeline synchronization and to clear data from one or more cache memories in an active pipeline before processing a batch of commands.
[0151] In some embodiments, the return buffer state commands 916 are used to configure a set of return buffers to which each pipeline writes data. Some pipeline operations require the allocation, selection, or configuration of one or more return buffers to 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, the return buffer state 916 includes selecting the size and number of return buffers to use for a set of pipeline operations.
[0152] The remaining commands in the command sequence differ based on the active pipeline for the operation. Based on the pipeline decision 920, the command sequence is adjusted for either the 3D pipeline 922, which begins at a 3D pipeline state 930, or the media pipeline 924, which begins at a media pipeline state 940.
[0153] The commands that configure the 3D pipeline state 930 include 3D state setting commands for vertex buffer state, vertex element state, constant color state, depth buffer state, and other state variables that should be configured before 3D primitive commands are processed. The values of these commands are determined, at least in part, based on the particular 3D API at the time of use. In some embodiments, the 3D pipeline state 930 commands can also selectively disable or bypass certain pipeline elements if those elements are not used.
[0154] In some embodiments, 3D primitive 932 commands are used to submit 3D primitives to be processed by the 3D pipeline. Commands and associated parameters passed to the graphics processor via 3D primitive 932 commands are forwarded to a vertex fetch function of the graphics pipeline. The vertex fetch function uses the 3D primitive 932 command data to generate a vertex data structure. The vertex data structure is stored in one or more return buffers. In some embodiments, 3D primitive 932 commands are used to perform vertex operations on 3D primitives via vertex shaders. To process vertex shaders, 3D pipeline 922 dispatches shader execution threads to the graphics processor execution units.
[0155] In some embodiments, the 3D pipeline 922 is triggered via an execute 934 command or event. In some embodiments, a register write triggers command execution. In some embodiments, execution is triggered via a "go" or "kick" command in a command sequence. In one embodiment, command execution is triggered using a pipeline synchronization command to flush the command sequence through the graphics pipeline. The 3D pipeline will perform geometry processing for the 3D primitives. Once the operations are complete, the resulting geometric objects are rasterized and the pixel engine colors the resulting pixels. Additional commands to control pixel shading and pixel backend operations may also be included for these operations.
[0156] In some embodiments, the graphics processor command sequence 910 follows a media pipeline 924 path when performing media operations. In general, the specific use and manner of programming for the media pipeline 924 depends on the media or computational operations being performed. Specific media decode operations may be offloaded to the media pipeline during media decoding. In some embodiments, the media pipeline may also be bypassed, and media decoding may be performed in whole or in part using resources provided by one or more general purpose processing cores. In one embodiment, the media pipeline also includes elements for general purpose graphics processor unit (GPGPU) operation, where the graphics processor is used to perform SIMD vector operations using computational shader programs that are not explicitly related to rendering graphics primitives.
[0157] In some embodiments, the media pipeline 924 is configured in a similar manner to the 3D pipeline 922. A set of commands that configure the media pipeline state 940 are dispatched or placed in a command queue before the media object 942. In some embodiments, the commands for the media pipeline state 940 contain data that configures the media pipeline elements that will be used to process the media object. This includes data that configures the video decoding and video encoding logic within the media pipeline, such as the encoding or decoding format. In some embodiments, the commands for the media pipeline state 940 also support the use of one or more pointers to "indirect" state elements that contain a batch of state settings.
[0158] In some embodiments, a media object command 942 provides a pointer to a media object for processing by the media pipeline. A media object includes a memory buffer that contains the video data to be processed. In some embodiments, all media pipeline state must be valid before issuing a media object command 942. Once the pipeline state is configured and the media object command 942 is queued, the media pipeline 924 is triggered via an execute command 944 or equivalent execute event (e.g., a register write). The output from the media pipeline 924 can then be self-processed by operations provided by the 3D pipeline 922 or the media pipeline 924. In some embodiments, GPGPU operations are configured and executed in a similar manner as media operations.
[0159] Graphics Software Architecture 10 illustrates an example graphics software architecture for a data processing system 1000, according to some embodiments. In some embodiments, the software architecture includes a 3D graphics application 1010, an operating system 1020, and at least one processor 1030. In some embodiments, the processor 1030 includes a graphics processor 1032 and one or more general-purpose processor cores 1034. The graphics application 1010 and the operating system 1020 each execute within the system memory 1050 of the data processing system.
[0160] In some embodiments, the 3D graphics application 1010 includes one or more shader programs that include shader instructions 1012. The shader language instructions may be in a high-level shader language, such as Direct3D's High Level Shader Language (HLSL), OpenGL Shader Language (GLSL), etc. The application also includes executable instructions 1014 in a machine language suitable for execution by a general-purpose processor core 1034. The application also includes graphics objects 1016 that are defined by vertex data.
[0161] In some embodiments, the operating system 1020 is a Microsoft® Windows® operating system from Microsoft® Corporation, a proprietary UNIX®-like operating system, or an open source UNIX-like operating system using a variant of the Linux® kernel. The operating system 1020 can support a graphics API 1022, such as a Direct3D API, an OpenGL API, or a Vulkan API. When the Direct3D API is in use, the operating system 1020 compiles any shader instructions 1012 in HLSL into a lower level shader language using a front-end shader compiler 1024. The compilation can be a just-in-time (JIT) compilation, or the application can perform shader pre-compilation. In some embodiments, high-level shaders are compiled into low-level shaders during compilation of the 3D graphics application 1010. In some embodiments, the shader instructions 1012 are provided in an intermediate form, such as a version of the Standard Portable Intermediate Representation (SPIR) used by the Vulkan API.
[0162] In some embodiments, user mode graphics driver 1026 includes a back-end shader compiler 1027 that converts shader instructions 1012 into a hardware-specific representation. When the OpenGL API is in use, shader instructions 1012 in the GLSL high-level language are passed to user mode graphics driver 1026 for compilation. In some embodiments, user mode graphics driver 1026 communicates with kernel mode graphics driver 1029 using operating system kernel mode functions 1028. In some embodiments, kernel mode graphics driver 1029 communicates with graphics processor 1032 to dispatch commands and instructions.
[0163] IP Core Implementation One or more aspects of at least one embodiment may be implemented by representative code stored on a machine-readable medium that represents and / or defines logic within an integrated circuit, such as a processor. For example, the machine-readable medium may include instructions that represent various logic within a processor. When read by a machine, the instructions may cause the machine to create logic to perform the techniques described herein. Such representations, known 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 that describes the structure of the integrated circuit. The hardware model may be provided to various customers or manufacturing facilities, which load the hardware model into a manufacturing machine that produces the integrated circuit. The integrated circuit may be manufactured such that the circuit performs the operations described in connection with any of the embodiments described herein.
[0164] FIG. 11A is a block diagram illustrating an IP core development system 1100 that may be used to manufacture an integrated circuit that performs operations, according to one embodiment. The IP core development system 1100 may be used to generate modular, reusable designs 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 1130 may generate a software simulation 1110 of the IO core design in a high-level programming language (e.g., C / C++). The software simulation 1110 may be used to design, test, and verify the behavior of the IP core using a simulation model 1112. The simulation model 1112 may include functional, behavioral, and / or timing simulation. A register transfer level (RTL) design 1115 may then be created or synchronized from the simulation model 1112. The RTL design 1115 is an abstraction of the behavior of the integrated circuit that models the flow of digital signals between hardware registers, including associated logic that is executed using the modeled digital signals. In addition to the RTL design 1115, a lower level design at the logic level or transistor logic may be created, designed or synchronized. Thus, the specific details of the initial design and simulation may differ.
[0165] The RTL design 1115 and equivalents may further be integrated by a design facility into a hardware model 1120, which may be in a hardware description language (HDL) or some other representation of physical design data. The HDL may further be simulated or tested to evaluate the IP core design. The IP core design may be stored using a non-volatile memory 1140 (e.g., a hard disk, a flash memory, or any non-volatile storage medium) for delivery to a third-party manufacturing facility 1165. Alternatively, the IP core design may be transmitted over a wired connection 1150 or a wireless connection 1160 (e.g., via the Internet). The manufacturing facility 1165 may then manufacture an integrated circuit based at least in part on the IP core design. The manufactured integrated circuit may be configured to perform operations according to at least one embodiment described herein.
[0166] 11B shows a cross-sectional side view of an integrated circuit package assembly 1170 according to some embodiments described herein. The integrated circuit package assembly 1170 illustrates an implementation of one or more processors or accelerator devices described herein. The package assembly 1170 includes multiple units of hardware logic 1172, 1174 coupled to a substrate 1180. The logic 1172, 1174 may be implemented, at least in part, in configurable logic or fixed function logic hardware and may include one or more portions of any of the processor cores, graphics processors, or other accelerator devices described herein. Each unit of logic 1172, 1174 may be implemented within a semiconductor die and may be coupled to the substrate 1180 via an interconnect structure 1173. The interconnect structure 1173 may be configured to route electrical signals between the logic 1172, 1174 and the substrate 1180 and may include interconnects such as, but not limited to, dumps and pillars. In some embodiments, the interconnect structure 1173 may be configured to route electrical signals, such as input / output (I / O) signals and / or power or ground signals associated with the operation of the logic 1172, 1174. In some embodiments, the substrate 1180 is an epoxy-based laminate substrate. The substrate 1180 may include other suitable types of substrates in other embodiments. The package assembly 1170 may be connected to other electrical devices via the package interconnect 1183. The package interconnect 1183 may be coupled to a surface of the substrate 1180 to route electrical signals to other electrical devices, such as a motherboard or other chipsets or multi-chip modules.
[0167] In some embodiments, the units of logic 1172, 1174 are electrically coupled to a bridge 1182 configured to route electrical signals between the logic 1172, 1174. The bridge 1182 may be a dense interconnect structure that provides a route for the electrical signals. The bridge 1182 may include a bridge substrate made of glass or a suitable semiconductor material. Electrical routing features may be formed on the bridge substrate to provide chip-to-chip connections between the logic 1172, 1174.
[0168] Although two units of logic 1172, 1174 and a bridge 1182 are shown, embodiments described herein may include more or fewer logic units on one or more dies. When logic is included on a single die, bridge 1182 may be omitted, and one or more dies may be connected by zero or more bridges. Alternatively, multiple dies or units of logic may be connected by one or more bridges. Additionally, in other possible configurations, including three-dimensional configurations, multiple logic units, dies and bridges may be connected together.
[0169] FIG. 11C illustrates a package assembly 1190 including multiple units of hardware logic chiplets connected to a substrate 1180 (e.g., a base die). Graphics processing units, parallel processors, and / or computational accelerators as described herein can be constructed from multiple silicon chiplets that are fabricated separately. In this context, a chiplet is an at least partially packaged integrated circuit that includes individual units of logic that can be assembled with other chiplets into a larger package. Multiple sets of chiplets with different IP core logic can be assembled into a single device. Additionally, chiplets can be integrated into a base die or base chiplet using active interposer technology. The concepts described herein allow interconnection and communication between different forms of IP within a GPU. IP cores can be fabricated using different process technologies and configured during fabrication, avoiding the complexity of aggregating multiple IPs into the same fabrication process, especially on a large SoC with several flavors of IP. Enabling the use of multiple process technologies improves time to market and provides a cost-effective way to create multiple product SKUs. Additionally, the decomposed IP can be further modified to be independently power-gated, allowing components not being used in a given workload to be powered off, reducing overall power consumption.
[0170] The hardware logic chiplets can include special purpose hardware logic chiplets 1172, logic or I / O chiplets 1174, and / or memory chiplets 1175. The hardware logic chiplets 1172 and logic or I / O chiplets 1174 can be implemented, at least in part, in configurable logic or fixed function logic hardware and can include one or more portions of any of the processor cores, graphics processors, parallel processors, or other accelerators described herein. The memory chiplets 1175 can be DRAM (e.g., GDDR, HBM) memory or cache (SRAM) memory.
[0171] Each chiplet can be fabricated as a separate semiconductor die and can be coupled to substrate 1180 via interconnect structures 1173. Interconnect structures 1173 can be configured to route electrical signals between various chiplets and logic within substrate 1180. Interconnects 1173 can include interconnects such as, but not limited to, bumps and pillars. In some embodiments, interconnect structures 1173 can be configured to route electrical signals, such as input / output (I / O) signals and / or power or ground signals associated with logic, I / O, and memory chiplets.
[0172] In some embodiments, the substrate 1180 is an epoxy-based laminate substrate. The substrate 1180 may include other suitable types of substrates in other embodiments. The package assembly 1190 may be connected to other electrical devices via package interconnects 1183. The package interconnects 1183 may be coupled to a surface of the substrate 1180 and may route electrical signals to other electrical devices, such as a motherboard or other chiplets or multi-chip modules.
[0173] In some embodiments, the logic or I / O chiplets 1174 and the memory chiplets 1175 may be electrically coupled via a bridge 1187. The bridge 1187 is configured to route electrical signals between the logic or I / O chiplets 1174 and the memory chiplets 1175. The bridge 1187 may be a dense interconnect structure that provides a route for the electrical signals. The bridge 1187 may include a bridge substrate that is made of glass or a suitable semiconductor material. Electrical routing features may be formed on the bridge substrate to provide chip-to-chip connections between the logic or I / O chiplets 1174 and the memory chiplets 1175. The bridge 1187 may also be referred to as a silicon bridge or an interconnect bridge. For example, the bridge 1187 is an Embedded Multi-die Interconnect Bridge (EMIB) in some embodiments. In some embodiments, the bridge 1187 may simply be a direct connection from one chiplet to another.
[0174] Substrate 1180 can include hardware components for I / O 1191, cache memory 1192, and other hardware logic 1193. Fabric 1185 can be embedded in substrate 1180 to enable communication between various chiplets and logic 1191, 1193 within substrate 1180. In one embodiment, I / O 1191, fabric 1185, cache, bridges, and other hardware logic 1193 can be integrated into a base die that is layered on top of substrate 1180.
[0175] In various embodiments, package assembly 1190 may include fewer or more components and chiplets interconnected by fabric 1185 or one or more bridges 1187. Chiplets in package assembly 1190 may be arranged in a 3D or 2.5D arrangement. In general, bridge structures 1187 may be used to facilitate point-to-point interconnections between, for example, logic or I / O chiplets and memory chiplets. Fabric 1185 may be used to interconnect various logic and / or I / O chiplets (e.g., chiplets 1172, 1174, 1191, 1193) with other logic and / or I / O chiplets. In one embodiment, cache memory 1192 in the substrate may function as a global cache for package assembly 1190, as part of a distributed global cache or as a dedicated cache for fabric 1185.
[0176] FIG. 11D illustrates a package assembly 1194 including replaceable chiplets 1195, according to one embodiment. The replaceable chiplets 1195 can be assembled into standardized slots on one or more base substrates 1196, 1198. The base chiplets 1196, 1198 can be coupled via a bridge interconnect 1197. The bridge interconnect 1197 can be similar to other bridge interconnects described herein, for example, an EMIB. Memory chiplets can also be connected to logic or I / O chiplets via bridge interconnects. The I / O and logic chiplets can communicate via an interconnect fabric. The base chiplets can each support one or more slots in a standardized format for one of logic or I / O or memory / cache.
[0177] In one embodiment, the SRAM and power delivery circuitry may be fabricated in one or more of the base chiplets 1196, 1198, which may be fabricated using a different process technology than the replaceable chiplet 1195 that is stacked on top of the base chiplet. For example, the base chiplets 1196, 1198 may be fabricated using a larger process technology, while the replaceable chiplet may be fabricated using a smaller process technology. One or more of the replaceable chiplets 1195 may be memory (e.g., DRAM) chiplets. Different memory densities may be selected for the package assembly 1194 based on the power and / or performance targeted for the product using the package assembly 1194. In addition, logic chiplets having different numbers and types of functional units may be selected at assembly time based on the power and / or performance targeted for the product. In addition, chiplets containing different types of IP logic cores may be inserted into the replaceable chiplet slots, enabling hybrid processor designs where IP blocks of different technologies can be mixed and matched.
[0178] Exemplary System-on-Chip Integrated Circuit 12-13 illustrate an example integrated circuit and associated graphics processor that may be manufactured using one or more IP cores according to various embodiments described herein. In addition to what is illustrated, other logic and circuitry may be included, including additional graphics processors / cores, peripheral interface controllers, or general purpose processor cores.
[0179] 12 is a block diagram illustrating an example system on an integrated circuit 1200 that may be manufactured using one or more IP cores, according to one embodiment. The example integrated circuit 1200 includes one or more application processors 1205 (e.g., a CPU), at least one graphics processor 1210, and may further include an image processor 1215 and / or a video processor 1220, any of which may be modular IP cores from the same or multiple different design facilities. The integrated circuit 1200 includes a USB controller 1225, a UART controller 1230, an SPI / SDIO controller 1235, and an I / O controller 1236. 2 S / I 2 The integrated circuit includes peripheral or bus logic including a C controller 1240. Additionally, the integrated circuit may include a display device 1245 coupled to one or more of a high-definition multimedia interface (HDMI) controller 1250 and a mobile industry processor interface (MIPI) display interface 1255. Storage may be provided by a flash memory subsystem 1260 including a flash memory and a flash memory controller. A memory interface may be provided via a memory controller 1265 for access to an SDRAM or SRAM memory device. Some integrated circuits further include an embedded security engine 1270.
[0180] 13A-13B are block diagrams illustrating example graphics processors for use in an SoC according to embodiments described herein. FIG. 13A illustrates an example graphics processor 1310 of a system-on-chip integrated circuit that may be fabricated using one or more IP cores according to one embodiment. FIG. 13B illustrates a further example graphics processor 1340 of a system-on-chip integrated circuit that may be fabricated using one or more IP cores according to one embodiment. The graphics processor 1310 of FIG. 13A is an example of a low-power graphics processor core. The graphics processor 1340 of FIG. 13B is an example of a higher performance graphics processor core. Each of the graphics processors 1310, 1410 may be a variation of the graphics processor 1210 of FIG. 12.
[0181] As illustrated in FIG. 13A, the graphics processor 1310 includes a vertex processor 1305 and one or more fragment processors 1315A-1315N (e.g., 1315A, 1315B, 1315C, 1315D-1315N-1, and 1315N). The graphics processor 1310 can execute different programs through separate logic, such that the vertex processor 1305 is optimized to perform operations for vertex shader programs, while the fragment processors 1315A-1315N perform fragment (e.g., pixel) shading operations for fragment or pixel shader programs. The vertex processor 1305 executes the vertex processing stage of the 3D graphics pipeline and generates primitive and vertex data. The fragment processors 1315A-1315N use the primitive and vertex data generated by the vertex processor 1305 to generate a frame buffer that is displayed on a display device. In one embodiment, the fragment processors 1315A-1315N are optimized to execute fragment shader programs provided in the OpenGL API, which can be used to perform operations similar to pixel shader programs provided in the Direct3D API.
[0182] The graphics processor 1310 further includes one or more memory management units (MMUs) 1320A-1320B, caches 1325A-1325B, and circuit interconnects 1330A-1330. The one or more MMUs 1320A-1320B provide virtual to physical address mapping for the graphics processor 1310, including the vertex processor 1305 and / or fragment processors 1315A-1315N, which may reference vertices or image / texture data stored in memory in addition to vertices or image / texture data stored in one or more caches 1325A-1325B. In one embodiment, one or more MMUs 1320-1320B may be synchronized with other MMUs in the system, including one or more MMUs associated with one or more application processors 1205, image processor 1215, and / or video processor 1220 of Figure 12, such that each processor 1205-1220 may participate in a shared or unified virtual memory system. One or more circuit interconnects 1330A-1330B enable graphics processor 1310 to interface with other IP cores in the SoC, either via an internal bus of the SoC or via a direct connection, depending on the embodiment.
[0183] As illustrated in FIG. 13B, the graphics processor 1340 includes one or more MMUs 1320A-1320B, caches 1325A-1325B, and circuit interconnects 1330A-1330B of the graphics processor 1310 of FIG. 13A. The graphics processor 1340 includes one or more shader cores 1355A-1355N (e.g., 1355A, 1355B, 1355C, 1355D, 1355E, 1355F-1355N-1, and 1355N) that provide a unified shader core architecture in which a single core or type or cores can execute all types of programmable shader cores, including shader program code that implements vertex shaders, fragment shaders, and / or compute shaders. The exact number of shader cores present may vary among embodiments and implementations. Additionally, graphics processor 1340 includes an inter-core task manager 1345 that functions as a thread dispatcher to dispatch execution threads to one or more shader cores 1355A-1355N, and a tiling unit 1358 that accelerates tiling operations for tile-based rendering, in which rendering operations for a scene are subdivided in image space, e.g., to exploit local spatial coherence within the scene or to optimize internal cache usage.
[0184] Machine Learning Overview Machine learning algorithms are algorithms that can learn based on a set of data. Machine learning algorithm embodiments can be designed to model high-level abstractions within a dataset. For example, image recognition algorithms can be used to determine which of several categories a given input belongs to; regression algorithms can output a numerical value given an input; pattern recognition algorithms can be used to generate converted text or perform speech and / or voice recognition from text.
[0185] An exemplary type of machine learning algorithm is a neural network. There are many types of neural networks, and a simple type of neural network is a feedforward network. A feedforward network may be implemented as an acyclic graph with nodes 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 converts the input received by the input layer into a representation useful for generating an output at the output layer. The network nodes are fully connected to adjacent layers via edges, but no edges exist between the nodes within each layer. Data received at the nodes of the input layer of a feedforward network is propagated (i.e., "fed forward") to the nodes of the output layer via an activation function that calculates the state of the nodes of each successive layer in the network based on coefficients ("weights") respectively associated with each of the edges connecting the layers. Depending on the particular model represented by the algorithm being executed, the output from a neural network algorithm can take a variety of forms.
[0186] 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 being represented by the network, and adjusting weights until the network model runs with minimal error for all instances of the training data set. For example, during a supervised learning training process for a neural network, an output generated by the network in response to an input representing an instance in the training data set is compared to an output labeled "correct" for that instance, an error signal representing the difference between the output and the labeled output is calculated, and weights associated with the connections are adjusted to minimize the error as the error signal propagates backwards through the layers of the network. The network is considered "trained" when the error for each of the outputs generated from instances of the training data set is minimized.
[0187] The accuracy of machine learning algorithms can be greatly affected by the quality of the data set used to train the algorithm. The training process can be computationally intensive and can require a significant amount of time in a conventional general-purpose processor. Therefore, parallel processing hardware is used to train many types of machine learning algorithms. This is particularly beneficial for optimizing the training of neural networks, since the calculations performed in adjusting the coefficients in the neural network naturally lend themselves to parallel implementation. In particular, many machine learning algorithms and software applications are adapted to use parallel processing hardware in general-purpose graphics processing devices.
[0188] FIG. 14 is a generalized diagram of a machine learning software stack 1400. A machine learning application 1402 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 1402 may include training and inference functions for the neural network and / or special software that may be used to train the neural network prior to deployment. The machine learning application 1402 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.
[0189] Hardware acceleration for machine learning applications 1402 may be enabled through machine learning framework 1404. Machine learning framework 1404 may provide a library of machine learning primitives. Machine learning primitives are basic operations typically performed by machine learning algorithms. Without machine learning framework 1404, developers of machine learning algorithms would need to create and optimize the main computational logic associated with the machine learning algorithm and then reoptimize that computational logic as new parallel processors are developed. Instead, machine learning applications may be configured to perform the necessary computations using primitives provided by machine learning framework 1404. Exemplary primitives include tensor convolutions, activation functions, and pooling, which are computational operations performed while training a convolutional neural network (CNN). Machine learning framework 1404 may also provide primitives that implement basic linear algebra subprograms performed by many machine learning algorithms, such as matrix and vector operations.
[0190] The machine learning framework 1404 can process input data received from the machine learning application 1402 to generate appropriate inputs to the computation framework 1406. The computation framework 1406 abstracts the underlying instructions provided to the GPGPU driver 1408, allowing the machine learning framework 1404 to take advantage of hardware acceleration via the GPGPU hardware 1410 without the machine learning framework 1404 needing to have detailed knowledge of the architecture of the GPGPU hardware 1410. Additionally, the computation framework 1406 can enable hardware acceleration of the machine learning framework 1404 across different types and generations of GPGPU hardware 1410.
[0191] Machine learning neural network implementation The computing architecture provided by the embodiments described herein can be configured to perform a type of parallel processing that is 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 known in the art, there are various types of neural network implementations used in machine learning. One exemplary type of neural network is a feedforward network, as previously described.
[0192] A second exemplary type of neural network is the Convolutional Neural Network (CNN). CNNs are specialized feed-forward neural networks for processing data with a known grid-like topology, such as image data. Thus, CNNs are commonly used for computational vision and image recognition applications, but they may also be used for other types of pattern recognition, such as speech and language processing. Nodes in the CNN input layer are organized into sets of "filters" (feature detectors inspired by receptive fields found in the retina), and the output of each set of filters is propagated to nodes in successive layers of the network. Computation for a CNN involves applying a convolution mathematical operation to each filter to generate the output of that filter. A convolution is a special kind of mathematical operation performed by two functions to generate a third function that is a modified version of one of the two original functions. In convolutional network terminology, the first function to the convolution can be called the input, and the second function can be called the convolution kernel. The output can be called a feature map. For example, the input to a convolutional layer may be a multidimensional array of data defining the various color components of the input image, and the convolution kernel may be a multidimensional array of parameters, where the parameters are adapted by a neural network training process.
[0193] Recurrent neural networks (RNNs) are a family of feedback neural networks that contain feedback connections between layers. RNNs allow for the modeling of sequential data by sharing parameter data across different parts of the neural network. The architecture of RNNs includes cycles. At least a portion of the output data from the RNN is used as feedback to process subsequent inputs in the sequence, so that a cycle represents the influence of a variable's current value on its own value at a future time. This feature makes RNNs particularly useful for language processing due to the variable nature that can constitute linguistic data.
[0194] The figures described below present example feedforward, CNN and RNN networks and explain the general process for training and deploying each of these types of networks, respectively. It will be understood that these descriptions are illustrative and non-limiting with respect to any specific embodiments described herein, and that the concepts described can be generally applied to deep neural networks and machine learning techniques in general.
[0195] The above-mentioned exemplary neural network can be used to perform deep learning. Deep learning is machine learning using deep neural networks. The deep neural networks used in deep learning are artificial neural networks that are composed of multiple hidden layers, as opposed to shallow neural networks that contain only a single hidden layer. Deeper neural networks are generally more computationally intensive to train. However, the additional hidden layers of the network allow for multi-step pattern recognition, which results in a reduced output error compared to shallow machine learning techniques.
[0196] A deep neural network used in deep learning typically includes a front-end network performing feature recognition coupled to a back-end network representing a mathematical model that can perform operations (e.g., object classification, speech recognition, etc.) based on feature representations provided to the model. Deep learning allows machine learning to be performed without the need to perform manually created feature engineering on the model. Instead, the deep neural network can learn features based on statistical structures or correlations in the input data. The learned features can be provided to a mathematical model that can map detected features to an output. The mathematical model used by the network is generally specialized for the particular task to be performed, and different models are used to perform different tasks.
[0197] 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 in the model to reduce the network's output error. Backpropagation of error is a common method used to train 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 of the neurons 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 these errors using algorithms such as the stochastic gradient descent algorithm to update the neural network weights.
[0198] 15A-15N illustrate an example convolutional neural network. FIG. 15A illustrates various layers within a CNN. As illustrated in FIG. 15A, an example CNN used to model image processing can receive an input 1502 indicating red, green, and blue (RGB) components of an input image. The input 1502 can be processed by multiple convolutional layers (e.g., a first convolutional layer 1504, a second convolutional layer 1506). The output from the multiple convolutional layers can optionally be processed by a set of fully connected layers 1508. Neurons in a fully connected layer have full connections to all activations in the previous layer, as described above with respect to feedforward networks. The output from the fully connected layers 1508 can be used to generate output results from the network. The activations in the fully connected layers 1508 can be calculated using matrix multiplication instead of convolution. Not all CNN implementations use fully connected layers 1508. For example, in some implementations, the second convolutional layer 1506 can generate output for the CNN.
[0199] Convolutional layers are sparsely connected, unlike traditional neural network configurations found in the fully connected layer 1508. Traditional neural network layers are fully connected such that every output interacts with every input. Convolutional layers, however, are sparsely connected because the output of the convolution of the field is the input to the nodes of the subsequent layer (instead of the respective state values of each of the nodes in the field), as shown. The kernels associated with the convolutional layers perform the convolution operation, and the output is sent to the next layer. The dimensionality reduction performed in the convolutional layers is one aspect that allows CNNs to scale and process large images.
[0200] FIG. 15B illustrates exemplary computational steps within a convolutional layer of a CNN. An input 1512 to the convolutional layer of a CNN can be processed in three stages in a convolutional layer 1514. The three stages can include a convolution stage 1516, a detector stage 1518, and a pooling stage 1520. The convolutional layer 1514 can then output data to a successive convolutional layer. The final convolutional layer of the network can generate output feature map data or provide an input to a fully connected layer to generate, for example, a classification value for the input to the CNN.
[0201] The convolution stage 1516 performs several convolutions in parallel to generate a set of linear activations. The convolution stage 1516 can include an affine transformation, including any transformation that can be specified as a linear transformation plus a translation. Affine transformations include rotation, translation, scaling, and combinations of these transformations. The convolution stage calculates the output of a function (e.g., a neuron) that is connected to a unique region in the input. Such a unique region can be determined as a local region associated with the neuron. The neuron calculates a dot product between the neuron's weight and the region in the local input to which the neuron is connected. The output from the convolution stage 1516 defines a set of linear activations that are processed by successive stages of the convolution layer 1514.
[0202] The linear activations may be processed by a detector stage 1518. In the detector stage 1518, each linear activation is processed by a nonlinear activation function. The nonlinear activation function increases the nonlinear characteristics of the entire network without affecting the receptive fields of the convolutional layers. Several types of nonlinear activation functions may be used. One particular type is the rectified linear unit (ReLU). ReLU uses an activation function defined as f(x)=max(0,x) such that the activations are thresholded at zero.
[0203] The pooling stage 1520 uses a pooling function that replaces the output of the second convolutional layer 1506 with a summary statistic of nearby outputs. The pooling function can be used to introduce translation invariance into the neural network so that small translations to the input do not change the pooled output. Invariance to local translations can be beneficial 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 1520, including max pooling, average pooling, and 12-norm pooling. In addition, some CNN implementations do not include a pooling stage. Instead, such implementations use an additional convolution stage with an increased stride relative to the previous convolution.
[0204] The output from the convolutional layer 1514 may then be processed by a next layer 1522, which may be an additional convolutional layer or one of the fully connected layers 1508. For example, the first convolutional layer 1504 in FIG. 15A may output to a second convolutional layer 1506, which in turn may output to the first layer of the fully connected layers 1508.
[0205] FIG. 16 illustrates an example recurrent neural network. In a recurrent neural network (RNN), the previous state of the network influences the output of the current state of the network. RNNs can be constructed in a variety of ways using a variety of functions. The use of RNNs generally revolves around using mathematical models to predict the future based on previous sequences of inputs. For example, RNNs may be used to perform statistical language modeling to predict the next word given a previous sequence of words. The illustrated RNN 1600 may be described as having an input layer 1602 that receives input vectors, a hidden layer that implements a recurrent function, a feedback mechanism 1605 that allows a "memory" of previous states, and an output layer 1606 that outputs the results. The RNN 1600 operates based on time steps. The state of the RNN at a given time step is influenced based on previous time steps via the feedback mechanism 1605. For a given time step, the state of the hidden layer 1604 is defined based on the previous state and the input at the current time step. An initial input (x1) at the first time step may be processed by the hidden layer 1604. The second input (x2) can be processed by the hidden layer 1604 using state information determined during processing of the initial input (x1). A given state can be denoted as s t =f(Ux t +Ws t-1 ), where U and W are parametric metrics. The function f is typically nonlinear, such as a variant of the hyperbolic tangent function (Tanh) or the rectifier function f(x)=max(0,x). However, the particular mathematical function used in the hidden layer 1604 may vary depending on the particular implementation details of the RNN 1600.
[0206] In addition to the basic CNNs and RNNs described, variations on these networks may also be possible. One exemplary RNN variation is the long short-term memory (LSTM) RNN. LSTM RNNs can learn long-term dependencies that may be necessary to process longer language sequences. A variation on CNNs is the convolutional deep belief network, which has a similar structure to CNNs and is trained in a similar manner to deep belief networks. Deep belief networks (DBNs) are generative neural networks that consist of multiple layers of probabilistic (random) variables. DBNs can be trained layer-by-layer using greedy unsupervised learning. The learned weights of the DBNs can then be used to provide pre-train neural networks by determining an optimal initial set of weights for the neural network.
[0207] FIG. 17 illustrates the training and deployment of deep neural networks. Once a given network is structured for a task, the neural network is trained using a training dataset 1702. Various training frameworks have been developed to allow for hardware acceleration of the training process. For example, the machine learning framework 1404 of FIG. 14 may be configured as a training framework 1704. The training framework 1704 may hook into an untrained neural network 1706, allowing the untrained neural net to be trained using parallel processing resources as described herein to generate a trained neural network 1708. To begin the training process, initial weights may be selected randomly or by pre-training using a deep belief network. The training cycle is then performed in either a supervised or unsupervised manner.
[0208] Supervised learning is a learning method in which training is performed as a mediated operation, such as when the training data set 1702 includes inputs that are paired with desired outputs for the inputs, or when the training data set includes inputs with known outputs and the neural network's outputs are manually graded. The network processes the inputs and compares the resulting outputs to a set of expected or desired outputs. Errors are then propagated through the system. The training framework 1704 can adjust the weights that control the untrained neural network 1706. The training framework 1704 can provide tools to monitor how well the untrained neural network 1706 is converging toward a model suitable for generating the correct answer based on known input data. The training process occurs iteratively as the network weights are adjusted to refine the outputs generated by the neural network. The training process can continue until the neural network reaches a statistically desired accuracy associated with the trained neural network 1708. The trained neural network 1708 may then be deployed to implement any number of machine learning operations to generate inference results 1714 based on the input of new data 1712.
[0209] Unsupervised learning is a learning method in which a network attempts to train itself using unlabeled data. Thus, in unsupervised learning, the training dataset 1702 will include input data without any associated output data. The untrained neural network 1706 can learn groupings within the unlabeled inputs and determine how individual inputs relate to the entire dataset. Unsupervised training can be used to generate self-organizing maps, which are a type of trained neural network 1708 that can perform operations that are useful in reducing the dimensionality of the data. Unsupervised training can also be used to perform anomaly detection. Anomaly detection allows for the identification of data points within an input dataset that deviate from normal patterns of the data.
[0210] Variations on supervised and unsupervised training may also be employed. Semi-supervised learning is a technique in which the training data set 1702 contains a mixture of labeled and unlabeled data of the same distribution. Incremental learning is a variation of supervised learning in which input data is successively used to further train the model. Incremental learning allows the trained neural network 1708 to adapt to new data 1712 without forgetting the knowledge injected into the network during initial training.
[0211] The training process, especially for deep neural networks, whether supervised or unsupervised, can be too computationally intensive for a single computation node. Instead of using a single computation node, a distributed network of computation nodes can be used to accelerate the training process.
[0212] 18 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 neural networks. The distributed computing nodes can each include one or more host processors and one or more general-purpose processing nodes. As shown, distributed learning can implement model parallelism 1802, data parallelism 1804, or a combination of model and data parallelism 1804.
[0213] In model parallelism 1802, different computational nodes in a distributed system can perform training computations on 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. Advantages of model parallelism include the ability to scale to particularly large models. Splitting up the computations associated with different layers of a neural network enables the training of very large neural networks where the weights of all layers do not fit into the memory of a single computational node. In some examples, model parallelism can be particularly beneficial in performing unsupervised training of large neural networks.
[0214] In data parallelism 1804, different nodes of the distributed network have a complete instance of the model, with each node receiving a different portion of the data. The results from the different nodes are then combined. Different approaches to data parallelism are possible, but all data parallel training approaches require techniques to combine the results and synchronize the model parameters between each node. Exemplary approaches to combining data include parameter averaging and update-based data parallelism. Parameter averaging trains each node on a subset of the training data and sets the global parameters (e.g., weights, biases) to the average of the parameters from each node. Parameter averaging uses a central parameter server that maintains the parameter data. Update-based data parallelism is similar to parameter averaging, except that instead of transferring parameters from the nodes to the parameter server, updates to the model are transferred. In addition, update-based data parallelism can also be performed in a distributed manner, where updates are compressed and transferred between nodes.
[0215] The combined model and data parallelism 1806 may be implemented, for example, in a distributed system where each compute node contains multiple GPUs. Each node may have a complete instance of the model, where separate GPUs in each node are used to train different parts of the model.
[0216] Distributed training incurs increased overhead compared to training on a single machine, however, the parallel processors and GPGPUs described herein can each implement various techniques to reduce the overhead of distributed training, including techniques that enable high-bandwidth inter-GPU data transfers and accelerated remote data synchronization.
[0217] Example Machine Learning Applications 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. Applications of computer vision range from replicating human visual capabilities, such as recognizing faces, to creating new categories of visual capabilities. For example, a computer vision application may be configured to recognize sound waves from vibrations caused by visible objects in a video. Parallel processor-accelerated machine learning allows computer vision applications to be trained using significantly larger training datasets than previously possible, and allows inference systems to be deployed using low-power parallel processors.
[0218] Machine learning accelerated with parallel processors has autonomous driving applications including lane and road sign recognition, collision avoidance, navigation and driving control. Accelerated machine learning techniques can be used to train driving models based on data sets that define appropriate responses to specific training inputs. The parallel processors described herein can enable rapid training of increasingly complex neural networks used in autonomous driving solutions, enabling the deployment of low-power inference processors on mobile platforms suitable for integration into autonomous vehicles.
[0219] Deep neural networks accelerated on parallel processors are enabling a machine learning approach to automatic speech recognition (ASR). ASR involves creating a function that computes the most likely language sequence given an input acoustic sequence. Accelerated machine learning using deep neural networks allows for the replacement of hidden Markov models (HMMs) and Gaussian mixture models (GMMs), previously used for ASR.
[0220] Machine learning accelerated by parallel processors can also be used to accelerate natural language processing. Automated learning procedures can use statistical inference algorithms to generate models that are robust to erroneous or unfamiliar input. Exemplary natural language processor applications include automatic machine translation between human languages.
[0221] Parallel processing platforms used for machine learning can be divided into training platforms and deployment platforms: training platforms are generally highly parallel and include optimizations to accelerate multi-GPU single-node training and multi-node, multi-GPU training, while deployment machine learning (e.g., inference) platforms generally include low-power parallel processors suitable for use in products such as cameras and autonomous robots and vehicles.
[0222] GPGPU with matrix acceleration logic 19 is a block diagram of a data processing system 1900, according to one embodiment. The data processing system 1900 is a heterogeneous processing system having a processor 1901, a unified memory 1910, and a GPGPU 1920 that includes machine learning acceleration logic. The processor 1902 and the GPGPU 1920 can be any of the processors and GPGPUs / parallel processors described herein. The processor 1902 can execute instructions of a compiler 1915 stored in a system memory 1912. The compiler 1915 runs on the processor 1902 to compile source code 1914A into compiled code 1914B. The compiled code 1914B can include instructions that can be executed by the processor 1902 and / or instructions that can be executed by the GPGPU 1920. During compilation, compiler 1915 may perform operations to insert metadata, including hints regarding the level of data parallelism present in compiled code 1914B and / or hints regarding data locality associated with threads dispatched based on compiled code 1914B. Compiler 1915 may include information necessary to perform such operations, or may perform such operations with the aid of runtime library 1916. Runtime library 1916 may also assist compiler 1915 in compiling source code 1914, and may also include instructions that are linked with compiled code 1914B at runtime to facilitate execution of the compiled instructions on GPGPU 1920.
[0223] Unified memory 1910 represents a unified address space that may be accessed by processor 1902 and GPGPU 1920. The unified memory may include system memory 1912 as well as GPGPU memory 1918. GPGPU memory 1918 is memory within the address space of GPGPU 1920 and may include some or all of system memory 1912. In one embodiment, GPGPU memory 1918 may also include at least a portion of any memory dedicated for exclusive use by GPGPU 1920. In one embodiment, compiled code 1914B stored in system memory 1912 may be mapped into GPGPU memory 1918 for access by GPGPU 1920.
[0224] The GPGPU 1920 includes a number of computation blocks 1924-1924N. The number of computation blocks 1924-1924N may include one or more of the various computation units or execution elements described herein. In one embodiment, the GPGPU 1920 further includes a matrix accelerator 1923. The matrix accelerator 1923 may include one or more specialized function compute units designed to accelerate a subset of matrix operations (e.g., dot products, etc.). The GPGPU 1920 may also include a set of resources that may be shared by the computation blocks 1924A-1924N and the matrix accelerator 1923, including, but not limited to, a set of registers 1925, a power and performance module 1926, and a cache 1927. In one embodiment, the registers 1925 include directly or indirectly accessible registers, where the indirectly accessible registers are optimized for use by the matrix accelerator 1923. Power and performance module 1926 may be configured to adjust power supplies and clock frequencies for the computation blocks 1924A-1924N and to power gated idle components within the computation blocks 1924A-1924N. In various embodiments, cache 1927 may include an instruction cache and / or a lower level data cache.
[0225] The GPGPU 1920 may further include an L3 data cache 1930 that may be used to cache data accessed from the unified memory 1910 by the matrix accelerator 1923 and / or the computational elements in the computation blocks 1924A-1924N. In one embodiment, the L3 data cache 1930 includes a shared local memory 1932 that may be shared by the computational elements or matrix accelerator 1923 in the computation blocks 1924A-1924N.
[0226] In one embodiment, the GPGPU 1920 includes instruction handling logic such as a fetch and decode unit 1921 and a scheduler controller 1922. The fetch and decode unit 1921 includes a fetch unit and a decode unit that fetch and decode instructions for execution by one or more of the computation blocks 1924A-1924N or the matrix accelerator 1923. Through the scheduler controller 1922, instructions can be scheduled to appropriate functional units within the computation blocks 1924A-1924N or the matrix accelerator. In one embodiment, the scheduler controller 1922 is an ASIC that can be configured to perform advanced scheduling operations. In one embodiment, the scheduler controller 1922 is a microcontroller or a low energy-per-instruction processing core that can execute scheduler instructions loaded from a firmware module.
[0227] In one embodiment, some functions performed by the computation blocks 1924A-1924N can be directly scheduled or offloaded to the matrix accelerator 1923. In various embodiments, the matrix accelerator 1923 includes processing element logic configured to efficiently perform matrix computation operations, such as multiplication and addition operations and dot product operations used by 3D graphics or computation shader programs. In one embodiment, the matrix accelerator 1923 can be configured to accelerate operations used by machine learning frameworks. In one embodiment, the matrix accelerator 1923 is an application specific integrated circuit explicitly configured to perform a specific set of parallel matrix multiplication and / or addition operations. In one embodiment, the matrix accelerator 1923 is a field programmable gate array (FPGA) that provides fixed function logic that can be updated between workloads. The set of matrix operations that can be performed by the matrix accelerator 1923 can be limited compared to the operations that can be performed by the computation blocks 1924A-1924N. However, the matrix accelerator 1923 can execute these calculations with a much higher throughput than the calculation blocks 1924A to 1924N.
[0228] 20 illustrates one embodiment of a matrix operation 2005 performed by an instruction pipeline 2000, according to one embodiment. The instruction pipeline 2000 may be configured to perform the matrix operation 2005, such as, but not limited to, a dot product operation. The dot product of two vectors is a scalar value equal to the sum of the products of corresponding components of the vectors. The dot product may be calculated as shown in equation (1) below:
number
[0229] The dot product can be used in the convolution operation of a convolutional neural network (CNN). FIG. 19 illustrates a two-dimensional (2D) convolution using a matrix operation 2005 that includes a dot product. Although a 2D convolution is illustrated, an N-dimensional convolution can be performed on an N-dimensional volume using an N-dimensional filter. The receptive field tile 2002 highlights a portion of an input volume in an input volume buffer 2004. The input volume buffer can be stored in a memory 2030. A dot matrix operation 2005 can be performed between the data in the receptive field tile 2002 and a convolution filter to generate data points in an output buffer 2006. The output buffer 2006 can also be stored in a memory 2030. The memory 2030 can be any of the memories described herein, including the system memory 1912, the GPGPU memory 1918, or one or more cache memories 1927, 1930 of FIG. 19.
[0230] The combination of data points in the output buffer 2006 represents an activation map that is generated by the convolution operation. Each point in the activation map is generated by sliding a respective field tile across the input volume buffer 2004. The activation map data can be input to an activation function, and an output activation value can be determined. In one embodiment, the convolution of the input volume buffer 2004 can be determined within the framework as a high-level matrix operation 1705. The high-level matrix operation can be performed via primitive operations such as Basic Linear Algebraic Subprogram (BLAS) operations. The primitive operations can be accelerated via hardware instructions executed by the instruction pipeline 2000.
[0231] The instruction pipeline 2000 used to accelerate hardware instructions may include an instruction fetch and decode unit 1921 that may fetch and decode hardware instructions, and a scheduler controller 1922 that may schedule the decoded instructions to one or more execution units in the computation blocks 1924A-1924B and / or the matrix accelerator 1923. In one embodiment, the hardware instructions may be scheduled to the computation blocks 1924A-1924N for offloading to the matrix accelerator 1923. One or more hardware instructions and associated data for performing the matrix operation 2005 may be stored in the memory 2030. The output of the hardware instructions may also be stored in the memory 2030.
[0232] In one embodiment, the matrix accelerator 1923 can execute one or more hardware instructions to perform the matrix operations 2005 using a unified dot product logic 2008 (DP logic). The dot product logic 2008 can include a combination of programmable and fixed function hardware that can be configured to perform dot product operations. Although the functional units in the computation blocks 1924A-1924N can also be configured to perform dot product operations, the dot product logic 2008 can be configured to perform a limited subset of dot product operations at a much higher throughput than the computation blocks 1924A-1924N.
[0233] During the processing of matrix multiplication operations in CNNs, such as Residual Neural Networks (ResNet)-50, there exists a significant percentage of sparseness (e.g., zero values) in the activation metrics across multiple layers. In fact, the sparsity can reach 99.9% in some instances. Such a high percentage of sparse matrices provides an opportunity for processing optimizations, including bypassing redundant memory accesses and computations. Thus, energy consumption can be reduced by saving unnecessary processing.
[0234] According to one embodiment, the matrix accelerator 1923 provides a tiling optimization that provides the ability to skip (or bypass) multiple tile operations of sparse matrices. In such an embodiment, the matrix data may be processed as tiles having a size selected to maximize utilization of sparseness by including a maximum number of tiles that are all "0". Thus, a larger number of all-zero tiles (e.g., zero tile count) allows a larger number of convolution matrix operations to be bypassed, leading to enhanced performance.
[0235] In one embodiment, the matrix accelerator 1923 receives input matrix data and examines the data to determine sparsity. In such an embodiment, the matrix accelerator 1923 selects a tile size (e.g., 4×4 or 8×8) based on the determined sparsity to maximize sparseness utilization. FIG. 21 illustrates one embodiment of input matrix data 2100 having various tile configurations. As illustrated in FIG. 21, the matrix data 2100 may include 8×8 tiles 2110 (e.g., 2110a and 2110b) and 4×4 tiles 2120 (e.g., 2120a and 2120b). Although illustrated as 4×4 and 8×8 implementations, other embodiments may implement different tile sizes.
[0236] In one embodiment, the matrix accelerator 1923 converts the received matrix data into sub-blocks (e.g., 4x4 size) and determines the sparsity of the data by examining consecutive sub-blocks (e.g., 4) to select a tile size (e.g., 4x4 or 8x8) to process. In such an embodiment, bitmap data is received along with the matrix data and stored in memory for writing output matrices across convolutional layers. Figure 22A illustrates one embodiment of a bitmap corresponding to a sub-block of matrix data.
[0237] In one embodiment, each bit value (or subblock bit) in the bitmap is associated with a subblock of matrix data. In a further embodiment, the matrix accelerator 1923 examines each subblock bit to determine whether the subblock contains sparse data (e.g., all zeros). In such an embodiment, a bit is set high (e.g., a logical 1) whenever the associated subblock contains all zero values, and is set low (e.g., a logical 0) whenever the subblock contains at least one nonzero value.
[0238] In a further embodiment, the matrix accelerator 1923 examines the subblock bits associated with four consecutive (or adjacent) blocks of subblocks to determine the tile size to be processed. In this embodiment, the matrix accelerator 1923 selects an 8×8 tile size for a block of subblocks when it determines that each of the associated subblock bits is set high (e.g., Bit0-Bit3=1111). Thus, the 8×8 tile size is selected when it determines that all four blocks have all-zero data. As a result of the selection of the 8×8 tile size, the output matrix data can be generated by skipping operations since the tile contains all sparse data. FIG. 22B illustrates one embodiment of subblock data to be processed as an 8×8 tile size.
[0239] In a further embodiment, the matrix accelerator 1923 selects a 4×4 tile size for processing when it determines that at least one of the subblock bits is not set high (e.g., Bit0-Bit3=0111, 1011, 0001, etc.). Thus, a 4×4 tile size is selected for processing a block to generate output data when it determines that at least one of the subblocks has non-zero data. FIG. 22C illustrates one embodiment of subblock data to be processed as a 4×4 tile size. According to one embodiment, the bit pattern check described above is performed during writing to memory and therefore does not involve reading and writing data / matrices to and from memory.
[0240] Figures 23A and 23B illustrate an embodiment of a systolic pipeline implemented to process block matrix data. Figure 23A illustrates an embodiment of a systolic pipeline 2300 implemented in the matrix accelerator 192. As shown in Figure 23A, the systolic pipeline 2300 includes eight stages that process an 8x8 systolic array of matrix data. Each stage operates on input matrix data loaded into a register file register, resulting in output data stored in another register (e.g., r24[0_7]-r31[0_7]).
[0241] According to one embodiment, the systolic pipeline 2300 may be configured to process 4x4 tiles. In such an embodiment, the 8-stage pipeline 2300 is implemented as a 4+4 configuration to process the 4x4 tile size. FIG. 23B illustrates an embodiment of the 4+4 configuration. As shown in FIG. 23B, the pipeline 2300 is converted into two systolic pipelines, each with "4" stages. In one embodiment, an additional "extra" operation is implemented to generate the equivalent of two "8x4" pipeline outputs. In this embodiment, the pipeline variant implements up to six read (or "RD") ports and up to two write (or "WR") ports per cycle. More than four "RD" ports and two "WR" ports are required only if only diagonal non-zero sub-blocks or a single non-sparse block occur.
[0242] 24 is a flow diagram illustrating one embodiment of a process for processing tiling optimization. At processing block 2410, input matrix data is received. At processing block 2420, the matrix data is converted into sub-blocks (e.g., 4×4). At processing block 2430, bitmap data associated with the matrix data is retrieved. At processing block 2440, sub-block bits in the bitmap for blocks of adjacent sub-blocks are examined.
[0243] At decision block 2450, a determination is made as to whether all of the subblock bits are set high (e.g., Bit0-Bit4=1111). If so, then at processing block 2460, a first tile size of matrix data representing adjacent subblocks is selected (e.g., 8×8). At processing block 2470, output matrix data is generated using the 8×8 tiles of sparse data. As a result, the matrix operations implemented to generate the output matrix data may be bypassed. At decision block 2450, a determination is made that one or more of the tile bits are not set high, and at processing block 2480, a second tile size (e.g., 4×4) representing the size of each block is selected. At processing block 2470, matrix operations are performed on the 4×4 tiles to generate the output matrix data.
[0244] The embodiments may be implemented as any or a combination of one or more microchips or integrated circuits interconnected using a parent board, hardwired logic, software stored by a memory device and executed by a microprocessor, firmware, application specific integrated circuits (ASICs) and / or field programmable gate arrays (FPGAs). The term "logic" may include, by way of example, software or hardware and / or a combination of software and hardware.
[0245] The embodiments may be provided, for example, as a computer program product, which may include one or more machine-readable media having machine-executable instructions 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 according to the embodiments described herein. Machine-readable media may include, but are not limited to, floppy diskettes, optical disks, Compact Disc-Read Only Memories (CD-ROMs) and magneto-optical disks, ROMs, RAMs, Erasable Programmable Read Only Memories (EPROMs), Electrically Erasable Programmable Read Only Memories (EEPROMs), magnetic or optical cards, flash memories, or other types of media / machine-readable media suitable for storing machine-executable instructions.
[0246] Additionally, embodiments may be downloaded as a computer program product, and the program may be transferred from a remote computer (e.g., a server) to a requesting computer (e.g., a client) via a communications link (e.g., modern and / or network connection) by one or more data signals embodied in and / or modulated by a carrier wave or other propagation medium.
[0247] The following sections and / or examples relate to further embodiments or examples. Details in these examples may be used anywhere in one or more of the embodiments. Various features of different embodiments or examples may be combined in various ways with some features included and other features excluded to suit a variety of different applications. Examples may include subject matter such as a method for facilitating hybrid communication according to the embodiments and examples described herein, a means for performing operations of the method, at least one machine-readable instruction including instructions that, when executed by a machine, cause the machine to perform the operations of the method or the apparatus or system.
[0248] Some embodiments relate to Example 1, which includes an apparatus for facilitating matrix processing, the apparatus comprising a matrix accelerator that receives input matrix data, converts the input matrix data to a plurality of sub-blocks, examines a first one of the sub-blocks to determine whether the first block includes sparse data, selects a first tile size if the first block includes sparse data, and generates output matrix data based on the first tile size.
[0249] Example 2 includes the subject matter of example 1, wherein the first tile size comprises a size of the first block.
[0250] Example 3 includes the subject matter of Examples 1 and 2, where the matrix accelerator selects a second tile size if it determines that the first block does not contain sparse data.
[0251] Example 4 includes the subject matter of examples 1 to 3, wherein the second tile size comprises a size of a sub-block.
[0252] Example 5 includes the subject matter of examples 1-4, where the matrix accelerator retrieves the bitmap data having a plurality of sub-block bits, each associated with one of the plurality of sub-blocks.
[0253] Example 6 includes the subject matter of Examples 1 to 5, wherein examining the first block includes examining subblock bits associated with each subblock in the first block to determine whether each subblock includes sparse data.
[0254] Example 7 includes the subject matter of Examples 1 through 6, where the matrix accelerator selects the first tile size upon determining that each sub-block in the first block contains sparse data.
[0255] Example 8 includes the subject matter of examples 1-7, wherein the matrix accelerator selects the second tile size if the matrix accelerator determines that at least one sub-block in the first block does not include sparse data.
[0256] Some embodiments relate to Example 9, which includes a method for facilitating matrix processing, the method including receiving input matrix data, converting the input matrix data into a plurality of sub-blocks, inspecting a first block of the sub-blocks to determine whether the first block includes sparse data, selecting a first tile size upon determining that the first block includes sparse data, and generating output matrix data based on the first tile size.
[0257] Example 10 includes the subject matter of example 9, wherein the first tile size comprises a size of the first block.
[0258] Example 11 includes the subject matter of examples 9 and 10, and further includes selecting a second tile size upon determining that the first block does not include sparse data.
[0259] Example 12 includes the subject matter of Examples 9-11, further including retrieving bitmap data having a plurality of sub-block bits, each associated with one of the plurality of sub-blocks.
[0260] Example 13 includes the subject matter of Examples 9 to 12, wherein examining the first block includes examining subblock bits associated with each subblock in the first block to determine whether each subblock includes sparse data.
[0261] Example 14 includes the subject matter of Examples 9-13, and further includes selecting a first tile size when determining that each sub-block in the first block includes sparse data, and selecting a second tile size when determining that at least one sub-block in the first block does not include sparse data.
[0262] Some embodiments relate to Example 15, including a graphics processor comprising: a matrix accelerator that receives input matrix data, converts the input matrix data into a plurality of sub-blocks, examines a first one of the sub-blocks to determine whether the first block includes sparse data, and selects a first tile size if the first block determines that the first block includes sparse data; and a systolic pipeline that generates output matrix data based on the first tile size.
[0263] Example 16 includes the subject matter of example 15, wherein the first tile size comprises a size of the first block.
[0264] Example 17 includes the subject matter of examples 15 and 16, wherein the matrix accelerator selects a second tile size if it determines that the first block does not include sparse data, the second tile size comprising a size of the sub-block.
[0265] Example 18 includes the subject matter of Examples 15-17, wherein the matrix accelerator retrieves bitmap data having a plurality of sub-block bits, each associated with one of a plurality of sub-blocks.
[0266] Example 19 includes the subject matter of Examples 15 to 18, and wherein examining the first block includes examining subblock bits associated with each subblock in the first block to determine whether each subblock includes sparse data.
[0267] Example 20 includes the subject matter of Examples 15-19, wherein the matrix accelerator selects the first tile size when it determines that each sub-block in the first block includes sparse data, and selects the second tile size when it determines that at least one sub-block in the first block does not include sparse data.
[0268] The foregoing description and drawings should be interpreted in an illustrative and not a restrictive sense. It will be understood by those skilled in the art that various modifications and changes may be made to the embodiments described herein without departing from the broad spirit and scope of the present invention as set forth in the appended claims.
Claims
1. 1. An apparatus for facilitating matrix processing, comprising: a matrix accelerator that receives input matrix data, converts the input matrix data into a plurality of sub-blocks, extracts bitmap data having a plurality of sub-block bits, each associated with one of the plurality of sub-blocks, determines a tile size to be processed by examining sub-block bits associated with adjacent sub-blocks in a first block of the plurality of sub-blocks, selects a first tile size upon determining that the sub-block bits indicate that each sub-block in the first block contains sparse data that is all zero, and generates output matrix data based on the first tile size. Device.
2. the first tile size comprises a size of the first block; 2. The apparatus of claim 1.
3. and selecting a second tile size when the matrix accelerator determines that at least one sub-block in the first block does not include sparse data.
2. The apparatus of claim 1.
4. the second tile size comprises a size of a sub-block.
4. The apparatus of claim 3.
5. 1. A method performed by a graphics processor to facilitate matrix processing, comprising: receiving input matrix data; converting the input matrix data into a number of sub-blocks; retrieving bitmap data having a plurality of sub-block bits, each sub-block bit associated with one of the plurality of sub-blocks; examining subblock bits associated with adjacent subblocks in a first block of the plurality of subblocks to determine a tile size to be processed; selecting a first tile size upon determining that the sub-block bits indicate that each sub-block in the first block includes sparse data that is all zero; generating output matrix data based on the first tile size; A method comprising:
6. the first tile size comprises a size of the first block; The method according to claim 5. selecting a second tile size upon determining that at least one subblock in the first block does not contain sparse data; The method of claim 5 further comprising:
8. The method of claim 7, wherein the second tile size comprises a size of a subblock. The method according to claim 7.
9. A graphics processor comprising: a matrix accelerator that receives input matrix data, converts the input matrix data into a plurality of sub-blocks, extracts bitmap data having a plurality of sub-block bits, each associated with one of the plurality of sub-blocks, determines a tile size to be processed by examining sub-block bits associated with adjacent sub-blocks in a first block of the plurality of sub-blocks, and selects the first tile size when the sub-block bits indicate that each sub-block in the first block contains sparse data that is all zero; a systolic pipeline for generating output matrix data based on the first tile size; A graphics processor comprising:
10. the first tile size comprises a size of the first block; 10. A graphics processor according to claim 9.
11. and selecting a second tile size when the matrix accelerator determines that at least one sub-block in the first block does not include sparse data.
10. A graphics processor according to claim 9.
12. The method of claim 11, wherein the second tile size comprises a size of a subblock.
12. A graphics processor according to claim 11.
13. the matrix accelerator examines a second block of the plurality of sub-blocks to determine whether the second block includes sparse data, and if the matrix accelerator determines that the second block does not include sparse data, selects a second tile size and generates output matrix data based on the second tile size.
10. A graphics processor according to claim 9.
Citation Information
Patent Citations
Adaptive tile matrix representation and multiplication
US20170168990A1
Instruction and logic for systolic dot product with accumulate
US20190324746A1