Computing cluster preemption within generic graphics processing unit

By employing programmable compute units and advanced scheduling with fine-grained thread preemption, GPUs address inefficiencies in data processing, achieving enhanced performance and resource utilization in graphics and general-purpose operations.

CN119088747APending Publication Date: 2024-12-06INTEL CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411136602.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2017-04-09
Filing Date
2018-04-08
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

Current graphics processing units (GPUs) face limitations in efficiently handling a wide range of data processing operations due to their reliance on fixed-function compute units and suboptimal parallel processing techniques, particularly in SIMT architectures, which can lead to inefficiencies in thread execution and resource utilization.

Method used

Implementing a graphics processing unit (GPU) with programmable compute units and advanced scheduling algorithms to manage thread execution and resource allocation, enabling fine-grained thread preemption and migration, and utilizing low-latency preemption systems to enhance parallel processing efficiency.

Benefits of technology

Enhances the GPU's ability to perform diverse data processing tasks with improved efficiency and reduced latency, allowing for more effective utilization of resources and better handling of varying workloads.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088747A_ABST
    Figure CN119088747A_ABST
Patent Text Reader

Abstract

The invention discloses computing cluster preemption within a generic graphics processing unit. One embodiment provides a generic graphics processing unit, the generic graphics processing unit comprising: a computing cluster comprising a plurality of computing units; the stop notification module is used for detecting that one or more computing units in the computing cluster stop and sending a stop notification; and a rebalancing module to receive the stop notification, the rebalancing module to migrate the first workload from the one or more stopped computing units in response to the stop notification.
Need to check novelty before this filing date? Find Prior Art

Description

This application is a divisional application of application number 201810306575.4, application date April 8, 2018, and entitled “Computing Cluster Preemption in a General-Purpose Graphics Processing Unit”. Technical Field

[0001] Embodiments relate generally to data processing, and more particularly to data processing via a general purpose graphics processing unit. Background Art

[0002] Current parallel graphics data processing includes the development of systems and methods for performing specific operations on graphics data, such as linear interpolation, tessellation, rasterization, texture mapping, depth testing, etc. Traditionally, graphics processors have used fixed-function compute units to process graphics data. However, recently, portions of graphics processors have been made programmable, enabling these processors to support a wider range of operations to process vertex and fragment data.

[0003] To further improve performance, graphics processors typically implement processing techniques such as pipelining, which attempt to process as much graphics data as possible in parallel throughout different parts of the graphics pipeline. Parallel graphics processors with a single instruction multiple thread (SIMT) architecture are designed to maximize the amount of parallel processing in the graphics pipeline. In a SIMT architecture, groups of parallel threads attempt to execute program instructions synchronously as often as possible to improve processing efficiency. A general overview of software and hardware for the SIMT architecture can be found in Shane Cook, CUDA Programming, Chapter 3, pages 37-51 (2013) and / or Nicholas Wilt, CUDA Handbook, A Comprehensive Guide to GPU Programming, Sections 2.6.2 to 3.1.2 (June 2013). BRIEF DESCRIPTION OF THE DRAWINGS

[0004] In order to understand the above-described features of the present embodiment in detail, the above briefly summarized embodiments may be described in more detail by reference to the embodiments, some of which are shown in the attached drawings. However, it should be noted that the attached drawings only show typical embodiments and therefore should not be considered as limiting the scope thereof.

[0005] Figure 1is a block diagram illustrating a computer system configured to implement one or more aspects of the embodiments described herein;

[0006] FIG. 2A to FIG. 2D shows a parallel processor component according to an embodiment;

[0007] FIG. 3A to FIG. 3B is a block diagram of a graphics multiprocessor according to an embodiment;

[0008] 4A to 4F An exemplary architecture is shown in which multiple GPUs are communicatively coupled to multiple multi-core processors;

[0009] Figure 5 is a conceptual diagram of a graphics processing pipeline according to an embodiment;

[0010] Figure 6 A preemptable GPGPU computing system according to an embodiment is shown;

[0011] Figures 7A-7C is a flow chart of operations for preempting a computing cluster according to an embodiment;

[0012] Figure 8 illustrates task migration for a stopped computing cluster according to an embodiment;

[0013] Fig. 9 A computing unit configured to suspend an active thread to a thread scratch space according to an embodiment is shown;

[0014] Fig.10 Operations for enabling fine-grained thread preservation and switching according to an embodiment are shown;

[0015] Fig.11 A low latency preemption system according to an embodiment is shown;

[0016] Fig.12 is a flow chart of low latency preemption logic according to an embodiment;

[0017] Fig.13 is a block diagram of a processing system configurable for fine-grained reset according to an embodiment;

[0018] Fig.14 is a flow chart of fine-grained reset logic according to an embodiment;

[0019] Fig.15 A data processing system according to an embodiment is shown;

[0020] Fig.16 is a block diagram of a processing system according to an embodiment;

[0021] Fig.17 is a block diagram of a processor according to an embodiment;

[0022] Fig.18 is a block diagram of a graphics processor according to an embodiment;

[0023] Fig.19 is a block diagram of a graphics processing engine of a graphics processor according to some embodiments;

[0024] Fig. 20 is a block diagram of a graphics processor provided by an additional embodiment;

[0025] Fig.21 shows thread execution logic including an array of processing elements employed in some embodiments;

[0026] Fig. 22 is a block diagram illustrating a graphics processor instruction format according to some embodiments;

[0027] Fig.23 is a block diagram of a graphics processor according to another embodiment;

[0028] FIG. 24A to FIG. 24B shows a graphics processor command format and command sequence according to some embodiments;

[0029] Fig.25 An exemplary graphical software architecture for a data processing system according to some embodiments is shown;

[0030] Fig.26 is a block diagram showing an IP core development system according to an embodiment;

[0031] Fig. 27 is a block diagram illustrating an exemplary system-on-chip integrated circuit according to an embodiment;

[0032] Fig.28 is a block diagram illustrating an additional graphics processor according to an embodiment; and

[0033] Fig.29 is a block diagram illustrating an additional exemplary graphics processor of a system on a chip integrated circuit according to an embodiment. DETAILED DESCRIPTION

[0034] In some embodiments, a graphics processing unit (GPU) is communicatively coupled to a host / processor core to accelerate graphics operations, machine learning operations, pattern analysis operations, and various general purpose GPU (GPGPU) functions. The GPU may be communicatively coupled to a host processor / core via a bus or another interconnect (e.g., a high-speed interconnect such as PCIe or NVLink). In other embodiments, the GPU may be integrated on the same package or chip as the core and communicatively coupled to the core via an internal processor bus / interconnect (i.e., inside the package or chip). Regardless of the manner in which the GPU is connected, the processor core may assign work to the GPU in the form of a sequence of commands / instructions contained in a work descriptor. The GPU then uses dedicated circuits / logic for efficiently processing these commands / instructions.

[0035] In the following description, many specific details are set forth to provide a more comprehensive understanding. However, it will be apparent to those skilled in the art that the embodiments described herein may be practiced without one or more of these specific details. In other instances, well-known features are not described to avoid obscuring the details of the present embodiment. System Overview

[0036] Figure 1 1 is a block diagram illustrating a computer system 100 configured to implement one or more aspects of the embodiments described herein. The computing system 100 includes a processing subsystem 101 having one or more processors 102 and a system memory 104, the one or more processors and the system memory communicating via an interconnect path, which may include a memory hub 105. The memory hub 105 may be a separate component within a chipset component or may be integrated within the one or more processors 102. The memory hub 105 is coupled to an I / O subsystem 111 via a communication link 106. The I / O subsystem 111 includes an I / O hub 107, which may enable the computing system 100 to receive input from one or more input devices 108. In addition, the I / O hub 107 may enable a display controller (which may be included in the one or more processors 102) to provide output to one or more display devices 110A. In one embodiment, the one or more display devices 110A coupled to the I / O hub 107 may include a local display device, an internal display device, or an embedded display device.

[0037] In one embodiment, the processing subsystem 101 includes one or more parallel processors 112, which are coupled to the memory hub 105 via a bus or other communication link 113. The communication link 113 can be one of any number of standard-based communication link technologies or protocols (such as but not limited to PCI Express), or it can be a vendor-specific communication interface or communication structure. In one embodiment, the one or more parallel processors 112 form a computing-centric parallel or vector processing system that includes a large number of processing cores and / or processing clusters such as integrated many-core (MIC) processors. In one embodiment, the one or more parallel processors 112 form a graphics processing subsystem that can output pixels to one of one or more display devices 110A coupled via the I / O hub 107. The one or more parallel processors 112 may also include a display controller and a display interface (not shown) to enable direct connection to one or more display devices 110B.

[0038] Within the I / O subsystem 111, a system storage unit 114 may be connected to the I / O hub 107 to provide a storage mechanism for the computing system 100. The I / O switch 116 may be used to provide an interface mechanism to enable connection between the I / O hub 107 and other components that may be integrated into the platform, such as a network adapter 118 and / or a wireless network adapter 119, as well as various other devices that may be added via one or more plug-in devices 120. The network adapter 118 may be an Ethernet adapter or another wired network adapter. The wireless network adapter 119 may include one or more of Wi-Fi, Bluetooth, near field communication (NFC), or other network devices including one or more radio devices.

[0039] Computing system 100 may include other components not explicitly shown, including USB or other port connections, optical storage drives, video capture devices, etc., which may also be connected to I / O hub 107. Figure 1 The communication paths interconnecting the various components may be implemented using any suitable protocol such as a PCI (Peripheral Component Interconnect) based protocol (e.g., PCI-Express), or any other bus or point-to-point communication interface(s) and / or protocol such as the NV-Link high-speed interconnect or an interconnect protocol known in the art.

[0040] In one embodiment, one or more parallel processors 112 incorporate circuits optimized for graphics and video processing, including, for example, video output circuits, and the circuits constitute a graphics processing unit (GPU). In another embodiment, one or more parallel processors 112 incorporate circuits optimized for general-purpose processing while retaining the basic computing architecture described in more detail herein. In yet another embodiment, the components of the computing system 100 can be integrated with one or more other system elements on a single integrated circuit. For example, one or more parallel processors 112, a memory hub 105, (multiple) processors 102, and an I / O hub 107 can be integrated into a system on a chip (SoC) integrated circuit. Alternatively, the components of the computing system 100 can be integrated into a single package to form a system in package (SIP) configuration. In other embodiments, at least a portion of the components of the computing system 100 can be integrated into a multi-chip module (MCM), which can be interconnected with other multi-chip modules to form a modular computing system.

[0041] It should be understood that the computing system 100 shown herein is illustrative and variations and modifications are possible. The connection topology, including the number and arrangement of bridges, the number of (multiple) processors 102, and the number of (multiple) parallel processors 112, can be modified as needed. For example, in some embodiments, the system memory 104 is directly connected to the (multiple) processors 102 rather than through a bridge, and other devices communicate with the system memory 104 via the memory hub 105 and the (multiple) processors 102. In other alternative topologies, the (multiple) parallel processors 112 are connected to the I / O hub 107 or directly to one of the one or more processors 102, rather than to the memory hub 105. In other embodiments, the I / O hub 107 and the memory hub 105 can be integrated into a single chip. Most embodiments may include two or more groups of (multiple) processors 102 attached via multiple sockets, which may be coupled to two or more instances of (multiple) parallel processors 112. Some specific components shown herein are optional and may not be included in all implementations of the computing system 100. For example, any number of add-in cards or peripheral devices may be supported, or some components may be omitted.

[0042] Figure 2A 200 according to an embodiment. The various components of the parallel processor 200 may be implemented using one or more integrated circuit devices such as a programmable processor, an application specific integrated circuit (ASIC), or a field programmable gate array (FPGA). According to an embodiment, the parallel processor 200 shown is Figure 1 A variation of one or more parallel processors 112 is shown.

[0043] In one embodiment, parallel processor 200 includes parallel processing unit 202. The parallel processing unit includes an I / O unit 204, which enables communication with other devices including other instances of parallel processing unit 202. I / O unit 204 can be directly connected to other devices. In one embodiment, I / O unit 204 is connected to other devices via the use of a hub or switch interface such as memory hub 105. The connection between memory hub 105 and I / O unit 204 forms communication link 113. Within parallel processing unit 202, I / O unit 204 is connected to host interface 206 and memory cross switch 216, wherein host interface 206 receives commands related to performing processing operations and memory cross switch 216 receives commands related to performing memory operations.

[0044] When host interface 206 receives command buffers via I / O unit 204, host interface 206 may direct work operations for executing the commands to front end 208. In one embodiment, front end 208 is coupled to scheduler 210, which is configured to dispatch commands or other work items to processing cluster array 212. In one embodiment, scheduler 210 ensures that processing cluster array 212 is properly configured and in a valid state before dispatching tasks to processing clusters of processing cluster array 212.

[0045] Processing cluster array 212 may include up to "N" processing clusters (eg, cluster 214A, cluster 214B through cluster 214N). Each cluster 214A through 214N in processing cluster array 212 is capable of executing a large number (eg, thousands) of concurrent threads, where each thread is an instance of a program.

[0046] In one embodiment, different clusters 214A to 214N may be assigned to process different types of programs or to perform different types of calculations. Scheduler 210 may use various scheduling and / or work distribution algorithms to assign work to clusters 214A to 214N in processor cluster array 212, which may vary depending on the workload that occurs for each type of program or calculation. Scheduling may be handled dynamically by scheduler 210, or may be assisted in part by compiler logic during compilation of program logic that is configured for execution by processing cluster array 212.

[0047] Processing cluster array 212 may be configured to perform various types of parallel processing operations. In one embodiment, processing cluster array 212 is configured to perform general-purpose parallel computing operations. For example, processing cluster array 212 may include logic for performing processing tasks including, but not limited to, linear and nonlinear data transformations, filtering of video and / or audio data, and / or modeling operations (e.g., applying laws of physics to determine the position, velocity, and other properties of an object).

[0048] In one embodiment, processing cluster array 212 is configured to perform parallel graphics processing operations. In embodiments where parallel processor 200 is configured to perform graphics processing operations, processing cluster array 212 may include additional logic for supporting the execution of such graphics processing operations, including but not limited to texture sampling logic for performing texture operations and tessellation logic and other vertex processing logic. In addition, processing cluster array 212 may be configured to execute shader programs associated with graphics processing, such as but not limited to vertex shaders, tessellation shaders, geometry shaders, and pixel shaders. Parallel processing unit 202 may transfer data from system memory via I / O unit 204 for processing. During processing, the transferred data may be stored in on-chip memory (e.g., parallel processor memory 222) during processing and then written back to system memory.

[0049] In one embodiment, when parallel processing unit 202 is used to perform graphics processing, scheduler 210 can be configured to divide the processing workload into tasks of approximately equal size to better enable the distribution of graphics processing operations to multiple clusters 214A to 214N of processing cluster array 212. In some embodiments, portions of processing cluster array 212 can be configured to perform different types of processing. For example, a first portion can be configured to perform vertex shading and topology generation, a second portion can be configured to perform tessellation and geometry shading, and a third portion can be configured to perform pixel shading or other screen space operations to generate a rendered image for display. Intermediate data generated by one or more of clusters 214A to 214N can be stored in a buffer to allow the intermediate data to be transferred between clusters 214A to 214N for further processing.

[0050] During operation, the processing cluster array 212 may receive processing tasks to be executed via the scheduler 210, which receives commands defining the processing tasks from the front end 208. For graphics processing operations, a processing task may include data to be processed, such as surface (patch) data, primitive data, vertex data, and / or pixel data, as well as state parameters and commands (e.g., which program to execute) that define how the data is to be processed. The scheduler 210 may be configured to obtain an index corresponding to a task or may receive an index from the front end 208. The front end 208 may be configured to ensure that the processing cluster array 212 is configured to a valid state before a workload specified by an incoming command buffer (e.g., a batch buffer, a push buffer, etc.) is initiated.

[0051] Each of the one or more instances of the parallel processing unit 202 may be coupled to a parallel processor memory 222. The parallel processor memory 222 may be accessed via a memory crossbar switch 216, which may receive memory requests from the processing cluster array 212 and the I / O unit 204. The memory crossbar switch 216 may access the parallel processor memory 222 via a memory interface 218. The memory interface 218 may include a plurality of partition units (e.g., partition unit 220A, partition unit 220B, up to partition unit 220N), each of which is directly coupled to a portion of the parallel processor memory 222 (e.g., a memory unit). The number of partition units 220A to 220N is generally equal to the number of memory units, such that a first partition unit 220A has a corresponding first memory unit 224A, a second partition unit 220B has a corresponding memory unit 224B, and an Nth partition unit 220N has a corresponding Nth memory unit 224N. In other embodiments, the number of partition units 220A to 220N may not be equal to the number of memory devices.

[0052] In various embodiments, the memory units 224A to 224N may include various types of memory devices, including dynamic random access memory (DRAM) or graphics random access memory, such as synchronous graphics random access memory (SGRAM), including graphics double data rate (GDDR) memory. In one embodiment, the memory units 224A to 224N may also include 3D stacked memory, including but not limited to high bandwidth memory (HBM). Those skilled in the art will appreciate that the specific implementation of the memory units 224A to 224N may vary and may be selected from one of a variety of conventional designs. Rendering targets such as frame buffers or texture maps may be stored on the memory units 224A to 224N, allowing the partition units 220A to 220N to write to portions of each rendering target in parallel to efficiently use the available bandwidth of the parallel processor memory 222. In some embodiments, in order to support a unified memory design that utilizes system memory together with local cache memory, the local instance of the parallel processor memory 222 may be excluded.

[0053] In one embodiment, any of the clusters 214A to 214N in the processing cluster array 212 can process data to be written to any of the memory units 224A to 224N within the parallel processor memory 222. The memory crossbar 216 can be configured to route the output of each cluster (214A to 214N) to the input of any partition unit (220A to 220N) or to another cluster (214A to 214N) for further processing. Each cluster 214A to 214N can communicate with the memory interface 218 through the memory crossbar 216 to read from or write to various external memory devices. In one embodiment, the memory crossbar 216 has a connection to the memory interface 218 to communicate with the I / O unit 204, and a connection to a local instance of the parallel processor memory 222, so that the processing units within different processing clusters 214A to 214N can communicate with the system memory or other memory that is not local to the parallel processing unit 202. In one embodiment, the memory crossbar switch 216 may use virtual channels to separate traffic streams between the clusters 214A to 214N and the partition units 220A to 220N.

