Page faults and selective preemption
By introducing fine-grained preemption and context switching mechanisms into the graphics processor, the latency problem caused by page faults is solved, improving computational efficiency and resource utilization, and supporting multi-task parallel processing.
Patent Information
- Application Number
- CN201810310215.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2017-04-09
- Filing Date
- 2018-04-09
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2038-04-09
AI Technical Summary
Existing graphics processors (GPUs) suffer from time-consuming context switching processes caused by page faults when processing graphics data, which impacts computational efficiency, especially in multi-threaded parallel processing scenarios. Traditional global GPU context switching results in significant latency and computational loss.
By dividing the GPU's parallel execution blocks into smaller, more granular preemption boundaries, stopping and saving the hardware context only when a page fault occurs within a compute block, allowing other compute blocks to continue executing instructions, and scheduling new workgroups when necessary, fine-grained context switching and preemption are achieved.
It improves the computational efficiency of the graphics processor when facing page faults, reduces overall latency, supports simultaneous execution of multiple contexts, and optimizes resource utilization.
Smart Images

Figure CN108694691B_ABST
Abstract
Description
Technical Field
[0001] Embodiments relate generally to data processing, and more particularly to data processing via a general purpose graphics processing unit. Background Art
[0002] Current parallel graphics data processing includes systems and methods developed to perform specific operations on graphics data, such as, for example, linear interpolation, tessellation, rasterization, texture mapping, depth testing, etc. Traditionally, graphics processors have used fixed-function compute units to process graphics data; however, recently, portions of graphics processors have been made programmable, enabling such processors to support a wider variety of operations for processing vertex and tile data.
[0003] To further increase performance, graphics processors typically implement processing techniques such as pipelining, which attempts to process as much graphics data in parallel as possible across different parts of the graphics pipeline. Parallel graphics processors with a single instruction, multiple thread (SIMT) architecture are designed to maximize the amount of parallel processing in the graphics pipeline. In a SIMT architecture, groups of parallel threads attempt to execute program instructions together synchronously as often as possible to increase processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0004] In order that the above-described features of the present embodiment can be understood in detail, a more specific description of the embodiments briefly summarized above can be obtained by reference to the embodiments, some of which are illustrated in the accompanying drawings. However, it is to be noted that the drawings illustrate only typical embodiments and are not to be considered as limiting the scope thereof.
[0005] Figure 1 is a block diagram illustrating a computer system configured to implement one or more aspects of the embodiments described herein;
[0006] Figures 2A-2D illustrates a parallel processor assembly according to an embodiment;
[0007] Figure 3A-3B is a block diagram of a graphics multiprocessor according to an embodiment;
[0008] Figures 4A-4F An exemplary architecture is illustrated in which a plurality of GPUs are communicatively coupled to a plurality of multi-core processors;
[0009] Figure 5 is a conceptual diagram of a graphics processing pipeline according to an embodiment;
[0010] Figure 6 illustrates a subsystem for executing threads within a single instruction multiple data (SIMD) computing system according to an embodiment;
[0011] Figure 7 is a block diagram of an implementation subsystem within a processing array of a GPGPU according to an embodiment;
[0012] Figures 8A-8B is a flow chart of performing fine-grained context switching according to the logic of an embodiment;
[0013] Fig. 9 An instruction execution system according to an embodiment is illustrated;
[0014] Fig.10 An exemplary graph illustrating hints and associated per-thread register file usage;
[0015] Fig.11 is a flow chart of preemption within a computing unit according to an embodiment;
[0016] Fig.12 is a block diagram of a data processing system according to an embodiment;
[0017] Fig.13 is a block diagram of a processing system according to an embodiment;
[0018] Fig.14 is a block diagram of a processor according to an embodiment;
[0019] Fig.15 is a block diagram of a graphics processor according to an embodiment;
[0020] Fig.16 is a block diagram of a graphics processing engine of a graphics processor in accordance with some embodiments;
[0021] Fig.17 is a block diagram of a graphics processor provided by an additional embodiment;
[0022] Fig.18 illustrates thread execution logic including an array of processing elements employed in some embodiments;
[0023] Fig.19 is a block diagram illustrating a graphics processor instruction format according to some embodiments;
[0024] Fig. 20 is a block diagram of a graphics processor according to another embodiment;
[0025] Figures 21A-21B illustrates a graphics processor command format and command sequence according to some embodiments;
[0026] Fig. 22 illustrates an exemplary graphics software architecture for a data processing system according to some embodiments;
[0027] Fig.23 is a block diagram illustrating an IP core development system according to an embodiment;
[0028] Fig.24 is a block diagram illustrating an exemplary system-on-chip integrated circuit according to an embodiment;
[0029] Fig.25 is a block diagram illustrating an additional graphics processor according to an embodiment; and
[0030] Fig.26 is a block diagram illustrating an additional exemplary graphics processor of a system-on-chip integrated circuit according to an embodiment. DETAILED DESCRIPTION
[0031] 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 the host processor / core via a bus or another interconnect (e.g., a high-speed interconnect, such as PCIe or NVLink). In other embodiments, the GPU may be integrated on the same package or chip as the core and communicatively coupled to the core via an internal processor bus / interconnect (i.e., inside the package or chip). Regardless of the manner in which the GPU is connected, the processor core 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 to efficiently process these commands / instructions.
[0032] A page fault may occur on a GPGPU in response to an instruction attempting to access an invalid virtual address or a virtual address that is not mapped to a physical address. For example, GPU oversubscription may be implemented where the virtual address space addressable by the GPU includes GPU local memory and system memory associated with a host processor of a host data processing system. When a virtual address that is not currently mapped to a physical memory address is accessed, a page fault may occur to load a page into the associated virtual address space. This may include simply mapping the virtual address to an area of local physical memory, or may include an additional operation to load a page from system memory into a local physical memory address. A page fault invokes a page fault handler that establishes an appropriate virtual-to-physical mapping and continues execution of the faulting instruction or signals an error if the address is invalid.
[0033] If servicing a page fault will result in significant delay, the GPU may switch the context to a context associated with another process or thread. The context switch causes state information to be stored until the state information is needed in response to a subsequent context switch. However, performing a full GPU context switch can be significantly time consuming. The entire hardware context is saved and restored, and various hardware caches are cleared to prepare for the implementation of the separated context. From a computational perspective, this process can result in a significant loss of time. In addition, the page fault handling process for the context may require tracking. For example, if a context is switched out to handle a page fault, switching the context back to the GPU before handling the page fault can introduce additional delays and hinder computational efficiency.
[0034] The embodiments described herein increase the computational efficiency associated with context switching by enabling the GPU to perform preemption at a lower granularity than the entire GPU. In one embodiment, the parallel execution blocks of the GPU are divided into computational blocks that define preemption boundaries for hardware resources within the GPU. When a page fault affects a computational block, the hardware tracks the execution process of the computational block, stops execution, and places the computational block in a preempted state. While in the preempted state, the hardware context of the computational block is saved to an area in the memory assigned for use by the computational block. While the computational block is in the preempted state, other computational blocks on the GPU can continue to execute instructions. Once the hardware context of the computational block is saved to memory, the scheduling hardware for the GPU can load a new workgroup onto the computational block. The workgroup can be from the same context, or in an embodiment in which the GPU supports multiple simultaneous contexts, the scheduler can load a workgroup for replacing the context onto the preempted computational block.
[0035] As an additional optimization, in one embodiment, the scheduler hardware of the GPU can track the execution status of the active workgroups for a given context. When all workgroups of a context are complete (except for the workgroup that was preempted due to a page fault associated with the context), the scheduler hardware can preempt the compute blocks associated with other active contexts on the GPU and reload the previously faulted and preempted context to complete the final outstanding workgroup for that context. The reloading process is particularly efficient for embodiments in which the GPU is configured to execute multiple contexts simultaneously.
[0036] In the following description, numerous specific details are set forth to provide a more thorough understanding. However, it will be apparent to those skilled in the art that the embodiments described herein can 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.
[0037] System Overview
[0038] Figure 1 1 is a block diagram illustrating a computing 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 that communicate via an interconnect path, which may include a memory hub 105. The memory hub 105 may be a separate component within a chipset assembly, or may be integrated within the one or more processors 102. The memory hub 105 is coupled to an I / O subsystem 111 via a communication link 106. The I / O subsystem 111 includes an I / O hub 107 that may enable the computing system 100 to receive input from one or more input devices 108. In addition, the I / O hub 107 may enable a display controller to provide output to one or more display devices 110A, which may be included in the one or more processors 102. In one embodiment, the one or more display devices 110A coupled to the I / O hub 107 may include local, internal, or embedded display devices.
[0039] In one embodiment, the processing subsystem 101 includes one or more parallel processors 112 coupled to the memory hub 105 via a bus or other communication link 113. The communication link 113 can be one of any number of standard-based communication link technologies or protocols, such as but not limited to PCI Express, or can be a vendor-specific communication interface or communication organization. In one embodiment, the one or more parallel processors 112 form a parallel or vector processing system focused on computing, which includes a large number of processing cores and / or processing clusters, such as many integrated 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 the one or more display devices 110A coupled via the I / O hub 107. The one or more parallel processors 112 may also include a display controller and display interface (not shown) to enable a direct connection to one or more display devices 110B.
[0040] Within the I / O subsystem 111, a system storage unit 114 may be connected to the I / O hub 107 to provide a storage mechanism for the computing system 100. An I / O switch 116 may be used to provide an interface mechanism to enable connectivity between the I / O hub 107 and other components, such as a network adapter 118 and / or a wireless network adapter 119 that may be integrated into the platform, 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 wireless radio devices.
[0041] 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 for the various components in the system may be implemented using any suitable protocol, such as a PCI (Peripheral Component Interconnect) based protocol (e.g., PCI-Express), or any other bus or point-to-point communication interface and / or protocol(s), such as the NV Link high-speed interconnect, or interconnect protocols known in the art.
[0042] In one embodiment, the one or more parallel processors 112 incorporate circuits optimized for graphics and video processing, including, for example, video output circuits, and constitute a graphics processing unit (GPU). In another embodiment, the one or more parallel processors 112 incorporate circuits optimized for general-purpose processing while retaining the underlying computing architecture described in more detail herein. In yet another embodiment, the components of the computing system 100 may be integrated with one or more other system elements on a single integrated circuit. For example, the one or more parallel processors 112, the memory hub 105, (multiple) processors 102, and the I / O hub 107 may be integrated into a system-on-chip (SoC) integrated circuit. Alternatively, the components of the computing system 100 may be integrated into a single package to form a system-in-package (SIP) configuration. In one embodiment, at least a portion of the components of the computing system 100 may be integrated into a multi-chip module (MCM), which may be interconnected with other multi-chip modules to form a modular computing system.
[0043] It will be appreciated 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 desired. 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. Large embodiments may include two or more sets of processors 102 attached via multiple sockets, which may be coupled to two or more instances of the (multiple) parallel processors 112. Some of the specific components shown herein are optional, and may not be included in all implementations of computing system 100. For example, any number of add-in cards or peripherals may be supported, or some components may be excluded.
[0044] Figure 2A A parallel processor 200 is illustrated 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 illustrated parallel processor 200 is Figure 1 A variation of the one or more parallel processors 112 shown in .
[0045] In one embodiment, parallel processor 200 includes parallel processing unit 202. Parallel processing unit includes 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 bar 216, wherein host interface 206 receives commands related to performing processing operations and memory cross bar 216 receives commands related to performing memory operations.
[0046] When host interface 206 receives command buffers via I / O unit 204, host interface 206 may direct work operations to execute those commands to front end 208. In one embodiment, front end 208 is coupled to scheduler 210, which is configured to distribute commands or other work items to processing cluster array 212. In one embodiment, scheduler 210 ensures that processing cluster array 212 is properly configured and in a valid state before distributing tasks to processing clusters of processing cluster array 212.
[0047] Processing cluster array 212 may include up to "N" processing clusters (eg, cluster 214A, cluster 214B, through cluster 214N). Each cluster 214A-214N of 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.
[0048] In one embodiment, different clusters 214A-214N may be assigned for processing different types of programs, or for performing different types of computations. Scheduler 210 may use a variety of scheduling and / or work distribution algorithms (which may vary depending on the workload caused by each type of program or computation) to allocate work to clusters 214A-214N of processing cluster array 212. Scheduling may be handled dynamically by scheduler 210, or may be partially assisted by compiler logic during compilation of program logic configured for execution by processing cluster array 212.
[0049] 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 to perform 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 position, velocity, and other properties of an object).
[0050] 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 to support the execution of such graphics processing operations, including but not limited to texture sampling logic to perform texture operations, as well as tessellation logic and other vertex processing logic. In addition, processing cluster array 212 may be configured to execute graphics processing related shader programs, such as but not limited to vertex shaders, tessellation shaders, geometry shaders, and pixel shaders. Parallel processing unit 202 may deliver data from system memory via I / O unit 204 for processing. During processing, the delivered data may be stored to on-chip memory (e.g., parallel processor memory 222) during processing and then written back to system memory.
[0051] In one embodiment, when parallel processing unit 202 is used to perform graphics processing, scheduler 210 can be configured to divide the processing workload into tasks of approximately equal size to better enable the distribution of graphics processing operations to multiple clusters 214A-214N 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 produce a rendered image for display. Intermediate data generated by one or more of clusters 214A-214N can be stored in a buffer to allow the intermediate data to be transferred between clusters 214A-214N for further processing.
[0052] During operation, the processing cluster array 212 may receive processing tasks to be performed via the scheduler 210, which receives commands defining the processing tasks from the front end 208. For graphics processing operations, a processing task may include an index of data to be processed, such as surface (patch) data, primitive data, vertex data, and / or pixel data, as well as state parameters and commands defining how the data is to be processed (e.g., what program to perform). The scheduler 210 may be configured to extract the index corresponding to the task, or may receive the 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 upcoming command buffer (e.g., a batch buffer, a push buffer, etc.) is initiated.
[0053] Each of the one or more instances of parallel processing unit 202 may be coupled to parallel processor memory 222. Parallel processor memory 222 may be accessed via memory crossbar 216, which may receive memory requests from processing cluster array 212 and I / O unit 204. Memory crossbar 216 may access parallel processor memory 222 via memory interface 218. Memory interface 218 may include a plurality of partition units (e.g., partition unit 220A, partition unit 220B to partition unit 220N), each of which is directly coupled to a portion (e.g., memory cells) of parallel processor memory 222. The number of partition units 220A-220N is generally equal to the number of memory cells, such that a first partition unit 220A has a corresponding first memory cell 224A, a second partition unit 220B has a corresponding memory cell 224B, and an Nth partition unit 220N has a corresponding Nth memory cell 224N. In other embodiments, the number of partition units 220A-220N may not be equal to the number of memory devices.
[0054] In various embodiments, the memory units 224A-224N may include various types of memory devices, including dynamic random access memory (DRAM) or graphics random access memory, such as synchronous graphics random access memory (SGRAM), including graphics double data rate (GDDR) memory. In one embodiment, the memory units 224A-224N may also include 3D stacked memory, including but not limited to high bandwidth memory (HBM). Those skilled in the art will appreciate that the specific implementation of the memory units 224A to 224N may vary and may be selected from one of various conventional designs. Rendering targets such as frame buffers or texture maps may be stored across the memory units 224A to 224N, thereby allowing the partition units 220A to 220N to write 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 facilitate the use of a unified memory design of system memory combined with local cache memory, local instances of the parallel processor memory 222 may be excluded.
[0055] In one embodiment, any one of the clusters 214A to 214N of the processing cluster array 212 can process data to be written to any one 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 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 the 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 216 may use virtual channels to separate traffic flows between the clusters 214A to 214N and the partition units 220A to 220N.
[0056] Although a single instance of parallel processing unit 202 is illustrated in parallel processor 200, any number of instances of parallel processing unit 202 may be included. For example, multiple instances of parallel processing unit 202 may be provided on a single plug-in card, or multiple plug-in cards may be interconnected. Different instances of parallel processing unit 202 may be configured to interoperate even if different instances have different numbers of processing cores, different amounts of local parallel processor memory, and / or other configuration differences. For example and in one embodiment, some instances of parallel processing unit 202 may include floating point units with higher precision 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 desktops, laptops, or handheld personal computers, servers, workstations, game consoles, and / or embedded systems.
[0057] Figure 2B is a block diagram of a partition unit 220 according to an embodiment. In one embodiment, the partition unit 220 is Figure 2A2 is an example of one of the partition units 220A to 220N. As illustrated, the partition unit 220 includes an L2 cache 221, a frame buffer interface 225, and an ROP 226 (raster operation unit). The L2 cache 221 is a read / write cache configured to perform load and store operations received from the memory crossbar 216 and the ROP 226. Read misses and urgent writeback requests are output by the L2 cache 221 to the frame buffer interface 225 for processing. Dirty updates can also be sent to the frame buffer via the frame buffer interface 225 for opportunistic processing. In one embodiment, the frame buffer interface 225 interfaces with one of the memory units in the parallel processor memory, such as the memory units 224A to 224N of FIG. 2 (e.g., within the parallel processor memory 222).
[0058] 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 can 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 within each processing cluster (e.g., clusters 214A to 214N of FIG. 2) rather than within partition unit 220. In such embodiments, read and write requests for pixel data are transmitted through memory crossbar 216 rather than pixel tile data.
[0059] The processed graphics data can be displayed on a display device (such as Figure 1 100 ), routed for routing by the processor(s) 102 , or routed for routing by the processor(s) 102 . Figure 2A The processing is further processed by one of the processing entities within parallel processor 200.
[0060] Figure 2C2 is a block diagram of a processing cluster 214 within a parallel processing unit according to an embodiment. In one embodiment, the processing cluster is an instance of one of the processing clusters 214A to 214N of FIG. 2. The processing cluster 214 can be configured to execute many threads in parallel, wherein the term "thread" refers to an instance of a specific program executed on a specific input data set. In some embodiments, a single instruction multiple data (SIMD) instruction issuance technique is used to support the parallel execution of a large number of threads without providing multiple independent instruction units. In other embodiments, by using a common instruction unit configured to issue instructions to a processing engine set within each of the processing clusters, a single instruction multiple thread (SIMT) technique is used to support the parallel execution of a large number of substantially synchronized threads. Unlike the SIMD execution regime in which all processing engines typically execute the same instruction, the 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 regime represents a functional subset of the SIMT processing regime.
[0061] The operation of the processing cluster 214 can be controlled via a pipeline manager 232 that distributes processing tasks to the SIMT parallel processors. The pipeline manager 232 receives instructions from the scheduler 210 of Figure 2 and manages the execution of those instructions via the graphics multiprocessor 234 and / or the texture unit 236. The illustrated graphics multiprocessor 234 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 cross bar 240 can be used to distribute the processed data to one of multiple possible destinations including other shader units. The pipeline manager 232 can promote the distribution of processed data by specifying a destination for the processed data to be distributed via the data cross bar 240.
[0062] Each graphics multiprocessor 234 within a processing cluster 214 may include an identical set of function execution logic (e.g., arithmetic logic units, load-store units, etc.), which may be pipelined to allow new instructions to be issued before previous instructions are 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), shifts, and calculations of various algebraic functions (e.g., planar interpolation, trigonometry, exponential and logarithmic functions, etc.); and different operations may be performed using the same function unit hardware.
[0063] The series of instructions transmitted to the processing cluster 214 constitute threads, as defined previously herein, and a collection of a certain number of concurrently executed 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 thread group that concurrently executes the same program on different input data, wherein a thread of 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 a 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 within consecutive clock cycles. Each graphics multiprocessor 234 can support up to G thread groups concurrently. In addition, within a graphics multiprocessor 234, multiple related thread groups may be active at the same time (in different stages of execution).
[0064] In one embodiment, the graphics multiprocessor 234 includes an internal cache memory that performs load and store operations. In one embodiment, the graphics multiprocessor 234 can abandon the internal cache and use cache memory (e.g., L1 cache 308) within the processing cluster 214. Each graphics multiprocessor 234 is also able to access the L2 cache within the partition unit (e.g., partition units 220A to 220N of Figure 2) shared among all processing clusters 214, and can be used to transfer data between threads. The graphics multiprocessor 234 can also access off-chip global memory, which can include one or more of the local parallel processor memory and / or system memory. Any memory external to the parallel processing unit 202 can be used as global memory. In which the processing cluster 214 includes multiple instances of the graphics multiprocessor 234, embodiments can share common instructions and data that can be stored in the L1 cache 308.
[0065] Each processing cluster 214 may include an MMU 245 (memory management unit) configured to map virtual addresses into physical addresses. In other embodiments, one or more instances of the MMU 245 may reside within the memory interface 218 of FIG. 2 . The MMU 245 includes a set of page table entries (PTEs) for mapping virtual addresses to physical addresses of tiles (more on tileization) 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. Physical addresses are processed to distribute surface data access locality to allow efficient request interleaving among partition units. The cache line index may be used to determine whether a request for a cache line is a hit or a miss.
[0066] In graphics and computing applications, the processing clusters 214 can be configured such that each graphics multiprocessor 234 is coupled to a texture unit 236 for performing texture mapping operations, such as determining texture sample locations, reading texture data, and filtering texture data. Texture data is read from an internal texture L1 cache (not shown) or in some embodiments from an L1 cache within the graphics multiprocessor 234, and the texture data is fetched from an L2 cache, a local parallel processor memory, or a 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, a local parallel processor memory, or a 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 a ROP unit, which can be located using a partition unit (e.g., partition units 220A to 220N of FIG. 2 ) as described herein. The preROP 242 unit may perform optimizations for color blending, organize pixel color data, and perform address translation.
[0067] It will be appreciated that the core architecture described herein is illustrative, and variations and modifications are possible. For example, any number of processing units, such as graphics multiprocessors 234, texture units 236, preROPs 242, etc., may be included within a processing cluster 214. Additionally, while only one processing cluster 214 is shown, a parallel processing unit as described herein may include any number of instances of a processing cluster 214. In one embodiment, each processing cluster 214 may be configured to operate independently of other processing clusters 214 using separate and distinct processing units, L1 caches, etc.
[0068] 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 including, but 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.
[0069] In one embodiment, the instruction cache 252 receives the instruction stream to be executed from the pipeline manager 232. The instructions are cached in the instruction cache 252 and dispatched for execution by the instruction unit 254. The instruction unit 254 can dispatch the instructions as thread groups (e.g., wraps), where each thread of the thread group is assigned to a different execution unit within the GPGPU core 262. The instruction 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 translate addresses in the unified address space into different memory addresses that can be accessed by the load / store unit 266.
[0070] Register file 258 provides a set of registers for the functional units of graphics multiprocessor 324. Register file 258 provides temporary storage for operands for data paths of functional units (e.g., GPGPU core 262, load / store unit 266) connected to graphics multiprocessor 324. In one embodiment, register file 258 is divided between each of the functional units so that each functional unit is assigned a dedicated portion of register file 258. In one embodiment, register file 258 is divided between different wire harnesses being executed by graphics multiprocessor 324.
[0071] 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 GPGPU cores 262 may be similar in architecture, or may be different in architecture. For example and in one embodiment, the first portion of the GPGPU core 262 includes a single-precision FPU and an integer ALU, while the second portion of the GPGPU core includes a double-precision FPU. In one embodiment, the FPU may implement the IEEE 754-2008 standard for floating-point arithmetic or enable variable-precision floating-point arithmetic. In addition, the graphics multiprocessor 324 may include one or more fixed-function or special-function units that perform specific functions such as copying rectangles or pixel blending operations. In one embodiment, one or more of the GPGPU cores may also include fixed or special-function logic.
[0072] 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 perform 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 enable communication between threads executing on the functional units. For example, the cache memory 272 can be used as a data cache to cache texture data transferred between the functional units and the texture unit 236.
[0073] FIG. 3A to FIG. 3B Additional graphics multiprocessors are illustrated according to an embodiment. The illustrated graphics multiprocessors 325, 350 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.
[0074] Figure 3A A graphics multiprocessor 325 is shown according to an additional embodiment. The graphics multiprocessor 325 includes 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-332B, register files 334A-334B, and (multiple) texture units 344A-344B. The graphics multiprocessor 325 also includes multiple sets of graphics or computing execution units (e.g., GPGPU cores 336A-336B, GPGPU cores 337A-337B, GPGPU cores 338A-338B) and multiple sets of load / store units 340A-340B. In one embodiment, the execution resource unit has a common instruction cache 330, texture and / or data cache memory 342, and shared memory 346. The various components can communicate via the interconnect structure 327. In one embodiment, the interconnect structure 327 includes one or more crossbar switches to enable communication between the various components of the graphics multiprocessor 325.
[0075] Figure 3B A graphics multiprocessor 350 is shown according to an additional embodiment. Figure 2D and Figure 3A As shown in , the graphics processor includes multiple sets of execution resources 356A-356D, where each set of execution resources includes multiple instruction units, register files, GPGPU cores, and load-store units. The execution resources 356A-356D can work in cooperation with (multiple) texture units 360A-360D for texture operations while sharing an instruction cache 354 and a shared memory 362. In one embodiment, the execution resources 356A-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-358B. The various components can be connected via Figure 3A The interconnect structure 327 communicates with a similar interconnect structure 352 .
[0076] Those skilled in the art will appreciate that Figure 1 , 2A The architectures described in FIG. 2A-2D and FIG. 3A-3B are illustrative and are not limiting with respect to the scope of the present embodiments. Thus, the techniques described herein may be implemented on any appropriately configured processing unit, including without limitation, one or more mobile application processors, one or more desktop or server central processing units (CPUs), including multi-core CPUs, one or more parallel processing units, such as parallel processing unit 202 of FIG. 2 , and one or more graphics processors or special purpose processing units, without departing from the scope of the embodiments described herein.
[0077] 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 with the core on the same package or chip and communicatively coupled to the core via an internal processor bus / interconnect (i.e., inside the package or chip). Regardless of the manner in which the GPU is connected, the processor core can assign work to the GPU in the form of a sequence of commands / instructions contained in a work descriptor. The GPU then uses dedicated circuits / logic to efficiently process these commands / instructions.
[0078] Technology for interconnecting the GPU to the host processor
[0079] Figure 4A An exemplary architecture is illustrated in which multiple GPUs 410-413 are communicatively coupled to multiple multi-core processors 405-406 via high-speed links 440-443 (e.g., buses, point-to-point interconnects, etc.). In one embodiment, the high-speed links 440-443 support 4GB / s, 30GB / s, 80GB / s, or higher communication throughputs depending on the implementation. Various interconnect protocols may be used, including but not limited to PCIe 4.0 or 5.0 and NVLink 2.0. However, the underlying principles of the present invention are not limited to any particular communication protocol or throughput.
[0080] Furthermore, in one embodiment, two or more of GPUs 410-413 are interconnected via high-speed links 444-445, which may be implemented using the same or different protocols / links as those used for high-speed links 440-443. Similarly, two or more of multi-core processors 405-406 may be connected via high-speed link 433, which may be a symmetric multiprocessor (SMP) bus operating at 20 GB / s, 30 GB / s, 120 GB / s, or higher. Alternatively, Figure 4A All communications between the various system components shown in can be implemented 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.
[0081] 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. Memory interconnects 430-431 and 450-453 may utilize the same or different memory access technologies. By way of example and not limitation, processor memory 401-402 and 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).
[0082] As described below, although the various processors 405-406 and GPUs 410-413 may be physically coupled to specific memories 401-402, 420-423, respectively, a unified memory architecture may be implemented in which the same virtual system address space (also referred to as an "effective address" space) is distributed among all of the various physical memories. For example, the processor memories 401-402 may each include 64GB of the system memory address space, and the GPU memories 420-423 may each include 32GB of the system memory address space (resulting in a total of 256GB of addressable memory in this example).
[0083] Figure 4B Additional details of the interconnection between the multi-core processor 407 and the graphics acceleration module 446 according to one embodiment are illustrated. 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.
[0084] The illustrated processor 407 includes a plurality of cores 460A-460D, each having a translation lookaside buffer 461A-461D and one or more caches 462A-462D. The core may include various other components (e.g., instruction fetch unit, branch prediction unit, decoder, execution unit, reorder buffer, etc.) for executing instructions and processing data, which are not illustrated to avoid obscuring the underlying principles of the present invention. Caches 462A-462D may include level 1 (L1) and level 2 (L2) caches. In addition, one or more shared caches 426 may be included in the cache hierarchy and shared by a collection of cores 460A-460D. For example, one embodiment of the processor 407 includes 24 cores, each having its own L1 cache, 12 shared L2 caches, and 12 shared L3 caches. In this embodiment, one of the L2 and L3 caches is shared by two adjacent cores. The processor 407 and the graphics accelerator integrated module 446 are connected to the system memory 441, which may include the processor memories 401-402.
[0085] Coherence is maintained for data and instructions stored in the various caches 462A-462D, 456, and the system memory 441 via inter-core communications over the coherence bus 464. For example, each cache may have cache coherence logic / circuitry associated therewith to communicate over the coherence bus 464 in response to a detected read or write to a particular cache line. In one implementation, a cache snooping protocol is implemented over the coherence bus 464 to snoop cache accesses. Cache snooping / coherence techniques are well understood by those skilled in the art and will not be described in detail herein to avoid obscuring the underlying principles of the present invention.
[0086] 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. In particular, 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.
[0087] In one implementation, the accelerator integrated circuit 436 provides cache management, memory access, context management, and interrupt management services on behalf of the multiple graphics processing engines 431, 432, N of the graphics acceleration module 446. The graphics processing engines 431, 432, N may each include a separate graphics processing unit (GPU). Alternatively, the graphics processing engines 431, 432, N may include different types of graphics processing engines within the GPU, such as a graphics execution unit, a media processing engine (e.g., a video encoder / decoder), a sampler, and a block transfer engine. In other words, the graphics acceleration module may be a GPU having multiple graphics processing engines 431-432, N, or the graphics processing engines 431-432, 43N may be separate GPUs integrated on a common package, line card, or chip.
[0088] In one embodiment, the accelerator integrated circuit 436 includes a memory management unit (MMU) 439 for performing various memory management functions such as virtual to physical memory translation (also known as effective to real memory translation) and memory access protocols for accessing the system memory 441. The MMU 439 may also include a translation lookaside buffer (TLB) (not shown) for caching virtual / effective to physical / real address translations. In one implementation, the cache 438 stores commands and data for efficient access by the graphics processing engines 431-432, N. In one embodiment, the data stored in the cache 438 and the graphics memory 433-434, N is kept consistent with the core caches 462A-462D, 456 and the system memory 411. As mentioned, this may be accomplished via proxy circuitry 425, which participates in cache coherence mechanisms on behalf of cache 438 and memories 433-434, N (e.g., sending updates to cache 438 involving modifications / accesses of cache lines on processor caches 462A-462D, 456 and receiving updates from cache 438).
[0089] The set of registers 445 stores context data for threads executed by the graphics processing engines 431-432, N, and the context management circuit 448 manages the thread contexts. For example, the context management circuit 448 can perform save and restore operations to save and restore the 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 can store the current register values to a designated area in memory (e.g., identified by a context pointer). It can then restore the register values when returning to that context. In one embodiment, the interrupt management circuit 447 receives and processes interrupts received from system devices.
[0090] In one implementation, the virtual / effective addresses from the graphics processing engine 431 are translated by the MMU 439 into actual / physical addresses in the system memory 411. One embodiment of the accelerator integrated circuit 436 supports multiple (e.g., 4, 8, 16) graphics accelerator modules 446 and / or other accelerator devices. The graphics accelerator module 446 may be dedicated to a single application executed on the processor 407, or may be shared between multiple applications. In one embodiment, a virtualized graphics execution environment is presented in which the resources of the graphics processing engines 431-432, N are shared with multiple applications or virtual machines (VMs). Resources may 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.
[0091] Thus, the accelerator integrated circuit acts as a bridge to the system for the graphics acceleration module 446 and provides address translation and system memory cache services. In addition, the accelerator integrated circuit 436 can provide virtualization facilities for the host processor to manage virtualization of the graphics processing engine, interrupts, and memory management.
[0092] Since the hardware resources of the graphics processing engines 431-432, N 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, N so that they appear to the system as independent units.
[0093] As mentioned, in the illustrated embodiment, one or more graphics memories 433-434, M are respectively coupled to each of the graphics processing engines 431-432, N. The graphics memories 433-434, M store instructions and data being processed by each of the graphics processing engines 431-432, N. The graphics memories 433-434, M may be volatile memories such as DRAM (including stacked DRAM), GDDR memories (e.g., GDDR5, GDDR6), or HBM, and / or may be non-volatile memories such as 3DXPoint or Nano-Ram.
[0094] In one embodiment, to reduce the amount of data traffic on link 440, biasing techniques are used to ensure that the data stored in graphics memory 433-434, M is the data that will be used most frequently by graphics processing engines 431-432, N, and preferably not used (at least not frequently) by cores 460A-460D. Similarly, the biasing mechanism attempts to keep data needed by the cores (and preferably not graphics processing engines 431-432, N) within caches 462A-462D, 456 of the core and system memory 411.
[0095] Figure 4C Another embodiment is illustrated in which an accelerator integrated circuit 436 is integrated within the processor 407. In this embodiment, the graphics processing engines 431-432, N communicate directly with the accelerator integrated circuit 436 via interface 437 and interface 435 over a high-speed link 440 (which again can utilize any form of bus or interface protocol). The accelerator integrated circuit 436 can perform operations related to Figure 4B The same operations as those described, but performed with potentially higher throughput given their close proximity to the coherency bus 462 and caches 462A-462D, 426.
[0096] One embodiment supports different programming models, including a dedicated process programming model (without graphics acceleration module virtualization) and a shared programming model (with virtualization). The latter may include a programming model controlled by accelerator integrated circuit 436 and a programming model controlled by graphics acceleration module 446.
[0097] In one embodiment of a dedicated process model, graphics processing engines 431-432, N 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-432, N, thereby providing virtualization within a VM / partition.
[0098] In a dedicated process programming model, graphics processing engines 431-432, N can be shared by multiple VM / application partitions. The shared model requires a hypervisor to virtualize graphics processing engines 431-432, N to allow access by each operating system. For a single partition system without a hypervisor, graphics processing engines 431-432, N are owned by the operating system. In both cases, the operating system can virtualize graphics processing engines 431-432, N to provide access to each process or application.
[0099] For the shared programming model, the graphics acceleration module 446 or the separate graphics processing engines 431-432, N use a process handle to select a process element. In one embodiment, the process element is stored in the system memory 411 and can be addressed using the effective address to actual address translation technology described herein. The process handle can be an implementation-specific value provided to the host process when registering its context with the graphics processing engine 431-432, N (that is, calling the system software to add a process element to the process element link table). The lower 16 bits of the process handle can be the offset of the process element within the process element link table.
[0100] Figure 4D An exemplary accelerator integrated slice 490 is illustrated. As used herein, a "slice" includes a specified portion of the processing resources of an accelerator integrated circuit 436. An application effective address space 482 within the system memory 411 stores process elements 483. In one embodiment, process elements 483 are stored in response to a GPU call 481 from an application 480 executed on a processor 407. Process elements 483 contain process states for corresponding applications 480. The work descriptor (WD) 484 contained in process element 483 may be a single job requested by an application, or may contain a pointer to a job queue. In the latter case, WD 484 is a pointer to a job request queue in the address space 482 of the application.
[0101] Graphics acceleration module 446 and / or individual graphics processing engines 431-432, N may be shared by all or a subset of processes in the system. Embodiments of the present invention include infrastructure for setting up process state and sending WD 484 to graphics acceleration module 446 to start a job in a virtualized environment.
[0102] In one implementation, a dedicated process programming model is implementation specific. In this model, a single process owns a 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 get the owned partition, and the operating system initializes the accelerator integrated circuit 436 to get the owned process when assigning the graphics acceleration module 446.
[0103] In operation, the WD extraction unit 491 in the accelerator integrated slice 490 extracts the next WD 484, which includes an indication of the work to be completed by one of the graphics processing engines of the graphics acceleration module 446. As illustrated, 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 handle 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-432, N is translated into an actual address by the MMU 439.
[0104] In one embodiment, the same set of registers 445 is replicated for each graphics processing engine 431-432, N and / or graphics acceleration module 446 and can be initialized by a hypervisor or operating system. Each of these replicated registers can be included in an accelerator integrated slice 490. Exemplary registers that can be initialized by a hypervisor are shown in Table 1.
[0105] Table 1 – Registers initialized by the hypervisor
[0106] 1 Slice Control Register 2 Process area pointer dispatched by real address (RA) 3 Permission Mask Override Register 4 Interrupt vector table entry offset 5 Interrupt Vector Table Entry Limits 6 Status Register 7 Logical Partition ID 8 Real Address (RA) Manager Accelerator Utilizes Record Pointers 9 Storage Description Register
[0107] Example registers that may be initialized by the operating system are shown in Table 2.
[0108] Table 2 – Registers initialized by the operating system
[0109] 1 Process and thread identification 2 Effective Address (EA) context save / restore pointer 3 Virtual Address (VA) Accelerator Utilizes Record Pointers 4 Virtual Address (VA) Segment Table Pointer 5 Permission masking 6 Job Descriptor
[0110] In one embodiment, each WD 484 is specific to a particular graphics acceleration module 446 and / or graphics processing engine 431-432, N. It contains all the information required by the graphics processing engine 431-432, N to complete its work, or it may be a pointer to a memory location where the application has set up a command queue for work to be done.
[0111] Figure 4E Additional details for one embodiment of a sharing model are illustrated. This embodiment includes a hypervisor real address space 498 in which a process element list 499 is stored. The hypervisor real address space 498 is accessible via a hypervisor 496 that virtualizes a graphics acceleration module engine to an operating system 495.
[0112] The shared programming model allows all or a subset of processes from all or a subset of partitions in the system to use the graphics acceleration module 446. There are two programming models where the graphics acceleration module 446 is shared by multiple processes and partitions: time-sliced sharing and graphics-directed sharing.
[0113] 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 through the hypervisor 496, the graphics acceleration module 446 may be subject to the following requirements: 1) The application's job request must be autonomous (that is, no state needs to be maintained between jobs), or the graphics acceleration module 446 must provide a context save and restore mechanism. 2) The application's job request is guaranteed to be completed within a specified amount of time by the graphics acceleration module 446, including any translation errors, or the graphics acceleration module 446 provides the ability to preempt job processing. 3) When operating in a directed sharing programming model, the graphics acceleration module 446 must be guaranteed to be fair between processes.
[0114] In one embodiment, for the shared model, the application 480 is necessary to make an operating system 495 system call using a graphics acceleration module 446 type, a work descriptor (WD), an authority mask register (AMR) value, and a context save / restore region pointer (CSRP). The graphics acceleration module 446 type describes the targeted acceleration function for the system call. The graphics acceleration module 446 type can be a system-specific value. The WD is specifically formatted for the graphics acceleration module 446, and the WD 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 describing the work to be done 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 of setting the AMR. If the accelerator integrated circuit 436 and the graphics acceleration module 446 implementation do not support the user authority 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 privilege mask override register (AMOR) value before placing the AMR in the process element 483. In one embodiment, the CSRP is one of the registers 445 that contains the effective address of an area in the application's address space 482 for the graphics acceleration module 446 to save and restore context state. This pointer is optional if state is not required to be saved between jobs or when a job is preempted. The context save / restore area may be pinned system memory.
[0115] Upon receiving the system call, the operating system 495 can verify that the application 480 has been registered and given permission to use the graphics acceleration module 446. The operating system 495 then calls the hypervisor 496 with the information shown in Table 3.
[0116] Table 3 - OS call parameters to the hypervisor
[0117] 1 Job Descriptor (WD) 2 Authority Mask Register (AMR) value (potentially masked) 3 Effective Address (EA) Context Save / Restore Region Pointer (CSRP) 4 Process ID (PID) and optional thread ID (TID) 5 Virtual Address (VA) Accelerator Utilization Record Pointer (AURP) 6 Virtual address of the storage segment table pointer (SSTP) 7 Logical Interrupt Service Number (LISN)
[0118] Upon receiving the hypervisor call, the hypervisor 496 verifies that the operating system 495 has registered and been given permission to use the graphics acceleration module 446. The hypervisor 496 then places the process element 483 into a process element link table for the corresponding type of graphics acceleration module 446. The process element may contain the information shown in Table 4.
[0119] Table 4 – Process Element Information
[0120] 1 Job Descriptor (WD) 2 Authority Mask Register (AMR) value (potentially masked) 3 Effective Address (EA) Context Save / Restore Region Pointer (CSRP) 4 Process ID (PID) and optional thread ID (TID) 5 Virtual Address (VA) Accelerator Utilization Record Pointer (AURP) 6 Virtual address of the storage segment table pointer (SSTP) 7 Logical Interrupt Service Number (LISN) 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)
[0121] In one embodiment, the hypervisor initializes multiple accelerator integrated slices 490 of registers 445 .
[0122] like Figure 4F As illustrated in , one embodiment of the present invention employs a unified memory addressable via a common virtual memory address space for accessing physical processor memory 401-402 and GPU memory 420-423. In this implementation, operations executed on GPUs 410-413 utilize the same virtual / effective memory address space to access processor memory 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 memory 401-402 and GPU memory 420-423, thereby allowing any processor or GPU to access any physical memory having a virtual address mapped to that memory.
[0123] 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 4F4. Multiple instances of bias / consistency management circuits 494A-494E are illustrated in , but the bias / consistency circuits may be implemented within an MMU of one or more host processors 405 and / or within an accelerator integrated circuit 436.
[0124] One embodiment allows the GPU-attached memory 420-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 drawbacks associated with full system cache coherence. The ability to access the GPU-attached memory 420-423 as system memory without heavy cache coherence overhead provides a beneficial operating environment for GPU offloading. This arrangement allows the host processor 405 software to set up operands and access calculation results without the overhead of traditional I / O DMA data copies. Such traditional copies involve driver calls, interrupts, and memory-mapped I / O (MMIO) accesses, which are all inefficient relative to simple memory accesses. At the same time, the ability to access the GPU-attached memory 420-423 without cache coherence overhead can 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-413. The efficiency of operand setup, the efficiency of result access, and the efficiency of GPU computation all play a role in determining the effectiveness of GPU offloading.
[0125] 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 that includes 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-423, with or without a bias cache in the GPUs 410-413 (e.g., to cache entries of the bias table that are frequently / recently used). Alternatively, the entire bias table may be maintained within the GPU.
[0126] In one implementation, the bias table entry associated with each access to the GPU-attached memory 420-423 is accessed before the GPU memory is actually accessed, resulting in the following operations. First, local requests from GPUs 410-413 whose pages are found in the GPU bias are forwarded directly to the corresponding GPU memory 420-423. Local requests from GPUs whose pages are found in the host bias are forwarded to processor 405 (e.g., via a high-speed link as discussed above). In one embodiment, requests from processor 405 to find the requested page in the host processor bias complete the request as a normal memory read. Alternatively, requests for GPU bias pages can be forwarded to GPUs 410-413. If the GPU is not currently using the page, the GPU can then convert the page to the host processor bias.
[0127] The bias state of a page may be changed by a software-based mechanism, a hardware-assisted software-based mechanism, or, for a limited set of circumstances, a purely hardware-based mechanism.
[0128] One mechanism for changing the bias state employs an API call (e.g., OpenCL) that in turn calls the GPU's device driver, which in turn sends a message to the GPU (or queues a command descriptor) directing the GPU to change the bias state, and for some transitions, performs a cache flush operation in the host. The cache flush operation is necessary for a transition from host processor 405 bias to GPU bias, but not for the reverse transition.
[0129] In one embodiment, cache coherency is maintained by temporarily rendering GPU-biased pages that are not cacheable by host processor 405. To access these pages, processor 405 may request access from GPU 410, which may or may not immediately grant access, depending on the implementation. Therefore, to reduce communication between processor 405 and GPU 410, it is beneficial to ensure that GPU-biased pages are those that are required by the GPU but not by the host processor 405, and vice versa.
[0130] Graphics processing pipeline
[0131] Figure 5 2 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 as described herein, such as parallel processor 200 of FIG. 2 , which in one embodiment is Figure 12 . As described herein, various parallel processing systems may implement the graphics processing pipeline 500 via one or more instances of a parallel processing unit (e.g., parallel processing unit 202 of FIG. 2 ). For example, a shader unit (e.g., graphics multiprocessor 234 of FIG. 3 ) may be configured to perform the functions of one or more of a vertex processing unit 504, a tessellation control processing unit 508, a tessellation evaluation processing unit 512, a geometry processing unit 516, and a tile / pixel processing unit 524. The functions of the data assembler 502, the primitive assemblers 506, 514, 518, the tessellation unit 510, the rasterizer 522, and the raster operation unit 526 may also be performed by other processing engines within a processing cluster (e.g., processing cluster 214 of FIG. 3 ) and corresponding partition units (e.g., partition units 220A-220N of FIG. 2 ). Alternatively, the graphics processing pipeline 500 may be implemented using dedicated processing units for one or more functions. In one embodiment, one or more portions of the graphics processing pipeline 500 may be executed by parallel processing logic within a general purpose processor (e.g., a CPU). In one embodiment, one or more portions of the graphics processing pipeline 500 may access on-chip memory (e.g., such as parallel processor memory 222 in FIG. 2 ) via a memory interface 528, which may be an example of the memory interface 218 of FIG. 2 .
[0132] In one embodiment, the data assembler 502 is a processing unit that collects vertex data for high-order surfaces and primitives, etc. and outputs the vertex data including vertex attributes to the vertex processing unit 504. The vertex processing unit 504 is a programmable execution unit that is configured to execute a vertex shader program, thereby lighting and transforming vertex data as specified by the vertex shader program. For example, the vertex processing unit 504 can be programmed to transform vertex data from an object-oriented coordinate representation (object space) to a coordinate system that is alternatively based on a space such as a world space or a normalized device coordinate (NDC) space. The vertex processing unit 504 can read data stored in a cache, local or system memory for use in processing vertex data.
[0133] 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 graphics primitives include triangles, line segments, points, patches, etc. as supported by various graphics processing application programming interfaces (APIs).
[0134] The tessellation control processing unit 508 treats the input vertices as control points for 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 estimation by the tessellation evaluation processing unit 512. The tessellation control processing unit 508 also computes 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 line, triangle 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 vertex attributes and a surface representation for each vertex associated with the geometric primitive.
[0135] The second instance of the primitive assembler 514 receives vertex attributes from the tessellation evaluation processing unit 512, reads the stored vertex attributes as needed, and constructs graphics primitives for processing by the geometry processing unit 516. The geometry processing unit 516 is a programmable execution unit that is configured to execute a geometry shader program, transforming the graphics primitives received from the primitive assembler 514 as specified by the geometry shader program. For example, the geometry processing unit 516 may be programmed to subdivide a graphics primitive into one or more new graphics primitives and calculate parameters, such as plane equation coefficients, for rasterizing the new graphics primitives.
[0136] In some embodiments, the geometry processing unit 516 may also add or delete elements in the geometry stream. The geometry processing unit 516 outputs parameters and vertices specifying new graphics primitives to the primitive assembler 518, which receives the parameters and vertices from the geometry processing unit 516, reads the stored vertex attributes as needed, and constructs the graphics primitives for processing by the viewport scaling, culling, and clipping unit 520. The geometry processing unit 516 may read data stored in the parallel processor memory or the system memory for use in processing the geometry data. The viewport scaling, culling, and clipping unit 520 performs clipping, culling, and viewport scaling, and outputs the processed graphics primitives to the rasterizer 522.
[0137] The rasterizer 522 scan converts the new graphics primitives and outputs tile and coverage data to the tile / pixel processing unit 524. In addition, the rasterizer 522 may be configured to perform z-culling and other z-based optimizations.
[0138] The tile / pixel processing unit 524 is a programmable execution unit configured to execute a tile shader program or a pixel shader program. The tile / pixel processing unit 524 transforms tiles or pixels received from the rasterizer 522 as specified by the tile or pixel shader program. For example, the tile / pixel processing unit 524 can be programmed to perform operations such as perspective correction, texture mapping, shading, blending, etc. to generate shaded tiles or pixels output to the raster operation unit 526. The tile / pixel processing unit 524 can read data stored in a parallel processor memory or a system memory for use in processing tile data. The tile or pixel shader program can be configured to shade with samples, pixels, tiles, or other granularities depending on the programmed sampling rate.
[0139] The raster operation unit 526 is a processing unit that performs raster operations such as stenciling, 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., parallel processor memory 222 in FIG. 2 ) and / or as Figure 1 104 in the system memory 104 for display on one of the one or more display devices 110 or for further processing by the one or more processors 102 or one of the parallel processor(s) 112. In some embodiments, the raster operation unit 526 is configured to compress z or color data written to memory and decompress z or color data read from memory.
[0140] Page fault preemption at lower levels of the hierarchy
[0141] Figure 6 A subsystem 600 for executing threads within a single instruction multiple data (SIMD) computing system according to an embodiment is illustrated. The subsystem 600 includes a front end 608, a scheduler 610, and a processing array 612. In one embodiment, the front end 608, the scheduler 610, and the processing array 612 are Figure 2A 208, scheduler 210, and processing array 212. In such an embodiment, the front end is associated with a processor such as Figure 2A The processing array 612 includes processing clusters 614A-614H, each of which may be Figure 2A and Figure 2C An instance of processing cluster 214 .
[0142] In one embodiment, processing clusters 614A-614H are grouped into computing blocks 620A-620B. For example, processing clusters 614A-614D may be grouped into computing block 620A, while processing clusters 61E-614H may be grouped into computing block 620B. However, the illustrated grouping of processing clusters and computing blocks is exemplary, because any number of computing blocks and processing clusters may be included in processing array 612. Computing blocks 620A-620B are configured as preemptive groups so that processing clusters within any given computing block may be context switched without affecting the execution of processing clusters in different computing blocks. For example, if a thread executed on any processing cluster 614A-614D within computing block 620A triggers a page fault or incurs any other form of memory access-related execution delay, the current state of the workgroup associated with the thread may be saved, and a new workgroup may be loaded onto computing block 620A without affecting the execution of the workgroup executed on computing block 620B.
[0143] The processing clusters 614A-614H of the computing blocks 620A-620B can execute a large number of threads in parallel while utilizing a collection of shared assets 618. The shared assets 618 may include hardware resources such as texture units, texture samplers, and cache memory. The shared assets 618 may additionally include an address generation unit and an address mapping unit to enable the processing clusters 614A-614H to access local memory and the system. During thread execution, various states and context information for the shared assets 618 are generated. In addition, each of the processing clusters 614A-614H may have an associated internal state that is generated or modified during instruction execution. When a context switch is triggered for any one of the computing blocks 620A-620B, context information for the internal state of the processing cluster within the computing block, as well as the context state associated with the portion of the shared assets 618 accessed by the computing block, may be saved, and execution may be stopped only for the affected computing block.
[0144] Figure 7 is a block diagram of an execution subsystem 700 within a processing array of a GPGPU according to an embodiment. The execution subsystem 700 enables fine-grained preemption within the GPGPU by allowing various parts of the GPGPU to context switch while other parts of the GPGPU continue to execute. In addition, in some embodiments, the GPGPU supports execution of multiple simultaneous contexts, thereby enabling multiple applications to render graphics data or perform general computing operations simultaneously. In addition, the GPGPU can be configured to perform simultaneous execution of graphics and computing instructions.
[0145] In some embodiments, the execution subsystem 700 includes an embedded microcontroller (e.g., a scheduler microcontroller 710) configured to execute firmware logic to perform scheduling operations for the compute blocks 620A-620N. The firmware of the scheduler microcontroller 710 can enable complex scheduling behaviors for at least a portion of the GPGPU. In one embodiment, the scheduler microcontroller 710 is configured to schedule and manage the execution of work items and work groups within the execution subsystem 700. In various embodiments, the executed work items and work groups can include threads, thread groups, thread blocks, thread harnesses, cooperative thread arrays, or any other grouping or arrangement of instructions. During execution, various execution resources within each of the compute blocks 620A-620N can utilize shared assets 618, such as Figure 6 620A-620N。
[0146] During execution, one or more threads executed on computing blocks 620A-620N may encounter page faults. In one embodiment, once the number of page faults within a computing block exceeds a threshold, the computing block is transformed to a preemptive ready state. In one embodiment, the page fault threshold is limited to a percentage of the number of threads executed on the computing block. For example and in one embodiment, the threshold is limited to one-third of the threads executed on the computing block. In one embodiment, the threshold is limited to half of the threads executed on the computing block. However, the specific threshold can vary across embodiments. In one embodiment, the page fault threshold is configurable.
[0147] Stop the execution of threads for execution resources (processing clusters, graphics multiprocessors, etc.), and save the context state for the workgroup executed on the computing block. Once the execution resources in the computing block terminate execution, the context state for the workgroup in execution can be saved to the memory. In one embodiment, the scheduler microcontroller 710 can copy the state information to the context data 722A-722N area in the context storage memory reserved for each of the corresponding computing blocks 620A-620N. The context data 722A-722N area can save the internal state of the execution resources in each computing block 620A-620N, as well as the context data for the part of the shared assets 618 used by the computing block to execute the workgroup. In one embodiment, the execution subsystem 700 supports the execution of multiple simultaneous contexts. For example, the computing block 620A can execute the rendering or computing operation for the first application, while the computing block 620B can execute the rendering or computing operation for the second application. The number of active contexts supported can vary across embodiments.
[0148] Under some circumstances, overly aggressive preemption may result in a decrease in overall system performance rather than an increase. If preemption is performed to satisfy a page fault that is resolved quickly, performance efficiency may be reduced. Fast page fault resolution may occur, for example, when servicing a soft page fault. A soft page fault occurs when a page has been temporarily unmapped from virtual memory but the data in memory is still valid. Such a page fault can be satisfied by simply remapping the page to the appropriate virtual memory address. A soft page fault is different from a hard page fault, for which a memory transfer is necessary.
[0149] In one embodiment, the scheduler microcontroller 710 is configured to avoid overly aggressive preemption by monitoring the average page fault latency on a per-context basis. The average page fault latency for the context can then be compared against a low watermark threshold and a high watermark threshold. When the scheduler microcontroller 710 detects that the average page fault latency for the context is below the low watermark threshold, the scheduler will disable preemption of workgroups or threads from the context based on page faults. When the scheduler microcontroller 710 detects that the average page fault latency for the context is above the high watermark threshold, the scheduler can enable page fault preemption for the context. In one embodiment, the GPGPU can be configured with a default low watermark threshold and a high watermark threshold. The low and high watermark thresholds can also be adjusted via configuration software or by driver logic in software executed on a host processor. In one embodiment, the watermark threshold can be stored in a hardware register in the GPGPU. In one embodiment, the driver logic can store the watermark threshold in a memory.
[0150] Fig. 8A 800 for performing fine-grained context switching according to an embodiment. In one embodiment, the execution resource logic 800 may be executed by a scheduler logic within a GPGPU. In one embodiment, the scheduler logic may be implemented by a microcontroller within a GPGPU, such as a Figure 7 The scheduler microcontroller 710. However, the embodiments are not limited to microcontroller-based scheduling implementations.
[0151] As shown at 802, the execution resource logic 800 may receive a notification that the number of page faults at one of a plurality of compute blocks within the GPGPU has exceeded a threshold. In one embodiment, the execution resource logic 800 may receive a notification from a compute block. In one embodiment, the execution resource logic 800 monitors the execution state of the execution resources within the plurality of compute blocks and keeps an eye out for any execution blocking events associated with those execution resources. The specific threshold associated with the number of page faults may vary across embodiments. In one embodiment, the page fault threshold is predefined in hardware. In one embodiment, the page fault threshold is dynamically configured based on the number of work items and / or work groups that are pending execution.
[0152] As shown at 804, the execution resource logic 800 can save the hardware context of the failed computing block to a context memory associated with the computing block. The saved hardware context includes all hardware state information for the execution resources within the computing block, as well as any context associated with the shared assets used by the computing block that is necessary to subsequently continue the execution of the work group that is about to be preempted. The exact hardware state saved depends on the underlying microarchitecture of the computing resources within the computing block and varies across embodiments.
[0153] As shown at 805, the execution resource logic 800 may then determine if there are any pending workgroups for the same context that was previously being executed. If any workgroups for the current same context are pending, the execution resource logic 800 may load the pending workgroups on the compute block at 810. In one embodiment, the GPGPU associated with the execution resource logic 800 supports execution of multiple simultaneous contexts. In such an embodiment, if no workgroups for the same context are pending at 805, the execution resource logic 800 may determine if workgroups for different contexts are pending at 807. If no additional workgroups are pending, the execution resource logic 800 may wait until additional work is ready to be scheduled for the same context at 805 or for the different context at 807. If any workgroups for the different context are pending at 807, the execution resource logic 800 may configure the compute block to execute the different context at 808 before loading the pending workgroups on the compute block at 810.
[0154] In one embodiment, the illustrated operations additionally include an optimization in which preemption priority can be given to contexts with nearly complete sets of workgroups. For example, when all workgroups of a context are complete (except for the workgroup that page faulted and was previously preempted), the scheduler hardware can preempt compute blocks associated with other active contexts on the GPGPU to free up execution resources to reload the previously faulted and preempted context. Such optimizations can enable more efficient use of GPGPU resources by allowing nearly complete workgroups to retire and release associated resources.
[0155] Figure 8B is a flow chart of scheduler logic 820 for enabling or disabling fine-grained context switching according to an embodiment. In one embodiment, scheduler logic 820 is implemented in a processor such as Figure 7The scheduler logic 820 may read the configured water level threshold for the GPGPU, as shown at block 820. The configured water level threshold includes a low water level threshold and a high water level threshold. In one embodiment, the threshold is read from a hardware register within the GPGPU. In one embodiment, the threshold is supplied by the driver logic for the GPGPU. Although the threshold is configurable, one embodiment enables the threshold to be preconfigured to a default value. The scheduler logic 820 may read the average page fault latency of the context, as shown at block 804. If the average page fault latency is below the low water level threshold at block 805, the scheduler logic 820 may disable page fault preemption for the context at block 810. If the average page fault latency is above the low water level threshold at block 805, the scheduler logic 820 may determine whether the average latency is above the high water level threshold at block 807. If the average latency is above the high watermark threshold at block 807 , scheduler logic 820 may enable page fault preemption for the context at block 808 .
[0156] Selective preemption based on command or instruction type
[0157] GPGPUs can have a large number of cores that can support the simultaneous execution of hundreds or thousands of threads. For example, the current generation produced can run about 100 threads simultaneously. GPGPUs that support instruction-level preemption when running computational workloads can stop execution at instruction boundaries and save thread states to memory. Depending on the number of resources in use at the time of preemption, a large amount of thread states may be required to be stored to enable instruction-level preemption. The amount of thread states required to be saved and restored also increases with the total number of threads supported on the GPGPU. In some GPGPU implementations, when a preemption request is received, the execution resource stops executing, waits for unfinished operations to complete, and saves the current thread state. However, the following scenario may occur: if the execution resource continues to execute several additional instructions, the number of registers in use will be significantly reduced, resulting in a smaller amount of state data to be saved and restored.
[0158] In the embodiments described herein, a compiler that compiles source code for execution on a GPGPU may generate hints to GPGPU instruction resources about potential upcoming changes in the amount of active thread states. In one embodiment, the compiler hints may indicate the relative efficiency of performing preemption at a given instruction, including whether the instruction is the optimal point to stop execution and save state. The compiler hints may also indicate to the execution resources whether it would be beneficial to continue to execute several additional instructions to reach a state that is more optimal for preemption. When a preemption request is received for a workgroup (e.g., a thread group, a thread block, a harness, etc.), on a per-thread basis, the computing hardware may immediately stop execution, or execute several additional instructions to reduce the register file footprint.
[0159] Fig. 9 An instruction execution system 900 according to an embodiment is illustrated. In one embodiment, the instruction execution system 900 is configured to process metadata 902 and associated instructions 904 via a computing unit 920. In one embodiment, the computing unit 920 is structured in a manner similar to the graphics multiprocessor 400 of FIG. 4. However, the computing unit 920 may be any one of the instruction-level execution units described herein. The computing unit 920 may include an extraction unit 922 that extracts instructions to be executed, and a decoding unit 924 that decodes the extracted instructions. The computing unit 920 additionally includes an execution resource 928 having one or more single-precision floating point units, double-precision floating point units, integer arithmetic logic units, load / store units, and / or special function units. The metadata 902 and instructions 904 may be generated by a compiler executed on a data processing system. In one embodiment, the compiler generates metadata as an intermediate language or assembly language that can be processed by a GPGPU based on register file usage and other thread state data determined from human-readable source code during the compilation process.
[0160] The computation unit 920 may be coupled to a scheduler 910, which may be a scheduler logic within a microcontroller, such as Figure 7 The scheduler 910 may be a microcontroller based scheduler 710. However, embodiments are not limited to a microcontroller based scheduler. The scheduler 910 may schedule one or more workgroups to the compute unit 920 and may preempt one or more of the workgroups from being executed on the compute unit 920. The scheduler 910 may preempt workgroups from being executed on the compute unit 920 for various reasons. For example, a computational workload on the compute unit 920 may be preempted to maintain a balance between computational and graphics rendering operations. In addition, the scheduler 910 may preempt workgroups from being executed on the compute unit 920 to maintain high utilization, such as if the number of page faults for a thread executing on the compute unit 920 exceeds a threshold.
[0161] During operation, the fetch unit 922 may fetch metadata 902 and instructions 904 from the instruction cache. The compute decode unit 924 may then decode the metadata 902 and instructions 904 to determine one or more operations to be performed based on the instruction. Decoding the metadata 902 includes parsing the preemption hint for the instruction and determining the state of the preemption status register 926 set to the register file of the compute unit 920. In one embodiment, the preemption status register is a single bit register that stores an OK / NOK value (e.g., 1b / 0b). The decode unit 924 may decode the metadata 902 associated with the instruction and set the value in the preemption status register 926 based on the preemption hint. In one embodiment, the decoding logic may simply store the metadata 902 in the preemption status register 926. In such an embodiment, the compute unit 920 includes logic to determine a response to the preemption request based on the value stored in the preemption status register 926. The response may be determined based on the preemption hint as well as other factors, including power and performance metrics for the compute unit 920 and / or the GPGPU as a whole.
[0162] In one embodiment, the scheduler 910 may preempt a work group on the compute unit 920 by sending a preemption request to the compute unit 920. In one embodiment, the scheduler 910 may interrupt the compute unit 920 and indicate the work group executing on the compute unit 920 to be preempted. The compute unit 920, in handling the interrupt, may immediately stop executing, or continue executing additional instructions to reduce the amount of register data or other thread state saved to preempt the work group.
[0163] Although metadata 902 is illustrated as distinct from instructions 904, in one embodiment, metadata 902 is a field within the instruction that is parsed by decode unit 924 while decoding the instruction. In one embodiment, not all instructions have associated metadata 902. Rather, the compiler may insert metadata 902 into the compiled code at periodic intervals or if a significant change to the size of the thread context information occurs. In one embodiment, metadata 902 is communicated via a separate instruction that explicitly sets the value of preemption status register 926.
[0164] The amount of data that can be encoded by the preemption hint in the metadata can be determined based on the number of bits allocated to the hint. In one embodiment, a single bit indicating whether preemption is optimal for a given instruction can be encoded. In one embodiment, multiple bits can be encoded to give various data. For example, a 2-bit hint can provide information as indicated in Table 1 below.
[0165] Table 1 - Example preemption hints
[0166] Tips (bits) meaning 00b Optimal preemption point - low register file usage 01b Register file usage increases rapidly 10b Register file usage is high but will decrease rapidly 11b Register file usage is high without immediate reduction
[0167] As shown in Table 1, the 2-bit hint can encode four values that can indicate one of four possible preemption hints associated with the instruction. An exemplary hint is determined based on the current per-thread register usage. For example, a hint can indicate that a given instruction represents an optimal preemption point (e.g., 00b) because register file usage is currently low. If a preemption request is received while executing the instruction, the computing unit 920 will immediately stop executing and preempt. The hint can also indicate that register file usage increases rapidly on the next instruction set (e.g., 01b). Such a hint will also cause the computing unit 920 to stop executing to prevent an increase in register file usage. The hint can also indicate that register file usage is high, but will decrease rapidly within the next few instructions (e.g., 10b). In response to a preemption request received when executing an instruction with such a hint, the computing unit 920 will continue to execute the instruction until the optimal preemption point is reached. The hint also indicates that register file usage is high without immediately decreasing. In such a scenario, the computing unit 920 can respond differently depending on the desired preemption delay. If low latency preemption is desired, compute unit 920 may stop executing despite the relatively large amount of context necessary to save to perform the preemption. However, if context storage space is at a premium, e.g., for a GPGPU capable of executing an extremely large number of concurrent threads, compute unit 920 may continue to execute instructions until register file usage decreases. In such a scenario, a timeout value may be enforced that limits the number of instructions that can be executed after a preemption request has been received.
[0168] Fig.10 An exemplary graph of hints and associated register file usage for each thread is illustrated. The illustrated graph shows the relationship between register file usage as determined by a source code compiler and associated hints associated with compiled instructions. The exemplary hint values correspond to the hint values of Table 1, although not all embodiments are limited to those specific hint values. In the illustrated graph, the compiler inserts preemption hints at relative points along the execution path to indicate whether a change in register file usage for each thread is imminent. The behavior of the computing unit can vary based on the expected preemption delay and the tolerance for large context states during preemption. In one embodiment, if a preemption trigger (1002) is received while the preemption hint value indicates that register file usage will decrease rapidly, the computing unit can continue to execute until an optimal preemption point (1004) is reached. At other points, the computing unit can be configured to stop execution immediately when a decrease in register file usage (and associated context state) is imminent. Alternatively, if register file usage is high and context storage space is low, the computing unit can continue to execute until an optimal preemption point is reached or a preemption timeout occurs.
[0169] Fig.11 is a flow chart of preemption in a computing unit according to an embodiment. Preemption can be performed by, for example, Fig. 9 The preemption hint may be derived from metadata associated with the instruction. The metadata may be an additional bit set or additional field attached to the instruction, or may be set via a separate instruction. Preemption logic within the compute unit may determine at 1105 whether a "can be preempted" value may be set for the compute unit. This may be done in a manner such as a decode logic. Fig. 9 The preemption value may be set in a preemption status register such as the preemption status register 926 of the computing unit. The preemption status register 926 may be a register in a register file of the computing unit, or may be a specially reserved bit set in the internal memory of the computing unit 920. The preemption value may alternatively be set in a state flag set within the computing unit 920.
[0170] In one embodiment, if the current hint value indicates that the size of each thread state is to be reduced on the next instruction set, preemption logic within the compute unit may clear the preemption bit at 1108. In such an embodiment, the preemption logic may set the preemption bit at 1106 based on any other hint value. Furthermore, the preemption bit may be set by default and only cleared if continued execution of additional instructions would result in an almost immediate reduction in the size of the pre-thread state to be saved prior to preemption. Alternatively, if the thread state storage for the suspended thread is small in terms of available capacity, the compute unit may continue to execute instructions even if a reduction is not imminent if the hint indicates that the size of the thread state to be saved is high. Execution may continue until an optimal preemption point is reached or a timeout occurs.
[0171] The instruction may begin execution at block 1109. During execution, a preemption request may be received at block 1109. In one embodiment, a response to a preemption request received during execution at 1110 depends on the value of the preemption bit as determined at 1111. The manner in which the preemption request is received at 1110 may vary depending on the embodiment. In one embodiment, it may be assumed that once a preemption request is received, the request remains active until the computation unit completes execution. If the preemption bit is set, the computation unit may immediately stop execution at 1112. If the computation bit is cleared, the computation unit may continue to execute instructions, as shown at 1114, until the preemption bit is cleared based on the updated hint.
[0172] The embodiment can be based on Fig.11. For example, one embodiment does not include additional logic to set or clear the preemption bit. Instead, the hint value associated with each instruction may be temporarily stored while the instruction is being executed. If a preemption request is received, the computing unit may determine whether to proceed directly based on the hint bit received with the instruction.
[0173] Fig.12 1 is a block diagram of a data processing system 1200 according to an embodiment. The data processing system 1200 is a heterogeneous processing system having a processor 1202, a unified memory 1210, and a GPGPU 1220. The processor 1202 and the GPGPU 1220 may be any of the processors and GPGPU / parallel processors described herein. The processor 1202 may execute instructions for a compiler 1215 stored in a system memory 1212. The compiled 1215 is executed on the processor 1202 to compile the source code 1214A into a compiled code 1214B. The compiled code 1214B may include code that may be executed by the processor 1202 and / or code that may be executed by the GPGPU 1220. During compilation, the compiler 1215 may perform operations to insert metadata, including hints about register file usage and / or other information related to the size of each thread context information to be saved and restored in the event of preemption. The compiler 1215 may include the information necessary to perform such operations, or the operations may be performed with the help of a runtime library 1216. Runtime library 1216 may also facilitate compiler 1215 in the compilation of source code 1214A, and may also include instructions that are linked with compiled code 1214B at runtime to facilitate execution on GPGPU 1220 .
[0174] Unified memory 1210 represents a unified address space that can be accessed by processor 1202 and GPGPU 1220. Unified memory includes system memory 1212 and GPGPU memory 1218. GPGPU memory 1218 includes GPGPU local memory 1228 within GPGPU 1220, and may also include some or all of system memory 1212. For example, compiled code 1214B stored in system memory 1212 may also be mapped into GPGPU memory 1218 for access by GPGPU 1220.
[0175] GPGPU 1220 includes a plurality of computing blocks 1222A-1222N, which may be Fig.12 and Figure 7GPGPU 1220 also includes a set of registers 1224 that can be shared among the compute blocks 1222A-1222N, a cache memory 1226, and a preemption module 1225. The preemption module 1225 can be configured to manage compute block preemption, as illustrated in FIG8 , and selective preemption based on command or instruction type, as illustrated in FIG9 . Fig.11 GPGPU 1220 may additionally include GPGPU local memory 1228, which is physical memory that shares a graphics card or multi-chip module with GPGPU 1220.
[0176] Additional Exemplary Graphics Processing Systems
[0177] Details of the embodiments described above may be incorporated into the graphics processing systems and devices described below. Figures 13 to 26 The graphics processing systems and devices of illustrative embodiments illustrate alternative systems and graphics processing hardware that can implement any and all of the techniques described above.
[0178] Additional Exemplary Graphics Processing System Overview
[0179] Fig.13 1300 is a block diagram of a processing system 1300 according to an embodiment. In various embodiments, the system 1300 includes one or more processors 1302 and one or more graphics processors 1308, and may be a single-processor desktop system, a multi-processor workstation system, or a server system with a large number of processors 1302 or processor cores 1307. In one embodiment, the system 1300 is a processing platform incorporated within a system-on-chip (SoC) integrated circuit for use in a mobile, handheld, or embedded device.
[0180] Embodiments of the system 1300 may include or be incorporated into a server-based gaming platform, a gaming console (including gaming and media consoles, mobile gaming consoles, handheld gaming consoles, or online gaming consoles). In some embodiments, the system 1300 is a mobile phone, a smart phone, a tablet computing device, or a mobile Internet device. The data processing system 1300 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 into the wearable device. In some embodiments, the data processing system 1300 is a television or set-top box device having one or more processors 1302 and a graphical interface generated by one or more graphics processors 1308.
[0181] In some embodiments, each of the one or more processors 1302 includes one or more processor cores 1307 that process instructions that, when executed, perform operations for system and user software. In some embodiments, each of the one or more processor cores 1307 is configured to process a specific instruction set 1309. In some embodiments, the instruction set 1309 may facilitate complex instruction set computing (CISC), reduced instruction set computing (RISC), or computing via very long instruction words (VLIW). Multiple processor cores 1307 may each process a different instruction set 1309, which may include instructions that facilitate the emulation of other instruction sets. The processor core 1307 may also include other processing devices, such as a digital signal processor (DSP).
[0182] In some embodiments, the processor 1302 includes a cache memory 1304. Depending on the architecture, the processor 1302 may have a single internal cache or multiple levels of internal cache. In some embodiments, the cache memory is shared among various components of the processor 1302. In some embodiments, the processor 1302 also uses an external cache (e.g., a level 3 (L3) cache or a last level cache (LLC)) (not shown), which may be shared among the processor core 1307 using known cache coherence techniques. In addition, a register file 1306 is included in the processor 1302, 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 1302.
[0183] In some embodiments, the processor 1302 is coupled to a processor bus 1310 to transmit communication signals such as addresses, data, or control signals between the processor 1302 and other components in the system 1300. In one embodiment, the system 1300 uses an exemplary 'hub' system architecture, including a memory controller hub 1316 and an input-output (I / O) controller hub 1330. The memory controller hub 1316 facilitates communication between memory devices and other components of the system 1300, while the I / O controller hub (ICH) 1330 provides connections to I / O devices via a local I / O bus. In one embodiment, the logic of the memory controller hub 1316 is integrated within the processor.
[0184] The memory device 1320 may be a dynamic random access memory (DRAM) device, a static random access memory (SRAM) device, a flash memory device, a phase change memory device, or some other memory device having suitable properties to act as process memory. In one embodiment, the memory device 1320 may operate as system memory for the system 1300 to store data 1322 and instructions 1321 for use when the one or more processors 1302 execute applications or processes. The memory controller hub 1316 is also coupled to an optional external graphics processor 1312, which may communicate with the one or more graphics processors 1308 in the processor 1302 to perform graphics and media operations.
[0185] In some embodiments, the ICH 1330 enables peripherals to be connected to the memory device 1320 and the processor 1302 via a high-speed I / O bus. The I / O peripherals include, but are not limited to, an audio controller 1346, a firmware interface 1328, a wireless transceiver 1326 (e.g., Wi-Fi, Bluetooth), a data storage device 1324 (e.g., a hard drive, flash memory, etc.), and a traditional I / O controller 1340 for coupling legacy (e.g., Personal System 2 (PS / 2)) devices to the system. One or more Universal Serial Bus (USB) controllers 1342 connect input devices, such as a keyboard and mouse 1344 combination. A network controller 1334 may also be coupled to the ICH 1330. In some embodiments, a high-performance network controller (not shown) is coupled to the processor bus 1310. It will be appreciated that the illustrated system 1300 is exemplary and not limiting, as other types of data processing systems with different configurations may also be used. For example, the I / O controller hub 1330 may be integrated within the one or more processors 1302 , or the memory controller hub 1316 and the I / O controller hub 1330 may be integrated into a discrete external graphics processor, such as the external graphics processor 1312 .
[0186] Fig.14 is a block diagram of an embodiment of a processor 1400 having one or more processor cores 1402A- 1402N, an integrated memory controller 1414 , and an integrated graphics processor 1408 . Fig.14Those elements having the same reference numerals (or names) as those of any other figures herein may operate or function in any manner similar to that described elsewhere herein, but are not limited to such. Processor 1400 may include additional cores up to and including additional core 1402N represented by a dashed box. Each of processor cores 1402A-1402N includes one or more internal cache units 1404A-1404N. In some embodiments, each processor core may also access one or more shared cache units 1406.
[0187] Internal cache units 1404A-1404N and shared cache unit 1406 represent a cache memory hierarchy within processor 1400. 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 before external memory is classified as LLC. In some embodiments, cache coherency logic maintains coherency between the various cache units 1406 and 1404A-1404N.
[0188] In some embodiments, the processor 1400 may also include a set of one or more bus controller units 1416 and a system agent core 1410. The one or more bus controller units 1416 manage a set of peripheral buses, such as one or more peripheral component interconnect buses (e.g., PCI, PCI Express). The system agent core 1410 provides management functions for various processor components. In some embodiments, the system agent core 1410 includes one or more integrated memory controllers 1414 to manage access to various external memory devices (not shown).
[0189] In some embodiments, one or more of the processor cores 1402A-1402N include support for simultaneous multithreading. In such embodiments, the system agent core 1410 includes components for coordinating and operating the cores 1402A-1402N during multithreaded processing. In addition, the system agent core 1410 may include a power control unit (PCU) including logic and components for adjusting the power state of the processor cores 1402A-1402N and the graphics processor 1408.
[0190] In some embodiments, in addition, the processor 1400 includes a graphics processor 1408 that performs graphics processing operations. In some embodiments, the graphics processor 1408 is coupled to a set of shared cache units 1406 and a system agent core 1410, which includes the one or more integrated memory controllers 1414. In some embodiments, a display controller 1411 is coupled to the graphics processor 1408 to drive the graphics processor output to one or more coupled displays. In some embodiments, the display controller 1411 can be a separate module coupled to the graphics processor via at least one interconnect, or can be integrated within the graphics processor 1408 or the system agent core 1410.
[0191] In some embodiments, a ring-based interconnect unit 1412 is used to couple the internal components of the processor 1400. However, alternative interconnect units may be used, such as point-to-point interconnects, switched interconnects, or other technologies, including those known in the art. In some embodiments, the graphics processor 1408 is coupled to the ring interconnect 1412 via an I / O link 1413.
[0192] Exemplary I / O links 1413 represent at least one of a plurality of types of I / O interconnects, including an on-package I / O interconnect that facilitates communication between various processor components and a high-performance embedded memory module 1418, such as an eDRAM module. In some embodiments, each of processor cores 1402A-1402N and graphics processor 1408 use embedded memory module 1418 as a shared last-level cache.
[0193] In some embodiments, the processor cores 1402A-1402N are homogeneous cores that implement the same instruction set architecture. In another embodiment, the processor cores 1402A-1402N are heterogeneous in terms of instruction set architecture (ISA), wherein one or more of the processor cores 1402A-1402N implement a first instruction set, while at least one of the other cores implements a subset of the first instruction set or a different instruction set. In one embodiment, the processor cores 1402A-1402N are heterogeneous 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, the processor 1400 can be implemented on one or more chips or as a SoC integrated circuit having the illustrated components in addition to other components.
[0194] Fig.151 is a block diagram of a graphics processor 1500, which may be a discrete graphics processing unit, or may be a graphics processor integrated with multiple processing cores. In some embodiments, the graphics processor communicates via a memory-mapped I / O interface to registers on the graphics processor and using commands placed in processor memory. In some embodiments, the graphics processor 1500 includes a memory interface 1514 to access memory. The memory interface 1514 may be an interface to local memory, one or more internal caches, one or more shared external caches, and / or to system memory.
[0195] In some embodiments, the graphics processor 1500 also includes a display controller 1502 to drive display output data to a display device 1520. The display controller 1502 includes hardware for one or more overlay planes for a display and a combination of multiple layers of video or user interface elements. In some embodiments, the graphics processor 1500 includes a video codec engine 1506 that encodes, decodes, or transcodes media to, from, or between one or more media encoding formats, including but not limited to Moving Picture Experts Group (MPEG) formats (such as MPEG-2), Advanced Video Coding (AVC) formats (such as H.264 / MPEG-4 AVC), and Society of Motion Picture & Television Engineers (SMPTE) 421 M / VC-1, and Joint Photographic Experts Group (JPEG) formats (such as JPEG, and Motion JPEG (MJPEG) formats).
[0196] In some embodiments, graphics processor 1500 includes a block image transfer (BLIT) engine 1504 that performs two-dimensional (2D) rasterizer operations, including, for example, bit boundary block transfers. However, in one embodiment, 2D graphics operations are performed using one or more components of a graphics processing engine (GPE) 1510. In some embodiments, GPE 1510 is a compute engine for performing graphics operations, including three-dimensional (3D) graphics operations and media operations.
[0197] In some embodiments, GPE 310 includes a 3D pipeline 1512 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 1512 includes programmable and fixed functional elements that perform various tasks within execution threads that are spawned to elements and / or 3D / media subsystem 1515. While 3D pipeline 1512 can be used to perform media operations, embodiments of GPE 1510 also include a media pipeline 1516 specifically for performing media operations, such as video post-processing and image enhancement.
[0198] In some embodiments, the media pipeline 1516 includes fixed-function or programmable logic units to replace or represent the video codec engine 1506 to perform one or more specialized media operations, such as video decoding acceleration, video deinterlacing, and video encoding acceleration. In some embodiments, the media pipeline 1516 also includes a thread spawning unit to spawn threads for execution on the 3D / media subsystem 1515. The spawned threads perform calculations for media operations on one or more graphics execution units included in the 3D / media subsystem 1515.
[0199] In some embodiments, the 3D / media subsystem 1515 includes logic for executing threads spawned by the 3D pipeline 1512 and the media pipeline 1516. In one embodiment, the pipeline sends thread execution requests to the 3D / media subsystem 1515, which includes thread dispatch logic for arbitrating and dispatching various requests to available thread execution resources. The execution resources include an array of graphics execution units that handle 3D and media threads. In some embodiments, the 3D / media subsystem 1515 includes one or more internal caches for thread instructions and data. In some embodiments, the subsystem also includes shared memory (including registers and addressable memory) to share data between threads and store output data.
[0200] Exemplary Additional Graphics Processing Engines
[0201] Fig.16 is a block diagram of a graphics processing engine 1610 of a graphics processor in accordance with some embodiments. In one embodiment, the graphics processing engine (GPE) 1610 is Fig.15 A version of the GPE 1510 is shown in FIG. Fig.16 Elements having the same reference number (or name) as elements in any other figure herein may operate or function in any manner similar to that described elsewhere herein, but are not limited to such. Fig.15 1610. The 3D pipeline 1512 and the media pipeline 1516 of the GPE 1610. The media pipeline 1516 is optional in some embodiments of the GPE 1610 and may not be explicitly included in the GPE 1610. For example and in at least one embodiment, separate media and / or image processors are coupled to the GPE 1610.
[0202] In some embodiments, the GPE 1610 is coupled to or includes a command streamer 1603 that provides a command stream to the 3D pipeline 1512 and / or the media pipeline 1516. In some embodiments, the command streamer 1603 is coupled to a memory, which may be a system memory or one or more of an internal cache memory and a shared cache memory. In some embodiments, the command streamer 1603 receives commands from the memory and sends the commands to the 3D pipeline 1512 and / or the media pipeline 1516. The commands are instructions extracted from a ring buffer storing commands for the 3D pipeline 1512 and the media pipeline 1516. In one embodiment, in addition, the ring buffer includes a batch command buffer storing a plurality of command batches. The commands for the 3D pipeline 1512 may also include references to data stored in the memory, such as, but not limited to, vertex and geometry data for the 3D pipeline 1512 and / or image data and memory objects for the media pipeline 1516. The 3D pipeline 1512 and the media pipeline 1516 process commands and data by performing operations via logic within the respective pipelines or by dispatching one or more execution threads to the graphics core array 1614 .
[0203] In various embodiments, the 3D pipeline 1512 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 1614. The graphics core array 1614 provides a unified execution resource block. The multi-purpose execution logic (e.g., execution unit) within the graphics core array 1614 includes support for various 3D API shader languages and can execute multiple simultaneous execution threads associated with multiple shaders.
[0204] In some embodiments, graphics core array 1614 also includes execution logic that performs media functions such as video and / or image processing. In one embodiment, in addition to graphics processing operations, the execution unit further includes general logic that can be programmed to perform parallel general computing operations. The general logic can be connected to Fig.13 (multiple) processor cores 1307 or Fig.14 The general logic within cores 1402A-1402N in the performs processing operations in parallel or in combination.
[0205] Output data generated by threads executing on graphics core array 1614 can output data to memory in unified return buffer (URB) 1618. URB 1618 can store data for multiple threads. In some embodiments, URB 1618 can be used to send data between different threads executing on graphics core array 1614. In some embodiments, URB 1618 can also be used for synchronization between threads on the graphics core array and fixed function logic within shared function logic 1620.
[0206] In some embodiments, graphics core array 1614 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 1610. In one embodiment, execution resources are dynamically scalable such that execution resources can be enabled or disabled as needed.
[0207] The graphics core array 1614 is coupled to a shared function logic 1620, which includes a plurality of resources shared between the graphics cores in the graphics core array. The shared functions within the shared function logic 1620 are hardware logic units that provide dedicated supplementary functions to the graphics core array 1614. In various embodiments, the shared function logic 1620 includes, but is not limited to, a sampler 1621, a math 1622, and an inter-thread communication (ITC) 1623 logic. In addition, some embodiments implement one or more caches 1625 within the shared function logic 1620. The shared functions are implemented in the case where the demand for a given dedicated function is insufficient to be included in the graphics core array 1614. Instead, a single instantiation of the dedicated function is implemented as an independent entity in the shared function logic 1620 and shared among the execution resources within the graphics core array 1614. The precise set of functions shared between the graphics core array 1614 and included within the graphics core array 1614 varies between embodiments.
[0208] Fig.17 is a block diagram of another embodiment of a graphics processor 1700 . Fig.17 Elements having the same reference number (or name) as elements in any other figures herein may operate or function in any manner similar to that described elsewhere herein, but are not limited to such.
[0209] In some embodiments, graphics processor 1700 includes ring interconnect 1702, pipeline front end 1704, media engine 1737, and graphics cores 1780A-1780N. In some embodiments, ring interconnect 1702 couples the graphics processor to other processing units, including other graphics processors or one or more general-purpose processor cores. In some embodiments, the graphics processor is one of many processors integrated into a multi-core processing system.
[0210] In some embodiments, the graphics processor 1700 receives batches of commands via a ring interconnect 1702. Incoming commands are interpreted by a command streamer 1703 in a pipeline front end 1704. In some embodiments, the graphics processor 1700 includes scalable execution logic that performs 3D geometry processing and media processing via graphics core(s) 1780A-1780N. For 3D geometry processing commands, the command streamer 1703 supplies the commands to a geometry pipeline 1736. For at least some media processing commands, the command streamer 1703 supplies the commands to a video front end 1734, which is coupled to a media engine 1737. In some embodiments, the media engine 1737 includes a video quality engine (VQE) 1730 for video and image post-processing and a multi-format encoding / decoding (MFX) 1733 engine that provides hardware accelerated encoding and decoding of media data. In some embodiments, geometry pipeline 1736 and media engine 1737 each generate execution threads for use with thread execution resources provided by at least one graphics core 1780A.
[0211] In some embodiments, the graphics processor 1700 includes scalable thread execution resource characterization modular cores 1780A-1780N (sometimes referred to as core slices), each having multiple sub-cores 1750A-550N, 1760A-1760N (sometimes referred to as core sub-slices). In some embodiments, the graphics processor 1700 may have any number of graphics cores 1780A to 1780N. In some embodiments, the graphics processor 1700 includes a graphics core 1780A, which has at least a first sub-core 1750A and a second sub-core 1760A. In other embodiments, the graphics processor is a low-power processor with a single sub-core (e.g., 1750A). In some embodiments, the graphics processor 1700 includes multiple graphics cores 1780A-1780N, each including a set of first sub-cores 1750A-1750N and a set of second sub-cores 1760A-1760N. Each sub-core in the set of first sub-cores 1750A-1750N includes at least a first set of execution units 1752A-1752N and a media / texture sampler 1754A-1754N. Each sub-core in the set of second sub-cores 1760A-1760N includes at least a second set of execution units 1762A-1762N and a sampler 1764A-1764N. In some embodiments, each sub-core 1750A-1750N, 1760A-1760N shares a set of shared resources 1770A-1770N. 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.
[0212] Exemplary Additional Implementation Units
[0213] Fig.18 Thread execution logic 1800 is illustrated, including an array of processing elements employed in some embodiments of a GPE. Fig.18 Elements having the same reference number (or name) as elements in any other figures herein may operate or function in any manner similar to that described elsewhere herein, but are not limited to such.
[0214] In some embodiments, thread execution logic 1800 includes a shader processor 1802, a thread dispatcher 1804, an instruction cache 1806, a scalable execution unit array including a plurality of execution units 1808A-1808N, a sampler 1810, a data cache 1812, and a data port 1814. 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 1808A, 1808B, 1808C, 1808D, up to any one of 1808N-1 and 1808N) 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, thread execution logic 1800 includes one or more connections to a memory (such as a system memory or cache memory) through one or more of the instruction cache 1806, the data port 1814, the sampler 1810, and the execution units 1808A-1808N. In some embodiments, each execution unit (e.g., 1808A) 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 1808A-1808N is scalable to include any number of separate execution units.
[0215] In some embodiments, execution units 1808A-1808N are primarily used to execute shader programs. Shader processor 1802 can process various shader programs and dispatch execution threads associated with the shader programs via thread dispatcher 1804. In one embodiment, thread dispatcher includes logic to arbitrate thread initiation requests from graphics and media pipelines and instantiate the requested threads on one or more of execution units 1808A-1808N. For example, the geometry pipeline (e.g., Fig.17 1736) can dispatch vertex, tessellation or geometry shaders to thread execution logic 1800 ( Fig.18) for processing. In some embodiments, thread dispatcher 1804 can also process runtime thread spawning requests from executing shader programs.
[0216] In some embodiments, execution units 1808A-1808N support instruction sets that include native support for many standard 3D graphics shader instructions, so that shader programs from graphics libraries (e.g., Direct 3D and OpenGL) are executed with minimal translation. The execution units support vertex and geometry processing (e.g., vertex programs, geometry programs, vertex shaders), pixel processing (e.g., pixel shaders, fragment shaders), and general processing (e.g., compute and media shaders). Each of the execution units 1808A-1808N is capable of multi-issue single instruction multiple data (SIMD) execution, and multi-threaded operations enable efficient execution environments in the face of high-latency memory accesses. Each hardware thread within each execution unit has a dedicated high-bandwidth register file and an associated independent thread state. For pipelines capable of integer, single-precision floating-point and double-precision floating-point operations, SIMD branching capabilities, logical operations, transcendental operations, and other miscellaneous operations, execution is multi-issue per clock. While waiting for data from memory or one of the shared functions, dependency logic within execution units 1808A-1808N puts the waiting thread to sleep until the requested data has returned. While the waiting thread is sleeping, hardware resources can be dedicated to processing other threads. For example, during a delay associated with a vertex shader operation, an execution unit can perform operations for a pixel shader, a fragment shader, or another type of shader program including a different vertex shader.
[0217] Each execution unit in execution units 1808A-1808N operates on an array of data elements. The number of data elements is the "execution size" or number of lanes for an instruction. An execution lane is a logical unit that performs data element access, masking, and flow control within an instruction. The number of lanes may be independent of the number of physical arithmetic logic units (ALUs) or floating point units (FPUs) for a particular graphics processor. In some embodiments, execution units 1808A-1808N support integer and floating point data types.
[0218] The execution unit instruction set includes SIMD instructions. Various data elements can be stored in registers as packed data types, and the execution unit will process various elements based on the data size of the element. For example, when operating on a 256-bit wide vector, 256 bits of the vector are stored in registers, and the execution unit operates on a vector as four separated 64-bit packed data elements (data elements of quadruple word length (QW) size), eight separated 32-bit packed data elements (data elements of double word length (DW) size), sixteen separated 16-bit packed data elements (data elements of word length (W) size) or thirty-two separated 8-bit data elements (data elements of byte (B) size). However, different vector widths and register sizes are possible.
[0219] One or more internal instruction caches (e.g., 1806) are included in the thread execution logic 1800 to cache thread instructions for the execution unit. In some embodiments, one or more data caches (e.g., 1812) are included to cache thread data during thread execution. In some embodiments, a sampler 1810 is included to provide texture sampling for 3D operations and media sampling for media operations. In some embodiments, the sampler 1810 includes a specialized texture or media sampling function to process the texture or media data during the sampling process before providing the sampled data to the execution unit.
[0220] During execution, the graphics and media pipeline sends thread initiation requests to the thread execution logic 1800 via thread spawning and dispatching logic. Once the group of geometric objects has been processed and rasterized into pixel data, the pixel processor logic (e.g., pixel shader logic, fragment shader logic, etc.) within the shader processor 1802 is called to further calculate output information and cause the results to be written to the output surface (e.g., color buffer, depth buffer, template buffer, etc.). In some embodiments, the pixel shader or fragment shader calculates the values of various vertex attributes, which are interpolated across the rasterized objects. In some embodiments, the pixel processor logic within the shader processor 1802 then executes the pixel or fragment shader program supplied by the application programming interface (API). To execute the shader program, the shader processor 1802 dispatches the thread to the execution unit (e.g., 1808A) via the thread dispatcher 1804. In some embodiments, the pixel shader 1802 uses the texture sampling logic in the sampler 1810 to access the texture data in the texture map stored in the memory. Arithmetic operations on the texture data and the input geometry data compute pixel color data for each geometry fragment, or discard one or more pixels from further processing.
[0221] In some embodiments, data port 1814 provides a memory access mechanism for thread execution logic 1800 to output processed data to memory for processing on the graphics processor output pipeline. In some embodiments, data port 1814 includes or is coupled to one or more cache memories (e.g., data cache 1812) to cache data for memory access via the data port.
[0222] Fig.19 1 is a block diagram illustrating a graphics processor instruction format 1900 according to some embodiments. In one or more embodiments, a graphics processor execution unit supports an instruction set having instructions in a variety of formats. Solid line boxes illustrate components that are generally included in execution unit instructions, while dashed lines include optional components or components that are included only in a subset of instructions. In some embodiments, the described and illustrated instruction format 1900 are macroinstructions because they are instructions supplied to the execution unit, as opposed to micro-operations that result from instruction decoding once execution is processed.
[0223] In some embodiments, the graphics processor execution unit natively supports instructions in 128-bit instruction format 1910. A 64-bit compressed instruction format 1930 may be used for some instructions based on the selected instruction, instruction options, and the number of operands. The native 128-bit instruction format 710 provides access to all instruction options, while some options and operations are restricted to the 64-bit format 1930. The native instructions available in the 64-bit format 1930 vary depending on the embodiment. In some embodiments, the instructions are partially compressed using a set of index values in the index field 1913. 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 the 128-bit instruction format 1910.
[0224] For each format, the instruction opcode 1912 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 simultaneous add operation across each color channel, the color channel representing a texture element or a picture element. By default, the execution unit executes each instruction across all data channels of the operand. In some embodiments, the instruction control field 1914 enables control of certain execution options, such as channel selection (e.g., prediction) and data channel ordering (e.g., swizzling). For instructions in the 128-bit instruction format 1910, the execution size field 1916 limits the number of data channels that will be executed in parallel. In some embodiments, the execution size field 1916 is not available for use in the 64-bit compressed instruction format 1930.
[0225] Some execution unit instructions have up to three operands, including two source operands (src0 1920, src1 1922) and a destination 1918. 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 1924), where the instruction opcode 1912 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.
[0226] In some embodiments, the 128-bit instruction format 1910 includes an access / address mode field 1926, which specifies, for example, whether direct register addressing mode or indirect register addressing mode is used. When direct register addressing mode is used, the register address of one or more operands is provided directly by bits in the instruction.
[0227] In some embodiments, the 128-bit instruction format 1910 includes an access / address mode field 1926 that specifies an address mode and / or access mode for the instruction. In one embodiment, the access mode is used to define the data access alignment for the instruction. Some embodiments support access modes including a 16-byte aligned access mode and a 1-byte aligned access mode, wherein the byte alignment of the access mode determines the access alignment of the instruction operands. For example, when in a first mode, the instruction may use byte-aligned addressing for source operands and destination operands, and when in a second mode, the instruction may use 16-byte aligned addressing for all source operands and destination operands.
[0228] In one embodiment, the address mode portion of the access / address mode field 1926 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.
[0229] In some embodiments, instructions are grouped based on the opcode 1912 bit field to simplify opcode decoding 1940. For 8-bit opcodes, bits 4, 5, and 6 allow the execution unit to determine the type of opcode. The precise opcode grouping shown is only an example. In some embodiments, the move and logic opcode group 1942 includes data movement and logic instructions (e.g., move (mov), compare (cmp)). In some embodiments, the move and logic group 1942 shares five most significant bits (MSBs), where the move (mov) instruction is in the form of 0000xxxxb, and the logic instruction is in the form of 0001xxxxb. The flow control instruction group 1944 (e.g., call (call), jump (jmp)) includes instructions in the form of 0010xxxxb (e.g., 0x20). The miscellaneous instruction group 1946 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 1948 includes component-wise arithmetic instructions (e.g., add, mul) in the form of 0100xxxxb (e.g., 0x40). The parallel math group 1948 performs arithmetic operations in parallel across data lanes. The vector math group 1950 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 calculations.
[0230] Exemplary Additional Graphics Pipeline
[0231] Fig. 20 is a block diagram of another embodiment of a graphics processor 2000 . Fig. 20 Elements having the same reference number (or name) as elements in any other figures herein may operate or function in any manner similar to that described elsewhere herein, but are not limited to such.
[0232] In some embodiments, the graphics processor 2000 includes a graphics pipeline 2020, a media pipeline 2030, a display engine 2040, a thread execution logic 2050, and a rendering output pipeline 2070. In some embodiments, the graphics processor 2000 is a graphics processor within a multi-core processing system including one or more general-purpose processing cores. The graphics processor is controlled by writing to registers of one or more control registers (not shown) or via commands issued to the graphics processor 2000 via a ring interconnect 2002. In some embodiments, the ring interconnect 2002 couples the graphics processor 2000 to other processing components, such as other graphics processors or general-purpose processors. Commands from the ring interconnect 2002 are interpreted by a command streamer 2003, which supplies instructions to various components of the graphics pipeline 2020 or the media pipeline 2030.
[0233] In some embodiments, command streamer 2003 directs the operation of vertex fetcher 2005, which reads vertex data from memory and executes vertex processing commands provided by command streamer 2003. In some embodiments, vertex fetcher 2005 provides vertex data to vertex shader 2007, which performs coordinate space transformation and lighting operations on each vertex. In some embodiments, vertex fetcher 2005 and vertex shader 2007 execute vertex processing instructions by dispatching execution threads to execution units 2052A-2052B via thread dispatcher 2031.
[0234] In some embodiments, execution units 2052A-2052B are vector processor arrays with instruction sets for performing graphics and media operations. In some embodiments, execution units 2052A-2052B have an attached L1 cache 2051 that is specific 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.
[0235] In some embodiments, the graphics pipeline 2020 includes a tessellation component that performs 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 2013 operates at the direction of the hull shader 2011 and contains dedicated logic to generate a detailed set of geometric objects based on a coarse geometric model that is provided as input to the graphics pipeline 2020. In some embodiments, if tessellation is not used, the tessellation components (e.g., the hull shader 2011, the tessellation 2013, and the domain shader 2017) can be bypassed.
[0236] In some embodiments, the complete geometric object may be processed by the geometry shader 2019 via one or more threads dispatched to execution units 2052A-2052B, or may proceed directly to the clipper 2029. In some embodiments, the geometry shader operates on entire geometric objects rather than vertices or vertex patches as in previous stages of the graphics pipeline. If tessellation is disabled, the geometry shader 2019 receives input from the vertex shader 2007. In some embodiments, the geometry shader 2019 may be programmed by a geometry shader program to perform geometry tessellation if the tessellation unit is disabled.
[0237] Before rasterization, the clipper 2029 processes the vertex data. The clipper 2029 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 2073 in the rendering output pipeline 2070 dispatches a pixel shader to convert the geometric object into a per-pixel representation. In some embodiments, the pixel shader logic is included in the thread execution logic 2050. In some embodiments, the application can bypass the rasterizer and depth test component 2073 and access the unrasterized vertex data via the outflow unit 2023.
[0238] The graphics processor 2000 has an interconnect bus, interconnect structure, or some other interconnect mechanism that allows data and messages to be passed among the main components of the processor. In some embodiments, the execution units 2052A-2052B and associated cache(s) 2051, texture and media samplers 2054, and texture / sampler cache 2058 are interconnected via data ports 2056 to perform memory accesses and communicate with the rendering output pipeline components of the processor. In some embodiments, the samplers 2054, caches 2051, 2058, and execution units 2052A-2052B each have separate memory access paths.
[0239] In some embodiments, the rendering output pipeline 2070 includes a rasterizer and a depth test component 2073, which converts vertex-based objects into associated pixel-based representations. In some embodiments, the rasterizer logic includes a windower / masker unit that performs fixed-function triangle and line rasterization. An associated rendering cache 2078 and depth cache 2079 are also available in some embodiments. The pixel operation component 2077 performs pixel-based operations on data, although in some instances, pixel operations associated with 2D operations (e.g., using mixed bit block image delivery) are performed by the 2D engine 2041, or replaced by the display controller 2043 using an overlay display plane at display time. In some embodiments, a shared L3 cache 2075 can be used for all graphics components, allowing data to be shared without using main system memory.
[0240] In some embodiments, the graphics processor media pipeline 2030 includes a media engine 2037 and a video front end 2034. In some embodiments, the video front end 2034 receives pipeline commands from the command streamer 2003. In some embodiments, the media pipeline 2030 includes a separate command streamer. In some embodiments, the video front end 2034 processes media commands before sending the commands to the media engine 2037. In some embodiments, the media engine 2037 includes a thread spawning function that spawns threads for dispatching to the thread execution logic 2050 via the thread dispatcher 2031.
[0241] In some embodiments, the graphics processor 2000 includes a display engine 2040. In some embodiments, the display engine 2040 is external to the processor 2000 and is coupled to the graphics processor via a ring interconnect 2002 or some other interconnect bus or structure. In some embodiments, the display engine 2040 includes a 2D engine 2041 and a display controller 2043. In some embodiments, the display engine 2040 contains dedicated logic that can operate independently of the 3D pipeline. In some embodiments, the display controller 2043 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.
[0242] In some embodiments, graphics pipeline 2020 and media pipeline 2030 can be configured to perform operations based on multiple graphics and media programming interfaces and are not specific to any one application programming interface (API). In some embodiments, driver software for graphics processors translates API calls specific to specific graphics or media libraries into commands that can be processed by graphics processors. In some embodiments, support is provided for all open graphics libraries (OpenGL), open computing languages (OpenCL) and / or Vulkan graphics and computing APIs from Khronos Group. In some embodiments, support can also be provided for Direct3D libraries from Microsoft. In some embodiments, combinations of these libraries can be supported. Support can also be provided for open source computer vision libraries (OpenCV). If a mapping from the pipeline of a future API to the pipeline of a graphics processor can be made, future APIs with compatible 3D pipelines will also be supported.
[0243] Example Additional Graphics Pipeline Programming
[0244] Fig.21A is a block diagram illustrating a graphics processor command format 2100 according to some embodiments. Fig.21B is a block diagram illustrating a graphics processor command sequence 2110 according to an embodiment. Fig.21A The solid-line boxes in illustrate components that are generally included in the graphics commands, while the dashed lines include components that are optional or included only in a subset of the graphics commands. Fig.21A The exemplary graphics processor command format 2100 includes a data field that identifies the target client 2102 of the command, a command operation code (opcode) 2104, and associated data for the command 2106. Some commands also include a sub-opcode 2105 and a command size 2108.
[0245] In some embodiments, client 2102 specifies a client unit of a graphics device that processes command data. In some embodiments, a graphics processor command parser checks the client field of each command to adjust further processing of the command and routes the command data to 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 for processing commands. Once a command is received by a client unit, the client unit reads an opcode 2104 and a subopcode 2105 (if present) to determine the operation to be performed. The client unit uses the information in the data field 2106 to execute the command. For some commands, a clear command size 2108 is expected to specify the size of the command. In some embodiments, the command parser automatically determines the size of at least some of the commands based on the command opcode. In some embodiments, commands are aligned via multiples of a double word length.
[0246] Fig.21B An exemplary graphics processor command sequence 2110 is shown in the flowchart in FIG. 21. 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 set up, perform, and terminate a set of graphics operations. The sample command sequence is shown and described for purposes of example only, as embodiments are not limited to these specific commands or to the command sequence. Moreover, 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 concurrent manner.
[0247] In some embodiments, the graphics processor command sequence 2110 may begin with a pipeline clear command 2112 to cause any active graphics pipeline to complete currently pending commands for the pipeline. In some embodiments, the 3D pipeline 2122 and the media pipeline 2124 do not operate concurrently. The pipeline clear is performed to cause the active graphics pipeline to complete any pending commands. In response to the pipeline clear, the command parser for the graphics processor will stop command processing until the active drawing engine completes pending operations and the associated read cache is invalidated. Optionally, any data marked as "dirty" in the rendering cache can be cleared to memory. In some embodiments, the pipeline clear command 2112 can be used for pipeline synchronization or before placing the graphics processor in a low power state.
[0248] In some embodiments, when a command sequence requires the graphics processor to explicitly switch between pipelines, a pipeline select command 2113 is used. In some embodiments, a pipeline select command 2113 is required only once in an execution context before issuing pipeline commands, unless the context is to issue commands for both pipelines. In some embodiments, a pipeline clear command 2112 is required immediately before a pipeline switch via a pipeline select command 2113.
[0249] In some embodiments, pipeline control commands 2114 configure the graphics pipeline for operation and are used to program 3D pipeline 2122 and media pipeline 2124. In some embodiments, pipeline control commands 2114 configure pipeline states for active pipelines. In one embodiment, pipeline control commands 2114 are used for pipeline synchronization and clearing data from one or more cache memories within an active pipeline before processing a batch of commands.
[0250] In some embodiments, return buffer state command 2116 is used to configure a set of return buffers for the corresponding pipeline to write data. Some pipeline operations require the allocation, selection, or configuration of one or more return buffers into which the operation writes intermediate data during processing. In some embodiments, the graphics processor also uses one or more return buffers to store output data and perform cross-thread communication. In some embodiments, return buffer state 2116 includes selecting the size and number of return buffers to use for the set of pipeline operations.
[0251] The remaining commands in the command sequence differ based on the active pipeline for operation. Based on pipeline determination 2120 , the command sequence is tailored for either the 3D pipeline 2122 starting at 3D pipeline state 2130 , or the media pipeline 2124 starting at media pipeline state 2140 .
[0252] The commands to configure the 3D pipeline state 2130 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, the 3D pipeline state 2130 commands can also selectively disable or bypass certain pipeline elements if those elements will not be used.
[0253] In some embodiments, the 3D primitive 2132 command is used to submit a 3D primitive to be processed by the 3D pipeline. The command and associated parameters passed to the graphics processor via the 3D primitive 2132 command are forwarded to the vertex extraction function in the graphics pipeline. The vertex extraction function uses the 3D primitive 2132 command data to generate a vertex data structure. The vertex data structure is stored in one or more return buffers. In some embodiments, the 3D primitive 2132 command is used to perform vertex operations on the 3D primitive via a vertex shader. In order to process the vertex shader, the 3D pipeline 2122 dispatches the shader execution thread to the graphics processor execution unit.
[0254] In some embodiments, the 3D pipeline 2122 is triggered via an execute 2134 command or event. In some embodiments, a register write triggers the command execute. In some embodiments, the execute is triggered via a "forward" or "kick" command in a command sequence. In one embodiment, the command execute is triggered using a pipeline synchronization command to clear the command sequence through the graphics pipeline. The 3D pipeline will perform geometry processing on 3D primitives. Once the operation is completed, the resulting geometric objects are rasterized and the pixel engine shades the resulting pixels. For those operations, additional commands that control pixel shading and pixel backend operations may also be included.
[0255] In some embodiments, when performing media operations, the graphics processor command sequence 2110 follows the media pipeline 2124 path. In general, the specific use and manner of programming for the media pipeline 2124 depends on the media or computing operations to be performed. During media decoding, specific media decoding operations can be offloaded to the media pipeline. In some embodiments, the media pipeline can also be bypassed, and 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, where the graphics processor is used to perform SIMD vector operations using compute shader programs that are not explicitly related to the rendering of graphics primitives.
[0256] In some embodiments, the media pipeline 2124 is configured in a similar manner to the 3D pipeline 2122. A set of commands to configure the media pipeline state 2140 is dispatched or placed into a command queue prior to the media object commands 2142. In some embodiments, the commands for the media pipeline state 2140 include data to configure the media pipeline elements that will be used to process the media objects. This includes data to configure 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 2140 also support the use of one or more pointers to "indirect" state elements that contain state setup batches.
[0257] In some embodiments, media object commands 2142 supply pointers to media objects for processing by the media pipeline. The media object includes a memory buffer containing video data to be processed. In some embodiments, all media pipeline states must be valid before issuing media object commands 2142. Once the pipeline state is configured and the media object commands 2142 are queued, the media pipeline 2124 is triggered via an execution command 2144 or an equivalent execution event (e.g., a register write). The output from the media pipeline 2124 can then be post-processed by operations provided by the 3D pipeline 2122 or the media pipeline 2124. In some embodiments, GPGPU operations are configured and executed in a manner similar to media operations.
[0258] Exemplary Graphics Software Architecture
[0259] Fig. 22 An exemplary graphics software architecture for a data processing system 2200 according to some embodiments is illustrated. In some embodiments, the software architecture includes a 3D graphics application 2210, an operating system 2220, and at least one processor 2230. In some embodiments, the processor 2230 includes a graphics processor 2232 and one or more general purpose processor cores 2234. The graphics application 2210 and the operating system 2220 are each executed in a system memory 2250 of the data processing system.
[0260] In some embodiments, the 3D graphics application 2210 includes one or more shader programs that include shader instructions 2212. The shader language instructions may be in a high-level shader language, such as High Level Shader Language (HLSL) or OpenGL Shader Language (GLSL). The application also includes executable instructions 2214 in a machine language suitable for execution by the general purpose processor core 2234. The application also includes graphics objects 2216 defined by vertex data.
[0261] In some embodiments, the operating system 2220 is a Microsoft® Windows® operating system from Microsoft Corporation, a dedicated UNIX-style operating system, or an open source UNIX-style operating system using a variant of the Linux kernel. The operating system 2220 can support a graphics API 2222, such as a Direct3D API, an OpenGL API, or a Vulkan API. When the Direct3D API is in use, the operating system 2220 uses a front-end shader compiler 2224 to compile any shader instruction 2212 in HLSL into a lower-level shader language. The compilation can be a just-in-time (JIT) compilation, or the application can perform shader precompilation. In some embodiments, during the compilation of the 3D graphics application 2210, a high-level shader is compiled into a low-level shader. In some embodiments, the shader instruction 2212 is provided in an intermediate form, such as a version of the standard portable intermediate representation (SPIR) used by the Vulkan API.
[0262] In some embodiments, the user mode graphics driver 2226 includes a backend shader compiler 2227 to convert shader instructions 2212 into hardware specific representations. When using the OpenGL API, the shader instructions 2212 in the GLSL high level language are passed to the user mode graphics driver 2226 for compilation. In some embodiments, the user mode graphics driver 2226 uses the operating system kernel mode functions 2228 to communicate with the kernel mode graphics driver 2229. In some embodiments, the kernel mode graphics driver 2229 communicates with the graphics processor 2232 to dispatch commands and instructions.
[0263] Exemplary IP Core Implementation
[0264] 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 such as a processor within an integrated circuit. For example, a machine-readable medium may include instructions representing various logic within a processor. When read by a machine, the instructions may cause the machine to make logic to perform the techniques described herein. Such representations (referred to as "IP cores") are reusable units 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 various consumers or manufacturing organizations that load the hardware model on a manufacturing machine that manufactures the integrated circuit. An integrated circuit may be manufactured so that the circuit performs the operations described in association with any one of the embodiments described herein.
[0265] Fig.232 is a block diagram illustrating an IP core development system 2300 that can be used to manufacture an integrated circuit to perform operations according to an embodiment. The IP core development system 2300 can be used to generate modular, reusable designs that can be incorporated into a larger design or used to construct an entire integrated circuit (e.g., a SOC integrated circuit). The design mechanism 2330 can generate a software simulation 2310 of the IP core design in a high-level programming language (e.g., C / C++). The software simulation 2310 can be used to design, test, and verify the behavior of the IP core using a simulation model 2312. The simulation model 2312 can include functional, behavioral, and / or timing simulations. A register transfer level (RTL) design 2315 can then be created or synthesized from the simulation model 2312. The RTL design 2315 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 2315, a lower-level design at the logic level or transistor level can also be created, designed, or synthesized. Therefore, the specific details of the initial design and simulation can vary.
[0266] The RTL design 2315 or equivalent may be further synthesized by the design agency into a hardware model 2320, which may be in a hardware description language (HDL) or some other representation of physical design data. The HDL may be further simulated or tested to verify the IP core design. The IP core design may be stored using a non-volatile memory 2340 (e.g., a hard disk, a flash memory, or any non-volatile storage medium) for delivery to a third-party fabrication agency 2365. Alternatively, the IP core design may be transmitted (e.g., via the Internet) via a wired connection 2350 or a wireless connection 2360. The fabrication agency 2365 may then fabricate an integrated circuit based at least in part on the IP core design. The fabricated integrated circuit may be configured to perform operations in accordance with at least one embodiment described herein.
[0267] Exemplary System-on-Chip Integrated Circuit
[0268] Figure 24-26 An exemplary integrated circuit and associated graphics processor that can be fabricated using one or more IP cores according to various embodiments described herein are illustrated. In addition to what is illustrated, other logic and circuits may be included, including additional graphics processors / cores, peripheral interface controllers, or general purpose processor cores.
[0269] Fig.242400, which may be a modular IP core from the same or multiple different design organizations. The integrated circuit 2400 includes peripheral or bus logic, including a USB controller 2425, a UART controller 2430, an SPI / SDIO controller 2435, and an I / O controller 2440. 2 S / I 2 C controller 2440. In addition, the integrated circuit may include a display device 2445 coupled to one or more of a high-definition multimedia interface (HDMI) controller 2450 and a mobile industry processor interface (MIPI) display interface 2455. Storage may be provided by a flash memory subsystem 2460 (including flash memory and a flash memory controller). A memory interface may be provided via a memory controller 2465 for accessing SDRAM or SRAM memory devices. In addition, some integrated circuits include an embedded security engine 2470.
[0270] Fig.25 25 is a block diagram illustrating an exemplary graphics processor 2510 of a system-on-chip integrated circuit that may be fabricated using one or more IP cores according to an embodiment. The graphics processor 2510 may be Fig.24 A variation of the graphics processor 2410 of FIG. The graphics processor 2510 includes a vertex processor 2505 and one or more tile processors 2515A-2515N (e.g., 2515A, 2515B, 2515C, 2515D, up to 2515N-1 and 2515N). The graphics processor 2510 can execute different shader programs via separate logic, such that the vertex processor 2505 is optimized to execute operations for vertex shader programs, while the one or more tile processors 2515A-2515N execute tile (e.g., pixel) shading operations for tile or pixel shader programs. The vertex processor 2505 performs the vertex processing stage of the 3D graphics pipeline and generates primitives and vertex data. The (multiple) tile processors 2515A-2515N use the primitives and vertex data generated by the vertex processor 2505 to generate a frame buffer displayed on a display device. In one embodiment, the tile processor(s) 2515A-2515N are optimized to execute tile shader programs as provided in the OpenGL API, which can be used to perform similar operations as pixel shader programs as provided in the Direct 3D API.
[0271] In addition, the graphics processor 2510 includes one or more memory management units (MMUs) 2520A-2520B, cache(s) 2525A-2525B, and circuit interconnect(s) 2530A-2530B. The one or more MMUs 2520A-2520B provide virtual to physical address mappings for the integrated circuit 2510, including for the vertex processor 2505 and / or the tile processor(s) 2515A-2515N, which may reference vertex or image / texture data stored in memory in addition to vertex or image / texture data stored in the one or more caches 2525A-2525B. In one embodiment, the one or more MMUs 2520A-2520B may communicate with other MMUs within the system, including with Fig.24 The one or more MMUs associated with the one or more application processors 2405, image processor 2415, and / or video processor 2420 of the graphics processor 2510 may be synchronized so that each processor 2405-2420 may participate in a shared or unified virtual memory system. According to an embodiment, the one or more circuit interconnects 2530A-2530B enable the graphics processor 2510 to interface with other IP cores within the SoC via an internal bus of the SoC or via a direct connection.
[0272] Fig.26 is a block diagram illustrating an additional exemplary graphics processor 2610 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 2610 may be Fig.24 A variation of the graphics processor 2410 of FIG. 2610 includes Fig.25 The one or more MMUs 2520A-2520B, caches 2525A-2525B, and circuit interconnects 2530A-2530B of the integrated circuit 2500.
[0273] Graphics processor 2610 includes one or more shader cores 2615A-2615N (e.g., 2615A, 2615B, 2615C, 2615D, 2615E, 2615F, up to 2615N-1 and 2615N) that provide a unified shader core architecture in which a single core or type or core can execute all types of programmable shader code, including shader program code to implement vertex shaders, fragment shaders, and / or compute shaders. The exact number of shader cores present may vary among embodiments and implementations. In addition, the graphics processor 2610 includes an inter-core task manager 2605, which acts as a thread dispatcher that dispatches execution threads to one or more shader cores 2615A-2615N and a tile unit 2618 that accelerates tile operations for tile-based rendering, where rendering operations for 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.
[0274] The following clauses and / or examples relate to specific embodiments or examples thereof. The details in the examples may be used anywhere in one or more embodiments. The various features of the different embodiments or examples may be combined in various ways with some features included and other features excluded to accommodate various different applications. Examples may include, for example, methods, components 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 an apparatus or system according to the embodiments and examples described herein. Various components may be components for performing the described operations or functions.
[0275] One embodiment provides a parallel processor, including a processing array within the parallel processor, the processing array including a plurality of computing blocks, each computing block including a plurality of processing clusters configured for parallel operation, and each of the plurality of computing blocks is independently preemptible. In one embodiment, the parallel processor is a GPGPU configured for SIMT execution. In one embodiment, the parallel processor includes a scheduler module that schedules workloads to the plurality of computing blocks. The scheduler module may be an embedded microcontroller. In one embodiment, the plurality of computing blocks include a first computing block and a second computing block. The first computing block may be configured to preempt a first working group of the workload, while the second computing block executes a second working group of the workload. In one embodiment, the processing array is configured to address the memory via a virtual address mapping, and is configured to support page faults for the virtual address mapping. The first computing block may be configured to detect that the first working group has a number of unhandled page faults exceeding a threshold, stop the execution of the first working group, and save a context state for the first working group. In one embodiment, the parallel processor additionally includes a context save memory storing a context state for each of the plurality of computing blocks, and the first computing block saves the context state for the first working group to the context save memory. In one embodiment, the context save memory is dedicated to the first computing block.
[0276] In one embodiment, the first computing block and the second computing block share a set of shared assets within the processing array. The set of shared assets may include a texture unit, a texture sampler, and a cache memory. The set of shared assets may also include an address generation unit and an address mapping unit. In one embodiment, the context state for the first working group includes a context state for the set of shared assets.
[0277] One embodiment provides a method of workload management on a parallel processor, the method comprising, in response to receiving a notification that a number of page faults associated with a first workgroup on a first compute block within the parallel processor has exceeded a threshold, placing the first compute block in a preempted state when page fault preemption is enabled for contexts associated with the first workgroup. The method additionally comprises determining whether a first pending workgroup is available for execution on the first compute block, preempting the first workgroup on the first compute block when the first pending workgroup is available for execution on the first compute block, and executing a second workgroup on a second compute block within the parallel processor while preempting the first workgroup, wherein the first compute block and the second compute block each comprise a plurality of processing clusters, each of the plurality of processing clusters comprising a plurality of processing units. In one embodiment, the method additionally comprises enabling page fault preemption for contexts associated with the first workgroup when an average page fault latency for the context is above a high watermark threshold, and disabling page fault preemption for the context when the average page fault latency for the context is below a low watermark threshold. In one embodiment, placing the first computation block in a preempted state includes saving a hardware context state associated with the first computation block to a context save memory, and saving the hardware context state associated with the first computation block to the context save memory includes saving a context state associated with at least the first work group.
[0278] One embodiment provides a method for workload management on a general purpose graphics processing unit (GPGPU), the method comprising compiling source code for execution on the GPGPU to generate compiled source code. While compiling the source code, the compiler may generate metadata associated with one or more instructions of the compiled source code, wherein the metadata indicates a size of a context save state when execution at the one or more instructions is preempted. In one embodiment, the metadata includes a preemption hint indicating a pending change in register file usage or register file usage in a next instruction set.
[0279] The embodiments described herein relate to specific configurations of hardware such as application specific integrated circuits (ASICs) that are configured to perform certain operations or have predetermined functions. Such electronic devices typically include a collection of one or more processors coupled to one or more other components, such as one or more storage devices (non-volatile machine-readable storage media), user input / output devices (e.g., keyboards, touch screens, and / or displays), and network connections. The coupling of the collection of processors and other components is typically through one or more buses and bridges (also referred to as bus controllers). The storage device and the signal carrying the network service represent one or more machine-readable storage media and machine-readable communication media, respectively. Therefore, the storage device of a given electronic device typically stores code and / or data for execution on the collection of one or more processors of the electronic device.
[0280] Example
[0281] Example 1: A parallel processor comprising:
[0282] A processing array within a parallel processor, the processing array comprising a plurality of computational blocks, each computational block comprising a plurality of processing clusters configured for parallel operation, wherein each of the plurality of computational blocks is independently preemptible.
[0283] Example 2: A parallel processor as described in Example 1, wherein the parallel processor is a general purpose graphics processing unit (GPGPU).
[0284] Example 3: A parallel processor as described in Example 2, wherein the parallel processor is a single instruction multiple thread (SIMT) processor.
[0285] Example 4: The parallel processor as described in Example 1 additionally includes a scheduler module for scheduling workloads to the plurality of computing blocks.
[0286] Example 5: A parallel processor as described in Example 4, wherein the scheduler module is an embedded microcontroller.
[0287] Example 6: The parallel processor of Example 4, wherein the plurality of computation blocks comprises a first computation block and a second computation block.
[0288] Example 7: A parallel processor as in Example 6, wherein the first computational block preempts a first workgroup of the workload and the second computational block performs a second workgroup of the workload.
[0289] Example 8: A parallel processor as in Example 7, wherein the processing array is configured to address the memory via a virtual address map and supports page faults for the virtual address map, and wherein the scheduler module tracks average latency to resolve page faults.
[0290] Example 9: The parallel processor of Example 8, wherein a first computation block of the plurality of computation blocks is configured to detect that a first workgroup has a number of unhandled page faults exceeding a threshold, stop execution of the first workgroup, and save a context state for the first workgroup.
[0291] Example 10: The parallel processor as described in Example 9, additionally comprising a context saving memory storing a context state for each of the plurality of computing blocks, wherein the first computing block saves the context state for the first working group to the context saving memory.
[0292] Example 11: A parallel processor as described in Example 10, wherein the first computation block saves the context state for the first work group to a region of the context save memory dedicated to the first computation block.
[0293] Example 12: A method of workload management on a parallel processor, the method comprising:
[0294] In response to receiving a notification that a number of page faults associated with a first workgroup on a first compute block within the parallel processor has exceeded a threshold, placing the first compute block in a preempted state when page fault preemption is enabled for a context associated with the first workgroup;
[0295] determining whether a first pending workgroup is available for execution on a first computational block;
[0296] preempting the first workgroup on the first computation block when the first pending workgroup is available for execution on the first computation block; and
[0297] A second workgroup is executed on a second computational block within the parallel processor while preempting the first workgroup, wherein the first computational block and the second computational block each include a plurality of processing clusters, each of the plurality of processing clusters including a plurality of processing units.
[0298] Example 13: The method as described in Example 12 additionally includes enabling page fault preemption for a context associated with a first workgroup when an average page fault latency for the context is above a high water mark, and disabling page fault preemption for the context when the average page fault latency for the context is below a low water mark.
[0299] Example 14: A method as described in Example 13, wherein placing the first computing block in a preempted state includes saving a hardware context state associated with the first computing block to a context save memory, and saving the hardware context state associated with the first computing block to the context save memory includes saving a context state associated with at least the first workgroup.
[0300] Example 15: The method of Example 13, wherein saving the hardware context associated with the first compute block to a context save memory comprises saving the context state to a region in the context save memory dedicated to the first compute block.
[0301] Example 16: A method as described in Example 12, wherein the first pending workgroup is from the same context as the first workgroup.
[0302] Example 17: A method for workload management on a general purpose graphics processing unit (GPGPU), the method comprising:
[0303] compiling source code for execution on the GPGPU to generate compiled source code; and
[0304] While compiling the source code, metadata associated with one or more instructions of the compiled source code is generated, the metadata indicating a size of a context-saved state when execution at the one or more instructions is preempted.
[0305] Example 18: The method as described in Example 17, wherein the metadata includes a preemption hint indicating an amount of register file space in use at the one or more instructions.
[0306] Example 19: The method as described in Example 18, additionally comprising executing the compiled source code on a GPGPU.
[0307] Example 20: The method of Example 19, when the compiled source code is executed on a GPGPU, additionally comprising:
[0308] fetching instructions of the compiled source code at a computation unit of the GPGPU;
[0309] Decodes the preemption hint associated with the instruction;
[0310] receiving a request to preempt execution; and
[0311] Based on the preemption hint, at least one additional instruction is executed after receiving the request to preempt execution.
[0312] Of course, different combinations of software, firmware and / or hardware can be used to implement one or more parts of the embodiment. Throughout this detailed description, for the purpose of explanation, numerous specific details are set forth to provide a thorough understanding of the present invention. However, it will be apparent to those skilled in the art that embodiments can be put into practice without some of these specific details. In some instances, known structures and functions are not described in detail to avoid blurring the subject matter of the invention of the embodiment. Accordingly, the scope and spirit of the present invention should be determined according to the appended claims.
Claims
1. A parallel processor, comprising: a processing array within a parallel processor, the processing array comprising a plurality of computational blocks, each computational block comprising a plurality of processing clusters configured to perform parallel operations, the processing array configured to address a memory via a virtual address map and to support page faults to the virtual address map, wherein each of the plurality of computational blocks is independently preemptible; as well as a scheduler for scheduling workloads to the plurality of computing blocks, wherein the scheduler tracks average latency to resolve page faults, The scheduler is configured to enable page fault preemption for a context associated with a workgroup executed by a corresponding computing block when an average page fault latency for the context associated with the workgroup executed by the corresponding computing block is above a high water mark threshold, and to disable page fault preemption for the context when the average page fault latency for the context is below a low water mark threshold.
2. The parallel processor of claim 1, wherein the parallel processor is a general purpose graphics processing unit (GPGPU).
3. A parallel processor as claimed in claim 2, wherein the parallel processor is a Single Instruction Multiple Thread (SIMT) processor.
4. A parallel processor as claimed in claim 1, wherein the scheduler is an embedded microcontroller.
5. The parallel processor as claimed in claim 4, wherein the plurality of computation blocks include a first computation block and a second computation block.
6. A parallel processor as claimed in claim 5, wherein a first computing block preempts a first workgroup of the workload and a second computing block performs a second workgroup of the workload.
7. The parallel processor of claim 1, wherein a first computation block of the plurality of computation blocks is configured to detect that a first workgroup has a number of unhandled page faults exceeding a threshold, stop execution of the first workgroup, and save a context state for the first workgroup.
8. The parallel processor of claim 1, additionally comprising a context save memory storing a context state for each of the plurality of computing blocks, wherein the first computing block saves the context state for the first work group to the context save memory.
9. The parallel processor of claim 8, wherein the first computation block saves the context state for the first work group to a region of the context save memory dedicated to the first computation block.
10. A method for workload management on a parallel processor, the method comprising: In response to receiving a notification that a number of page faults associated with a first workgroup on a first compute block within the parallel processor has exceeded a threshold, placing the first compute block in a preempted state when page fault preemption is enabled for a context associated with the first workgroup; enabling page fault preemption for a context associated with a first workgroup when an average page fault latency for the context is above a high water threshold, and disabling page fault preemption for the context when the average page fault latency for the context is below a low water threshold; determining whether a first pending workgroup is available for execution on a first computational block; preempting a first workgroup on a first computation block when a first pending workgroup is available for execution on the first computation block; as well as A second workgroup is executed on a second computational block within the parallel processor while preempting the first workgroup, wherein the first computational block and the second computational block each include a plurality of processing clusters, each of the plurality of processing clusters including a plurality of processing units.
11. A method as described in claim 10, wherein placing the first computing block in a preempted state includes saving a hardware context state associated with the first computing block to a context save memory, and saving the hardware context state associated with the first computing block to the context save memory includes saving a context state associated with at least the first work group.
12. The method of claim 10, wherein saving the hardware context associated with the first computational block to a context save memory comprises saving the context state to a region in the context save memory dedicated to the first computational block.
13. The method of claim 10, wherein the first pending workgroup is from the same context as the first workgroup.
14. The method of claim 13, wherein the first pending workgroup is not available for execution on the first computation block, and additionally comprising: determining whether a second pending workgroup is available for execution on the first computation block; as well as A first workgroup on a first computation block is preempted when a second pending workgroup is available for execution on the first computation block.
15. The method of claim 14, wherein the second pending workgroup is from a different context than the first workgroup.
16. The method of claim 10, wherein placing the first computational block in a preempted state comprises, for each computational unit within the first computational block, determining whether a preempt bit is set for the computational unit, and stopping execution of the computational unit when the preempt bit is set.
17. The method of claim 10, wherein placing the first computational block in a preempted state comprises, for each computational unit within the first computational block, determining whether a preempt bit is set for the computational unit, and continuing execution of the computational unit until the preempt bit is set.
18. The method of claim 17, additionally comprising stopping execution of the computing unit after a preemption timeout.
19. A machine-readable medium having instructions stored thereon, which when executed by a machine cause the machine to perform the method according to any one of claims 10-18.
20. An apparatus for workload management on a parallel processor, comprising: means for placing the first compute block in a preempted state when page fault preemption is enabled for a context associated with the first workgroup in response to receiving a notification that a number of page faults associated with a first workgroup on the first compute block within the parallel processor has exceeded a threshold; means for enabling page fault preemption for contexts associated with a first workgroup when an average page fault latency for the contexts is above a high water threshold and disabling page fault preemption for the contexts when the average page fault latency for the contexts is below a low water threshold; means for determining whether a first pending workgroup is available for execution on a first computational block; means for preempting a first workgroup on a first computation block when a first pending workgroup is available for execution on the first computation block; as well as Means for executing a second workgroup on a second computational block within the parallel processor while preempting the first workgroup, wherein the first computational block and the second computational block each include a plurality of processing clusters, each of the plurality of processing clusters including a plurality of processing units.
21. A computer program product comprising program instructions, which, when executed by a processor, cause the processor to perform the method according to any one of claims 10-18.