[0054] Although a single instance of parallel processing unit 202 is shown as being within parallel processor 200, any number of instances of parallel processing unit 202 may also be included. For example, multiple instances of parallel processing unit 202 may be provided on a single plug-in card, or multiple plug-in cards may be interconnected. Even if different instances have different numbers of processing cores, different local parallel processor storage amounts, and / or other configuration differences, different instances of parallel processing unit 202 may also be configured to interoperate. For example, and in one embodiment, some instances of parallel processing unit 202 may include higher precision floating point units relative to other instances. Systems incorporating one or more instances of parallel processing unit 202 or parallel processor 200 may be implemented in various configurations and form factors, including but not limited to desktop computers, laptop computers or handheld personal computers, servers, workstations, game consoles, and / or embedded systems.

[0055] Figure 2B is a block diagram of a partition system 220 according to an embodiment. In one embodiment, the partition system 220 is Figure 2A 220N. As shown, partition unit 220 includes L2 cache 221, frame buffer interface 225 and ROP 226 (raster operation unit). L2 cache 221 is a read / write cache configured to perform load and store operations received from memory crossbar switch 216 and ROP 226. Read misses and urgent write-back requests are output by L2 cache 221 to frame buffer interface 225 for processing. Dirty updates can also be sent to the frame buffer via frame buffer interface 225 for opportunistic processing. In one embodiment, frame buffer interface 225 is connected to one of the memory units in the parallel processor memory, such as Figure 2A The memory units 224A to 224N (eg, within the parallel processor memory 222) interact.

[0056] In graphics applications, ROP 226 is a processing unit that performs raster operations (such as stencil, z-test, blending, etc.) and outputs pixel data as processed graphics data for storage in graphics memory. In some embodiments, ROP 226 may be configured to compress z or color data written to memory and decompress z or color data read from memory. In some embodiments, ROP 226 is included in each processing cluster (e.g., Figure 2A 214A to 214N) rather than being included in the partition unit 220. In such an embodiment, read and write requests for pixel data are transmitted through the memory crossbar 216 rather than pixel fragment data.

[0057] The processed graphic data can be displayed on a display device such as Figure 1 to one of the one or more display devices 110, routed by the processor(s) 102 for further processing, or by Figure 2A One of the processing entities within parallel processor 200 is routed for further processing.

[0058] Figure 2C is a block diagram of a processing cluster 214 within a parallel processing unit according to an embodiment. In one embodiment, a processing cluster is Figure 2A 214N。Processing cluster 214 can be configured to execute multiple threads in parallel, wherein the term "thread" refers to an instance of a specific program executed on a specific input data set. In some embodiments, a single instruction multiple data (SIMD) instruction issuance technology is used to support the parallel execution of a large number of threads without providing multiple independent instruction units. In other embodiments, a single instruction multiple thread (SIMT) technology is used to use a common instruction unit configured to issue instructions to a group of processing engines in each of the processing clusters to support the parallel execution of a large number of roughly synchronized threads. Unlike the SIMD execution mechanism in which all processing engines usually execute the same instruction, SIMT execution allows different threads to more easily follow the divergent execution path through a given thread program. It will be appreciated by those skilled in the art that the SIMD processing mechanism represents a functional subset of the SIMT processing mechanism.

[0059] The operation of the processing cluster 214 can be controlled via a pipeline manager 232 that distributes processing tasks to SIMT parallel processors. The pipeline manager 232 Figure 2A The scheduler 210 receives instructions and manages the execution of those instructions via the graphics multiprocessor 234 and / or the texture unit 236. The graphics multiprocessor 234 shown is an exemplary instance of a SIMT parallel processor. However, various types of SIMT parallel processors of different architectures can be included in the processing cluster 214. One or more instances of the graphics multiprocessor 234 can be included in the processing cluster 214. The graphics multiprocessor 234 can process data, and the data crossbar 240 can be used to distribute the processed data to one of multiple possible destinations including other shading units. The pipeline manager 232 can facilitate the distribution of processed data by specifying a destination for the data to be distributed via the data crossbar 240.

[0060] Each graphics multiprocessor 234 within a processing cluster 214 may include the same set of function execution logic (e.g., arithmetic logic units, load-store units, etc.), which may be pipelined to allow a new instruction to be issued before a previous instruction has completed. Any combination of function execution logic may be provided. In one embodiment, the function logic supports a variety of operations, including integer and floating point arithmetic (e.g., addition and multiplication), comparison operations, Boolean operations (AND, OR, XOR), bit-shifting, and calculation of various algebraic functions (e.g., planar interpolation functions, trigonometric functions, exponential functions, and logarithmic functions, etc.); and the same function unit hardware may be utilized to perform different operations.

[0061] A series of instructions transmitted to the processing cluster 214 constitutes a thread as previously defined herein, and a collection of a certain number of concurrently executing threads across parallel processing engines (not shown) within the graphics multiprocessor 234 is referred to herein as a thread group. As used herein, a thread group refers to a group of threads that concurrently execute the same program on different input data, wherein a thread in the group is assigned to a different processing engine within the graphics multiprocessor 234. A thread group may include fewer threads than the number of processing engines within the graphics multiprocessor 234, in which case some processing engines will be idle during the cycle when the thread group is being processed. A thread group may also include more threads than the number of processing engines within the graphics multiprocessor 234, in which case processing will occur on consecutive clock cycles. Each graphics multiprocessor 234 can support up to G thread groups concurrently. In addition, multiple related thread groups may be active at the same time (in different execution stages) within the graphics multiprocessor 234.

[0062] In one embodiment, the graphics multiprocessor 234 includes internal cache memory for performing load and store operations. In one embodiment, the graphics multiprocessor 234 may forgo internal cache and instead use cache memory (e.g., L1 cache 308) within the processing cluster 214. Each graphics multiprocessor 234 may also have access to a partition unit (e.g., L1 cache 308) that is shared between all processing clusters 214. Figure 2A 308 and may be used to pass data between threads. Graphics multiprocessor 234 may also access off-chip global memory, which may include one or more of local parallel processor memory and / or system memory. Any memory external to parallel processing unit 202 may be used as global memory. Embodiments in which processing cluster 214 includes multiple instances of graphics multiprocessor 234 may share common instructions and data that may be stored in L1 cache 308.

[0063] Each processing cluster 214 may include an MMU 245 (memory management unit) configured to map virtual addresses to physical addresses. In other embodiments, one or more instances of MMU 245 may reside in Figure 2A 218. The MMU 245 includes a set of page table entries (PTEs) for mapping virtual addresses to physical addresses of tiles and optionally cache line indexes. The MMU 245 may include an address translation lookaside buffer (TLB) or cache that may reside within the graphics multiprocessor 234 or L1 cache or processing cluster 214. The physical addresses are processed to distribute surface data access locality to achieve efficient request interleaving between partition units. The cache line index may be used to determine whether a request for a cache line is a hit or a miss.

[0064] In graphics and compute applications, the processing clusters 214 may be configured such that each graphics multiprocessor 234 is coupled to a texture unit 236 to perform texture mapping operations, such as determining texture sample locations, reading texture data, and filtering texture data. Texture data is read from an internal texture L1 cache (not shown) or in some embodiments from an L1 cache within the graphics multiprocessor 234 and retrieved from an L2 cache, local parallel processor memory, or system memory as needed. Each graphics multiprocessor 234 outputs processed tasks to a data crossbar 240 to provide the processed tasks to another processing cluster 214 for further processing or to store the processed tasks in an L2 cache, local parallel processor memory, or system memory via a memory crossbar 216. A preROP 242 (pre-raster operation unit) is configured to receive data from the graphics multiprocessor 234, direct the data to ROP units, which may be used with partition units (e.g., Figure 2A The preROP 242 unit can optimize color mixing, organize pixel color data, and perform address translation.

[0065] It should be understood that the core architecture described herein is illustrative and variations and modifications are possible. Any number of processing units, such as graphics multiprocessor 234, texture unit 236, preROP 242, etc., may be included in processing cluster 214. In addition, although only one processing cluster 214 is shown, the parallel processing unit described herein may include any number of instances of processing cluster 214. In one embodiment, each processing cluster 214 may be configured to operate independently of other processing clusters 214 using separate and distinct processing units, L1 caches, etc.

[0066] Figure 2DA graphics multiprocessor 234 is shown according to one embodiment. In such an embodiment, the graphics multiprocessor 234 is coupled to the pipeline manager 232 of the processing cluster 214. The graphics multiprocessor 234 has an execution pipeline that includes, but is not limited to, an instruction cache 252, an instruction unit 254, an address mapping unit 256, a register file 258, one or more general purpose graphics processing unit (GPGPU) cores 262, and one or more load / store units 266. The GPGPU cores 262 and the load / store units 266 are coupled to a cache memory 272 and a shared memory 270 via a memory and cache interconnect 268.

[0067] In one embodiment, the instruction cache 252 receives a stream of instructions to be executed from the pipeline manager 232. These instructions are cached in the instruction cache 252 and dispatched for execution by the instruction unit 254. The instruction unit 254 can dispatch instructions as thread groups (e.g., warps), each thread of the thread group is assigned to a different execution unit within the GPGPU core 262. Instructions can access any of the local, shared, or global address spaces by specifying an address within the unified address space. The address mapping unit 256 can be used to convert addresses in the unified address space into different memory addresses that can be accessed by the load / store unit 266.

[0068] The register file 258 provides a set of registers for the functional units of the graphics multiprocessor 324. The register file 258 provides temporary storage for operands for the data paths of the functional units (e.g., GPGPU core 262, load / store unit 266) connected to the graphics multiprocessor 324. In one embodiment, the register file 258 is divided between each of the functional units so that each functional unit is allocated a dedicated portion of the register file 258. In one embodiment, the register file 258 is divided between the different warps being executed by the graphics multiprocessor 324.

[0069] The GPGPU cores 262 may each include a floating point unit (FPU) and / or an integer arithmetic logic unit (ALU) for executing instructions of the graphics multiprocessor 324. Depending on the embodiment, the architecture of the GPGPU cores 262 may be similar or different. For example, and in one embodiment, the first portion of the GPGPU core 262 includes a single-precision FPU and an integer ALU, while the second portion of the GPGPU core includes a double-precision FPU. In one embodiment, the FPU may implement the IEEE 754-2008 floating-point arithmetic standard or enable variable-precision floating-point arithmetic. In addition, the graphics multiprocessor 324 may also include one or more fixed-function or special-function units for performing specific functions such as copying rectangles or pixel blending operations. In one embodiment, one or more of the GPGPU cores may also include fixed or special-function logic.

[0070] The memory and cache interconnect 268 is an interconnect network that connects each of the functional units of the graphics multiprocessor 324 to the register file 258 and the shared memory 270. In one embodiment, the memory and cache interconnect 268 is a crossbar interconnect that allows the load / store unit 266 to implement load and store operations between the shared memory 270 and the register file 258. In one embodiment, the shared memory 270 can be used to implement communications between threads executing on the functional units. For example, the cache memory 272 can be used as a data cache to cache texture data communicated between the functional units and the texture unit 236.

[0071] FIG. 3A to FIG. 3B Additional graphics multiprocessors are shown according to embodiments. The graphics multiprocessors 325, 350 shown are Figure 2C The illustrated graphics multiprocessors 325, 350 may be configured as streaming multiprocessors (SMs) capable of executing a large number of execution threads simultaneously.

[0072] Figure 3A A graphics multiprocessor 325 is shown according to an additional embodiment. The graphics multiprocessor 325 includes a Figure 2DThe graphics multiprocessor 325 may include multiple additional instances of the execution resource unit of the graphics multiprocessor 234. For example, the graphics multiprocessor 325 may include multiple instances of instruction units 332A to 332B, register files 334A to 334B, and (multiple) texture units 344A to 344B. The graphics multiprocessor 325 also includes multiple groups of graphics or compute execution units (e.g., GPGPU cores 336A to 336B, GPGPU cores 337A to 337B, GPGPU cores 338A to 338B) and multiple groups of load / store units 340A to 340B. In one embodiment, the execution resource unit has a common instruction cache 330, texture and / or data cache memory 342, and shared memory 346. The various components can communicate via the interconnect structure 327. In one embodiment, the interconnect structure 327 includes one or more crossbar switches, which are used to enable communication between the various components of the graphics multiprocessor 325.

[0073] Figure 3B A graphics multiprocessor 350 is shown according to an additional embodiment. Figure 2D and Figure 3A As shown, the graphics processor includes multiple groups of execution resources 356A to 356D, each of which includes multiple instruction units, register files, GPGPU cores, and load storage units. The execution resources 356A to 356D can work with (multiple) texture units 360A to 360D to perform texture operations while sharing an instruction cache 354 and a shared memory 362. In one embodiment, the execution resources 356A to 356D can share multiple instances of the instruction cache 354 and the shared memory 362 as well as texture and / or data cache memories 358A to 358B. The various components can be connected via Figure 3A The interconnect structure 327 communicates with a similar interconnect structure 352 .

[0074] Those skilled in the art will understand that Figure 1 , FIG. 2A to FIG. 2D and FIG. 3A to FIG. 3B The architecture described in is illustrative and does not limit the scope of the embodiments of the present invention. Therefore, the techniques described herein can be implemented on any appropriately configured processing unit, including but not limited to: one or more mobile application processors; one or more desktop computer or server central processing units (CPUs), including multi-core CPUs; one or more parallel processing units such as Figure 2A and one or more graphics processors or special purpose processing units without departing from the scope of the embodiments described herein.

[0075] In some embodiments, a parallel processor or GPGPU as described herein is communicatively coupled to a host / processor core to accelerate graphics operations, machine learning operations, pattern analysis operations, and various general-purpose GPU (GPGPU) functions. The GPU can be communicatively coupled to the host processor / core via a bus or other interconnect (e.g., a high-speed interconnect such as PCIe or NVLink). In other embodiments, the GPU can be integrated on the same package or chip as the core and communicatively coupled to the core via an internal processor bus / interconnect (i.e., inside a package or chip). Regardless of the manner in which the GPU is connected, the processor core can assign work to the GPU in the form of a sequence of commands / instructions contained in a work descriptor. The GPU then uses dedicated circuits / logic to efficiently process these commands / instructions. Technologies for GPU to host processor interconnect

[0076] Figure 4A An exemplary architecture is shown in which multiple GPUs 410 to 413 are communicatively coupled to multiple multi-core processors 405 to 406 via high-speed links 440 to 443 (e.g., buses, point-to-point interconnects, etc.). In one embodiment, high-speed links 440 to 443 support 4GB / s, 30GB / s, 80GB / s, or higher communication throughput, depending on the implementation. Various interconnect protocols can be used, including but not limited to PCIe 4.0 or 5.0 and NVLink 2.0. However, the underlying principles of the invention are not limited to any particular communication protocol or throughput.

[0077] Furthermore, in one embodiment, two or more of the GPUs 410 to 413 are interconnected via high-speed links 444 to 445, which may be implemented using the same or different protocols / links as used for high-speed links 440 to 443. Similarly, two or more of the multi-core processors 405 to 406 may be connected via high-speed link 433, which may be a symmetric multiprocessor (SMP) bus running at 20 GB / s, 30 GB / s, 120 GB / s, or higher. Alternatively, Figure 4A All communications between the various system components shown in can be accomplished using the same protocol / links (eg, through a common interconnect structure). However, as mentioned, the underlying principles of the invention are not limited to any particular type of interconnect technology.

[0078] In one embodiment, each multi-core processor 405-406 is communicatively coupled to processor memory 401-402 via memory interconnects 430-431, respectively, and each GPU 410-413 is communicatively coupled to GPU memory 420-423 via GPU memory interconnects 450-453, respectively. The memory interconnects 430-431 and 450-453 may utilize the same or different memory access technologies. By way of example and not limitation, the processor memory 401-402 and the GPU memory 420-423 may be volatile memory such as dynamic random access memory (DRAM) (including stacked DRAM), graphics DDR SDRAM (GDDR) (e.g., GDDR5, GDDR6), or high bandwidth memory (HBM), and / or may be non-volatile memory such as 3D XPoint or Nano-Ram. In one embodiment, a portion of the memory may be volatile memory and another portion may be non-volatile memory (e.g., using a two-level memory (2LM) hierarchy).

[0079] As described below, although the various processors 405-406 and GPUs 410-413 may each be physically coupled to a specific memory 401-402, 420-423, respectively, a unified memory architecture may be implemented in which the same virtual system address space (also referred to as an "effective address" space) is distributed among all the various physical memories. For example, the processor memories 401-402 may each include 64GB of system memory address space, and the GPU memories 420-423 may each include 32GB of system memory address space (resulting in a total of 256GB of addressable storage space in the described example).

[0080] Figure 4B Additional details of the interconnection between the multi-core processor 407 and the graphics acceleration module 446 according to one embodiment are shown. The graphics acceleration module 446 may include one or more GPU chips integrated on a line card coupled to the processor 407 via the high-speed link 440. Alternatively, the graphics acceleration module 446 may be integrated on the same package or chip as the processor 407.

[0081] The processor 407 shown includes a plurality of cores 460A to 460D, each of which has a translation lookaside buffer 461A to 461D and one or more caches 462A to 462D. These cores may include various other components (e.g., instruction fetch units, branch prediction units, decoders, execution units, reorder buffers, etc.) for executing instructions and processing data not shown to avoid obscuring the basic principles of the present invention. Caches 462A to 462D may include level 1 (L1) and level 2 (L2) caches. In addition, one or more shared caches 426 may be included in the cache hierarchy and shared by each group of cores 460A to 460D. For example, one embodiment of the processor 407 includes 24 cores, each of which has its own L1 cache, 12 shared L2 caches, and 12 shared L3 caches. In this embodiment, one of the L2 cache and the L3 cache is shared by two adjacent cores. The processor 407 and the graphics accelerator integrated module 446 are connected to the system memory 441 , which may include the processor memories 401 to 402 .

[0082] The data and instructions stored in the various caches 462A to 462D, 456, and the system memory 441 are maintained consistent via inter-core communication via the consistency bus 464. For example, each cache may have cache consistency logic / circuitry associated therewith to communicate via the consistency bus 464 in response to a detected read or write to a particular cache line. In one implementation, a cache snooping protocol is implemented via the consistency bus 464 to snoop cache accesses. Cache snooping / consistency techniques are well understood by those skilled in the art and will not be described in detail herein to avoid obscuring the basic principles of the present invention.

[0083] In one embodiment, the proxy circuit 425 communicatively couples the graphics acceleration module 446 to the coherence bus 464, thereby allowing the graphics acceleration module 446 to participate in the cache coherence protocol as a peer of the core. Specifically, the interface 435 provides connectivity to the proxy circuit 425 via a high-speed link 440 (e.g., a PCIe bus, NVLink, etc.), and the interface 437 connects the graphics acceleration module 446 to the link 440.

[0084] In one implementation, the accelerator integrated circuit 436 provides cache management, memory access, context management, and interrupt management services on behalf of the multiple graphics processing engines 431, 432, 43N of the graphics acceleration module 446. The graphics processing engines 431, 432, 43N may each include a separate graphics processing unit (GPU). Alternatively, the graphics processing engines 431, 432, 43N may include different types of graphics processing engines such as graphics execution units, media processing engines (e.g., video encoders / decoders), samplers, and block image transfer engines within the GPU. In other words, the graphics acceleration module may be a GPU having multiple graphics processing engines 431, 432, 43N, or the graphics processing engines 431 to 432, 43N may be separate GPUs integrated on a common package, line card, or chip.

[0085] In one embodiment, the accelerator integrated circuit 436 includes a memory management unit (MMU) 439 for performing various memory management functions such as virtual to physical memory translation (also known as effective to real memory translation) and a memory access protocol for accessing the system memory 441. The MMU 439 may also include a translation lookaside buffer (TLB) (not shown) for caching virtual / effective to physical / real address translations. In one implementation, the cache 438 stores commands and data for efficient access by the graphics processing engines 431 to 432, 43N. In one embodiment, the data stored in the cache 438 and the graphics memory 433 to 434, 43N is kept consistent with the core caches 462A to 462D, 456 and the system memory 411. As mentioned, this can be accomplished via proxy circuitry 425, which participates in cache coherence mechanisms on behalf of cache 438 and memories 433 to 434, 43N (e.g., sending updates to cache 438 related to modifications / accesses of cache lines on processor caches 462A to 462D, 456 and receiving updates from cache 438).

[0086] A set of registers 445 stores context data for threads executed by the graphics processing engines 431 to 432, 43N, and a context management circuit 448 manages thread contexts. For example, the context management circuit 448 may perform save and restore operations to save and restore contexts of various threads during context switches (e.g., where a first thread is saved and a second thread is stored so that the second thread can be executed by the graphics processing engine). For example, upon context switching, the context management circuit 448 may store current register values ​​to a specified area in memory (e.g., identified by a context pointer). The context management circuit may restore register values ​​upon returning to context. In one embodiment, the interrupt management circuit 447 receives and processes interrupts received from system devices.

[0087] In one implementation, the virtual / effective address from the graphics processing engine 431 is converted to an actual / physical address in the system memory 411 by the MMU 439. One embodiment of the accelerator integrated circuit 436 supports multiple (e.g., 4, 8, 16) graphics accelerator modules 446 and / or other accelerator devices. The graphics accelerator module 446 can be dedicated to a single application executed on the processor 407, or can be shared between multiple applications. In one embodiment, a virtual graphics execution environment is presented in which the resources of the graphics processing engines 431 to 432, 43N are shared with multiple applications or virtual machines (VMs). Resources can be subdivided into "slices" that are allocated to different VMs and / or applications based on the processing requirements and priorities associated with the VMs and / or applications.

[0088] Thus, the accelerator integrated circuit acts as a bridge to the system of graphics acceleration modules 446 and provides address translation and system memory cache services. In addition, the accelerator integrated circuit 436 can provide virtualization facilities for the host processor to manage virtualization of the graphics processing engine, interrupts, and memory management.

[0089] Since the hardware resources of the graphics processing engines 431-432, 43N are explicitly mapped to the actual address space seen by the host processor 407, any host processor can directly address these resources using effective address values. In one embodiment, one function of the accelerator integrated circuit 436 is the physical separation of the graphics processing engines 431-432, 43N so that they appear on the system as independent units.

[0090] As mentioned, in the illustrated embodiment, one or more graphics memories 433-434, 43M are coupled to each of the graphics processing engines 431-432, 43N, respectively. The graphics memories 433-434, 43M store instructions and data being processed by each of the graphics processing engines 431-432, 43N. The graphics memories 433-434, 43M may be volatile memories such as DRAM (including stacked DRAM), GDDR memories (e.g., GDDR5, GDDR6), or HBM, and / or may be non-volatile memories such as 3D XPoint or Nano-Ram.

[0091] In one embodiment, in order to reduce data traffic on link 440, biasing techniques are used to ensure that the data stored in graphics memory 433 to 434, 43M is the data most frequently used by graphics processing engines 431 to 432, 43N, and preferably not used (at least not frequently) by cores 460A to 460D. Similarly, the biasing mechanism attempts to keep data needed by the core (and preferably not the graphics processing engines 431 to 432, 43N) within caches 462A to 462D, 456 of the core and system memory 411.

[0092] Figure 4C Another embodiment is shown in which an accelerator integrated circuit 436 is integrated into the processor 407. In this embodiment, the graphics processing engines 431 to 432, 43N communicate directly with the accelerator integrated circuit 436 via the interface 437 and the interface 435 through the high-speed link 440 (which may also utilize any form of bus or interface protocol). The accelerator integrated circuit 436 can perform operations related to Figure 4B The same operations are described, but given their close proximity to the coherency bus 462 and caches 462A to 462D, 426, it is possible to operate at a higher throughput.

[0093] One embodiment supports different programming models, including a dedicated process programming model (without graphics acceleration module virtualization) and a shared programming model (with virtualization). The shared programming model may include a programming model controlled by accelerator integrated circuit 436 and a programming model controlled by graphics acceleration module 446.

[0094] In one embodiment of a dedicated process model, graphics processing engines 431 to 432, 43N are dedicated to a single application or process under a single operating system. A single application can funnel other application requests to graphics engines 431 to 432, 43N, thereby providing virtualization within a VM / partition.

[0095] In a dedicated process programming model, the graphics processing engines 431 to 432, 43N can be shared by multiple VM / application partitions. The shared model requires a hypervisor that virtualizes the graphics processing engines 431 to 432, 43N to allow access by each operating system. For a single partition system without a hypervisor, the graphics processing engines 431 to 432, 43N are owned by the operating system. In both cases, the operating system can virtualize the graphics processing engines 431 to 432, 43N to provide access to each process or application.

[0096] For the shared programming model, the graphics acceleration module 446 or the individual graphics processing engines 431 to 432, 43N use a process handle to select a process element. In one embodiment, the process elements are stored in the system memory 411 and can be addressed using the effective address to real address translation techniques described herein. The process handle can be an implementation-specific value provided to the host process when registering its context with the graphics processing engine 431 to 432, 43N (i.e., calling the system software to add a process element to the process element linked list). The lower 16 bits of the process handle can be the offset of the process element within the process element linked list.

[0097] Figure 4D An exemplary accelerator integrated slice 490 is shown. As used herein, a "slice" includes a specified portion of the processing resources of the accelerator integrated circuit 436. The application effective address space 482 within the system memory 411 stores process elements 483. In one embodiment, the process element 483 is stored in response to a GPU call 481 from an application 480 executed on the processor 407. The process element 483 contains the processing state of the corresponding application 480. The work descriptor (WD) 484 contained in the process element 483 can be a single job requested by the application, or can contain a pointer to a job queue. In the latter case, the WD 484 is a pointer to a job request queue in the application address space 482.

[0098] Graphics acceleration module 446 and / or individual graphics processing engines 431-432, 43N may be shared by all or some processes in the system. Embodiments of the present invention include an infrastructure for establishing a processing state and sending a WD 484 to the graphics acceleration module 446 to start a job in a virtual environment.

[0099] In one implementation, the dedicated process programming model is specific to a specific implementation. In this model, a single process owns the graphics acceleration module 446 or a separate graphics processing engine 431. Since the graphics acceleration module 446 is owned by a single process, the hypervisor initializes the accelerator integrated circuit 436 to obtain the owned partition, and the operating system initializes the accelerator integrated circuit 436 to obtain the owned process when the graphics acceleration module 446 is allocated.

[0100] In operation, the WD acquisition unit 491 in the accelerator integrated slice 490 acquires the next WD 484, which includes an indication of the work to be performed by one of the graphics processing engines of the graphics acceleration module 446. As shown, the data from the WD 484 can be stored in the register 445 and used by the MMU 439, the interrupt management circuit 447 and / or the context management circuit 446. For example, one embodiment of the MMU 439 includes a segment / page walk circuit for accessing the segment / page table 486 within the OS virtual address space 485. The interrupt management circuit 447 can process the interrupt event 492 received from the graphics acceleration module 446. When performing graphics operations, the effective address 493 generated by the graphics processing engine 431 to 432, 43N is converted to an actual address by the MMU 439.

[0101] In one embodiment, the same set of registers 445 is replicated for each graphics processing engine 431 to 432, 43N and / or graphics acceleration module 446, and this set of registers can be initialized by a hypervisor or an operating system. Each of these replicated registers can be included in an accelerator integrated slice 490. Table 1 shows exemplary registers that can be initialized by a hypervisor. Table 1 - Hypervisor Initialization Registers 1 Slice Control Register 2 Real Address (RA) Dispatch Process Area Pointer 3 Authorization mask override register 4 Interrupt vector table entry offset 5 Interrupt vector table entry limit 6 Status Register 7 Logical Partition ID 8 Real Address (RA) Manager Accelerator Utilizes Record Pointers 9 Storage Description Register

[0102] Example registers that may be initialized by the operating system are shown in Table 2. Table 2 - Operating System Initialization Registers 1 Process and thread identities 2 Effective Address (EA) context save / restore pointer 3 Virtual Address (RA) Accelerator Utilizes Record Pointers 4 Virtual Address (RA) storage segment table pointer 5 Authorization Mask 6 Job Descriptor

[0103] In one embodiment, each WD 484 is specific to a particular graphics acceleration module 446 and / or graphics processing engine 431 to 432, 43N. The WD contains all the information needed by the graphics processing engine 431 to 432, 43N to complete its work, or the WD can be a pointer to a memory location where the application has established a command queue for work to be completed.

[0104] Figure 4EAdditional details of one embodiment of the sharing model are shown. The embodiment includes a hypervisor real address space 498 in which a process element list 499 is stored. The hypervisor real address space 498 is accessible via a hypervisor 496 that virtualizes a graphics acceleration module engine of an operating system 495.

[0105] The shared programming model allows all or some processes from all or some partitions in the system to use the graphics acceleration module 446. There are two programming models where the graphics acceleration module 446 is shared by multiple processes and partitions: time-sliced ​​sharing and graphics direct sharing.

[0106] In this model, the hypervisor 496 owns the graphics acceleration module 446 and makes its functionality available to all operating systems 495. In order for the graphics acceleration module 446 to support virtualization of the hypervisor 496, the graphics acceleration module 446 may comply with the following requirements: 1) Application job requests must be autonomous (i.e., no state needs to be maintained between jobs), or the graphics acceleration module 446 must provide a context save and restore mechanism. 2) The graphics acceleration module 446 guarantees that application job requests are completed within a specified amount of time, including any conversion errors, or the graphics acceleration module 446 provides the ability to preempt job processing. 3) When operating in a direct sharing programming model, fairness of the graphics acceleration module 446 in the process must be guaranteed.

[0107] In one embodiment, for the shared model, an application 480 is required to make an operating system 495 system call using a graphics acceleration module 446 type, a work descriptor (WD), an authorization mask register (AMR) value, and a context save / restore region pointer (CSRP). The graphics acceleration module 446 type describes the target acceleration function of the system call. The graphics acceleration module 446 type can be a system-specific value. The WD is formatted specifically for the graphics acceleration module 446 and can be in the following form: a graphics acceleration module 446 command; an effective address pointer to a user-defined structure; an effective address pointer to a command queue; or any other data structure used to describe the work to be performed by the graphics acceleration module 446. In one embodiment, the AMR value is the AMR state for the current process. The value passed to the operating system is similar to the application that sets the AMR. If the implementation of the accelerator integrated circuit 436 and the graphics acceleration module 446 does not support the user authorization mask override register (UAMOR), the operating system can apply the current UAMOR value to the AMR value before passing the AMR in the hypervisor call. The hypervisor 496 may optionally apply the current authorization mask override register (AMOR) value before placing the AMR into the process element 483. In one embodiment, the CSRP is one of the registers 445 that contains the effective address of an area in the application address space 482 for the graphics acceleration module 446 to save and restore context state. This pointer is optional if state does not need to be saved between jobs or when a job is preempted. The context save / restore area may be a plugged in system memory.

[0108] Upon receiving the system call, the operating system 495 can verify that the application 480 is registered and authorized to use the graphics acceleration module 446. The operating system 495 then calls the hypervisor 496 with the information shown in Table 3. Table 3 - Parameters of the operating system calling the hypervisor 1 Work Descriptor (WD) 2 Authorization Mask Register (AMR) value (may be masked) 3 Effective Address (EA) Context Save / Restore Region Pointer (CSRP) 4 Process ID (PID) and optional thread ID (TID) 5 Virtual Address (VA) Accelerator Utilization Record Pointer (AURP) 6 Virtual address of the storage segment table pointer (SSTP) 7 Logical Interrupt Service Number (LISN)

[0109] Upon receiving the hypervisor call, the hypervisor 496 may verify that the operating system 495 has registered and is authorized to use the graphics acceleration module 446. The hypervisor 496 then places the process element 483 into the process element linked list for the corresponding graphics acceleration module 446 type. The process element may contain the information shown in Table 4. Table 4 - Process element information 1 Work Descriptor (WD) 2 Authorization Mask Register (AMR) value (may be masked) 3 Effective Address (EA) Context Save / Restore Region Pointer (CSRP) 4 Process ID (PID) and optional thread ID (TID) 5 Virtual Address (VA) Accelerator Utilization Record Pointer (AURP) 6 Virtual address of the storage segment table pointer (SSTP) 7 Logical Interrupt Service Number (LISN) 8 Interrupt vector table, derived from the hypervisor call parameters 9 Status Register (SR) Value 10 Logical Partition ID (LPID) 11 Real Address (RA) Manager Accelerator Utilizes Record Pointers 12 Storage Descriptor Register (SDR)

[0110] In one embodiment, the hypervisor initializes the plurality of accelerator integrated slices 490 of registers 445 .

[0111] like Figure 4FAs shown, one embodiment of the present invention employs a unified memory addressable via a common virtual memory address space for accessing physical processor memories 401-402 and GPU memories 420-423. In this implementation, operations executed on GPUs 410-413 utilize the same virtual / effective memory address space to access processor memories 401-402, and vice versa, thereby simplifying programmability. In one embodiment, a first portion of the virtual / effective address space is allocated to processor memory 401, a second portion is allocated to second processor memory 402, a third portion is allocated to GPU memory 420, and so on. The entire virtual / effective memory space (sometimes referred to as the effective address space) is thus distributed across each of processor memories 401-402 and GPU memories 420-423, thereby allowing any processor or GPU to access any physical memory having a virtual address mapped to that memory.

[0112] In one embodiment, bias / coherency management circuits 494A-494E within one or more of MMUs 439A-439E ensure cache coherency between the caches of the host processor (e.g., 405) and GPUs 410-413, and also implement biasing techniques that indicate where certain types of data should be stored. Figure 4F 4. Although multiple instances of bias / consistency management circuits 494A to 494E are shown in FIG. 4, bias / consistency circuits may also be implemented within an MMU of one or more host processors 405 and / or within an accelerator integrated circuit 436.

[0113] One embodiment allows the GPU-attached memory 420 to 423 to be mapped as part of the system memory and accessed using shared virtual memory (SVM) technology, but without suffering from the typical performance defects associated with full system cache coherence. The ability to access the GPU-attached memory 420 to 423 as system memory does not cause heavy cache coherence overhead, which provides a favorable operating environment for GPU offloading. This arrangement allows the host processor 405 software to set operands and access calculation results without the overhead of traditional I / O DMA data copying. These traditional copies involve driver calls, interrupts, and memory-mapped I / O (MMIO) accesses, which are inefficient relative to simple memory accesses. At the same time, the ability to access the GPU-attached memory 420 to 423 without cache coherence overhead may be critical to the execution time of the offloaded calculation. For example, in the case of a large number of streaming write memory services, the cache coherence overhead can significantly reduce the effective write bandwidth seen by the GPU 410 to 413. The efficiency of operand setting, the efficiency of result access, and the efficiency of GPU calculation all play an important role in determining the effectiveness of GPU offloading.

[0114] In one implementation, the selection between GPU bias and host processor bias is driven by a bias tracker data structure. For example, a bias table may be used, which may be a page granular structure including 1 or 2 bits per GPU attached memory page (i.e., controlled at the granularity of a memory page). The bias table may be implemented in the stolen memory range of one or more GPU attached memories 420 to 423, with or without a bias cache in GPUs 410 to 413 (e.g., to cache frequently / recently used entries of the bias table). Alternatively, the entire bias table may be maintained within the GPU.

[0115] In one implementation, the bias table entry associated with each access to the GPU attached memory 420 to 423 is accessed before the GPU memory is actually accessed, so that the following operations are performed. First, local requests from GPUs 410 to 413 whose pages are found in the GPU bias are forwarded directly to the corresponding GPU memory 420 to 423. Local requests from the GPU whose pages are found in the host bias are forwarded to the processor 405 (e.g., over a high-speed link as described above). In one embodiment, the request from the processor 405 to find the requested page in the host processor bias completes the request like a normal memory read. Alternatively, the request for the GPU bias page can be forwarded to the GPU 410 to 413. If the GPU is not currently using the page, the GPU can convert the page to the host processor bias.

[0116] The bias state of a page can be changed by a software-based mechanism, a hardware-assisted software-based mechanism, or, for a limited set of cases, a hardware-only based mechanism.

[0117] One mechanism for changing the bias state employs an API call (e.g., OpenCL) which in turn calls a GPU device driver which in turn sends a message (or queues a command descriptor) to the GPU, thereby directing the GPU to change the bias state and, for certain transitions, perform a cache flush operation in the host. The cache flush operation is required for a transition from host processor 405 bias to GPU bias, but not for the reverse transition.

[0118] In one embodiment, cache coherency is maintained by temporarily presenting GPU bias pages that are non-cacheable to host processor 405. To access these pages, processor 405 may request access from GPU 410, which may or may not grant access immediately, depending on the implementation. Therefore, to reduce communication between processor 405 and GPU 410, it is advantageous to ensure that GPU bias pages are pages that are needed by the GPU but not by the host processor 405, and vice versa. Graphics processing pipeline

[0119] Figure 5 is a conceptual diagram of a graphics processing pipeline 500 according to an embodiment. In one embodiment, a graphics processor may implement the illustrated graphics processing pipeline 500. The graphics processor may be included in a parallel processing subsystem such as Figure 2A In one embodiment, the parallel processor 200 is Figure 1 As described herein, various parallel processing systems can be implemented via parallel processing units (e.g., Figure 2A The graphics processing pipeline 500 may be implemented using one or more instances of a parallel processing unit 202 of the graphics processing unit. For example, a shader unit (e.g., Figure 2C and Figure 2D The graphics multiprocessor 234 of the embodiment of the present invention may be configured to perform the functions of one or more of the vertex processing unit 504, the tessellation control processing unit 508, the tessellation evaluation processing unit 512, the geometry processing unit 516, and the fragment / pixel processing unit 524. The functions of the data assembler 502, the primitive assemblers 506, 514, 518, the tessellation unit 510, the rasterizer 522, and the raster operation unit 526 may also be performed by a processing cluster (e.g., Figure 2C Other processing engines and corresponding partition units (e.g., Figure 2AAlternatively, the graphics processing pipeline 500 may be implemented using one or more functionally dedicated processing units. In one embodiment, one or more portions of the graphics processing pipeline 500 may be executed by parallel processing logic within a general-purpose processor (e.g., a CPU). In one embodiment, one or more portions of the graphics processing pipeline 500 may access on-chip memory (e.g., such as a CPU) via a memory interface 528. Figure 2A The parallel processor memory 222 shown in FIG. 2 may be a memory interface. Figure 2A An example of a memory interface 218 .

[0120] In one embodiment, data assembler 502 is a processing unit that collects vertex data for high-order surfaces, primitives, etc., and outputs vertex data, including vertex attributes, to vertex processing unit 504. Vertex processing unit 504 is a programmable execution unit that is configured to execute vertex shader programs, lighting, and transform vertex data as specified by vertex shader programs. For example, vertex processing unit 504 can be programmed to transform vertex data from an object-based coordinate representation (object space) to a coordinate system based on other means (such as world space or normalized device coordinate (NDC) space). Vertex processing unit 504 can read data stored in cache, local memory, or system memory for processing vertex data.

[0121] A first instance of primitive assembler 506 receives vertex attributes from vertex processing unit 504, reads stored vertex attributes as needed, and constructs graphics primitives for processing by tessellation control processing unit 508, where these graphics primitives include triangles, line segments, points, patches, etc. as supported by various graphics processing application programming interfaces (APIs).

[0122] The tessellation control processing unit 508 treats the input vertices as control points of a geometric patch and transforms these control points from an input representation of the patch (often referred to as a basis for the patch) into a representation suitable for efficient surface evaluation by the tessellation evaluation processing unit 512. The tessellation control processing unit 508 also calculates tessellation factors for the edges of the geometric patch. The tessellation factors are applied to individual edges and quantify the view-dependent level of detail associated with the edge. The tessellation unit 510 is configured to: receive the tessellation factors for the edges of the patch; and tessellate the patch into a plurality of geometric primitives (such as lines, triangles, or quadrilateral primitives), which are transmitted to the tessellation evaluation processing unit 512. The tessellation evaluation processing unit 512 operates on the parameterized coordinates of the tessellated patch to generate a surface representation and vertex attributes for each vertex associated with the geometric primitives.

[0123] The second instance of primitive assembler 514 receives vertex attributes from tessellation evaluation processing unit 512, reads stored vertex attributes as needed, and constructs graphics primitives for processing by geometry processing unit 516. Geometry processing unit 516 is a programmable execution unit that is configured to execute geometry shader programs to transform graphics primitives received from primitive assembler 514 as specified by the geometry shader programs. For example, geometry processing unit 516 may be programmed to: tessellate a graphics primitive into one or more new graphics primitives; and calculate parameters (e.g., plane equation coefficients) that are used to rasterize the new graphics primitives.

[0124] In some embodiments, the geometry processing unit 516 may also add or remove elements from the geometry stream. The geometry processing unit 516 outputs parameters and vertices specifying new graphics primitives to a primitive assembler 518, which receives these parameters and vertices from the geometry processing unit 516, reads stored vertex attributes as needed, and constructs graphics primitives for processing by a viewport scaling, picking, and clipping unit 520. The geometry processing unit 516 may read data stored in a parallel processor memory or system memory for processing geometry data. The viewport scaling, picking, and clipping unit 520 performs clipping, picking, and viewport scaling, and outputs processed graphics primitives to a rasterizer 522.

[0125] The rasterizer 522 scan converts the new graphics primitives and outputs fragments and coverage data to the fragment / pixel processing unit 524. In addition, the rasterizer 522 may be configured to perform z-culling and other z-based optimizations.

[0126] The fragment / pixel processing unit 524 is a programmable execution unit that is configured to execute a fragment shader program or a pixel shader program. The fragment / pixel processing unit 524 transforms the fragments or pixels received from the rasterizer 522 as specified by the fragment or pixel shader program. For example, the fragment / pixel processing unit 524 can be programmed to perform operations such as perspective correction, texture mapping, shading, blending, etc. to produce shaded fragments or pixels that are output to the raster operation unit 526. The fragment / pixel processing unit 524 can read data stored in a parallel processor memory or a system memory for processing fragment data. The fragment or pixel shader program can be configured to shade with samples, pixels, tiles, or other granularity depending on the programmed sampling rate.

[0127] Raster operation unit 526 is a processing unit that performs raster operations (such as stencil printing, z-testing, blending, etc.) and outputs pixel data as processed graphics data for storage in graphics memory. The processed graphics data may be stored in graphics memory (e.g., Figure 2AThe parallel processor memory 222 shown in FIG. 1 and / or the ... Figure 1 104) for display on one of the one or more display devices 110 or for further processing by one of the one or more processors 102 or parallel processors 112. In some embodiments, raster operation unit 526 is configured to compress z or color data written to memory and decompress z or color data read from memory. Compute cluster preemption

[0128] The computing unit in the GPGPU is the core processing element of the GPGPU. The computing unit is the majority of the hardware assets in the GPGPU and can be used by 3D workloads, general computing workloads, and media workloads. In previous implementations, when a workload is assigned to a computing unit for execution, either the workload runs until completion, or the entire workload is preempted to make way for a new workload. The embodiments described herein use a preemption mechanism on a subset of computing units in a computing cluster to achieve rebalancing of computing assets. Rebalancing may be based on stop events (like page faults or barriers) and synchronization semaphores. These events typically stop the computing unit until the event is resolved, which reduces computing asset utilization.

[0129] The embodiments described herein provide a technique for enhanced preemption of a computing cluster for GPGPU. One embodiment provides a hardware mechanism for tracking blocking events when blocking events occur. The hardware then generates a notification to a rebalancing module. The rebalancing module can then switch out the stopped workload and reschedule any pending computing tasks to the previously stopped computing assets. One embodiment implements a hardware mechanism to migrate or restore state information (e.g., general registers, instruction pointers, etc.) for stopped tasks. When the workload is migrated from a computing unit, the state information can be stored in a temporary storage (e.g., a temporary storage memory). When the workload is ready to be restored, the state can be quickly restored from the temporary storage.

[0130] Figure 6 A preemptible GPGPU computing system 600 is shown according to an embodiment. The GPGPU computing system 600 includes a computing cluster 614 having a set of computing units 604. The computing units 604 can process workloads assigned to the computing units. During operation, instructions and data can be retrieved and loaded from a cache memory such as an L1 cache 608. In one embodiment, the GPGPU computing system 600 is configured to execute commands in parallel with the GPGPU computing system 614. Figure 3A-3BEach of the computing units 604 is constructed in a similar manner to the graphics multiprocessor of FIG. However, the computing unit 604 can be any of the instruction-level execution units described herein. The computing unit 604 may include a fetch unit for fetching instructions for execution and a decode unit for decoding the fetched instructions. In one embodiment, the computing unit 604 includes execution resources having one or more single-precision floating point units, double-precision floating point units, integer arithmetic logic units, load / store units, and / or special purpose function units.

[0131] In one embodiment, the computing cluster 614 includes a stop notification module 606 that maintains an activity scoreboard associated with the computing units 604 within the computing cluster 614. The activity scoreboard maintains an activity state or a blocking state for each of the computing units 604. The stop notification module 606 updates the activity scoreboard for the computing units 604 when execution on the computing units becomes blocked due to a blocking event. In one embodiment, once all computing units 604 within the computing cluster 614 become blocked, the stop notification module 606 may signal the rebalancing module to perform workload rebalancing on the computing units 604. In one embodiment, when one or more computing units are stopped or when the number of stopped computing units exceeds a threshold, the stop notification module 606 may signal the rebalancing module to perform workload rebalancing on the computing units 604.

[0132] In one embodiment, when a notification is received from the stop notification module 606, the rebalancing module 602 may query the scheduling logic to determine whether there are any workloads to be processed. If there are any new or existing tasks or workloads that can be scheduled to the computing unit 604, the rebalancing module may signal the computing unit 604 to perform the migration of the blocked workload. In preparation for migrating the blocked workload, the computing unit 604 may evaluate each of the pending pipeline activities associated with the workload. Existing pipeline activities may be allowed to be drained through the pipeline, or the activities may be discarded and marked for replay once the workload is restored on the computing unit 604. Once the pipeline has been drained, the pipeline state associated with the workload may be saved to a temporary memory. In one embodiment, the computing cluster 614 includes a temporary memory 612, which may be used as a temporary memory for the computing cluster. The computing cluster 614 may store pipeline states and other context information associated with the workload in the temporary memory 612. Alternatively, compute cluster 614 may store pipeline states in a cache memory, such as a level three (L3) cache shared by multiple compute clusters.

[0133] In one embodiment, the computing cluster 614 additionally includes a power module 605. The power module 605 can be used to power gate the idle computing unit 604. Once the stopped workload on the computing unit 604 is migrated out of the computing unit and the pipeline state associated with the workload is saved, the power module 605 can power gate the computing unit 604, provided that no additional workload is to be processed. The power module 605 can then re-enable the computing unit 604 once the stopped workload is unblocked or a new workload can be scheduled.

[0134] Figures 7A-7C is a flowchart of operations for preempting a computing cluster according to an embodiment. In one embodiment, at least part of the Figure 6 The stop notification module 606 and the rebalancing module 602 of the scheduler microcontroller are used to perform the operations shown. In one embodiment, at least a portion of the operations shown may be performed by firmware within a microcontroller. For example, and in one embodiment, the operations shown are implemented via microcontroller firmware of a scheduler microcontroller. In one embodiment, rebalancing may be performed by driver logic executed on a host processor. For example, a GPGPU driver associated with a GPGPU device as described herein may rebalance workloads when a stopped computing cluster is detected.

[0135] like Fig. 7A As shown in FIG. 7 , in one embodiment, the operations described include monitoring the execution of the computing cluster via a computing unit scoreboard, as shown at block 702. The computing unit scoreboard may be maintained in a stop notification module (such as, for example, Figure 6 The stop notification module or other hardware logic within the computing cluster may detect at block 704 that a computing unit in the computing cluster is stopped. In one embodiment, the stop notification module is configured to detect that the entire cluster is stopped, wherein none of the computing units are able to make forward progress on their workloads due to the stop event. In response to such detection, the stop notification module may notify the rebalancing module that the computing cluster has stopped, as shown at block 706.

[0136] As in Figure 7BAs shown in , logic within the rebalancing module or equivalent rebalancing logic may receive notification that the computing cluster has stopped, as shown at 708. The rebalancing logic may signal the computing cluster to migrate the stopped workload, as shown at box 710. The computing cluster hardware may be quiesced, where pending pipeline activities are drained or discarded. The discarded pipeline events are logged so that they can be replayed once the workload is resumed. At box 711, the rebalancing logic may then determine whether there are any workloads that are pending execution. In one embodiment, the rebalancing logic queries the scheduler logic to determine whether there are any workloads that are pending. In one embodiment, the rebalancing logic has access to the scheduling sequence used by the scheduling logic and can directly determine whether there are any workloads that are pending. If there are any workloads that are pending, the rebalancing logic may migrate the pending workloads to the computing cluster, as shown at box 712. If no workload is pending, the rebalancing logic may request the power module within the computing cluster to power gate the computing cluster, as shown at 714.

[0137] When the computing cluster becomes stopped, the unfinished events of the computing cluster can be discharged or discarded. The discharge or discard decision can be performed based on the pipeline tracking information associated with the event in the pipeline. For example, if a memory access has crossed the address translation level, the memory access can be allowed to be discharged. Before performing virtual to physical memory address conversion, the memory access can be discarded and marked for replay. The point at which a pipeline event is allowed to be discharged or discarded can be called the criticality of the event.

[0138] Figure 7C Operations for determining whether to drain or discard an event are shown. In one embodiment, a computing unit may receive notification of a workload that has been stalled, as shown at block 716. The computing unit may then determine whether to drain or discard each pending pipeline event of the workload, as shown at block 718. In one embodiment, the determination is performed based on determining whether the pipeline event has cleared a threshold for the event, as shown at 719. If the event has cleared a threshold, the event is allowed to complete, as shown at 720. If the event has not cleared a threshold (e.g., an address translation of a memory operation), the computing unit may discard the event and mark the event for retry once the workload is resumed after resolving the stall (e.g., a page fault, a barrier, etc.).

[0139] Figure 8Task migration of a stopped computing cluster according to an embodiment is shown. In one embodiment, a multi-context GPGPU (806A) can execute workloads from a first application 802 and a second application 804. For example, in the event that the workload of the second application 804 encounters a stop due to a page fault, a barrier, or other synchronization event, the workload of the second application 804 can be removed from the stopped cluster. Once the stopped workload is removed, the multi-context GPGPU (806B) can execute the workload of the first application 802. This mechanism will increase the utilization of computing units within the computing cluster and improve the efficiency and performance of the GPGPU. Fine-grained thread saving and switching

[0140] In one embodiment, migration is supported at a fine-grained level so that stalled work items on a single compute unit can be migrated. A single compute unit can be configured to execute multiple threads concurrently. When one of the multiple concurrent threads becomes blocked due to a long-delay stall, the compute unit can switch to another available thread that has been assigned to the compute unit until the blocked thread is unblocked. The compute unit can then switch between threads when a thread becomes blocked, so that cycles that would otherwise be idle are used to perform work across a group of assigned threads.

[0141] However, a scenario may occur where all threads assigned to a computing unit become blocked. When all threads assigned to a computing unit are blocked, the computing unit will become blocked until one of the many stops of the blocked threads is resolved. In order to enable the computing unit to continue processing operations when all assigned threads are blocked, the embodiments described herein enable the computing unit to suspend the assigned threads that have been blocked, thereby freeing thread resources to receive the dispatch of new threads for processing. Once the new thread is completed, the suspended thread can be reloaded.

[0142] Fig. 9A computing unit 904 is shown that is configured to suspend active threads to a thread scratch space 912 according to an embodiment. In one embodiment, the on-chip thread scratch space 912 is used to store thread information of the suspended thread. The thread scratch space 912 can be allocated in a dedicated area of ​​an on-chip memory, in a scratch memory, or in a shared cache memory such as an L3 cache memory. During operation, threads running on the computing unit 904 may be blocked for any number of reasons, including but not limited to waiting for a barrier to complete, waiting for data from a memory, waiting for a page fault to be resolved, or due to a software synchronization operation. Whenever all threads in the computing unit 904 are blocked, the computing unit can select a victim thread to transition from an active thread 905 that has previously been assigned to the computing unit. In one embodiment, the victim thread is randomly selected. In one embodiment, the victim thread is the last thread to be blocked.

[0143] The computing unit 904 may save the thread state information of the victim thread to the set of suspended threads 914 in the thread scratch space. In one embodiment, the computing unit 904 may store multiple threads into the set of suspended threads, thus selecting the thread state save offset to index the location where the suspended thread state will be saved. The computing unit 904 may also store the reason why the thread is blocked (e.g., barrier, memory return, page fault, etc.). The reason why the thread is blocked may be used to select from the set of suspended threads to be restored to the computing unit 904 when one of the active threads 905 completes.

[0144] Once the blocked threads are suspended and saved, compute unit 904 may indicate to thread dispatcher 902 that additional threads may be dispatched to compute unit 904. The additional threads are added to active threads 905 and execution on compute unit 904 may continue. If the new threads stop before other blocked threads on compute unit 904 become unblocked, additional victim threads may be suspended and new threads may be dispatched to compute unit 904 until the maximum number of suspended threads is reached.

[0145] When the thread being executed is completed, the computing unit 904 can determine whether there are any suspended threads stored in the set 914 of suspended threads. In one embodiment, restoring a previously suspended thread has a higher priority than receiving the dispatch of a new thread. Therefore, if the computing unit becomes blocked and a suspended thread is available in the set 914 of suspended threads, the suspended thread can be restored to the group of active threads 905 on the computing unit 904, rather than the computing unit signaling the thread dispatcher 902 to dispatch a new thread. If there are multiple threads that can be restored, the priority of restoration can be based on the expected completion of the event that caused the thread to be blocked. For example, a thread that is blocked when the memory returns will be restored before a thread that is blocked when waiting for a barrier. A thread that is blocked when waiting for a barrier will be restored after a thread that is blocked when waiting for a page fault.

[0146] Fig.10 Operations for enabling fine-grained thread preservation and switching according to an embodiment are shown. In one embodiment, to perform fine-grained thread preservation and switching, a computing unit as described herein may detect that all threads on the computing unit are blocked, as shown at block 1002. In response to detecting that all threads are blocked, the computing unit may select a victim thread to suspend to a thread scratch space, as shown at block 1004. The victim thread may be randomly selected, or a thread that was recently blocked may be selected.

[0147] The computing unit may then determine whether there is a suspended thread available in the set of suspended threads stored in the thread scratch space, as shown in block 1005. If a suspended thread is available, the computing unit may resume the suspended thread, as shown in block 1006. If multiple suspended threads are available for resumption, in one embodiment, the threads are resumed based on the expected completion of the event that caused the thread to be blocked. For example, a blocked thread waiting for memory access will be resumed before a blocked thread waiting for a page fault. If no suspended thread is available for resumption, the computing unit may request that a new thread be dispatched from a thread dispatcher, as shown in block 1008. Low latency preemption

[0148] Preempting GPGPU is a high latency process because GPGPU has deep pipeline stages and a large number of pipeline states. Typical preemption boundaries for 3D workloads include draw command level, primitive level, and pixel level. Finer granularity preemption requires saving a larger number of pipeline states. Pixel-level preemption requires saving a very large amount of transient pipeline state data, register data, and shared local memory data. A similar process is also used to preempt compute workloads.

[0149] The amount of time required to perform preemption on a GPGPU is related to the amount of data that needs to be saved. Therefore, reducing the amount of data that needs to be saved can reduce the time required to perform preemption. The embodiments described herein achieve lower latency preemption of a computing cluster by reducing the amount of pipeline state that needs to be saved. One embodiment is able to reduce preemption latency by using various metrics to collect the size of a computing unit register file. Metric collection is done with the help of hardware for tracking and monitoring register file usage. Register file usage is used to determine the appropriate point to preempt a computing unit so that the minimum amount of data needs to be saved during a preemption request. Register file usage can be reported to a memory or reported via a memory-mapped I / O register. One embodiment additionally includes hardware comparator logic, which can accept a threshold value provided by the preemption logic as an input. One embodiment additionally includes a hardware notification unit for generating an interrupt event to the preemption logic.

[0150] At the initialization of the GPGPU device, the preemption logic can program the threshold, and the comparator logic will start monitoring the usage value transmitted for the register file. Due to different register file sizes, when the register file size is below the programmed threshold, the comparator logic can generate an interrupt to the preemption logic. When the preemption logic receives the interrupt, the preemption logic can initiate a preemption sequence to migrate or remove the currently running task.

[0151] In one embodiment, when a shader program is compiled by shader compiler code, a threshold used by the preemption logic is generated. The shader compiler may generate metadata indicating the minimum and average register file sizes used by the compiled shader code. In one embodiment, the (register) file size tracking unit is optimized to update the threshold size value when new work is submitted to a compute unit and old work is retired from the compute unit. The comparator logic may also be triggered after the size is updated, thereby minimizing overhead.

[0152] Fig.11 A low latency preemption system 1100 is shown in accordance with an embodiment. In one embodiment, low latency preemption is enabled by attempting to perform a preemption operation on a compute unit when the register file usage of the compute unit is below a predetermined threshold. In one embodiment, register file size collection hardware 1102 monitors the size associated with register files 1104 used by the compute unit 904. The register file size collection hardware 1102 provides size data 1114 to a comparator unit 1110. The comparator unit 1110 receives the threshold from compiler software 1106 executing on a host processor of the low latency preemption system 1100. The compiler software generates metadata for determining the threshold 1112.

[0153] In one embodiment, the comparator unit 1110 is triggered when a change is made to the size data 1114 or the threshold 1112. The rate at which the size data 1114 is updated depends on the rate at which the register file size collection hardware 1102 provides the size data 1114. In one embodiment, the register file size collection hardware 1102 continuously updates the size data 1114 on a periodic basis. In one embodiment, the register file size collection hardware 1102 updates the size data 1114 in response to a change in the size data that exceeds an update threshold.

[0154] The comparator unit 1110 is configured to compare the size data 1114 with the threshold value 1112. When the size data 1114 is less than the threshold value 1112, the comparator unit 1110 triggers an update to the preemption logic 1120. The preemption logic 1120 includes a control module 1124. In one embodiment, the control module is provided by firmware executed on a microcontroller module such as a scheduler microcontroller. In one embodiment, the control module 1124 is software logic provided by a GPGPU driver executed on a host processor. The control module 1124 determines whether a pending preemption request 1122 for the computing unit 904 is not completed. In the case where the preemption request 1122 is pending, the control module 1124 can trigger the preemption logic 1120 to send a preemption event 1116 to the computing unit 904.

[0155] Fig.12 1200 is a flowchart of low-latency preemption logic according to an embodiment. In one embodiment, the low-latency preemption logic 1200 is implemented as follows: Fig.11 The register file size shown in FIG. 1 is implemented by collecting hardware, comparator units, and preemption logic. The low latency preemption logic 1200 can gate preemption requests so that the preemption requests are not serviced until the preemption can be performed with minimal latency (this is due to the relatively small register file size).

[0156] In one embodiment, the low latency preemption logic 1200 can compare the register file size of the computing unit with the register file size threshold via comparator logic, as shown in block 1202. The register file size of the computing unit can be provided to the comparator logic from the register file size collection hardware. The register file size threshold can be determined based on metadata provided by the shader compiler. In one embodiment, the comparison can be triggered based on an update to the register file size or the register file size threshold. If the register file size is not less than (e.g., greater than) the file size threshold, as determined at block 1203, the comparator logic does not perform an action. If the register file size is less than the threshold, the low latency preemption logic 1200 can generate an interrupt to the preemption logic via the comparator logic, as shown in block 1206.

[0157] In one embodiment, the low latency preemption logic 1200 can determine via the preemption logic whether a preemption request is pending at the preemption logic, as shown in block 1207. If no preemption request is pending at block 1207, the preemption logic may not perform an operation. The low latency preemption logic 1200 can then return to the comparator and wait for an update of the register file size or register file size threshold. However, if at block 1207, a preemption request is pending in the preemption logic, the preemption logic may preempt the computing unit, as shown in 1208.

[0158] The illustrated embodiment providing low latency preemption may be combined with any of the embodiments described herein. Hardware-based fine-grained reset

[0159] The low latency and fine-grained preemption and context switching techniques described herein can also be used to implement hardware-based fine-grained resets of portions of a GPGPU. When a reset event is required, for example, due to an unrecoverable fault in a shader execution pipeline, instead of resetting the entire GPGPU processing pipeline, only the computing unit where the fault occurred can be reset, while computing units not affected by the fault can continue to execute the workload. Hardware-based fine-grained resets are particularly suitable for GPGPUs used in embedded systems that use GPGPUs as parallel processors for navigation and / or control, such as automated vehicles or autonomous robots, or any system in which robust hardware and fault-tolerant hardware play an important role.

[0160] In one embodiment, the hardware-based fine-grained reset is optimized to be hardened against soft errors and single event upsets that are hardware rather than software in nature. Software used in embedded systems is typically highly secure and heavily validated. However, errors may still occur due to soft errors or other single event upsets in the hardware caused by false signals or data errors, which are typically triggered by cosmic rays or electrical noise introduced into the system (which should otherwise be fully functional). The hardware-based fine-grained reset provided by the embodiments described herein enables the system to automatically recover from such events without software intervention.

[0161] Fig.13 1 is a block diagram of a processing system 1300 that can be configured for fine-grained reset according to an embodiment. The processing system 1300 includes a set of computing units 1304A-1304N, which can be Figure 61304B. The computing units 1304A-1304N execute threads dispatched by the scheduler microcontroller 1310. The scheduler microcontroller is a microcontroller that executes software-updatable firmware that implements the complex scheduling, preemption, and work distribution tasks of the system 1300 (including fine-grained compute preemption and reallocation for implementing hardware-based fine-grained resets). The computing units 1304A-1304N use a set of shared resources 1318 to execute threads scheduled by the scheduler microcontroller 1310. The shared resources 1318 include resources such as texture units, shared caches, and fixed-function logic. The processing system 1300 additionally includes a context storage that maintains a set of context data 1322A-1322N for the computing units 1304A-1304B. The context data 1322A-1322N can be stored in a dedicated portion of on-chip memory in the processing system 1300.

[0162] In one embodiment, processing system 1300 supports variable granularity fine-grained resets via the use of reset blocks 1320A-1320N. Each reset block 1320A-1320N defines reset boundaries for one or more compute units 1304A-1304N. Computing units within a reset block can be reset independently of other computing units in other reset blocks, thereby allowing hardware-based fault tolerance and recovery of subsets of computing resources within system 1300 while threads continue to execute on other computing resources. For various embodiments, the granularity of the reset blocks is different. In one embodiment, each individual computing unit represents a separate reset block, so that, for example, computing unit 1302A includes a single computing unit with a reset boundary defined by reset block 1320A. In one embodiment, multiple computing units are included in each reset block. For example, each reset block 1320A-1320N may define a processing cluster of computing units (e.g., Figure 2C The reset boundary of the processing cluster 214) of Figure 2A and Figure 2C processing cluster.

[0163] In one embodiment, when a computing unit within a reset block encounters an unrecoverable hardware failure, instead of resetting the entire rendering or computing pipeline and the associated computing units 1304A-1304N, execution may be stopped only within the reset block of the failed computing unit. A set of unfinished threads to be processed on the computing units within the reset block may then be reallocated to other computing units within other reset blocks. The reallocation of threads may operate similarly to a preemption event. The context state on one or more failed computing units may be saved to the appropriate blocks of context data 1322A-1322N. The pending threads on one or more failed computing units may be migrated to other computing units, and when these threads become active on the new computing units, the saved state of the threads may be restored from context data 1322A-1322N.

[0164] Events that cause failures within a faulty computing unit may also cause data corruption, which may destroy the state information of a thread. For example, if a computing unit encounters a hardware failure due to a bit flip in memory, the register state of one or more threads of the faulty computing unit may contain incorrect data. In one embodiment, the checkpoint context state of each reset block 1320A-1320N is maintained in context data 1322A-1322N. For example, when a group of threads are dispatched to a computing unit within a reset block or when a reset block-wide preemption event occurs, the checkpoint context state can be stored. The context loaded onto the computing unit of the reset block can be temporarily maintained until the executing thread is completed. If a hardware failure occurs in a computing unit, the context state of the faulty computing unit can be discarded, and the pending threads can be reallocated for execution on other computing units.

[0165] In one embodiment, logic for implementing fine-grained resets is implemented within the scheduler microcontroller 1310, which includes firmware logic to continuously monitor the execution state of the computing units within each reset block 1320A-1320B. In one embodiment, each reset block 1320A-1320N includes logic for supporting the scheduler microcontroller 1310. For example, and in one embodiment, each reset block 1320A-1320N includes an interrupt module 1325A-1325N to trigger an interrupt to the scheduler microcontroller 1310 in the event that the reset block detects a fault within the computing unit. The reset blocks 1320A-1320N may include fault detection logic to determine whether the computing unit within the reset block encounters a fault. The interrupt modules 1325A-1325N of the reset blocks 1320A-1320N may then interrupt the scheduler microcontroller 1310. The scheduler microcontroller may handle the interrupt by reallocating the threads within the fault reset block and resetting the faulty computing unit. Once a compute unit 1304A-1304N is reset, the compute unit may begin accepting dispatches of new threads.

[0166] Fig.14 1400 is a flow chart of fine-grained reset logic according to an embodiment. The fine-grained reset logic 1400 may reside in a scheduler microcontroller, such as a scheduler microcontroller. Fig.13 The fine-grained reset logic 1400 enables a hardware reset of one or more computing units within a reset block in response to a hardware fault such as a soft error or another form of single event upset. Once the fault detection logic notices a faulty computing unit, the reset logic 1400 may receive a notification that the computing unit needs to be reset, as shown at block 1402. In one embodiment, the notification is received as an interrupt from a reset block that defines a reset boundary for the computing unit.

[0167] Once the reset logic 1400 has received notification that a computing unit needs to be reset, the logic can determine whether the current context state of the computing unit is recoverable, as shown in block 1403. If the hardware failure encountered by the computing unit does not result in corruption of the context state of the executing thread, the current context state is recoverable. If the current context state is recoverable at block 1403, the reset logic 1400 can save the current context state of the thread on the computing unit, as shown in 1406. The current context state can be saved to the on-die context save memory. The reset logic 1400 can then migrate the thread to a different computing unit, as shown in 1408, and restore the context saved by the migrated thread at block 1410.

[0168] If the reset logic 1400 determines at block 1403 that the current context state is not recoverable, then at block 1405, the logic may reallocate the thread on the compute unit to a different compute unit. The reallocation of threads is enabled by tracking the threads that have been assigned to any particular compute unit. In one embodiment, the logic will reallocate threads to compute units in different reset blocks. At block 1407, the reset logic 1400 may be configured to restore the checkpoint context of the reallocated thread. The checkpoint context may be the context of the thread that was previously saved to the context save memory at the checkpoint of the thread (e.g., when resuming the thread from preemption). Restoring the checkpoint context may allow the thread to start execution from the checkpoint, rather than from the original initialized state.

[0169] Once threads on a compute block have been migrated or reassigned, fine-grained reset logic 1400 can initiate a reset of the compute unit while other compute units continue thread execution. In one embodiment, compute units can be reset on an individual basis. In one embodiment, compute units are reset in groups, where all compute units within a reset block are reset, such as Fig.14 . When multiple computing units are reset into a block in response to a hardware failure at a computing unit within the block, the thread states of all computing units within the reset block are saved. In such an embodiment, each reset block may have dedicated space in an on-chip context save memory, and a snapshot of the context state of the group of computing units within the reset block is sometimes saved to the dedicated on-chip context save memory of the reset block. The snapshot state may be used as a checkpoint context, for example, as shown at block 1407.

[0170] Fig.151 is a block diagram of a data processing system 1500 according to an embodiment. The data processing system 1500 is a heterogeneous processing system having a processor 1502, a unified memory 1510, and a GPGPU 1520. The processor 1502 and the GPGPU 1520 may be any of a processor and a GPGPU / parallel processor as described herein. The processor 1502 may execute instructions for a compiler 1515 stored in a system memory 1512. The compiler 1515 is executed on the processor 1502 to compile a source code 1514A into a compiled code 1514B. The compiled code 1514B may include code that may be executed by the processor 1502 and / or code that may be executed by the GPGPU 1520. During compilation, the compiler 1515 may perform operations to insert metadata, including hints about the level of data parallelism present in the compiled code 1514B and / or hints about data locality associated with threads to be dispatched based on the compiled code 1514B. Compiler 1515 may include the information necessary to perform such operations, or may perform operations with the help of runtime library 1516. Runtime library 1516 may also facilitate compilation of source code 1514 by compiler 1515, and may also include instructions that are linked with compiled code 1514B at runtime to facilitate execution on GPGPU 1520.

[0171] Unified memory 1510 represents a unified address space accessible by processor 1502 and GPGPU 1520. Unified memory includes system memory 1512 and GPGPU memory 1518. GPGPU memory 1518 includes GPGPU local memory 1528 within GPGPU 1520, and may also include some or all of system memory 1512. For example, compiled code 1514B stored in system memory 1512 may also be mapped into GPGPU memory 1518 for access by GPGPU 1520.

[0172] GPGPU 1520 includes a plurality of computing blocks 1522A-1522N, which may be Figure 6 1520 also includes a set of registers 1524 that can be shared between the compute modules 1522A-1522N, a cache memory 1526, and a preemption module 1525. The preemption module 1525 can be configured to manage the preemption and context switching of the compute blocks of the thread groups and subgroups described herein. The GPGPU also includes a reset module 1527 that is configured to perform reset operations of the reset blocks, such as, Fig.13The GPGPU 1520 may additionally include a GPGPU local memory 1528, which is a physical memory that shares a graphics card or a multi-chip module with the GPGPU 1520.

[0173] In one embodiment, each of the computing blocks 1522A-1522N includes one or more TLBs and cache memories shared between the computing clusters within the computing blocks 1522A-1522N. By attempting to schedule threads that will access common data to the same computing block, the common resources shared between the computing elements of the computing blocks can be efficiently utilized. Additional sample graphics processing system

[0174] Details of the embodiments described above may be incorporated into the graphics processing system and device described below. Figure 16 to Figure 29 The graphics processing systems and devices of exemplify alternative systems and graphics processing hardware that may implement any and all of the techniques described above. Additional sample graphics processing system overview

[0175] Fig.16 16 is a block diagram of a processing system 1600 according to an embodiment. In various embodiments, the system 1600 includes one or more processors 1602 and one or more graphics processors 1608, and may be a single processor desktop system, a multi-processor workstation system, or a server system with a large number of processors 1602 or processor cores 1607. In one embodiment, the system 1600 is a processing platform incorporated into a system on a chip (SoC) integrated circuit for use in a mobile device, handheld device, or embedded device.

[0176] Embodiments of system 1600 may include or incorporate a server-based game platform, a game console, including a game and media console, a mobile game console, a handheld game console, or an online game console. In some embodiments, system 1600 is a mobile phone, a smart phone, a tablet computing device, or a mobile Internet device. Data processing system 1600 may also include a wearable device (such as a smart watch wearable device, a smart glasses device, an augmented reality device, or a virtual reality device), coupled to the wearable device, or integrated in the wearable device. In some embodiments, data processing system 1600 is a television or set-top box device having one or more processors 1602 and a graphical interface generated by one or more graphics processors 1608.

[0177] In some embodiments, one or more processors 1602 each include one or more processor cores 1607 for processing instructions, which perform the operation of the system and user software when executed. In some embodiments, each processor core in the one or more processor cores 1607 is configured to process a specific instruction set 1609. In some embodiments, the instruction set 1609 can facilitate complex instruction set computing (CISC), reduced instruction set computing (RISC), or computing via very long instruction words (VLIW). Multiple processor cores 1607 can each process different instruction sets 1609, and the instruction set may include instructions for facilitating emulation of other instruction sets. The processor core 1607 may also include other processing devices, such as a digital signal processor (DSP).

[0178] In some embodiments, the processor 1602 includes a cache memory 1604. Depending on the architecture, the processor 1602 may have a single internal cache or multiple levels of internal cache. In some embodiments, the cache memory is shared among the components of the processor 1602. In some embodiments, the processor 1602 also uses an external cache (e.g., a level 3 (L3) cache or a last level cache (LLC)) (not shown), and known cache coherence techniques may be used to share the external cache among the processor cores 1607. Additionally, a register file 1606 is included in the processor 1602, which may include different types of registers (e.g., integer registers, floating point registers, status registers, and instruction pointer registers) for storing different types of data. Some registers may be general purpose registers, while other registers may be specific to the design of the processor 1602.

[0179] In some embodiments, the processor 1602 is coupled to a processor bus 1610, which is used to transmit communication signals, such as address, data, or control signals, between the processor 1602 and other components within the system 1600. In one embodiment, the system 1600 uses an exemplary 'hub' system architecture, including a memory controller hub 1616 and an input-output (I / O) controller hub 1630. The memory controller hub 1616 facilitates communication between memory devices and other components of the system 1600, while the I / O controller hub (ICH) 1630 provides connections to I / O devices via a local I / O bus. In one embodiment, the logic of the memory controller hub 1616 is integrated within the processor.

[0180] Memory device 1620 may be a dynamic random access memory (DRAM) device, a static random access memory (SRAM) device, a flash memory device, a phase change memory device, or some other memory device having suitable properties for use as processing memory. In one embodiment, memory device 1620 may operate as system memory for system 1600 to store data 1622 and instructions 1621 for use when one or more processors 1602 execute applications or processes. Memory controller hub 1616 is also coupled to an optional external graphics processor 1612, which may communicate with one or more graphics processors 1608 in processor 1602 to perform graphics and media operations.

[0181] In some embodiments, the ICH 1630 enables peripheral components to be connected to the memory devices 1620 and the processor 1602 via a high-speed I / O bus. The I / O peripherals include, but are not limited to, an audio controller 1646, a firmware interface 1628, a wireless transceiver 1626 (e.g., Wi-Fi, Bluetooth), a data storage device 1624 (e.g., a hard drive, flash memory, etc.), and a traditional I / O controller 1640 for coupling legacy (e.g., Personal System 2 (PS / 2)) devices to the system. One or more Universal Serial Bus (USB) controllers 1642 connect multiple input devices, such as a keyboard and mouse 1644 combination. A network controller 1634 may also be coupled to the ICH 1630. In some embodiments, a high-performance network controller (not shown) is coupled to the processor bus 1610. It should be understood that the system 1600 shown is exemplary and not limiting, as other types of data processing systems configured in different ways may also be used. For example, I / O controller hub 1630 may be integrated within one or more processors 1602 , or memory controller hub 1616 and I / O controller hub 1630 may be integrated within a discrete external graphics processor (such as external graphics processor 1612 ).

[0182] Fig.17 is a block diagram of an embodiment of a processor 1700 having one or more processor cores 1702A- 1702N, an integrated memory controller 1714 , and an integrated graphics processor 1708 . Fig.17Those elements having the same reference numbers (or names) as those in any other figure herein may operate or function in any manner similar to, but not limited to, those described elsewhere herein. Processor 1700 may include additional cores up to and including additional core 1702N represented by a dashed box. Processor cores 1702A to 1702N each include one or more internal cache units 1704A to 1704N. In some embodiments, each processor core may also access one or more shared cache units 1706.

[0183] Internal cache units 1704A to 1704N and shared cache unit 1706 represent a cache memory hierarchy internal to processor 1700. The cache memory hierarchy may include at least one level of instruction and data cache within each processor core and one or more levels of shared mid-level cache, such as level 2 (L2), level 3 (L3), level 4 (L4), or other levels of cache, where the highest level of cache is classified as LLC before external memory. In some embodiments, cache coherence logic maintains coherence between each cache unit 1706 and 1704A to 1704N.

[0184] In some embodiments, the processor 1700 may further include a set of one or more bus controller units 1716 and a system agent core 1710. The one or more bus controller units 1716 manage a set of peripheral buses, such as one or more peripheral component interconnect buses (e.g., PCI, PCI Express). The system agent core 1710 provides management functions for each processor component. In some embodiments, the system agent core 1710 includes one or more integrated memory controllers 1714 for managing access to each external memory device (not shown).

[0185] In some embodiments, one or more of the processor cores 1702A to 1702N include support for simultaneous multithreading. In such embodiments, the system agent core 1710 includes components for coordinating and operating the cores 1702A to 1702N during multithreaded processing. In addition, the system agent core 1710 may also include a power control unit (PCU) including logic and components for adjusting the power state of the processor cores 1702A to 1702N and the graphics processor 1708.

[0186] In some embodiments, in addition, the processor 1700 further includes a graphics processor 1708 for performing graphics processing operations. In some embodiments, the graphics processor 1708 is coupled to a set of shared cache units 1706 and a system agent core 1710, which includes one or more integrated memory controllers 1714. In some embodiments, a display controller 1711 is coupled to the graphics processor 1708 to drive the graphics processor output to one or more coupled displays. In some embodiments, the display controller 1711 can be a separate module coupled to the graphics processor via at least one interconnect, or can be integrated within the graphics processor 1708 or the system agent core 1710.

[0187] In some embodiments, a ring-based interconnect unit 1712 is used to couple the internal components of the processor 1700. However, alternative interconnect units may be used, such as point-to-point interconnects, switched interconnects, or other technologies, including those well known in the art. In some embodiments, the graphics processor 1708 is coupled to the ring interconnect 1712 via an I / O link 1713.

[0188] Exemplary I / O links 1713 represent at least one of a plurality of varieties of I / O interconnects, including package I / O interconnects that facilitate communication between various processor components and high-performance embedded memory modules 1718 (such as eDRAM modules). In some embodiments, each of processor cores 1702A to 1702N and graphics processor 1708 use embedded memory modules 1718 as a shared last-level cache.

[0189] In some embodiments, processor cores 1702A to 1702N are homogeneous cores that execute the same instruction set architecture. In another embodiment, processor cores 1702A to 1702N are heterogeneous in terms of instruction set architecture (ISA), wherein one or more of processor cores 1702A to 1702N execute a first instruction set, while at least one of the other cores executes a subset of the first instruction set or a different instruction set. In one embodiment, processor cores 1702A to 1702N are homogeneous in terms of microarchitecture, wherein one or more cores with relatively high power consumption are coupled with one or more power cores with lower power consumption. In addition, processor 1700 may be implemented on one or more chips or as a SoC integrated circuit having the components shown in addition to other components.

[0190] Fig.181 is a block diagram of a graphics processor 1800, which may be a discrete graphics processing unit or may be a graphics processor integrated with multiple processing cores. In some embodiments, the graphics processor communicates with memory via a mapped I / O interface to registers on the graphics processor and using commands placed in processor memory. In some embodiments, the graphics processor 1800 includes a memory interface 1814 for accessing memory. The memory interface 1814 may be an interface to local memory, one or more internal caches, one or more shared external caches, and / or to system memory.

[0191] In some embodiments, the graphics processor 1800 also includes a display controller 1802 for driving display output data to a display device 1820. The display controller 1802 includes hardware for one or more overlapping planes of the display and a composition of multiple layers of video or user interface elements. In some embodiments, the graphics processor 1800 includes a video codec engine 1806 for encoding, decoding, or media code conversion to, from, or between one or more media coding formats, including but not limited to: Moving Picture Experts Group (MPEG) (such as MPEG-2), Advanced Video Coding (AVC) format (such as H.264 / MPEG-4 AVC), and Society of Motion Picture & Television Engineers (SMPTE) 421M / VC-1, and Joint Photographic Experts Group (JPEG) format (such as JPEG, and Motion JPEG (MJPEG) format).

[0192] In some embodiments, graphics processor 1800 includes a block image transfer (BLIT) engine 1804 for performing two-dimensional (2D) rasterizer operations including, for example, bit-boundary block transfers. However, in one embodiment, 2D graphics operations are performed using one or more components of a graphics processing engine (GPE) 1810. In some embodiments, GPE 1810 is a compute engine for performing graphics operations, including three-dimensional (3D) graphics operations and media operations.

[0193] In some embodiments, GPE 1810 includes a 3D pipeline 1812 for performing 3D operations, such as rendering three-dimensional images and scenes using processing functions that act on 3D primitive shapes (e.g., rectangles, triangles, etc.). 3D pipeline 1812 includes programmable and fixed functional elements that perform various tasks within the elements and / or generated execution threads to 3D / media subsystem 1815. Although 3D pipeline 1812 can be used to perform media operations, embodiments of GPE 1810 also include a media pipeline 1816 that is specifically used to perform media operations, such as video post-processing and image enhancement.

[0194] In some embodiments, the media pipeline 1816 includes fixed-function or programmable logic units to replace or perform one or more specialized media operations, such as video decoding acceleration, video deinterlacing, and video encoding acceleration, on behalf of the video codec engine 1806. In some embodiments, in addition, the media pipeline 1816 also includes a thread generation unit to generate threads for execution on the 3D / media subsystem 1815. The generated threads perform calculations for media operations on one or more graphics execution units included in the 3D / media subsystem 1815.

[0195] In some embodiments, the 3D / media subsystem 1815 includes logic for executing threads generated by the 3D pipeline 1812 and the media pipeline 1816. In one embodiment, the pipeline sends thread execution requests to the 3D / media subsystem 1815, which includes thread dispatch logic for arbitrating and dispatching each request to available thread execution resources. The execution resources include an array of graphics execution units for processing 3D and media threads. In some embodiments, the 3D / media subsystem 1815 includes one or more internal caches for thread instructions and data. In some embodiments, the subsystem also includes shared memory (including registers and addressable memory) to share data between threads and for storing output data. Additional Exemplary Graphics Processing Engines

[0196] Fig.19 is a block diagram of a graphics processing engine 1910 of a graphics processor according to some embodiments. In one embodiment, the graphics processing engine (GPE) 1910 is Fig.18 A version of the GPE 1810 is shown. Fig.19 Those elements having the same reference number (or name) as elements in any other figure herein may operate or function in any manner similar to, but not limited to, those described elsewhere herein. Fig.18 1910. The 3D pipeline 1812 and the media pipeline 1816 of the GPE 1910. The media pipeline 1816 is optional in some embodiments of the GPE 1910 and may not be explicitly included in the GPE 1910. For example and in at least one embodiment, separate media and / or image processors are coupled to the GPE 1910.

[0197] In some embodiments, GPE 1910 is coupled to or includes a command stream converter 1903, which provides a command stream to 3D pipeline 1812 and / or media pipeline 1816. In some embodiments, command stream converter 1903 is coupled to a memory, which may be a system memory, or one or more cache memories of an internal cache memory and a shared cache memory. In some embodiments, command stream converter 1903 receives commands from the memory and sends these commands to 3D pipeline 1812 and / or media pipeline 1816. The commands are instructions obtained from a ring buffer storing commands for 3D pipeline 1812 and media pipeline 1816. In one embodiment, in addition, the ring buffer may also include a batch command buffer storing multiple batches of multiple commands. Commands for 3D pipeline 1812 may also include references to data stored in memory, such as, but not limited to, vertex and geometry data for 3D pipeline 1812 and / or image data and memory objects for media pipeline 1816. The 3D pipeline 1812 and the media pipeline 1816 process the commands by performing operations via logic within the respective pipelines or by dispatching one or more execution threads to the execution unit array 1914 .

[0198] In various embodiments, the 3D pipeline 1812 can execute one or more shader programs, such as vertex shaders, geometry shaders, pixel shaders, fragment shaders, compute shaders, or other shader programs, by processing instructions and dispatching execution threads to the graphics core array 1914. The graphics core array 1914 provides a unified execution resource block. The multi-purpose execution logic (e.g., execution unit) within the graphics core array 1914 includes support for various 3D API shader languages ​​and can execute multiple simultaneous execution threads associated with multiple shaders.

[0199] In some embodiments, graphics core array 1914 also includes execution logic for performing media functions such as video and / or image processing. In one embodiment, in addition to graphics processing operations, the execution unit also includes general logic that can be programmed to perform parallel general computing operations. The general logic can be connected to Fig.16 (multiple) processor cores 1607 or Fig.17 The general logic within cores 1702A to 1702N performs processing operations in parallel or in combination.

[0200] Output data generated by threads executing on graphics core array 1914 can output data to memory in unified return buffer (URB) 1918. URB 1918 can store data for multiple threads. In some embodiments, URB 1918 can be used to send data between different threads executing on graphics core array 1914. In some embodiments, URB 1918 can also be used for synchronization between threads on the graphics core array and fixed function logic within shared function logic 1920.

[0201] In some embodiments, graphics core array 1914 is scalable such that the array includes a variable number of graphics cores each having a variable number of execution units based on the target power and performance level of GPE 1910. In one embodiment, execution resources are dynamically scalable such that execution resources can be enabled or disabled as needed.

[0202] The graphics core array 1914 is coupled to shared function logic 1920, which includes a plurality of resources shared between the graphics cores in the graphics core array. The shared functions within the shared function logic 1920 are hardware logic units that provide specialized supplementary functions to the graphics core array 1914. In various embodiments, the shared function logic 1920 includes, but is not limited to, samplers 1921, math 1922, and inter-thread communication (ITC) 1923 logic. In addition, some embodiments implement one or more caches 1925 within the shared function logic 1920. The shared functions are implemented in situations where the demand for a given specialized function is insufficient to be included in the graphics core array 1914. Instead, a single instance of the specialized function is implemented as an independent entity in the shared function logic 1920 and shared between execution resources within the graphics core array 1914. The exact set of functions shared between and included within the graphics core array 1914 varies between embodiments.

[0203] Fig. 20 is a block diagram of another embodiment of a graphics processor 2000 . Fig. 20 Those elements having the same reference numbers (or names) as elements in any other figure herein may operate or function in any manner similar to, but not limited to, those described elsewhere herein.

[0204] In some embodiments, graphics processor 2000 includes ring interconnect 2002, pipeline front end 2004, media engine 2037, and graphics cores 2080A to 2080N. In some embodiments, ring interconnect 2002 couples the graphics processor to other processing units, including other graphics processors or one or more general-purpose processor cores. In some embodiments, the graphics processor is one of multiple processors integrated into a multi-core processing system.

[0205] In some embodiments, the graphics processor 2000 receives batches of commands via a ring interconnect 2002. The incoming commands are interpreted by a command stream converter 2003 in a pipeline front end 2004. In some embodiments, the graphics processor 2000 includes scalable execution logic for performing 3D geometry processing and media processing via (multiple) graphics cores 2080A to 2080N. For 3D geometry processing commands, the command stream converter 2003 supplies the commands to a geometry pipeline 2036. For at least some media processing commands, the command stream converter 2003 supplies the commands to a video front end 2034, which is coupled to a media engine 2037. In some embodiments, the media engine 2037 includes a video quality engine (VQE) 2030 for video and image post-processing and a multi-format encoding / decoding (MFX) 2033 engine for providing hardware accelerated media data encoding and decoding. In some embodiments, the geometry pipeline 2036 and the media engine 2037 each generate an execution thread, which is used for thread execution resources provided by at least one graphics core 2080A.

[0206] In some embodiments, the graphics processor 2000 includes an extensible thread execution resource characterization module core 2080A to 2080N (sometimes referred to as a core slice), each of which has a plurality of sub-cores 2050A to 550N, 2060A to 2060N (sometimes referred to as a core sub-slice). In some embodiments, the graphics processor 2000 may have any number of graphics cores 2080A to 2080N. In some embodiments, the graphics processor 2000 includes a graphics core 2080A, which has at least a first sub-core 2050A and a second sub-core 2060A. In other embodiments, the graphics processor is a low-power processor having a single sub-core (e.g., 2050A). In some embodiments, the graphics processor 2000 includes a plurality of graphics cores 2080A to 2080N, each of which includes a group of first sub-cores 2050A to 2050N and a group of second sub-cores 2060A to 2060N. Each of the group of first sub-cores 2050A to 2050N includes at least a first group of execution units 2052A to 2052N and a media / texture sampler 2054A to 2054N. Each of the group of second sub-cores 2060A to 2060N includes at least a second group of execution units 2062A to 2062N and a sampler 2064A to 2064N. In some embodiments, each sub-core 2050A to 2050N, 2060A to 2060N shares a group of shared resources 2070A to 2070N. In some embodiments, the shared resources include a shared cache memory and a pixel operation logic. Other shared resources may also be included in various embodiments of the graphics processor. Additional Exemplary Execution Units

[0207] Fig.21 Thread execution logic 2100 is shown, which includes an array of processing elements employed in some embodiments of a GPE. Fig.21 Those elements having the same reference numbers (or names) as elements in any other figure herein may operate or function in any manner similar to, but not limited to, those described elsewhere herein.

[0208] In some embodiments, the thread execution logic 2100 includes a shader processor 2102, a thread dispatcher 2104, an instruction cache 2106, a scalable execution unit array including a plurality of execution units 2108A to 2108N, a sampler 2110, a data cache 2112, and a data port 2114. In one embodiment, the scalable execution unit array can be dynamically scaled by enabling or disabling one or more execution units (e.g., execution units 2108A, 2108B, 2108C, 2108D, up to any one of 2108N-1 and 2108N) based on the computational requirements of the workload. In one embodiment, the included components are interconnected via an interconnect structure that links to each of the components. In some embodiments, the thread execution logic 2100 includes one or more connections to a memory (such as a system memory or cache memory) through the instruction cache 2106, the data port 2114, the sampler 2110, and one or more of the execution unit arrays 2108A to 2108N. In some embodiments, each execution unit (e.g., 2108A) is an independently programmable general-purpose computing unit capable of executing multiple simultaneous hardware threads while processing multiple data elements in parallel for each thread. In various embodiments, the array of execution units 2108A to 2108N is scalable to include any number of separate execution units.

[0209] In some embodiments, execution units 2108A to 2108N are primarily used to execute shader programs. Shader processor 2102 can process various shader programs and dispatch execution threads associated with the shader programs via thread dispatcher 2104. In one embodiment, thread dispatcher includes logic for arbitrating thread initiation requests from graphics and media pipelines and instantiating the requested threads on one or more execution units 2108A to 2108N. For example, the geometry pipeline (e.g., Fig. 20 2036) can dispatch vertex processing, tessellation or geometry processing threads to thread execution logic 2100 ( Fig.21) for processing. In some embodiments, the thread dispatcher 2104 can also process runtime thread generation requests from executing shader programs.

[0210] In some embodiments, execution units 2108A to 2108N support instruction sets (the instruction sets include native support for many standard 3D graphics shader instructions), so that shader programs from graphics libraries (e.g., Direct3D and OpenGL) are executed with minimal conversion. These execution units support vertex and geometry processing (e.g., vertex programs, geometry programs, vertex shaders), pixel processing (e.g., pixel shaders, fragment shaders), and general processing (e.g., compute and media shaders). Each of execution units 2108A to 2108N is capable of executing multiple-issue single instruction multiple data (SIMD), and multi-threaded operations can achieve an efficient execution environment in the face of high latency memory access. Each hardware thread within each execution unit has a dedicated high-bandwidth register stack and associated independent thread state. For pipelines with integers, single-precision floating-point operations and double-precision floating-point operations, SIMD branch functions, logical operations, transcendental operations, and other miscellaneous operations, execution is multiple issues per clock. While waiting for data from memory or one of the shared functions, dependency logic within execution units 2108A to 2108N causes the waiting thread to sleep until the requested data has returned. While the waiting thread is sleeping, hardware resources may be dedicated to processing other threads. For example, during a delay associated with a vertex shader operation, an execution unit may execute operations of a pixel shader, a fragment shader, or another type of shader program including a different vertex shader.

[0211] Each of the execution units 2108A to 2108N operates on an array of data elements. The number of data elements is the "execution size," or number of channels of an instruction. An execution channel is a logical unit that performs 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, the execution units 2108A to 2108N support integer and floating point data types.

[0212] The execution unit instruction set includes SIMD instructions. Various data elements can be stored in registers as compressed data types, and the execution unit will process various elements based on the data size of the element. For example, when operating on a 256-bit wide vector, the 256-bit vector is stored in a register, and the execution unit operates on the vector as four separate 64-bit compressed data elements (data elements of quadruple word length (QW) size), eight separate 32-bit compressed data elements (data elements of double word length (DW) size), sixteen separate 16-bit compressed data elements (data elements of word length (W) size), or thirty-two separate 8-bit data elements (data elements of byte (B) size). However, different vector widths and register sizes are possible.

[0213] One or more internal instruction caches (e.g., 2106) are included in the thread execution logic 2100 to cache thread instructions for the execution unit. In some embodiments, one or more data caches (e.g., 2112) are included to cache thread data during thread execution. In some embodiments, a sampler 2110 is included to provide texture sampling for 3D operations and media sampling for media operations. In some embodiments, the sampler 2110 includes a dedicated texture or media sampling function to process texture or media data during the sampling process before providing the sampled data to the execution unit.

[0214] During execution, the graphics and media pipeline sends a thread initiation request to the thread execution logic 2100 via the thread generation and dispatch logic. Once a set of geometric objects has been processed and rasterized into pixel data, the pixel processor logic (e.g., pixel shader logic, fragment shader logic, etc.) within the shader processor 2102 is called to further calculate output information and cause the result to be written to the output surface (e.g., color buffer, depth buffer, stencil printing buffer, etc.). In some embodiments, the pixel shader or fragment shader calculates the value of each vertex attribute, which is interpolated across the rasterized object. In some embodiments, the pixel processor logic within the shader processor 2102 then executes the pixel or fragment shader program supplied by the application programming interface (API). In order to execute the shader program, the shader processor 2102 dispatches the thread to the execution unit (e.g., 2108A) via the thread dispatcher 2104. In some embodiments, the pixel shader 2102 uses the texture sampling logic in the sampler 2110 to access the texture data in the texture map stored in the memory. Arithmetic operations on texture data and input geometry data compute pixel color data for each geometry fragment, or discard one or more pixels without further processing.

[0215] In some embodiments, data port 2114 provides a memory access mechanism for thread execution logic 2100 to output processed data to memory for processing on the graphics processor output pipeline. In some embodiments, data port 2114 includes or is coupled to one or more cache memories (e.g., data cache 2112) to cache data via the data port for memory access.

[0216] Fig. 22 2200 is a block diagram illustrating a graphics processor instruction format 2200 according to some embodiments. In one or more embodiments, a graphics processor execution unit supports an instruction set having instructions in multiple formats. Solid line boxes illustrate components that are typically included in execution unit instructions, while dashed lines include optional components or components that are only included in a subset of instructions. In some embodiments, the instruction format 2200 described and illustrated are macroinstructions because they are instructions supplied to the execution unit, as opposed to micro-operations generated from instruction decoding (once the instruction is processed).

[0217] In some embodiments, the graphics processor execution unit natively supports instructions in 128-bit instruction format 2210. 64-bit compact instruction format 2230 can be used for some instructions based on the selected instruction, multiple instruction options and the number of operands. Native 128-bit instruction format 2210 provides access to all instruction options, while some options and operations are limited to 64-bit format 2230. The native instructions available in 64-bit format 2230 vary according to the embodiment. In some embodiments, the instructions are partially compressed using a set of index values ​​in index field 2213. The execution unit hardware references a set of compression tables based on the index values ​​and uses the compression table output to reconstruct the native instructions in 128-bit instruction format 2210.

[0218] For each format, the instruction opcode 2212 defines the operation to be performed by the execution unit. The execution unit executes each instruction in parallel across multiple data elements of each operand. For example, in response to an add instruction, the execution unit performs a synchronous add operation across each color channel, and the color channel represents a texture element or a picture element. By default, the execution unit executes each instruction across all data channels of the operand. In some embodiments, the instruction control field 2214 enables control of certain execution options, such as channel selection (e.g., prediction) and data channel sorting (e.g., mixing). For instructions using the 128-bit instruction format 2210, the execution size field 2216 limits the number of data channels that will be executed in parallel. In some embodiments, the execution size field 2216 is not available for the 64-bit compact instruction format 2230.

[0219] Some execution unit instructions have up to three operands, including two source operands (src0 2220, src1 2222) and a destination 2218. In some embodiments, the execution unit supports dual destination instructions, where one of the destinations is implicit. Data manipulation instructions may have a third source operand (e.g., SRC2 2224), where the instruction opcode 2212 determines the number of source operands. The last source operand of an instruction may be an immediate (e.g., hard-coded) value passed with the instruction.

[0220] In some embodiments, the 128-bit instruction format 2210 includes an access / address mode field 2226, which defines, for example, whether direct register addressing mode or indirect register addressing mode is used. When direct register addressing mode is used, the register address of one or more operands is provided directly by bits in the instruction.

[0221] In some embodiments, the 128-bit instruction format 2210 includes an access / address mode field 2226, which specifies the address mode and / or access mode of the instruction. In one embodiment, the access mode is used to define the data access alignment for the instruction. Some embodiments support access modes, including 16-byte aligned access modes and 1-byte aligned access modes, wherein the byte alignment of the access mode determines the access alignment of the instruction operands. For example, when in the first mode, the instruction can use byte-aligned addressing for source operands and destination operands, and when in the second mode, the instruction can use 16-byte aligned addressing for all source operands and destination operands.

[0222] In one embodiment, the address mode portion of the access / address mode field 2226 determines whether the instruction uses direct addressing or indirect addressing. When direct register addressing mode is used, the bits in the instruction directly provide the register address of one or more operands. When indirect register addressing mode is used, the register address of one or more operands can be calculated based on the address register value and the address immediate field in the instruction.

[0223] In some embodiments, instructions are grouped based on the opcode 2212 bit field to simplify opcode decoding 2240. For 8-bit opcodes, the 4th, 5th, and 6th bits allow the execution unit to determine the type of opcode. The precise opcode grouping shown is exemplary only. In some embodiments, the move and logic opcode group 2242 includes data movement and logic instructions (e.g., move (mov), compare (cmp)). In some embodiments, the move and logic group 2242 shares five most significant bits (MSBs), wherein the move (mov) instruction adopts the form of 0000xxxxb, and the logic instruction adopts the form of 0001xxxxb. The flow control instruction group 2244 (e.g., call (call), jump (jmp)) includes instructions in the form of 0010xxxxb (e.g., 0x20). The miscellaneous instruction group 2246 includes a mixture of instructions, including synchronization instructions (e.g., wait (wait), send (send)) in the form of 0011xxxxb (e.g., 0x30). The parallel math instruction group 2248 includes component-wise arithmetic instructions (e.g., add, mul) in the form of 0100xxxxb (e.g., 0x40). The parallel math group 2248 performs arithmetic operations in parallel across data lanes. The vector math group 2250 includes arithmetic instructions (e.g., dp4) in the form of 0101xxxxb (e.g., 0x50). The vector math group performs arithmetic operations on vector operands, such as dot product operations. Exemplary Additional Graphics Pipeline

[0224] Fig.23 is a block diagram of another embodiment of a graphics processor 2300 . Fig.23 Those elements having the same reference numbers (or names) as elements in any other figure herein may operate or function in any manner similar to, but not limited to, those described elsewhere herein.

[0225] In some embodiments, the graphics processor 2300 includes a graphics pipeline 2320, a media pipeline 2330, a display engine 2340, a thread execution logic 2350, and a rendering output pipeline 2370. In some embodiments, the graphics processor 2300 is a graphics processor within a multi-core processing system that includes one or more general-purpose processing cores. The graphics processor is controlled by register writes to one or more control registers (not shown) or by commands issued to the graphics processor 2300 via the ring interconnect 2302. In some embodiments, the ring interconnect 2302 couples the graphics processor 2300 to other processing components, such as other graphics processors or general-purpose processors. Commands from the ring interconnect 2302 are interpreted by a command stream converter 2303, which supplies instructions to separate components of the graphics pipeline 2320 or the media pipeline 2330.

[0226] In some embodiments, command stream converter 2303 directs the operation of vertex fetcher 2305, which reads vertex data from memory and executes vertex processing commands provided by command stream converter 2303. In some embodiments, vertex fetcher 2305 provides vertex data to vertex shader 2307, which performs coordinate space transformation and lighting operations on each vertex. In some embodiments, vertex fetcher 2305 and vertex shader 2307 execute vertex processing instructions by dispatching execution threads to execution units 2352A to 2352B via thread dispatcher 2331.

[0227] In some embodiments, execution units 2352A-2352B are vector processor arrays with instruction sets for performing graphics and media operations. In some embodiments, execution units 2352A-2352B have an attached L1 cache 2351 that is dedicated to each array or shared between arrays. The cache can be configured as a data cache, an instruction cache, or a single cache that is partitioned to contain data and instructions in different partitions.

[0228] In some embodiments, the graphics pipeline 2320 includes a tessellation component for performing hardware accelerated tessellation of 3D objects. In some embodiments, the programmable hull shader 811 configures the tessellation operation. The programmable domain shader 817 provides back-end evaluation of the tessellation output. The tessellation 2313 operates at the direction of the hull shader 2311 and contains dedicated logic for generating a detailed set of geometric objects based on a coarse geometric model that is provided as input to the graphics pipeline 2320. In some embodiments, if tessellation is not used, the tessellation components (e.g., hull shader 2311, tessellation 2313, domain shader 2317) can be bypassed.

[0229] In some embodiments, the complete geometric object can be processed by the geometry shader 2319 via one or more threads dispatched to the execution units 2352A to 2352B, or can proceed directly to the clipper 2329. In some embodiments, the geometry shader operates on the entire geometric object (rather than vertices or vertex patches as in the previous stage of the graphics pipeline). If tessellation is disabled, the geometry shader 2319 receives input from the vertex shader 2307. In some embodiments, the geometry shader 2319 can be programmed by a geometry shader program to perform geometric tessellation when the tessellation unit is disabled. Before rasterization, the clipper 2329 processes the vertex data. The clipper 2329 can be a fixed-function clipper or a programmable clipper with clipping and geometry shader functions. In some embodiments, the rasterizer and depth test component 2373 in the rendering output pipeline 2370 dispatches a pixel shader to convert the geometric object into its per-pixel representation. In some embodiments, the pixel shader logic is included in the thread execution logic 2350. In some embodiments, an application may bypass the rasterizer and depth test component 2373 and access unrasterized vertex data via the outflow unit 2323 .

[0230] The graphics processor 2300 has an interconnect bus, interconnect structure, or some other interconnect mechanism that allows data and messages to be passed among the main components of the graphics processor. In some embodiments, execution units 2352A-2352B and associated cache(s) 2351, texture and media samplers 2354, and texture / sampler cache 2358 are interconnected via data ports 2356 to perform memory accesses and communicate with the processor's rendering output pipeline components. In some embodiments, samplers 2354, caches 2351, 2358, and execution units 2352A-2352B each have separate memory access paths.

[0231] In some embodiments, the rendering output pipeline 2370 includes a rasterizer and a depth test component 2373, which converts vertex-based objects into associated pixel-based representations. In some embodiments, the rasterizer logic includes a window device / masker unit for performing fixed-function triangle and line rasterization. Associated rendering cache 2378 and depth cache 2379 are also available in some embodiments. Pixel operation component 2377 performs pixel-based operations on data, but in some instances, pixel operations associated with 2D operations (e.g., using mixed bit block image transfer) are performed by 2D engine 2341, or replaced by display controller 2343 using overlapping display planes at display time. In some embodiments, a shared L3 cache 2375 can be used for all graphics components, thereby allowing data to be shared without using main system memory.

[0232] In some embodiments, the graphics processor media pipeline 2330 includes a media engine 2337 and a video front end 2334. In some embodiments, the video front end 2334 receives pipeline commands from the command stream converter 2303. In some embodiments, the media pipeline 2330 includes a separate command stream converter. In some embodiments, the video front end 2334 processes the media commands before sending the commands to the media engine 2337. In some embodiments, the media engine 2337 includes a thread generation function for generating threads for dispatching to the thread execution logic 2350 via the thread dispatcher 2331.

[0233] In some embodiments, the graphics processor 2300 includes a display engine 2340. In some embodiments, the display engine 2340 is external to the processor 2300 and is coupled to the graphics processor via the ring interconnect 2302, or some other interconnect bus or mechanism. In some embodiments, the display engine 2340 includes a 2D engine 2341 and a display controller 2343. In some embodiments, the display engine 2340 includes dedicated logic that can operate independently of the 3D pipeline. In some embodiments, the display controller 2343 is coupled to a display device (not shown), which can be a system integrated display device (such as in a laptop computer), or an external display device attached via a display device connector.

[0234] In some embodiments, graphics pipeline 2320 and media pipeline 2330 can be configured to perform operations based on multiple graphics and media programming interfaces and are not dedicated to any application programming interface (API). In some embodiments, the driver software of graphics processor converts the API dispatch dedicated to specific graphics or media library into a command that can be processed by graphics processor. In some embodiments, support is provided for all open graphics libraries (OpenGL), open computing language (OpenCL) and / or Vulkan graphics and computing API from Khronos Group. In some embodiments, support can also be provided for Microsoft's Direct3D library. In some embodiments, the combination of these libraries can be supported. Support can also be provided for open source computer vision library (OpenCV). If the mapping from the pipeline of future API to the pipeline of graphics processor can be made, the future API with compatible 3D pipeline will also be supported. Example Graphics Pipeline Programming

[0235] Fig.24A is a block diagram illustrating a graphics processor command format 2400 according to some embodiments. Fig. 24B is a block diagram illustrating a graphics processor command sequence 2410 according to an embodiment. Fig.24A The solid-line boxes in show 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 the graphics commands. Fig.24A The exemplary graphics processor command format 2400 includes a data field for identifying the target client 2402 of the command, a command operation code (opcode) 2404, and associated data 2406 for the command. Some commands also include a sub-opcode 2405 and a command size 2408.

[0236] In some embodiments, client 2402 defines a client unit of a graphics device that processes command data. In some embodiments, a graphics processor command parser checks the client field of each command to adjust the further processing of the command and routes the command data to a suitable client unit. In some embodiments, a graphics processor client unit includes a memory interface unit, a rendering unit, a 2D unit, a 3D unit, and a media unit. Each client unit has a corresponding processing pipeline that processes the command. Once the command is received by the client unit, the client unit reads an opcode 2404 and a sub-opcode 2405 (if present) to determine the operation to be performed. The client unit uses the information in the data field 2406 to execute the command. For some commands, it is expected that the command size 2408 explicitly defines the size of the command. In some embodiments, the command parser automatically determines the size of at least some of the commands in the command based on the command opcode. In some embodiments, the command is aligned via a multiple of a double word length.

[0237] Fig. 24B An exemplary graphics processor command sequence 2410 is shown in the flowchart in FIG. In some embodiments, software or firmware of a data processing system featuring an embodiment of a graphics processor uses the version of the command sequence shown to initiate, execute, and terminate a set of graphics operations. The sample command sequence is shown and described for exemplary purposes only, as the embodiments are not limited to these specific commands or this command sequence. Moreover, the commands may be issued as a batch of commands in a command sequence so that the graphics processor will process the command sequence in an at least partially simultaneous manner.

[0238] In some embodiments, the graphics processor command sequence 2410 may begin with a pipeline flush command 2412 to cause any active graphics pipeline to complete currently pending commands for that pipeline. In some embodiments, the 3D pipeline 2422 and the media pipeline 2424 are not operating simultaneously. The pipeline flush is performed to cause the active graphics pipeline to complete any pending commands. In response to the pipeline flush, the command parser for the graphics processor will stop command processing until the active drawing engine completes pending operations and invalidates the associated read cache. Optionally, any data marked as 'dirty' in the render cache may be flushed to memory. In some embodiments, the pipeline flush command 2412 may be used for pipeline synchronization or before placing the graphics processor in a low power state.

[0239] In some embodiments, pipeline select command 2413 is used when a command sequence requires the graphics processor to explicitly switch between pipelines. In some embodiments, pipeline select command 2413 is only required once in an execution context before issuing pipeline commands, unless the context is to issue commands for two pipelines. In some embodiments, pipeline flush command 2412 is required just before a pipeline switch via pipeline select command 2413.

[0240] In some embodiments, pipeline control commands 2414 configure the graphics pipeline for operation and are used to program 3D pipeline 2422 and media pipeline 2424. In some embodiments, pipeline control commands 2414 configure the pipeline state of the active pipeline. In one embodiment, pipeline control commands 2414 are used for pipeline synchronization and for clearing data from one or more cache memories within the active pipeline before processing a batch of commands.

[0241] In some embodiments, return buffer state command 2416 is used to configure a set of return buffers for corresponding pipelines to write data. Some pipeline operations require allocating, selecting, or configuring one or more return buffers, and the operation writes intermediate data to the one or more return buffers during processing. In some embodiments, the graphics processor also uses one or more return buffers to store output data and perform cross-thread communication. In some embodiments, return buffer state 2416 includes selecting the size and number of return buffers for the set of pipeline operations.

[0242] The remaining commands in the command sequence differ based on the active pipeline for operation. Based on pipeline decision 2420 , the command sequence is tailored for either the 3D pipeline 2422 starting at 3D pipeline state 2430 , or the media pipeline 2424 starting at media pipeline state 2440 .

[0243] Commands for 3D pipeline state 2430 include 3D state setting commands for vertex buffer state, vertex element state, constant color state, depth buffer state, and other state variables to be configured before processing 3D primitive commands. The values ​​of these commands are determined at least in part based on the specific 3D API in use. In some embodiments, 3D pipeline state 2430 commands can also selectively disable or bypass specific pipeline elements if those elements are not to be used.

[0244] In some embodiments, 3D primitive 2432 commands are used to submit 3D primitives to be processed by the 3D pipeline. The commands and associated parameters passed to the graphics processor via the 3D primitive 2432 commands will be forwarded to the vertex acquisition function in the graphics pipeline. The vertex acquisition function uses the 3D primitive 2432 command data to generate multiple vertex data structures. The vertex data structures are stored in one or more return buffers. In some embodiments, 3D primitive 2432 commands are used to perform vertex operations on 3D primitives via vertex shaders. In order to process vertex shaders, the 3D pipeline 2422 dispatches the shader execution thread to the graphics processor execution unit.

[0245] In some embodiments, the 3D pipeline 2422 is triggered via an execution 2434 command or event. In some embodiments, a register write triggers the command execution. In some embodiments, the execution is triggered via a 'go' or 'kick' command in the command sequence. In one embodiment, the command execution is triggered using a pipeline synchronization command to clear the command sequence through the graphics pipeline dump. The 3D pipeline will perform geometry processing for the 3D primitives. Once the operation is completed, the generated geometric objects are rasterized and the pixel engine shades the generated pixels. For these operations, additional commands for controlling pixel shading and pixel backend operations may also be included.

[0246] In some embodiments, when performing media operations, the graphics processor command sequence 2410 follows the media pipeline 2424 path. Generally, the specific purpose and manner of programming for the media pipeline 2424 depends on the media or computing operation to be performed. During the media decoding process, specific media decoding operations can be offloaded to the media pipeline. In some embodiments, the media pipeline can also be bypassed, and the media decoding can be performed in whole or in part using resources provided by one or more general processing cores. In one embodiment, the media pipeline also includes elements for general purpose graphics processor unit (GPGPU) operations, wherein the graphics processor is used to perform SIMD vector operations using a compute shader program that is not explicitly related to rendering graphics primitives.

[0247] In some embodiments, the media pipeline 2424 is configured in a similar manner to the 3D pipeline 2422. A set of commands for configuring the media pipeline state 2440 is dispatched or placed into a command queue, before the media object commands 2442. In some embodiments, the commands for the media pipeline state 2440 include data for configuring the media pipeline elements that will be used to process the media objects. This includes data for configuring the video decoding and video encoding logic within the media pipeline, such as encoding or decoding formats. In some embodiments, the commands for the media pipeline state 2440 also support the use of one or more pointers to an "indirect" state element that contains a batch of state settings.

[0248] In some embodiments, media object commands 2442 supply pointers to media objects for processing by the media pipeline. The media object includes a memory buffer that contains video data to be processed. In some embodiments, all media pipeline states must be valid before issuing media object commands 2442. Once the pipeline state is configured and media object commands 2442 are queued, media pipeline 2424 is triggered via an execute 2444 command or an equivalent execution event (e.g., a register write). The output from media pipeline 2424 can then be post-processed by operations provided by 3D pipeline 2422 or media pipeline 2424. In some embodiments, GPGPU operations are configured and executed in a manner similar to media operations. Additional Exemplary Graphics Software Architecture

[0249] Fig.25 An exemplary graphics software architecture of a data processing system 2500 according to some embodiments is shown. In some embodiments, the software architecture includes a 3D graphics application 2510, an operating system 2520, and at least one processor 2530. In some embodiments, processor 2530 includes a graphics processor 2532 and one or more general purpose processor cores 2534. Graphics application 2510 and operating system 2520 are each executed in a system memory 2550 of the data processing system.

[0250] In some embodiments, the 3D graphics application 2510 includes one or more shader programs that include shader instructions 2512. The shader language instructions may be in a high-level shader language, such as a high-level shader language (HLSL) or an OpenGL shader language (GLSL). The application also includes executable instructions 2514 in a machine language suitable for execution by a general purpose processor core 2534. The application also includes graphics objects 2516 defined by vertex data.

[0251] In some embodiments, operating system 2520 is from Microsoft Corporation Operating system, dedicated UNIX operating system, or open source UNIX operating system using Linux kernel variant. Operating system 2520 can support graphics API 2522, such as Direct3D API, OpenGL API or Vulkan API. When Direct3D API is in use, operating system 2520 uses front-end shader compiler 2524 to compile any shader instruction 2512 in HLSL into a lower-level shader language. The compilation can be just-in-time (JIT) compilation, or the application executable shader precompilation. In some embodiments, in the process of compiling 3D graphics application 2510, high-level shaders are compiled into low-level shaders. In some embodiments, shader instructions 2512 are provided in an intermediate form, such as a version of the standard portable intermediate representation (SPIR) used by Vulkan API.

[0252] In some embodiments, the user mode graphics driver 2526 includes a backend shader compiler 2527 that converts shader instructions 2512 into hardware-specific representations. When using the OpenGL API, the shader instructions 2512 in the GLSL high-level language are passed to the user mode graphics driver 2526 for compilation. In some embodiments, the user mode graphics driver 2526 uses the operating system kernel mode function 2528 to communicate with the kernel mode graphics driver 2529. In some embodiments, the kernel mode graphics driver 2529 communicates with the graphics processor 2532 to dispatch commands and instructions. Example IP Core Implementation

[0253] One or more aspects of at least one embodiment may be implemented by representative code stored on a machine-readable medium, which represents and / or defines logic within an integrated circuit such as a processor. For example, a machine-readable medium may include instructions representing the various logics within a processor. When read by a machine, the instructions may enable the machine to manufacture logic for performing the techniques described herein. This type of representation (referred to as an "IP core") is a reusable unit of logic for an integrated circuit, which may be stored on a tangible, machine-readable medium as a hardware model describing the structure of the integrated circuit. The hardware model may be supplied to each consumer or manufacturing facility that loads the hardware model on a manufacturing machine that manufactures the integrated circuit. The integrated circuit may be manufactured so that the circuit performs the operations described in association with any of the embodiments described herein.

[0254] Fig.2626 is a block diagram showing an IP core development system 2600 that can be used to manufacture an integrated circuit to perform operations according to an embodiment. The IP core development system 2600 can be used to generate a modular, reusable design that can be incorporated into a larger design or used to build an entire integrated circuit (e.g., a SOC integrated circuit). The design facility 2630 can use a high-level programming language (e.g., C / C++) to generate a software simulation 2610 for the IP core design. The software simulation 2610 can be used to design, test and verify the behavior of the IP core using a simulation model 2612. The simulation model 2612 can include functional, behavioral and / or timing simulations. Then the register transfer level (RTL) design 2615 can be created or synthesized by the simulation model 2612. The RTL design 2615 is an abstraction of the behavior of an integrated circuit (including associated logic executed using the modeled digital signals) that models the flow of digital signals between hardware registers. In addition to the RTL design 2615, a lower level design at a logic level or transistor level can also be created, designed or synthesized. Thus, the specific details of the initial design and simulation can change.

[0255] The RTL design 2615 or equivalent can be further synthesized into a hardware model 2620 by the design facility, which can adopt a hardware description language (HDL) or some other representation of physical design data. The HDL can be further simulated or tested to verify the IP core design. The IP core design can be stored using a non-volatile memory 2640 (e.g., a hard disk, flash memory, or any non-volatile storage medium) for delivery to a third-party manufacturing facility 2665. Alternatively, the IP core design can be transmitted (e.g., via the Internet) via a wired connection 2650 or a wireless connection 2660. The manufacturing facility 2665 can then manufacture an integrated circuit based at least in part on the IP core design. The manufactured integrated circuit can be configured to perform operations according to at least one embodiment described herein. Exemplary System-on-Chip Integrated Circuit

[0256] Figure 27 to Figure 29 An exemplary integrated circuit and related graphics processor that can be manufactured using one or more IP cores according to various embodiments described herein are shown. In addition to what is shown, other logic and circuits may also be included, including additional graphics processors / cores, peripheral interface controllers, or general purpose processor cores.

[0257] Fig. 272700, which may be manufactured using one or more IP cores in accordance with an embodiment. The exemplary integrated circuit 2700 includes one or more application processors 2705 (e.g., CPUs), at least one graphics processor 2710, and may additionally include an image processor 2715 and / or a video processor 2720, any of which may be modular IP cores from the same or multiple different design facilities. The integrated circuit 2700 includes peripheral or bus logic, including a USB controller 2725, a UART controller 2730, an SPI / SDIO controller 2735, and an I 2 S / I 2 The integrated circuit may include a display device 2745 coupled to one or more of a high-definition multimedia interface (HDMI) controller 2750 and a mobile industry processor interface (MIPI) display interface 2755. Storage may be provided by a flash memory subsystem 2760 (including flash memory and a flash memory controller). A memory interface may be provided via a memory controller 2765 to access SDRAM or SRAM memory devices. In addition, some integrated circuits also include an embedded security engine 2770.

[0258] Fig.28 28 is a block diagram illustrating an exemplary graphics processor 2810 of a system-on-chip integrated circuit that may be fabricated using one or more IP cores in accordance with an embodiment. The graphics processor 2810 may be Fig. 27 A variation of the graphics processor 2710 of FIG. The graphics processor 2810 includes a vertex processor 2805 and one or more fragment processors 2815A to 2815N (e.g., 2815A, 2815B, 2815C, 2815D, all the way to 2815N-1 and 2815N). The graphics processor 2810 can execute different shader programs via separate logic, so that the vertex processor 2805 is optimized to perform operations of the vertex shader program, while one or more fragment processors 2815A to 2815N perform fragment (e.g., pixel) shading operations for fragment or pixel shader programs. The vertex processor 2805 performs the vertex processing stage of the 3D graphics pipeline and generates primitives and vertex data. (Multiple) fragment processors 2815A to 2815N use the primitives and vertex data generated by the vertex processor 2805 to generate a frame buffer displayed on a display device. In one embodiment, the fragment processor(s) 2815A-2815N are optimized to execute fragment shader programs provided in the OpenGL API, which can be used to perform similar operations as pixel shader programs provided in the Direct 3D API.

[0259] In addition, the graphics processor 2810 also includes one or more memory management units (MMUs) 2820A-2820B, one or more caches 2825A-2825B, and (multiple) circuit interconnects 2830A-2830B. The one or more MMUs 2820A-2820B provide virtual to physical address mappings for the graphics processor 2810, including for the vertex processor 2805 and / or one or more fragment processors 2815A-2815N, which can reference vertex or image / texture data stored in memory in addition to the vertex or image / texture data stored in the one or more caches 2825A-2825B. In one embodiment, the one or more MMUs 2820A-2820B can communicate with other MMUs within the system, including with Fig. 27 The graphics processor 2810 may be synchronized with one or more MMUs associated with one or more application processors 2705, image processor 2715, and / or video processor 2720 so that each processor 2705 to 2720 may participate in a shared or unified virtual memory system. According to an embodiment, one or more circuit interconnects 2830A to 2830B may enable the graphics processor 2810 to interact with other IP cores within the SoC via an internal bus of the SoC or via a direct connection.

[0260] Fig.29 2910 is a block diagram illustrating an additional exemplary graphics processor 2910 of a system-on-chip integrated circuit that may be fabricated using one or more IP cores in accordance with an embodiment. The graphics processor 2910 may be Fig. 27 A variation of the graphics processor 2710 of FIG. The graphics processor 2910 includes Fig.28 One or more MMUs 2820A-2820B, caches 2825A-2825B, and circuit interconnects 2830A-2830B of the integrated circuit 2800.

[0261] The graphics processor 2910 includes one or more shader cores 2915A to 2915N (e.g., 2915A, 2915B, 2915C, 2915D, 2915E, 2915F, all the way to 2915N-1 and 2915N), which provide a unified shader core architecture in which a single core or type or core can execute all types of programmable shader code including shader program code to implement vertex shaders, fragment shaders and / or compute shaders. The exact number of shader cores present may vary in embodiments and implementations. In addition, the graphics processor 2910 also includes an inter-core task manager 2905, which acts as a thread dispatcher for dispatching execution threads to one or more shader cores 2915A to 2915N and a tiling unit 2918 for accelerating tiling operations for tile-based rendering, wherein the rendering operations of a scene are subdivided in image space, for example to exploit local spatial consistency within a scene or to optimize the use of internal caches.

[0262] The following clauses and / or examples relate to specific embodiments or examples thereof. The details in these examples may be used anywhere in one or more embodiments. The various features of different embodiments or examples can be combined in various ways, with certain features being included and others being excluded, to accommodate a variety of different applications. Examples may include subject matter such as methods, devices for performing the actions of the methods, at least one machine-readable medium including instructions that, when executed by a machine, cause the machine to perform the actions of the methods, or the actions of a device or system according to the embodiments and examples described herein. The various components may be devices for performing the described operations or functions.

[0263] The embodiments described herein relate to specific configurations of hardware that is configured to perform certain operations or have predetermined functions, such as application specific integrated circuits (ASICs). Such electronic devices generally include a collection of one or more processors coupled to one or more other components, such as one or more storage devices (non-transitory machine-readable storage media), user input / output devices (e.g., keyboards, touch screens, and / or displays), and network connections. The coupling of the group of processors and other components is generally achieved through one or more buses and bridges (also referred to as bus controllers). The storage device and the signal carrying the network traffic represent one or more machine-readable storage media and machine-readable communication media, respectively. Therefore, the storage device of a given electronic device generally stores code and / or data for execution on a collection of one or more processors of the electronic device.

[0264] Of course, one or more parts of the embodiment can be implemented using different combinations of software, firmware and / or hardware. Throughout this specific embodiment, for the purpose of explanation, numerous specific details are set forth to provide a thorough understanding of the present invention. However, it is apparent to those skilled in the art that embodiments can be practiced without some of these specific details. In some instances, well-known structures and functions are not described in detail to avoid obscuring the inventive subject matter of the embodiment. Therefore, the scope and spirit of the present invention should be judged according to the appended claims.

Claims

1. A device comprising: A thread dispatcher for dispatching threads for execution; A computing unit, the computing unit having a single instruction multiple thread architecture, the computing unit being used to execute multiple concurrent threads; as well as A memory coupled to the computing unit, the memory being used to store a thread state of a suspended thread, wherein the computing unit is used to: Detecting that all threads on the computing unit are blocked and cannot execute, selecting a victim thread from the plurality of concurrent threads, suspending the victim thread, storing the thread state of the victim thread in the memory, and The victim thread is replaced with an additional thread to be executed.

2. The device according to claim 1, wherein: The computing unit is further configured to request the thread dispatcher to dispatch the additional thread to be executed.

3. The device according to claim 1, wherein: The computing unit is used to store the blocking status of the victim thread.

4. The device according to claim 3, wherein: The memory is used to store thread states of multiple suspended threads.

5. The device according to claim 4, wherein: The calculation unit is configured to store the thread state of the victim thread at an offset in the memory.

6. The device according to claim 5, wherein: The computation unit is configured to select the additional thread to be executed from the suspended threads having states stored in the memory.

7. The apparatus of claim 6, wherein the computing unit is configured to select a suspended thread in the memory based on a blocking condition associated with the suspended thread.

8. The device of claim 1, wherein: The device is a graphics processor.

9. The device of claim 1, wherein: The memory and the computing unit are located on the same integrated circuit.

10. A method comprising: Each of the plurality of concurrent threads of the computing unit of the detection processing device is blocked and cannot execute; selecting a victim thread from the plurality of concurrent threads; suspending the victim thread; storing the thread state of the victim thread in an on-chip memory coupled to the computing unit; as well as The victim thread is replaced with an additional thread to be executed.

11. The method of claim 10, additionally comprising: A thread dispatcher is requested by the computing unit to dispatch the additional thread to be executed.

12. The method of claim 10, additionally comprising: The blocking status of the victim thread is stored.

13. The method of claim 12, additionally comprising: storing thread states of a plurality of threads in the on-chip memory, each thread state being stored at a different offset within the on-chip memory; as well as The additional thread to be executed is selected from one of a plurality of threads having states stored to the on-chip memory.

14. The method of claim 13, additionally comprising: The additional thread is selected to be executed based on the stored blocking condition associated with the additional thread.

15. The method of claim 10, wherein: The processing device is a graphics processor.

16. A system-on-chip integrated circuit, comprising: Central Processing Unit CPU; as well as A graphics processing unit (GPU), the GPU is coupled to the CPU, the GPU and the CPU are on the same die, the GPU comprising: a thread dispatcher, the thread dispatcher is used to dispatch threads for execution; a computing unit, the computing unit has a single instruction multiple thread architecture, the computing unit is used to execute multiple concurrent threads; and a memory, the memory is coupled to the computing unit and is on the same die as the computing unit, the memory is used to store the thread state of the suspended thread; and The computing unit is used to: detect that all threads on the computing unit are blocked and cannot be executed, select a sacrifice thread from the multiple concurrent threads, suspend the sacrifice thread, store the thread state of the sacrifice thread in the memory, and replace the sacrifice thread with an additional thread to be executed.

17. The system on chip integrated circuit of claim 16, wherein: The computing unit is further configured to request the thread dispatcher to dispatch the additional thread to be executed.

18. The system on chip integrated circuit of claim 16, wherein: The computing unit is used to store the blocking status of the victim thread.

19. The system on chip integrated circuit of claim 18, wherein: The memory is for storing thread states of a plurality of suspended threads, and the computation unit is for selecting the additional thread to be executed from one of the plurality of threads having states stored to the memory.

20. The system on chip integrated circuit of claim 19, wherein: The computing unit is configured to select a suspended thread in the memory based on a stored blocking condition associated with the suspended thread.