Simultaneous Compute and Graphics Scheduling

Graphics and computing tasks are dynamically scheduled on the GPU through the hardware scheduler and arbiter, which solves the problem of resource utilization inefficiency and delay in executing graphics and computing tasks simultaneously on the GPU, and achieves higher processing speed and resource utilization.

CN110796588BActive Publication Date: 2024-08-23NVIDIA CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910451751.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2018-08-02
Filing Date
2019-05-28
Publication Date
2024-08-23
Estimated Expiration
2039-09-01

AI Technical Summary

Technical Problem

It is difficult for the existing technology to simultaneously perform graphics and computing tasks on the GPU, resulting in inefficient utilization of processing resources, increased latency, and the inability to flexibly allocate processor resources to improve response time.

Method used

Adopt hardware scheduler and hardware arbiter to dynamically schedule graphics and computing work items by switching between graphics greedy mode and computing greedy mode, and use resource utilization metrics and thresholds to make scheduling decisions to ensure balanced utilization of processing units in the two modes. .

Benefits of technology

It realizes the ability to perform graphics and computing tasks on the GPU at the same time, improves processing speed and resource utilization, avoids latency issues, and supports asynchronous computing, improving the overall performance of the processor.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110796588B_ABST
    Figure CN110796588B_ABST
Patent Text Reader

Abstract

The present invention provides a simultaneous computing and graphics scheduling. In some examples, a parallel processing unit (e.g., GPU) is described, including a hardware scheduler and a hardware arbiter, which initiates graphics work and computing work for simultaneous execution on a SIMD / SIMT processing unit. Each processing unit of the parallel processing unit (e.g., a streaming multiprocessor) operates in a graphics greedy mode or a computing greedy mode at each time. The hardware arbiter, in response to the result of comparing at least one monitored performance or utilization metric with a user-configured threshold, can selectively: cause the processing unit to run one or more computing work items from a computing queue when the processing unit operates in a computing greedy mode, and cause the processing unit to run one or more graphics work items from a graphics queue when the processing unit operates in a graphics greedy mode. Associated methods and systems are also described.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application is related to U.S. patent application Ser. No. 14 / 137,818, filed on Dec. 20, 2013, and entitled “System, method, and computer program product for simultaneous execution of compute and graphics workloads.”

[0003] Priority Claim

[0004] No. Technical Field

[0005] The present disclosure relates to scheduling tasks on a computer processor, and more particularly to scheduling graphics tasks and computational tasks on a parallel processing unit (e.g., a graphics processing unit (GPU)), and more particularly to scheduling graphics tasks and computational tasks on the same processing unit in a group of processing units of a parallel processing unit (e.g., a GPU) for simultaneous execution. Background Art

[0006] One way to increase the performance of a processing system is to use parallel processing cores that can execute many instruction streams in parallel. In the past few years, central processing units (CPUs) and graphics processing units (GPUs) have benefited from this increased parallelism. For example, a superscalar processor can dispatch multiple instructions to different execution units, thereby increasing the average execution speed. Similarly, many modern GPUs have a massively parallel processing architecture, meaning that they contain many parallel processors that can operate on different parts of a graphics image in parallel.

[0007] In the past, GPU functionality was limited to a well-defined set of graphics operations. This changed when GPUs became programmable. For example, in 2001, NVidia released its GE Force 3 NV20 GPU, which provided programmable vertex and pixel shaders. Later, Nvidia developed A parallel computing platform and programming model for general-purpose computing on graphics processing units (GPUs). Developers can significantly accelerate computing applications by using GPU processing power to perform computing tasks in addition to graphics tasks.

[0008] GPUs are typically specialized for processing large blocks of data by processing a large number of threads related to a specific scene in parallel. For example, a GPU may be initially assigned to a graphics scene, where all GPU threads are configured to process graphics data in parallel. When the GPU finishes rendering graphics, the CPU may switch the GPU to a different scene and reuse all GPU resources for compute (except graphics) data processing.

[0009] As used herein, a GPU graphics scene includes states related to executing instructions on the GPU to process graphics data (e.g., rendering 3D model data to generate 2D image data, processing textures, generating soft shadows, etc.). A GPU compute scene includes states related to executing instructions on the GPU to perform general parallel computations (e.g., physics computations used in animation or large data set analysis). Many traditional GPUs can be configured to process either a graphics scene or a compute scene, but not both at the same time. The operating system can dynamically switch the GPU from one scene to another as needed during execution in order to process graphics tasks or compute tasks.

[0010] In many applications, it is necessary to dynamically change the allocation of at least some processing power between graphics tasks and computing tasks without the need for context switching, and this can potentially increase the processing speed of the application and improve resource utilization. For example, in the process of processing graphics, the GPU can complete some graphics processing threads or warps while continuing to execute other graphics processing threads or warps. Before the GPU can execute the computing threads or warps, the context needs to be switched from the graphics context to the computing context, during which the GPU needs to complete all graphics processing before allocating any processing resources to the computing function, thereby increasing latency and reducing processor utilization.

[0011] Some other GPUs allocate some processing units for graphics processing and other processing units for computing processing, and allow the allocation ratio of processing units between graphics and computing to be changed without switching scenes. See, for example, USP 9,626,216, which configures a GPU to execute a first workload and a second workload according to a general processing scenario, and switches from executing the first workload to executing the second workload without performing a scene switch. These GPUs allow graphics tasks to be run on some processing units simultaneously, while computing tasks are run on other processing units. However, at least some commercial implementations such as in the past may need to drain the ongoing work from the GPU processing unit before reallocating the processing unit from graphics to computing, which can lead to inefficiencies and delays. In addition, the need to allocate resources at the processing unit level often leads to further inefficiencies.

[0012] Therefore, there is a need for systems with scheduling techniques that can improve response time and / or processing resource utilization by allowing more flexible allocation of the processor between graphics functions and compute functions, but without unduly compromising the ability of the GPU to quickly perform graphics processing. Summary of the invention

[0013] The exemplary embodiments remedy some of the deficiencies of the above-described techniques for sharing the processing resources of a GPU between graphics tasks and computing tasks.

[0014] Disclosed herein are methods, computer-readable media, and systems for scheduling a streaming multiprocessor in a parallel processing unit to simultaneously execute at least one graphics warp and at least one compute warp in parallel.

[0015] Example embodiments provide a graphics processing unit including a streaming multiprocessor that executes parallel instruction streams and a scheduler connected to the streaming processor. The scheduler schedules the streaming multiprocessor to execute at least one graphics warp and at least one compute warp in parallel at the same time.

[0016] Another exemplary embodiment provides a parallel processing unit, including multiple processing units, a hardware scheduler, and a hardware arbiter. Each processing unit is configured to operate in a graphics greedy mode or a computational greedy mode at various times, and to simultaneously run graphics work items from a graphics queue and computational work items from a computational queue. The hardware scheduler is configured to continuously select graphics work items from the graphics queue to run on the specific processing unit when the specific processing unit is configured to operate in the graphics greedy mode, and to continuously select computational work items from the computational queue to run on the specific processing unit when the specific processing unit is configured to operate in the computational greedy mode. The hardware arbiter is configured to, in response to a result of comparing at least one monitored performance or utilization metric with a user-configured threshold, selectively: cause the specific processing unit to run one or more computational work items from the computational queue when the specific processing unit is configured to operate in the graphics greedy mode, and cause the specific processing unit to run one or more graphics work items from the graphics queue when the specific processing unit is configured to operate in the computational greedy mode.

[0017] Another exemplary embodiment provides a method for executing graphics work items and computing work items simultaneously on a parallel processor having multiple processing units. The method includes receiving graphics work items from a graphics pipeline and computing work items from a computing pipeline, and scheduling a first group of the graphics work items and a second group of the computing work items to be executed simultaneously on selected single instruction multiple data (SIMD) or single instruction multiple thread (SIMT) processing units of the multiple processing units.

[0018] Another example embodiment provides a system, comprising: a CPU configured to execute an application; a memory configured to have a graphics queue and a computation queue; and a graphics processing unit. The graphics processing unit includes a plurality of processing units, a hardware scheduler, and a hardware arbiter. Each processing unit is configured to operate in a graphics greedy mode or a computation greedy mode at various times, and to simultaneously run graphics work items from the graphics queue and computation work items from the computation queue. The hardware scheduler is configured to continuously select graphics work items from the graphics queue to run on the specific processing unit when the specific processing unit is configured to operate in the graphics greedy mode, and to continuously select computation work items from the computation queue to run on the specific processing unit when the specific processing unit is configured to operate in the computation greedy mode. The hardware arbiter is configured to selectively: cause the specific processing unit to run one or more computation work items from the computation queue when the specific processing unit is configured to operate in the graphics greedy mode, or cause the specific processing unit to run one or more graphics work items from the graphics queue when the specific processing unit is configured to operate in the computation greedy mode, in response to a result of comparing at least one monitored performance or utilization metric with a user-configured threshold value. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 A system is shown in accordance with some example embodiments in which graphics work items and computational work items may be processed simultaneously in one of multiple single instruction multiple data (SIMD) or single instruction multiple thread (SIMT) processing units of a parallel processing unit such as a GPU.

[0020] Figure 2A A flow chart of a scheduling process according to some exemplary embodiments is shown.

[0021] Figure 2B An exemplary warp-level view of work on a processing unit according to conventional techniques is shown.

[0022] Figure 2C An exemplary warp-level view of work on a processing unit (eg, a single streaming multiprocessor) of a GPU is shown in accordance with some exemplary embodiments.

[0023] Figure 3 A parallel processing unit according to one embodiment is shown.

[0024] Figure 4A According to an embodiment Figure 3 A general-purpose processing cluster within a parallel processing unit.

[0025] Figure 4B According to an embodiment Figure 3 A memory partitioning unit for parallel processing units.

[0026] Figure 5A According to an embodiment Figure 4A Streaming multiprocessor.

[0027] Figure 5B According to one embodiment, the use Figure 3 Conceptual diagram of a processing system implemented with a parallel processing unit (PPU).

[0028] Figure 5C An exemplary system is shown that may implement the various architecture and / or functionality of various previous embodiments.

[0029] Figure 6 According to one embodiment, Figure 3 Conceptual diagram of the graphics processing pipeline implemented by the PPU.

[0030] Figure 7 Schematically illustrates the Figure 1 and further details of the scheduler and arbiter described in FIG. 2 .

[0031] Figure 8 A process is shown by which an application can configure a scheduling policy to control some aspects of how a GPU (or other type of PPU) schedules its graphics work items and its compute work items.

[0032] Fig. 9 A flow diagram of a process that may be performed by a scheduler, such as a scheduler, is shown according to some example embodiments.

[0033] Fig.10 A flow diagram of a process that may be performed by an arbitrator, such as an arbitrator, according to some example embodiments is shown.

[0034] Fig.11 A flow chart of a process that may be performed by an application or other program in a host processor, such as a CPU, to configure one or more scheduling profiles and timers for switching between scheduling profiles is shown.

[0035] Fig.12 A flow chart of a process that may be performed in a GPU, or in some embodiments, in an M-pipeline controller (MPC), to switch a scheduler profile among a series of configured scheduler profiles is shown.

[0036] Fig.13 A flow diagram of an idle detection process 1300 is shown, according to some example embodiments. DETAILED DESCRIPTION

[0037] Exemplary embodiments eliminate some of the deficiencies of the above-described techniques for sharing the processing resources of a GPU between graphics tasks and computing tasks. Exemplary embodiments, for example, provide a hardware scheduler that can effectively schedule independent sequences of graphics work and computing work on a parallel processing unit (e.g., a GPU) for simultaneous execution. Specifically, the hardware scheduler is configured to optimally use computing resources (e.g., a streaming multiprocessor called an SM) by making scheduling decisions at a thread group granularity (e.g., a warp granularity) based on scheduling control of specified software and localized feedback from execution units on how busy they are. Some exemplary embodiments enable sharing of a GPU processing unit (such as an SM) between a graphics pipeline and a computing pipeline by launching one or more graphics warps and one or more computing warps to execute simultaneously on the same SM, thereby sharing an SM between graphics functions and computing functions without requiring scene switching or completing either type of function.

[0038] The GPU according to an embodiment is configured to run graphics shaders (e.g., vertex, tessellation and geometry (VTG) shaders, pixel shaders, etc.) and compute shaders simultaneously on a single SM. Compute shaders are programmable shader stages that extend traditional graphics application programming interfaces (APIs) (e.g., Microsoft Direct3D11) beyond graphics programming. This means that warps from all work types can run simultaneously on the same SM, and warps can compete for SM resources (e.g., register file space, internal buffer entry (ISBE) space, shared memory space, SM ALU resources, L1 cache bandwidth, crossbar switch bandwidth, frame buffer bandwidth, etc.).

[0039] Embodiments provide a GPU to schedule compute work and graphics work at a warp granularity, while also providing software to provide scheduling hints to a hardware scheduler aligned with the work to fine-tune performance between different buckets of work, enable setting of compute priority relative to graphics priority regarding each compute kernel launch, provide feedback from execution units on the GPU to keep the scheduler informed as it attempts to make scheduling decisions, and enable balancing of graphics work across execution units to reduce underutilization due to the in-order nature of the graphics pipeline, etc. Exemplary embodiments use a hardware-implemented simultaneous compute and graphics arbiter (SCG-SM arbiter) to read SM occupancy and utilization statistics or other metrics to determine the time / space allocation percentage of the SM for graphics versus compute.

[0040] Previous GPUs, such as those described in U.S. Application No. 14 / 137,818, enable a scheduler in hardware to adjust the ratio of graphics groups to compute groups of an SM at runtime. However, software is required to make decisions with reference to the appropriate combination of SM groups and adjust them during the frame through a computational method as the work is executed. However, graphics workloads and compute workloads in many real-world scenarios are asynchronous and arrive at random times and are randomly aligned, so it is not practical for software to adjust the schedule through a computational method at runtime. Example embodiments may also improve prior art in features such as hard-coded computationally greedy policies that are not flexible enough to react dynamically to different workloads, cannot allocate any resources to compute or graphics (e.g., rendering or 2D drawing only during z), have high latency associated with exhaustion of SMs, and have high allocation granularity in terms of entire SMs, etc.

[0041] Advantages of the embodiments include improved execution speed, improved resource utilization, etc. due to the underlying support for dynamic allocation of various processing units (such as SMs) between computing tasks and graphics tasks. Among the many advantages of the embodiments, improved support for asynchronous computing is also related to traditional graphics APIs, such as the DirectX12 (DX12) API, which highly encourages the creation of asynchronous computing techniques in games. Simultaneous computing and graphics are key features of the DX12 API. In an exemplary embodiment, the ability to run graphics and computing simultaneously on the same SM is provided, which, among other advantages, avoids latency issues found in previous methods, such as the need to clear the protocol to force all graphics thread bundles to complete operations before switching SMs to run computing thread bundles.

[0042] System and method for concurrently executing compute and graphics on one SM

[0043] Figure 1 A system 100 is shown according to some exemplary embodiments, wherein graphics work items and computational work items can be processed simultaneously in one of multiple single instruction multiple data (SIMD) or single instruction multiple thread (SIMT) processing units of a parallel processing unit 102 (such as a GPU). Figure 3An example parallel processing unit is described. In system 100, a SIMD processing unit 104 is shown having a first set of one or more graphics tasks 106 and a second set of one or more compute tasks 108 that are executed simultaneously. This is in contrast to previous systems, such as the system described in commonly owned co-pending U.S. application Ser. No. 14 / 137,818 filed Dec. 20, 2013, where, although a GPU can process graphics tasks and compute tasks simultaneously on separate processing units, such simultaneous execution is not within the same SIMD processing unit of the GPU. As used in this disclosure, a "processing unit" refers to a SIMD or SIMT processing unit, such as, but not limited to, the following with respect to Figure 4A The streaming multiprocessor (SM) described in Figure 3 and Figure 4A As shown, the example PPU 300 includes multiple SMs in each of its processing cores 350 .

[0044] The first set of graphics tasks 106 and the second set of compute tasks 108 are scheduled for simultaneous execution on the processing unit 104 by a hardware scheduler 110, which schedules tasks from a graphics queue 114 of graphics work items stored therein 117 and tasks from a compute queue 116 of compute work items. The graphics work items in the graphics queue 114 may be queued through one or more graphics pipelines, and the compute work items in the compute queue 116 may be queued through one or more compute pipelines. A "graphics pipeline" ( Figure 6 A "compute pipeline" is a set of logical stages for processing graphics data related to shadow pixels in an image, where each stage can be scheduled separately in a pipelined manner. A "compute pipeline" is a set of logical stages for processing data that is not directly related to shadow pixels in an image. Example compute pipelines may include, but are not limited to, physics computations associated with generating animation models, analyzing large data sets from scientific or financial fields, etc.

[0045] The hardware scheduler 110 is configured to operate in a "graphics greedy mode" in which it repeatedly extracts work items from the graphics queue 114 and issues them to the processing unit 104, or in a "compute greedy mode" in which it repeatedly extracts work items from the compute queue 116 and issues them to the processing unit 104.

[0046] The hardware arbiter 112 operates to monitor the performance and / or utilization of execution and memory resources associated with the processing unit 104, and determines whether a non-greedy type task currently used for transmission should be inserted between the repeatedly selected greedy type tasks for execution in the processing unit 104 while also considering user or software defined configuration parameters for policy and / or task priority. More specifically, the hardware arbiter 112 continuously (or periodically at a configurable stage) monitors 113 runtime statistics of a predetermined set of processing or memory resources to identify "holes" (e.g., excess unused capacity) in the current resource usage, which can then be exhausted (e.g., occupied) by launching some tasks of the non-greedy type. When the hardware scheduler 110 operates in a particular greedy mode, these holes can also be considered as "opportunities" to launch one or more tasks of the non-greedy type. The hardware arbiter 112 can provide a signal 111 to the hardware scheduler 110, notifying it about any holes detected.

[0047] In an exemplary embodiment, each processing unit includes a hardware scheduler 110 and a hardware arbiter 112. For example, in Figure 4A In the embodiment of the present invention, each SM 440 may have an associated hardware scheduler 110 and an associated hardware arbiter 112 arranged within its data processing cluster (DPC).

[0048] The monitoring may be performed by the hardware arbiter 112 according to a policy 120 configured by an application 122 and / or driver software executing on the CPU 124. The policy 120 may set the type of hardware arbiter (e.g., the type of SCG-SM arbiter), the threshold for determining a hole in current resource utilization, the rate at which non-greedy tasks are launched when a hole is detected, etc. The application 122 may be a computer game (e.g., also known as a video game), or other application with both a graphics requirement that enqueues work items into a graphics queue 114 and a computational requirement that enqueues work items into a computational queue 116. The application may send its work items 126 to the memory 117 along with the associated task priority and corresponding instructions 128 to the parallel processing unit (PPU) 102.

[0049] Figure 2A A flow chart of a scheduling process 200 according to some exemplary embodiments is shown. The scheduling process 200 may be performed, for example, in a PPU 102 by hardware units including a hardware scheduler 110 and a hardware arbiter 112 to dynamically schedule graphics tasks and computing tasks to be executed simultaneously on the same SIMD processing unit 104.

[0050] After entering process 200, in operation 202, the hardware scheduler repeatedly launches work items from the graphics queue or the compute queue according to the current priority mode for execution on a processing unit such as processing unit 104 (e.g., SM). For example, when in graphics greedy mode, tasks from the graphics queue can be repeatedly launched, and when in compute greedy mode, tasks from the compute queue can be repeatedly launched. The priority mode (e.g., graphics greedy or compute greedy) can be set in various ways. In some embodiments, the priority mode is based on the higher of the priorities of the items in the graphics queue and the compute queue.

[0051] In operation 204, as a result of monitoring the resources associated with the processing unit, a "hole" in one or more resources currently utilized may be detected. The hole may be detected by comparing the current utilization (represented by statistics averaged over a time interval) to one or more thresholds specified in the scheduling policy.

[0052] In response to detecting a leak, the scheduler launches one or more work items from the queue for the current non-greedy priority in operation 206. For example, when operating in a graphics greedy mode, the detection of a leak may prompt the scheduler to launch certain compute work items, or alternatively, when operating in a compute greedy mode, the detection of a leak may prompt the scheduler to launch certain graphics work items. The non-greedy priority work items launched may be determined based on resource availability indicated by the detected leak and / or a flow rate specified in a currently active scheduling policy.

[0053] Thus, in operation 206, the processing unit may have graphics work items and compute work items executing on it simultaneously while both are competing for common resources.

[0054] Although method 200 is described in the context of a processing unit and certain hardware components, method 200 may also be performed by custom circuits, or by a combination of custom circuits and programs. For example, method 200 may be performed by a GPU (graphics processing unit) or any one or more processors capable of performing operations 202-206. In addition, it will be understood by those of ordinary skill in the art that any system that performs method 200 is within the scope and spirit of embodiments of the present invention.

[0055] Exemplary Warp Workload Distribution

[0056] Figure 2BAn exemplary workload including graphics and compute on one processing unit in a conventional GPU is shown. As shown, at any given time, only a single type of warp can occupy a processing unit. As shown, the processing unit executes a sequence including a full sequence of graphics warps, followed by a full sequence of compute warps, and again a full sequence of graphics warps. The sequence then continues with only a portion of the compute tasks scheduled, where some of the processing unit's capacity is not used.

[0057] Figure 2C Exemplary warps assigned to a processing unit over time according to certain exemplary embodiments are provided. For example, a processing unit may be capable of having multiple (eg, 32) concurrent warps. Figure 2C The processing unit is shown to be initially operating in graphics greedy mode, then briefly in compute greedy mode, and again in graphics greedy mode. It also shows that during the graphics greedy portion, a small number of compute warps are scheduled on the processing unit at certain times, such as when holes (underutilization) are detected. Areas of the graph without a fill pattern may indicate that holes in the workload are detected after a short time (e.g., due to statistics averaged over time). Areas where more than half of the workload are compute warps may represent compute greedy phases with a large number of graphics warps.

[0058] Figure 2B and 2C A comparison of shows a better utilization of the processing unit capacity. Figure 2C 2 indicates that the processing units are shared, and also shows that at least some non-greedy type thread warps can be started while a particular greedy mode is active.

[0059] At least some aspects of the exemplary embodiment may be described by analogy. A police officer manually directing traffic at an intersection where cars in two inbound roads are competing to enter a single outbound road may be similar to a hardware scheduler scheduling work from two work queues on a particular processing unit. The first inbound lane has all the important vehicles, and the police officer allows them to enter the outbound road as quickly as possible. During particularly busy times when multiple lanes of the first inbound road are filled, the police officer may have an assistant who has a more favorable vantage point on the traffic level. Like the hardware arbiter in the exemplary embodiment, the assistant may occasionally signal the police officer when a lull in traffic is observed, and the police officer quickly allows one or a small number of cars from the second inbound road to enter the outbound road. Thus, the outbound road is shared between cars from the first inbound road and the second inbound road in a manner similar to sharing a particular processing unit operating in graphics greedy mode between concurrent graphics warps and compute warps.

[0060] More illustrative information about various optional architectures and features that may or may not implement the aforementioned framework will now be described, depending on the user's desire. It should be strongly noted that the following information is described for illustrative purposes and should not be interpreted as limiting in any way. The following features may be selectively incorporated with or without excluding the other features described.

[0061] Parallel processing architecture

[0062] Figure 3 A parallel processing unit (PPU) 300 is shown according to one embodiment. In one embodiment, the PPU 300 is a multi-threaded processor implemented on one or more integrated circuit devices. The PPU 300 is a latency hiding architecture designed to process multiple threads in parallel. A thread (i.e., a thread of execution) is an instance of a set of instructions configured to be executed by the PPU 300. In one embodiment, the PPU 300 is a graphics processing unit (GPU) configured to implement a graphics rendering pipeline for processing three-dimensional (3D) graphics data to generate two-dimensional (2D) image data for display on a display device such as a liquid crystal display (LCD) device. In other embodiments, the PPU 300 can be used to perform general-purpose calculations. Although an exemplary parallel processor is provided herein for illustrative purposes, it should be strongly noted that such a processor is proposed for illustrative purposes only, and any processor can be used to supplement and / or replace the same processor.

[0063] One or more PPU 300s can be configured to accelerate thousands of high-performance computing (HPC), data center, and machine learning applications. PPU 300 can be configured to accelerate many deep learning systems and applications, including autonomous vehicle platforms, deep learning, high-precision speech, image, and text recognition systems, intelligent video analysis, molecular simulation, drug discovery, disease diagnosis, weather forecasting, big data analysis, astronomy, molecular dynamics simulation, financial modeling, robotics, factory automation, real-time language translation, online search optimization, and personalized user recommendations, etc.

[0064] like Figure 3As shown, the PPU 300 includes an input / output (I / O) unit 305, a front-end unit 315, a scheduler unit 320, a work distribution unit 325, a hub 330, a crossbar switch (Xbar) 370, one or more general processing clusters (GPCs) 350, and one or more partition units 380. The PPU 300 can be connected to a host processor or other PPUs 300 via one or more high-speed NVLink 310 interconnects. The PPU 300 can be connected to a host processor or other peripheral devices via an interconnect 302. The PPU 300 can also be connected to a local memory including a plurality of memory devices 304. In one embodiment, the local memory may include a plurality of dynamic random access memory (DRAM) devices. The DRAM devices can be configured as a high bandwidth memory (HBM) subsystem with a plurality of DRAM dies stacked within each device.

[0065] The NVLink 310 interconnect enables the system to scale and include one or more PPUs 300 in conjunction with one or more CPUs, supporting cache coherency between the PPU 300 and the CPU, and CPU mastering. Data and / or commands may be sent by the NVLink 310 through the hub 330 to or from other units of the PPU 300, such as one or more copy engines, video encoders, video decoders, power management units, etc. (not explicitly shown). Figure 5B NVLink 310 is described in more detail.

[0066] I / O unit 305 is configured to send and receive communications (i.e., commands, data, etc.) from a host processor (not shown) via interconnect 302. I / O unit 305 may communicate directly with the host processor via interconnect 302 or through one or more intermediate devices (e.g., a memory bridge). In one embodiment, I / O unit 305 may communicate with one or more other processors (such as one or more of PPU 300) via interconnect 302. In one embodiment, I / O unit 305 implements a peripheral component interconnect express (PCIe) interface for communicating over a PCIe bus, and interconnect 302 is a PCIe bus. In alternative embodiments, I / O unit 305 may implement other types of well-known interfaces for communicating with external devices.

[0067] I / O unit 305 decodes packets received via interconnect 302. In one embodiment, the packets represent commands configured to cause PPU 300 to perform various operations. As specified by the commands, I / O unit 305 sends the decoded commands to various other units of PPU 300. For example, some commands may be sent to front end unit 315. Other commands may be sent to hub 330 or other units of PPU 300, such as one or more copy engines, video encoders, video decoders, power management units, etc. (not explicitly shown). In other words, I / O unit 305 is configured to route communications between various logical units of PPU 300.

[0068] In one embodiment, a program executed by a host processor encodes a command stream in a buffer that provides a workload to the PPU 300 for processing. The workload may include several instructions and data that are processed by these instructions. A buffer is an area in memory that is accessible (i.e., read / write) by the host processor and the PPU 300. For example, the I / O unit 305 may be configured to access a buffer in a system memory that is connected to the interconnect 302 via a memory request transmitted through the interconnect 302. In one embodiment, the host processor writes a command stream to the buffer and then sends a pointer to the beginning of the command stream to the PPU 300. The front end unit 315 receives a pointer to one or more command streams. The front end unit 315 manages one or more streams, reads commands from the streams, and forwards the commands to the various units of the PPU 300.

[0069] The front end unit 315 is coupled to a scheduler unit 320, which configures the various GPCs 350 to process the tasks defined by one or more streams. The scheduler unit 320 is configured to track state information related to the various tasks managed by the scheduler unit 320. The state may indicate which GPC 350 the task is assigned to, whether the task is active or inactive, a priority associated with the task, etc. The scheduler unit 320 manages the execution of multiple tasks on one or more GPCs 350.

[0070] Scheduler unit 320 is coupled to work distribution unit 325, which is configured to dispatch tasks for execution on GPC 350. Work distribution unit 325 may track a plurality of scheduled tasks received from scheduler unit 320. In one embodiment, work distribution unit 325 manages a pending task pool and an active task pool for each GPC 350. The pending task pool may include a plurality of time slots (e.g., 32 time slots) containing tasks to be assigned to be processed by a particular GPC 350. The active task pool may include a plurality of time slots (e.g., 4 time slots) for tasks that are being actively processed by GPC 350. When a GPC 350 completes executing a task, the task is evicted from the active task pool of GPC 350, and one of the other tasks from the pending task pool is selected and scheduled for execution on GPC 350. If an active task is idle on a GPC 350 , for example, waiting for a data dependency to be resolved, the active task may be evicted from the GPC 350 and returned to the pending task pool, while other tasks in the pending task pool are selected and scheduled for execution on the GPC 350 .

[0071] Work distribution unit 325 communicates with one or more GPCs 350 via XBar 370. XBar 370 is an interconnect network that couples many units of PPU 300 to other units of PPU 300. For example, XBar 370 may be configured to couple work distribution unit 325 to a particular GPC 350. Although not explicitly shown, one or more other units of PPU 300 may also be connected to XBar 370 via hub 330.

[0072] Tasks are managed by a scheduler unit 320 and distributed to GPCs 350 by a work distribution unit 325. GPCs 350 are configured to process tasks and generate results. The results can be consumed by other tasks within the GPC 350, routed to a different GPC 350 via an XBar 370, or stored in memory 304. The results can be written to memory 304 via a partition unit 380, which implements a memory interface for reading and writing data to / from memory 304. The results can be transmitted to another PPU 304 or CPU via NVLink 310. In one embodiment, a PPU 300 includes U partition units 380, which is equal to the number of separate and different memory devices 304 coupled to the PPU 300. The following will be combined with Figure 4B The partition unit 380 is described in more detail.

[0073] In one embodiment, the host processor executes a driver kernel that implements an application programming interface (API) that allows one or more applications executing on the host processor to schedule operations to be performed on the PPU 300. In one embodiment, multiple computing applications are executed simultaneously by the PPU 300 and the PPU 300 provides isolation, quality of service (QoS), and independent address spaces for the multiple computing applications. The application can generate instructions (i.e., API calls) that cause the driver kernel to generate one or more tasks for execution by the PPU 300. The driver kernel outputs the tasks to one or more streams processed by the PPU 300. Each task may include one or more groups of related threads, referred to herein as thread warps. In one embodiment, a thread warp includes 32 related threads that can be executed in parallel. A cooperative thread may refer to multiple threads that include instructions to perform tasks and may exchange data through shared memory. In combination Figure 5A Describes threads and cooperative threads in more detail.

[0074] Figure 4A According to an embodiment Figure 3 PPU 300 GPC 350. Figure 4A As shown, each GPC 350 includes multiple hardware units for processing tasks. In one embodiment, each GPC 350 includes a pipeline manager 410, a front-end operation unit (PROP) 415, a raster engine 425, a work distribution crossbar (WDX) 480, a memory management unit (MMU) 490, and one or more data processing clusters (DPCs) 420. It should be understood that Figure 4A The GPC 350 may include instead Figure 4A The units shown in or except Figure 4A Other hardware units other than those shown in .

[0075] In one embodiment, the operation of the GPC 350 is controlled by a pipeline manager 410. The pipeline manager 410 manages the configuration of one or more DPCs 420 for processing tasks assigned to the GPC 350. In one embodiment, the pipeline manager 410 may configure at least one of the one or more DPCs 420 to implement at least a portion of a graphics rendering pipeline. For example, a DPC 420 may be configured to execute a vertex shader program on a programmable streaming multiprocessor (SM) 440. The pipeline manager 410 may also be configured to route packets received from the work distribution unit 325 to appropriate logic units within the GPC 350. For example, some packets may be routed to fixed-function hardware units in the PROP 415 and / or the raster engine 425, while other packets may be routed to the DPC 420 for processing by the primitive engine 435 or the SM 440. In one embodiment, the pipeline manager 410 may configure at least one of the one or more DPCs 420 to implement a neural network model and / or a compute pipeline.

[0076] PROP unit 415 is configured to route data generated by raster engine 425 and DPC 420 to a raster operations (ROP) unit, in conjunction with Figure 4B The PROP unit 415 may also be configured to perform optimization of color blending, organize pixel data, perform address translation, etc.

[0077] The raster engine 425 includes a plurality of fixed function hardware units configured to perform various raster operations. In one embodiment, the raster engine 425 includes a setup engine, a coarse raster engine, a culling engine, a shearing engine, a fine raster engine, and a tile merging engine. The setup engine receives the transformed vertices and generates plane equations associated with the geometric primitives defined by the vertices. The plane equations are sent to the coarse raster engine to generate coverage information (e.g., x, y coverage masks of tiles) of the primitives. The output of the coarse raster engine is sent to the culling engine, where the fragments associated with the primitives that fail the z test are culled, and the unculled fragments are sent to the shearing engine, where the fragments outside the frustum are sheared. Those fragments that have been clipped and culled can be passed to the fine raster engine to generate attributes of the pixel fragments according to the plane equations generated by the setup engine. The output of the raster engine 425 includes, for example, fragments to be processed by the fragment shader implemented in the DPC 420.

[0078] Each DPC 420 included in the GPC 350 includes an M-pipeline controller (MPC) 430, a primitive engine 435, and one or more SMs 440. The MPC 430 controls the operation of the DPC 420, routing packets received from the pipeline manager 410 to appropriate units in the DPC 420. For example, a packet associated with a vertex may be routed to the primitive engine 435, which is configured to retrieve vertex attributes associated with the vertex from the memory 304. In contrast, a packet associated with a shader program may be sent to the SM 440.

[0079] SM 440 includes a programmable stream processor configured to process tasks represented by multiple threads. Each SM440 is multithreaded and configured to execute multiple threads (e.g., 32 threads) from a specific thread group simultaneously. In one embodiment, SM 440 implements a SIMD (single instruction, multiple data) architecture, wherein each thread in a thread group (i.e., a warp) is configured to process different data sets based on the same set of instructions. All threads in a thread group execute the same instructions. In another embodiment, SM 440 implements a SIMT (single instruction, multiple threads) architecture, wherein each thread in a thread group is configured to process different data sets based on the same set of instructions, but wherein each thread in a thread group allows threads to diverge during execution. In one embodiment, a program counter, a call stack, and an execution state are maintained for each warp, and when threads in a warp diverge, concurrency between serial executions in the warp and the warp is made possible. In another embodiment, a program counter, a call stack, and an execution state are maintained for each individual thread, thereby achieving equal concurrency between all threads in the warp and between the warps. When the execution state is maintained for each individual thread, threads executing the same instructions can be converged and executed in parallel for maximum efficiency. Figure 5A Describe SM440 in more detail.

[0080] MMU 490 provides an interface between GPC 350 and partition unit 380. MMU 490 can provide virtual address to physical address translation, memory protection, and arbitration of memory requests. In one embodiment, MMU 490 provides one or more translation lookaside buffers (TLBs) for performing virtual address to physical address translation in memory 304.

[0081] Figure 4B According to an embodiment Figure 3 The memory partition unit 380 of the PPU 300. Figure 4BAs shown, the memory partition unit 380 includes a raster operation (ROP) unit 450, a second level (L2) cache 460, and a memory interface 470. The memory interface 470 is coupled to the memory 304. The memory interface 470 may implement a 32, 64, 128, 1024 bit data bus, etc. for high speed data transfer. In one embodiment, the PPU 300 includes U memory interfaces 470, one memory interface 470 for each pair of partition units 380, wherein each pair of partition units 380 is connected to a corresponding memory device 304. For example, the PPU 300 may be connected to Y memory devices 304, such as a high bandwidth memory stack or a graphics double data rate, version 5, synchronous dynamic random access memory, or other types of persistent memory.

[0082] In one embodiment, the memory interface 470 implements an HBM2 memory interface and Y is equal to half U. In one embodiment, the HBM2 memory stack is located on the same physical package as the PPU 300, saving significant power and area compared to traditional GDDR5 SDRAM systems. In one embodiment, each HBM2 stack includes four memory dies and Y is equal to 4, the HBM2 stack includes two 128-bit channels per die, a total of 8 channels and a data bus width of 1024 bits.

[0083] In one embodiment, memory 304 supports single-error correcting double-error detecting (SECDED) error correction code (ECC) to protect data. ECC provides higher reliability for computing applications that are sensitive to data corruption. Reliability is particularly important in large-scale cluster computing environments where PPU 300 processes very large data sets and / or long-running applications.

[0084] In one embodiment, the PPU 300 implements a multi-level memory hierarchy. In one embodiment, the memory partition unit 380 supports unified memory to provide a single unified virtual address space for the CPU and PPU 300 memory, thereby enabling data sharing between virtual memory systems. In one embodiment, the frequency with which the PPU 300 accesses memory located on other processors is tracked to ensure that memory pages are moved to the physical memory of the PPU 300 where the pages are accessed more frequently. In one embodiment, the NVLink 310 supports address translation services, allowing the PPU 300 to directly access the CPU's page tables and providing full access to the CPU's memory through the PPU 300.

[0085] In one embodiment, the copy engine transfers data between multiple PPUs 300 or between a PPU 300 and a CPU. The copy engine can generate a page fault for an address that is not mapped to a page table. The memory partition unit 380 can then handle the page fault, map the address into a page table, and then the copy engine can perform the transfer. In conventional systems, memory is pinned (i.e., non-pageable) for multiple copy engine operations between multiple processors, greatly reducing the available memory. With a hardware page fault, the address can be passed to the copy engine without having to worry about whether the memory page is resident, and the copy process is transparent.

[0086] Data from memory 304 or other system memory may be retrieved by memory partition unit 380 and stored in L2 cache 460, which is located on-chip and shared between various GPCs 350. As shown, each memory partition unit 380 includes a portion of L2 cache 460 associated with a corresponding memory device 304. Lower level caches may then be implemented in various units within GPC 350. For example, each of SM 440 may implement a level 1 (L1) cache. The L1 cache is private memory dedicated to a particular SM 440. Data from L2 cache 460 may be retrieved and stored in each L1 cache for processing in the functional units of SM 440. L2 cache 460 is coupled to memory interface 470 and XBar 370.

[0087] The ROP unit 450 performs graphics raster operations related to pixel color, such as color compression, pixel blending, etc. The ROP unit 450 also implements depth testing in conjunction with the raster engine 425, receiving the depth of the sample position associated with the pixel fragment from the culling engine of the raster engine 425. The depth is tested for the sample position associated with the fragment against the corresponding depth in the depth buffer. If the fragment passes the depth test for the sample position, the ROP unit 450 updates the depth buffer and sends the result of the depth test to the raster engine 425. It should be understood that the number of partition units 380 can be different than the number of GPCs 350, and therefore, each ROP unit 450 can be coupled to each of the GPCs 350. The ROP unit 450 tracks packets received from different GPCs 350 and determines to which GPC 350 to route the results generated by the ROP unit 450 via the Xbar 370. Although the ROP unit 450 is included in Figure 4B 380 in the memory partition unit 380, but in other embodiments, the ROP unit 450 may be located outside the memory partition unit 380. For example, the ROP unit 450 may reside in the GPC 350 or other units.

[0088] Figure 5A According to an embodiment Figure 4A The streaming multiprocessor 440. Figure 5A As shown, SM 440 includes an instruction cache 505, one or more scheduler units 510, a register file 520, one or more processing cores 550, one or more special function units (SFUs) 552, one or more load / store units (LSUs) 554, an interconnection network 580, and a shared memory / L1 cache 570.

[0089] As described above, the work distribution unit 325 distributes tasks for execution on the GPCs 350 of the PPU 300. Tasks are assigned to specific DPCs 420 within the GPC 350, and if the task is associated with a shader program, the task may be assigned to an SM 440. The scheduler unit 510 receives tasks from the work distribution unit 325 and manages instruction scheduling for assigning one or more thread blocks to the SMs 440. The scheduler unit 510 schedules the thread blocks for execution as warps of parallel threads, where at least one warp is assigned to each thread block. In one embodiment, each warp executes 32 threads. The scheduler unit 510 can manage multiple different thread blocks, assign warps to different thread blocks, and then dispatch instructions from multiple different cooperating groups to various functional units (i.e., cores 550, SFUs 552, and LSUs 554) during each clock cycle.

[0090] Cooperative Groups is a programming model for organizing groups of communicating threads that allows developers to express the granularity at which threads are communicating, enabling richer and more efficient decompositions of parallelism. The cooperative launch API supports synchronization between thread blocks to execute parallel algorithms. Traditional programming models provide a single simple construct for synchronizing cooperative threads: a barrier across all threads of a thread block (i.e., the syncthreads() function). However, programmers often want to define thread groups at a granularity smaller than a thread block and synchronize within the defined group in order to achieve higher performance, design flexibility, and software reuse in the form of a collective group-wide functional interface.

[0091] Cooperative Groups enables programmers to explicitly define thread groups at sub-block (i.e., as small as a single thread) and multi-block granularity, and perform collective operations such as synchronization on threads in a cooperative group. The programming model supports clean composition across software boundaries, so libraries and utility functions can safely synchronize in their local context without making assumptions about convergence. Cooperative Groups primitives support new cooperative parallelism patterns, including producer-consumer parallelism, opportunistic parallelism, and global synchronization across the entire grid of thread blocks.

[0092] The dispatch unit 515 is configured to send instructions to one or more functional units. In this embodiment, the scheduler unit 510 includes two dispatch units 515, which enables dispatching two different instructions from the same thread warp during each clock cycle. In alternative embodiments, each scheduler unit 510 may include a single dispatch unit 515 or additional dispatch units 515.

[0093] Each SM 440 includes a register file 520 that provides a set of registers for the functional units of the SM 440. In one embodiment, the register file 520 is divided between each functional unit, so that each functional unit is allocated a dedicated portion of the register file 520. In another embodiment, the register file 520 is divided between different warps executed by the SM 440. The register file 520 provides temporary storage for operands connected to the data paths of the functional units.

[0094] Each SM 440 includes L processing cores 550. In one embodiment, SM 440 includes a large number (e.g., 128, etc.) of different processing cores 550. Each core 550 may include a full pipeline, single precision, double precision, and / or mixed precision processing unit including a floating point arithmetic logic unit and an integer arithmetic logic unit. In one embodiment, the floating point arithmetic logic unit implements the IEEE 754-2008 standard for floating point arithmetic. In one embodiment, core 550 includes 64 single precision (32-bit) floating point cores, 64 integer cores, 32 double precision (64-bit) floating point cores, and 8 tensor cores.

[0095] The tensor core is configured to perform matrix operations, and in one embodiment, one or more tensor cores are included in the core 550. Specifically, the tensor core is configured to perform deep learning matrix arithmetic, such as convolution operations for neural network training and speculation. In one embodiment, each tensor core operates on a 4×4 matrix and performs a matrix multiplication and accumulation operation D=A×B+C, where A, B, C, and D are 4×4 matrices.

[0096] In one embodiment, the matrix multiplication inputs A and B are 16-bit floating-point matrices, while the accumulation matrices C and D can be either 16-bit floating-point matrices or 32-bit floating-point matrices. Tensor cores operate on 16-bit floating-point input data with 32-bit floating-point accumulation. The 16-bit floating-point multiplication requires 64 operations and produces a full-precision product, which is then used for a 4×4×4 matrix multiplication using 32-bit floating-point addition with other intermediate product accumulations. In practice, tensor cores are used to perform larger two-dimensional or higher-dimensional matrix operations that are built from these smaller elements. APIs such as the CUDA 9 C++ API expose specialized matrix loads, matrix multiplications and accumulations, and matrix store operations to efficiently use tensor cores from CUDA-C++ programs. At the CUDA level, the warp-level interface assumes that matrices of size 16×l6 span all 32 threads of the warp.

[0097] Each SM 440 also includes M SFUs 552 that perform special functions (e.g., attribute evaluation, reciprocal square root, etc.). In one embodiment, the SFUs 552 may include a tree traversal unit configured to traverse a hierarchical tree data structure. In one embodiment, the SFUs 552 may include a texture unit configured to perform texture mapping filtering operations. In one embodiment, the texture unit is configured to load a texture map (e.g., a 2D texture pixel array) from the memory 304 and sample the texture map to generate sampled texture values ​​for use in a shader program executed by the SM 440. In one embodiment, the texture map is stored in the shared memory / L1 cache 470. The texture unit implements texture operations, such as filtering operations using texture mapping matching (mip-map) (i.e., texture maps of different levels of detail). In one embodiment, each SM 340 includes two texture units.

[0098] Each SM 440 also includes N LSUs 554 that implement load and store operations between the shared memory / L1 cache 570 and the register file 520. Each SM 440 includes an interconnect network 580 that connects each functional unit to the register file 520 and the LSUs 554 to the register file 520, the shared memory / L1 cache 570. In one embodiment, the interconnect network 580 is a crossbar switch that can be configured to connect any functional unit to any register in the register file 520 and to connect the LSUs 554 to memory locations in the register file and the shared memory / L1 cache 570.

[0099] Shared memory / L1 cache 570 is an on-chip memory array that allows data storage and communication between SM 440 and primitive engines 435 and between threads in SM 440. In one embodiment, shared memory / L1 cache 570 includes 128KB of storage capacity and is located in the path from SM 440 to partition unit 380. Shared memory / L1 cache 570 can be used to cache reads and writes. One or more of shared memory / L1 cache 570, L2 cache 460, and memory 304 are backing stores.

[0100] Combining data cache and shared memory functionality into a single memory block provides the best overall performance for both types of memory accesses. Capacity can be used as a cache for programs that do not use shared memory. For example, if the shared memory is configured to use half of the capacity, texture and load / store operations can use the remaining capacity. Integration within shared memory / L1 cache 570 enables shared memory / L1 cache 570 to be used as a high throughput pipeline for streaming data while providing high bandwidth and low latency access to frequently reused data.

[0101] When configured for general parallel computing, a simpler configuration can be used compared to graphics processing. Specifically, bypassing Figure 3 , thereby creating a simpler programming model. In a general-purpose parallel computing configuration, the work distribution unit 325 allocates thread blocks and assigns them directly to the DPC 420. The threads in the block execute the same program, use unique thread IDs in calculations to ensure that each thread generates unique results, use SM 440 to execute the program and perform calculations, use shared memory / LI cache 570 to communicate between threads, and use LSU 554 to read and write global memory through shared memory / L1 cache 570 and memory partition unit 380. When configured for general-purpose parallel computing, SM 440 can also write commands that the scheduler unit 320 can use to start new work on DPC 420.

[0102] The PPU 300 may be included in a desktop computer, a laptop computer, a tablet computer, a server, a supercomputer, a smartphone (e.g., a wireless, handheld device), a personal digital assistant (PDA), a digital camera, a vehicle, a head-mounted display, a handheld electronic device, etc. In one embodiment, the PPU 300 is embodied on a single semiconductor substrate. In another embodiment, the PPU 300 is included in a system on a chip (SoC) with one or more other devices (e.g., an additional PPU 300, a memory 304, a reduced instruction set computer (RISC) CPU, a memory management unit (MMU), a digital-to-analog converter (DAC), etc.).

[0103] In one embodiment, PPU 300 may be included on a graphics card that includes one or more memory devices 304. The graphics card may be configured to interface with a PCIe slot on a motherboard of a desktop computer. In yet another embodiment, PPU 300 may be an integrated graphics processing unit (iGPU) or parallel processor included in a chipset of a motherboard.

[0104] Exemplary Computing System

[0105] Systems with multiple GPUs and CPUs are used in a variety of industries as developers expose and exploit more parallelism in applications such as artificial intelligence computing. High-performance GPU-accelerated systems with tens of thousands of computing nodes are deployed in data centers, research institutions, and supercomputers to solve increasingly challenging problems. As the number of processing devices within high-performance systems increases, communication and data transfer mechanisms need to scale to support this increase.

[0106] Figure 5B According to the use of the embodiment Figure 3 A conceptual diagram of a processing system 500 implemented by a PPU 300 of FIG. 5 . The exemplary system 500 may be configured to implement Figure 2A The processing system 500 includes a CPU 530, a switch 555, and a plurality of PPUs 300 and a memory 304 for each PPU. NVLink 310 provides a high-speed communication link between each PPU 300. Figure 5B A specific number of NVLink 310 and interconnect 302 connections are shown, but the number of connections to each PPU 300 and CPU 530 may vary. Switch 555 interfaces between interconnect 302 and CPU 530. PPU 300, memory 304, and NVLink 310 may be located on a single semiconductor platform to form parallel processing module 525. In one embodiment, switch 555 supports interface protocols between two or more of the various different connections and / or links.

[0107] In another embodiment (not shown), NVLink 310 provides one or more high-speed communication links between each PPU 300 and CPU 530, and switch 555 interfaces between interconnect 302 and each PPU 300. PPU 300, memory 304, and interconnect 302 may be located on a single semiconductor platform to form parallel processing module 525. In yet another embodiment (not shown), interconnect 302 provides one or more communication links between each PPU 300 and CPU 530. Switch 555 interfaces between each PPU 300 using NVLink 310 to provide one or more high-speed communication links between PPU 300. In another embodiment (not shown), NVLink 310 provides one or more high-speed communication links between PPU 300 and CPU 530 through switch 555. In another embodiment (not shown), interconnect 302 provides one or more communication links directly between each PPU 300. One or more NVLink 310 high-speed communication links may be implemented as a physical NVLink interconnect or an on-chip interconnect or an on-die interconnect using the same protocol as NVLink 310.

[0108] In the context of this specification, a single semiconductor platform may refer to a unique single semiconductor-based integrated circuit manufactured on a die or chip. It should be noted that the term single semiconductor platform may also refer to a multi-chip module with increased connectivity that simulates on-chip operation and is substantially improved over that using traditional bus implementations. Of course, various circuits or devices may also be provided individually or in various combinations of semiconductor platforms, depending on the user's expectations. Alternatively, the parallel processing module 525 may be implemented as a circuit board substrate, and each PPU 300 and / or memory 304 may be a packaged device. In one embodiment, the CPU 530, switch 555, and parallel processing module 525 are located on a single semiconductor platform.

[0109] In one embodiment, the signaling rate of each NVLink 310 is 20 to 25 Gigabits per second, and each PPU 300 includes six NVLink 310 interfaces (e.g., Figure 5B As shown, each PPU 300 includes five NVLink 310 interfaces. Each NVLink 310 provides a data transfer rate of 25 GBytes / sec in each direction, with six links providing 300 GBytes / sec. When the CPU 530 also includes one or more NVLink 310 interfaces, the NVLink 310 can be used exclusively for, for example, Figure 5B PPU to PPU communication as shown, or some combination of PPU to PPU and PPU to CPU.

[0110] In one embodiment, NVLink 310 allows direct load / store / atomic access from CPU 530 to memory 304 of each PPU 300. In one embodiment, NVLink 310 supports coherency operations, allowing data read from memory 304 to be stored in the cache hierarchy of CPU 530, reducing cache access latency of CPU 530. In one embodiment, NVLink 310 includes support for address translation services (ATS), allowing PPU 300 to directly access page tables within CPU 530. One or more NVLink 310 can also be configured to operate in a low power mode.

[0111] Figure 5C An exemplary system 565 is shown in which various architectures and / or functionality of various previous embodiments may be implemented. The exemplary system 565 may be configured to implement the method 200 shown in FIG.

[0112] As shown, a system 565 is provided, which includes at least one central processing unit 530 connected to a communication bus 575. The communication bus 575 can be implemented using any suitable protocol, such as PCI (Peripheral Component Interconnect), PCI-Express, AGP (Accelerated Graphics Port), HyperTransport or any other bus or point-to-point communication protocol. The system 565 also includes a main memory 540. Control logic (software) and data are stored in the main memory 540, which can take the form of random access memory (RAM).

[0113] The system 565 also includes an input device 560, a parallel processing system 525, and a display device 545 (i.e., a conventional CRT (cathode ray tube), LCD (liquid crystal display), LED (light emitting diode), plasma display, etc.). User input may be received from the input device 560 such as a keyboard, mouse, touch pad, microphone, etc. Each of the above modules and / or devices may even be located on a single semiconductor platform to form the system 565. Alternatively, the various modules may also be located individually or in various combinations of semiconductor platforms as desired by the user.

[0114] Furthermore, system 565 may be coupled to a network (eg, a telecommunications network, a local area network (LAN), a wireless network, a wide area network (WAN) such as the Internet, a peer-to-peer network, a wired network, etc.) through network interface 535 for communication.

[0115] System 565 may also include auxiliary storage (not shown). Auxiliary storage includes, for example, a hard disk drive and / or a removable storage drive in the form of a floppy disk drive, a tape drive, an optical disk drive, a digital versatile disk (DVD) drive, a recording device, a universal serial bus (USB) flash memory. The removable storage drive reads and writes to the removable storage unit in a well-known manner.

[0116] Computer programs or computer control logic algorithms may be stored in the main memory 540 and / or the secondary storage. Such computer programs, when executed, enable the system 565 to perform various functions. The main memory 540, storage, and / or any other storage are possible examples of computer-readable media.

[0117] The architecture and / or functionality of the various previous figures may be implemented in the context of a general purpose computer system, a circuit board system, a game console system dedicated to entertainment purposes, a specific application system, and / or any other desired system. For example, the system 565 may take the form of a desktop computer, a laptop computer, a tablet computer, a server, a supercomputer, a smartphone (e.g., wireless, handheld device), a personal digital assistant (PDA), a digital camera, a vehicle, a head mounted display, a handheld electronic device, a mobile phone device, a television, a workstation, a game console, an embedded system, and / or any other type of logic.

[0118] Although various embodiments have been described above, it should be understood that they are presented by way of example only and not limitation. Thus, the breadth and scope of a preferred embodiment should not be limited by any of the above-described exemplary embodiments, but should be limited only in accordance with the following claims and their equivalents.

[0119] Graphics Processing Pipeline

[0120] In one embodiment, PPU 300 includes a graphics processing unit (GPU). PPU 300 is configured to receive commands specifying a shader program for processing graphics data. Graphics data may be defined as a set of primitives, such as points, lines, triangles, quadrilaterals, triangle strips, etc. Typically, a primitive includes data specifying a plurality of vertices for the primitive (e.g., in a model space coordinate system) and attributes associated with each vertex of the primitive. PPU 300 may be configured to process graphics primitives to generate a frame buffer (i.e., pixel data for each pixel of a display).

[0121] The application writes the model data (i.e., a collection of vertices and attributes) of the scene to a memory such as system memory or memory 304. The model data defines each object visible on the display. Then, the application makes an API call to the driver kernel to request rendering and display of the model data. The driver kernel reads the model data and writes commands to one or more streams to perform operations to process the model data. The command may reference different shader programs to be implemented on the SM 440 of the PPU 300, including one or more of a vertex shader, a hull shader, a domain shader, a geometry shader, and a pixel shader. For example, one or more of the SM 440 may be configured to execute a vertex shader program that processes multiple vertices defined by the model data. In one embodiment, different SMs 440 may be configured to execute different shader programs simultaneously. For example, a first subset of SMs 440 may be configured to execute a vertex shader program, and a second subset of SMs 440 may be configured to execute a pixel shader program. The first subset of SM440 processes the vertex data to generate processed vertex data and writes the processed vertex data to L2 cache 460 and / or memory 304. After rasterizing the processed vertex data (i.e., transforming from three-dimensional data to two-dimensional data in screen space) to generate fragment data, the second subset of SM440 executes a pixel shader to generate processed fragment data, which is then mixed with other processed fragment data and written to a frame buffer in memory 304. The vertex shader program and the pixel shader program can be executed simultaneously, processing different data from the same scene in a pipelined manner until all model data of the scene is rendered to the frame buffer. The contents of the frame buffer are then sent to the display controller for display on the display device.

[0122] Figure 6 According to one embodiment, Figure 3 300 of the PPU 300. Graphics processing pipeline 600 is an abstract flow chart of processing steps implemented to generate a 2D computer-generated image from 3D geometric data. As is well known, pipeline architectures can more efficiently perform long-latency operations by breaking the operations into multiple stages, where the output of each stage is coupled to the input of the immediately next stage. Thus, graphics processing pipeline 600 receives input data 601 that is transmitted from one stage of graphics processing pipeline 600 to the next stage to generate output data 602. In one embodiment, graphics processing pipeline 600 may represent a graphics processing pipeline composed of API-defined graphics processing pipeline. Alternatively, graphics processing pipeline 600 can be implemented in the functional and architectural context of the previous figures and / or any subsequent figures.

[0123] like Figure 6As shown, the graphics processing pipeline 600 includes a pipeline architecture that includes multiple stages. These stages include, but are not limited to, a data assembly stage 610, a vertex shading stage 620, a primitive assembly stage 630, a geometry shading stage 640, a viewport scaling, culling and clipping (VSCC) stage 650, a rasterization stage 660, a fragment shading stage 670, and a raster operation stage 680. In one embodiment, input data 601 includes commands and geometric primitives (e.g., points, lines, triangles, quadrilaterals, triangle strips or fans, etc.) processed by the stage, which configure the processing unit to implement the stage of the graphics processing pipeline 600. Output data 602 may include pixel data (i.e., color data) or other types of surface data structures located in memory that are copied to a frame buffer.

[0124] The data collection stage 610 receives input data 601, which specifies vertex data for a high-order surface, primitive, etc. The data collection stage 610 collects the vertex data in a temporary storage or queue, such as by receiving a command from a host processor including a pointer to a buffer in memory and reading the vertex data from the buffer. The vertex data is then sent to the vertex shading stage 620 for processing.

[0125] The vertex shading stage 620 processes vertex data by performing a set of operations (i.e., a vertex shader or program) on each vertex. For example, a vertex may be specified as a 4-coordinate vector (i.e.,<x,y,z,w> ). The vertex shading stage 620 can manipulate various vertex attributes, such as position, color, texture coordinates, etc. In other words, the vertex shading stage 620 performs operations on vertex coordinates or other vertex attributes associated with the vertex. These operations typically include lighting operations (i.e., modifying the color attributes of the vertex) and transformation operations (i.e., modifying the coordinate space of the vertex). For example, a vertex can be specified using coordinates in an object coordinate space, and the vertex can be transformed by multiplying the coordinates by a matrix that converts the coordinates from the object coordinate space to a world space or a standardized device coordinate (NCD) space. The vertex shading stage 620 generates transformed vertex data, which is sent to the primitive assembly stage 630.

[0126] The primitive collection stage 630 collects the vertices output by the vertex shading stage 620 and groups the vertices into geometric primitives for processing by the geometry shading stage 640. For example, the primitive collection stage 630 may be configured to group every three consecutive vertices into a geometric primitive (i.e., a triangle) for transmission to the geometry shading stage 640. In some embodiments, a particular vertex may be reused for subsequent geometric primitives (e.g., two consecutive triangles in a triangle strip may share two vertices). The primitive collection stage 630 sends the geometric primitives (i.e., the collection of associated vertices) to the geometry shading stage 640.

[0127] The geometry shading stage 640 processes geometric primitives by performing a set of operations (i.e., geometry shaders or programs) on the geometric primitives. The tessellation operation can generate one or more geometric primitives from each geometric primitive. In other words, the geometry shading stage 640 can subdivide each geometric primitive into a finer grid of two or more geometric primitives for processing by the rest of the graphics processing pipeline 600. The geometry shading stage 640 sends the geometric primitives to the viewport SCC stage 650.

[0128] In one embodiment, the graphics processing pipeline 600 may operate within a streaming multiprocessor, and the vertex shading stage 620, primitive collection stage 630, geometry shading stage 640, fragment shading stage 670 and / or hardware / software associated therewith may perform processing operations sequentially. Once the sequential processing operations are completed, in one embodiment, the viewport SCC stage 650 may utilize the data. In one embodiment, primitive data processed by one or more stages in the graphics processing pipeline 600 may be written to a cache (e.g., an L1 cache, a vertex cache, etc.). In this case, in one embodiment, the viewport SCC stage 650 may access the data in the cache. In one embodiment, the viewport SCC stage 650 and the rasterization stage 660 may be implemented as fixed function circuits.

[0129] The viewport SCC stage 650 performs viewport scaling, culling, and clipping of geometric primitives. Each rendered surface is associated with an abstract camera position. The camera position represents the position from which the viewer views the scene and defines a viewing frustum that surrounds the objects of the scene. The viewing frustum may include an observation plane, a back plane, and four clipping planes. Any geometric primitives that are completely outside the viewing frustum may be culled (i.e., discarded) because they will not contribute to the final rendered scene. Any geometric primitives that are partially inside the viewing frustum and partially outside the viewing frustum may be clipped (i.e., transformed into new geometric primitives that are enclosed within the viewing frustum). In addition, the geometric primitives may each be scaled based on the depth of the viewing frustum. All visible geometric primitives are then sent to the rasterization stage 660.

[0130] The rasterization stage 660 converts 3D geometric primitives into 2D fragments (e.g., capable of being used for display, etc.). The rasterization stage 660 can be configured to use the vertices of the geometric primitives to set up a set of plane equations from which various attributes can be interpolated. The rasterization stage 660 can also calculate a coverage mask for multiple pixels, which indicates whether one or more sample positions for a pixel intercept the geometric primitive. In one embodiment, a z test can also be performed to determine whether the geometric primitive is occluded by other geometric primitives that have been rasterized. The rasterization stage 660 generates fragment data (i.e., interpolated vertex attributes associated with a particular sample position for each covered pixel), which is sent to the fragment shading stage 670.

[0131] The fragment shading stage 670 processes the fragment data by executing a set of operations (i.e., a fragment shader or program) on each fragment. The fragment shading stage 670 may generate pixel data (i.e., color values) for the fragment, such as by performing lighting operations or sampling a texture map using interpolated texture coordinates of the fragment. The fragment shading stage 670 generates pixel data, which is sent to the raster operations stage 680.

[0132] Raster operations stage 680 may perform various operations on the pixel data, such as performing alpha tests, stencil tests, and blending the pixel data with other pixel data corresponding to other fragments associated with the pixel. When raster operations stage 680 has finished processing the pixel data (i.e., output data 602), the pixel data may be written to a render target, such as a frame buffer, a color buffer, etc.

[0133] It should be understood that one or more additional stages may be included in the graphics processing pipeline 600 in addition to or in place of one or more of the above-described stages. Various implementations of the abstract graphics processing pipeline may implement different stages. Furthermore, in some embodiments, one or more of the above-described stages (e.g., the geometry shading stage 640) may be excluded from the graphics processing pipeline. Other types of graphics processing pipelines are also contemplated to be within the scope of the present disclosure. Furthermore, any stage of the graphics processing pipeline 600 may be implemented by one or more dedicated hardware units within a graphics processor such as the PPU 300. Other stages of the graphics processing pipeline 600 may be implemented by programmable hardware units such as the SM 440 of the PPU 300.

[0134] The graphics processing pipeline 600 may be implemented by an application program executed by a host processor (e.g., a CPU). In one embodiment, a device driver may implement an application programming interface (API) that defines various functions that may be used by an application program to generate graphics data for display. A device driver is a software program that includes a plurality of instructions that control the operation of the PPU 300. The API provides an abstraction for programmers that allows programmers to utilize dedicated graphics hardware (e.g., PPU 300) to generate graphics data without requiring programmers to utilize a specific instruction set of the PPU 300. An application program may include an API call that is routed to a device driver of the PPU 300. The device driver interprets the API call and performs various operations in response to the API call. In some cases, the device driver may perform operations by executing instructions on the CPU. In other cases, the device driver may perform operations at least in part by initiating operations on the PPU 300 using an input / output interface between the CPU and the PPU 300. In one embodiment, the device driver is configured to implement the graphics processing pipeline 600 using the hardware of the PPU 300.

[0135] Various programs may be executed within the PPU 300 to implement various stages of the graphics processing pipeline 600. For example, a device driver may launch a kernel on the PPU 300 to execute the vertex shading stage 620 on one SM 440 (or multiple SMs 440). The device driver (or the initial kernel executed by the PPU 300) may also launch other kernels on the PPU 300 to execute other stages of the graphics processing pipeline 600, such as the geometry shading stage 640 and the fragment shading stage 670. In addition, some stages of the graphics processing pipeline 600 may be implemented on fixed unit hardware, such as a rasterizer or a data assembler implemented within the PPU 300. It will be appreciated that the results from one kernel may be processed by one or more intermediate fixed hardware units before being processed by a subsequent kernel on the SM 440.

[0136] Machine Learning

[0137] Deep neural networks (DNNs) developed on processors like the PPU 300 are already being used for a variety of use cases, from self-driving cars to faster drug development, from automatic image captioning in online image databases to intelligent real-time language translation in video chat applications. Deep learning is a technology that mimics the neural learning process of the human brain, constantly learning, getting smarter, and providing more accurate results faster over time. Children are initially taught by adults to correctly identify and classify various shapes, and eventually are able to recognize shapes without any guidance. Similarly, deep learning or neural learning systems need to be trained in object recognition and classification in order to become smarter and more effective in identifying basic objects, occluded objects, etc., while also assigning context to objects.

[0138] At the simplest level, neurons in the human brain look at the various inputs they receive, assign a level of importance to each of these inputs, and pass outputs to other neurons for action. An artificial neuron, or perceptron, is the most basic model of a neural network. In one example, a perceptron may receive one or more inputs representing various features of an object that it is trained to recognize and classify, and assign a specific weight to each of these features based on how important that feature is in defining the shape of the object.

[0139] A deep neural network (DNN) model includes multiple layers of multiple connected perceptrons (e.g., nodes) that can be trained with large amounts of input data to quickly solve complex problems with high accuracy. In one example, the first layer of a DNN model breaks down an input image of a car into its parts and looks for basic patterns such as lines and angles. The second layer assembles lines to look for higher-level patterns such as wheels, windshields, and mirrors. The next layer identifies the type of vehicle, and the last few layers generate labels for the input image, identifying the model of a specific car brand.

[0140] Once a DNN is trained, it can be deployed and used to recognize and classify objects or patterns in a process called inference. Examples of inference (the process by which a DNN extracts useful information from a given input) include recognizing handwritten numbers on a check deposited into an ATM machine, identifying images of friends in photos, providing movie recommendations to over 50 million users, recognizing and classifying different types of cars, pedestrians, and road hazards in a self-driving car, or translating human speech in real time.

[0141] During training, data flows through the DNN in a forward propagation phase until a prediction is produced indicating a label corresponding to the input. If the neural network does not label the input correctly, the error between the correct label and the predicted label is analyzed, and the weights for each feature are adjusted in a backward propagation phase until the DNN correctly labels the input and other inputs in the training data set. Training complex neural networks requires a large amount of parallel computing performance, including floating-point multiplication and addition supported by the PPU 300. Inference, which is less computationally intensive than training, is a latency-sensitive process in which an already trained neural network is applied to new inputs that have not been seen before to classify images, translate speech, and generally infer new information.

[0142] Neural networks rely heavily on matrix math operations, and complex multi-layer networks require a lot of floating-point performance and bandwidth to improve efficiency and speed. PPU 300 has thousands of processing cores optimized for matrix math operations, providing tens to hundreds of TFLOPS of performance, and is a computing platform that can provide the performance required for artificial intelligence and machine learning applications based on deep neural networks.

[0143] Simultaneous Compute and Graphics Processing on a SM with an Unbalanced Arbiter

[0144] Figure 7 Schematically illustrates a schematic diagram of a circuit according to some example embodiments. Figure 1 2 and further details of the hardware scheduler and hardware arbiter described in FIG. More specifically, Figure 7 An MPC 702 of a PPU (eg, PPU 102) and a scheduler and an arbiter implemented in the MPC 702 are shown. Figure 7 In the illustrated embodiment, hardware scheduler 708 and hardware arbiter 710 are located in MPC 702 associated with SM 704. In some embodiments, one or both of scheduler 708 and arbiter 710 are implemented external to MPC 702, but within the same DPC as SM 704. The physical proximity of arbiter 710 to SM 704 facilitates the fast response necessary for the SM to perform non-greedy work efficiently. The physical proximity also improves the accuracy of feedback about SM utilization.

[0145] According to some embodiments, scheduler 708 and arbiter 710 may correspond to implementations of scheduler 110 and arbiter 112, respectively. According to some embodiments, scheduler 708 and arbiter 710 operate in a DPC-level arbiter mode, which is "unbalanced" in that each MPC makes decisions independently based on local information from its DPC (see Figure 4A DPC and MPC are described).

[0146] The scheduler 708 operates to repeatedly schedule thread groups for execution on the SM 704 via the warp launch block 712. The warp information 713 provided to the SM 704 by the warp launch block 712 may include warp priority information that the SM may use in scheduling instructions. The thread group includes graphics work items 718 from the graphics queue or compute work items 720 from the compute queue, and is obtained by the scheduler 708 according to the current priority mode (e.g., graphics greedy mode or compute greedy mode). Each group of threads may be a group of 32 threads, which may be referred to as a warp as described above. Because according to some embodiments, the SM may run 32 warps (each having 32 threads) simultaneously, the scheduler may allocate compute warps and graphics warps in different proportions to be executed simultaneously on a particular SM.

[0147] The arbitrator 710 operates to monitor a predetermined set of resource utilization metrics in view of one or more policy-controlled thresholds and, by providing a signal 716 , causes the scheduler 708 , currently operating in a particular greedy mode, to schedule some work items from a non-greedy work queue.

[0148] Feedback block 714 may implement monitoring of a predetermined set of resource utilizations according to a set of thresholds specified by a policy.

[0149] In some embodiments, the scheduler 708 may obtain graphics work items in a manner different from the manner in which it receives compute work items. Figure 7 In the schematic diagram of FIG. 7 , the scheduler 708 can obtain the graphics work items from the graphics queue directly (or through the front-end unit (not shown)), but needs to request the computing work distribution unit 706 to obtain the computing work items. The computing work distribution unit 706 may include a computing work distributor (CWD) 722 and a computing scheduling unit (CSU) 724, which respectively perform the distribution and scheduling of computing work items between multiple SMs.

[0150] Figure 8 A process 800 is shown by which an application may configure a scheduling policy to control how a GPU (or other type of PPU) schedules some aspects of its graphics work items and its compute work items. For example, process 800 may be performed by an application such as application 122 (e.g., a game, an application including physics simulation, other applications using an API such as DX12, etc.) executing on CPU 124.

[0151] After entering process 800, the application may set a scheduling policy in operation 802. The scheduling policy may include: a configuration for selecting an arbitrator from a plurality of arbitrators available in the system, one or more performance metrics and / or resource utilization / occupancy thresholds for detecting "holes" of unused resource capacity for each of the operations in the graphics greedy mode and the computation greedy mode, a trickle rate that may introduce non-greedy work items, and the like.

[0152] Parameters that can be configured as policy content can include separate parameter sets for graphics and for computing. Parameters are configured according to the characteristics of each resource and the type of work. For example, although it may be helpful to include whether the graphics work outputs stall (stall) in the performance and / or resource utilization metrics, at least in some embodiments, outputting the calculation to the shared memory may not have additional benefits for monitoring the output stall for the calculation. In contrast to the calculation output to the shared memory, the SM can use one or more fixed-function acceleration units for graphics work. Because the back pressure from these fixed-function units causes stagnation at the SM in the output stall metric of the graphics, the hardware scheduler can schedule the calculation without scheduling more graphics when the fixed-function units associated with the SM have been backed up.

[0153] Graphics-related policy parameters set as thresholds may include, but are not limited to: input starvation threshold, output stall threshold, graphics warp occupancy threshold, graphics register file occupancy threshold, and graphics ISBE occupancy threshold. The input starvation threshold specifies the threshold below which the arbiter may consider a particular input pipeline to be starving the SM (this parameter may be specified separately for each alpha pipeline, beta pipeline, and pixel pipeline (e.g., INPUT_STARVED_ALPHA, INPUT_STARVED_BETA, INPUT_STARVED_PIX, respectively); each metric may be calculated as the integral of a binary output that checks whether a particular type of work is available in the input queue over an average window). The output stall threshold specifies the threshold above which the arbiter may consider a particular output destination to be stalled because the output cannot be consumed as fast as the SM is producing it (this parameter may be specified separately for each alpha pipeline, beta pipeline outputting to ISBE memory, and pixel pipeline outputting to PROP / GPM (e.g., PE_ALPHA_OUT_STALL, PE_BETA_OUT_STALL, GPM_PIX_OUT_STALL, respectively); the parameter may be calculated as the ratio between the number of ISBEs waiting to be copied to the number of assigned ISBEs and the number of ISBEs still in use by active warps, or as the ratio between pixel registers that have been computed but are waiting to be drained to pixel registers still in use by pixel warps). The graphics warp occupancy threshold represents the graphics greed threshold for warp resources (e.g., GFX_WARP_OCCUPANCY), above which the arbiter may decide to launch computations. The graphics register file occupancy threshold represents the graphics greed threshold for register file resources (e.g., GFX_RF_OCCUPANCY), above which the arbiter may decide to launch computations. The graphics ISBE occupancy threshold represents the graphics greed threshold of the ISBE (eg, GFX_ISBE_OCCUPANCY), above which the arbiter can decide to launch a computation. Each occupancy can be calculated as the integral of the instantaneous compute warp occupancy for the DPC over a configurable averaging window.

[0154] Graph-related policy parameters also include a graph priority that specifies the priority of graph work (this is about the compute priority set by the driver within each compute work item data structure), and the number of children or other specified work to be retained in the MPC when the arbitrator grants the graph in compute greedy mode. The default value is set to a small value, such as 1, to trickle in the graph in compute greedy mode.

[0155] The computing-related policy parameters set as thresholds may include, but are not limited to: an input starvation computing threshold, a computing warp occupancy threshold, a computing register file occupancy threshold, and a computing shared memory occupancy threshold. An input starvation computing threshold (e.g., INPUT_STARVED_COMP), below which the arbitrator may consider that the computing is starving the SM (which may be calculated as an integral of a binary output, checking whether task synchronization is pending when there is no negative confirmation on the average window). A computing warp occupancy threshold (e.g., COMP_WARP_OCCUPANCY) indicates a computing greedy occupancy threshold, above which the arbitrator may decide to launch a graph. A computing register file occupancy threshold (e.g., COMP_RF_OCCUPANCY) indicates a computing greedy occupancy threshold for register file resources, above which the arbitrator may decide to launch a graph. A computing shared memory occupancy threshold (e.g., COMP_SHM_OCCUPANCY) indicates a computing greedy occupancy threshold for shared memory resources, above which the arbitrator may decide to launch a graph.

[0156] Compute-related policy parameters also include a compute priority, which indicates the priority level to be set for compute work (e.g., this is the priority set by the driver within each compute work item data structure (e.g., sometimes referred to as a "QMD"), and a compute MPC resource reservation parameter, which indicates the number of CTAs ("cooperative thread arrays" (also the cooperative groups mentioned above) or other number of compute work) reserved in the MPC when a compute is granted by the arbitrator when in graph greedy mode. The default value is set to a small value, such as 1, to allow compute to trickle in when in graph greedy mode.

[0157] In some embodiments, the policy parameters may also include the size of an averaging window that defines the window duration over which the SCG-SM arbiter input statistics are averaged by the MPC. The MPC may implement a sliding window average for the statistics provided to the SCG-SM arbiter. In some embodiments, the window may be implemented as a total number of samples rather than a time window. The policy parameters may also include a sample duration that defines the sampling rate used for the integration of the window.

[0158] In operation 804, the application may send instructions and work items in a stream of one or more graphics work items and / or one or more compute work items to the GPU. The work items may be appropriately arranged in a graphics queue and a compute queue accessed by the GPU. Instructions associated with the work items may be sent to the GPU.

[0159] The transfer of graphics work items and compute work items may continue throughout the execution of the application on the CPU and may cause graphics to be rendered on the system's display.

[0160] Fig. 9 A flow diagram of a process 900 that may be performed by a hardware scheduler (eg, scheduler 708 ) is shown according to some example embodiments.

[0161] After entering process 900, in operations 902-904, the scheduler determines the current priority mode of the GPU. The higher of the priorities associated with the next work item in the graphics queue and the next item in the compute queue can be used to determine the current priority mode. For example, if the priority of the next work item in the graphics queue is higher than the priority of the next item in the compute work queue, the current priority mode is set to the graphics greedy mode. Alternatively, if the next item in the compute queue has a higher priority than the next item in the graphics queue, the GPU is set to the compute greedy mode.

[0162] For both graphics work items and compute work items, the priorities of the work items may be set by the application on the same scale so that they can be compared to each other. In some example embodiments, each graphics work item and each compute work item is associated with a priority value on a scale of 1-63. According to some embodiments, the priority of the graphics work item may be set consistently with the instruction stream, and the priority of the compute work item may be set in the work item itself.

[0163] In some embodiments, graphics priority can be specified by the application or driver inline in graphics commands. Graphics command priority can be sampled at the top of the pixel pipeline so that it strictly maintains the order of all previous pixel work (but not strictly in the order of subsequent vertex work). Compute priority can be determined based on a field in the compute work item of the current mesh being distributed by the CWD.

[0164] In operation 902 , the scheduler detects the priority of the next item in each of the graphics queue and the compute queue, and in operation 904 , determines which has a higher priority.

[0165] If it is determined that the graphics priority is higher or equal, then the scheduler is set to operate in graphics greedy mode in operation 906. Operating in graphics greedy mode involves repeatedly launching graphics work items from the graphics queue while primarily considering graphics statistics to decide when to allow more compute work to be scheduled.

[0166] When in graphics greedy mode, in operation 908, the scheduler repeatedly selects the next item from the graphics queue and starts it for execution on the associated SM. Operation 908 is repeated until the graphics queue is empty, the scheduler switches out of graphics greedy mode, or receives a signal to start one or more non-greedy work items. As described above, this signal to "trickle" some non-greedy work items (in this case, compute work items) can be generated by a hardware arbiter such as arbiter 710. In operation 910, it is determined whether a signal (e.g., a compute launch command) has been received from the arbiter to trickle in non-greedy (in this case, compute work items). If so, process 900 proceeds to operation 914 to start one or more compute work items. The number of work items started when trickling in compute work in graphics greedy mode can be based on a policy parameter (e.g., the number of CTAs specified by the COMP_MPC_RESOURCE_RESERVE parameter, which is typically set to 1 so that the MPC only starts 1 CTA for each compute launch command from the SCG-SM arbiter).

[0167] If not, a determination is made in operation 911 whether the scheduler is still in graphics greedy mode. If the scheduler is still in graphics greedy mode, process 900 proceeds to operation 908 to start more graphics work items. If the scheduler is no longer in graphics greedy mode, process 900 may proceed to operation 914 to continue processing in compute greedy mode, for example.

[0168] If in operation 904, it is determined that the compute priority is greater than the graphics priority, then the scheduler is set to operate in compute greedy mode in operation 912. Operating in compute greedy mode involves repeatedly launching compute work items from the compute queue while primarily considering compute statistics to decide when to allow more graphics work to be scheduled.

[0169] Changing from graphics greedy mode to compute greedy mode may involve certain steps. If the change is caused by a high task priority due to task synchronization with CWD, the MPC can flush the VTG work that has been allocated register file space, thread warps, and ISBE memory, flush the pixel work that has been allocated resources, and then switch to compute greedy mode. Note that it may not be necessary to flush the entire graphics input pipeline. Alternatively, if the change is caused by a graphics priority reduction in the graphics pipeline, the MPC can flush all graphics inputs before the priority is set before switching the greedy mode from graphics to compute.

[0170] In some embodiments, compute work items can be obtained from a compute queue and started in the same manner as graphics work items. Figure 7In the illustrated embodiment, the scheduler schedules computing work items differently from graphics work items. In the illustrated embodiment, after determining to launch a computing work item, in operation 914, the scheduler reserves resources for the computing work item to be launched, and in operation 916, the scheduler requests a computing task.

[0171] In certain example embodiments, the scheduler (or other component in the MPC) requests compute work items from the CWD. The scheduler can request a specific number of CTAs at any time (e.g., at task synchronization, when the SCG-SM arbiter changes its decision, or when a CTA completes). The CWD will launch these CTAs or respond to the MPC with a CTA launch Nack. If it has more to send, the CWD will rasterize the CTAs. If in ComputeInGraphics mode (e.g., "ComputeInGraphics" refers to requesting trickle-in compute in graphics greedy mode), the CWD will send a CTA launch Nack when it cannot launch a CTA requested by the MPC. Once the MPC requests a CTA, resources in the SM are reserved, and it is guaranteed that any CTA launched by the CWD will be quickly loaded onto the SM. In ComputeInGraphics mode, the MPC can request CTAs asynchronously based on the SCG-SM arbiter.

[0172] The CWD to MPC protocol conceptually makes the MPC the master and lets the MPC request CTAs from the CWD. In ComputeInGraphics mode, the protocol allows the SCG-SM arbiter (located at the MPC or in the GPM) to not require a local CTA queue within the MPC whenever it decides to launch a CTA. Using the protocol in ComputeInGraphics mode, the CWD can load balance between SMs based on CTA requests from the MPC, which already takes into account the resources occupied by the graphics running on these TPCs.

[0173] Using the CWD to MPC protocol, the MPC can request CTA launches from the CWD in three ways: using CTA report packets when a task is synchronized, using CTA complete packets when a previous CTA is completed on the SM, or using new CTA request packets when, for example, the SCG arbiter tells the MPC to use more SM resources for compute instead of graphics. If the SCG-SM arbiter requests the MPC to use less SM resources for compute instead of graphics, the MPC can wait for those old requests to return CTA launches or be denied by the CWD, or it can request 0 additional CTA launches when existing CTAs are completed. This slowly shifts resources back to graphics.

[0174] When the MPC requests CTA launches from the CWD, the MPC must reserve the required SM resources for computation until these launches actually occur or are denied by the CWD. These resources are not allocated to concurrent graphics warp launches and are reserved for computation. New task synchronizations may cause all previous reservations to be implicitly denied.

[0175] The SCG-SM arbiter may decide when a computation may be started and may inform the MPC to compute the number of CTAs it needs to request from the CWD. The MPC may initiate CTA requests to the CWD, where the number of CTAs requested depends on what portion of the SM resources the computation should use. The MPC may pre-allocate space in the SM for these CTAs and may release resources only upon receiving a NAK from, for example, the CWD. Thus, when CTAs from the CWD arrive, they may be configured to always win selection within the MPC selector for shared memory allocation and register file / warp allocation. No CTAs may be queued or stalled inside the MPC.

[0176] In operation 918, a determination is made as to whether the computing task is received or rejected. If the request for the computing task is rejected (eg, a negative response is received as described above), then in operation 920, the reserved resources are released.

[0177] Resource reservations may take into account different graphics element types in the graphics queue. For example, ISBEs for VTG warps and shared memory for compute warps may be allocated to the same scratch memory in the SM and thus will compete for space, but the pixel-side TRAM will have space carved out. Therefore, at least in some embodiments, ISBE and shared memory resource tracking in the MPC may be unified to use the same resource counters. For register file and warp allocations, resource tracking counters may be unified for compute and graphics.

[0178] If the request for a compute task results in one or more tasks being allocated (eg, from the CWD), then in operation 922 , the tasks are started.

[0179] After the resource release step 920 or the start step 922, in operation 924, it is determined whether the arbiter has signaled a non-greedy item (in this case, a graphics work item) to trickle in to start. If so, the process 900 proceeds to operation 908 to start one or more graphics work items from the graphics queue.

[0180] If not, then in operation 925 it is determined whether the scheduler is still in compute greedy mode. If the scheduler is still in compute greedy mode, process 900 proceeds to operation 914 to launch more compute work items. If the scheduler is no longer in compute greedy mode, then, for example, process 900 may proceed to operation 908 to continue processing in graphics greedy mode. The number of graphics work items launched when trickling in graphics work in compute greedy mode may be controlled by a policy-based parameter (e.g., the number of sub-items or batches specified by the GFX_MPC_RESOURCE_RESERVE parameter, which is typically set to 1 so that the MPC will only launch 1 sub-item (or other graphics work unit) for each graphics launch command from the SCG-SM arbiter).

[0181] Graphics vs. compute priorities also affect instruction scheduling in the SM. The MPC can set 2-bit priority warps onto the SM during warp launch: Based on the priorities passed from the MPC, in graphics greedy mode, the SM can be scheduled with the following priorities: VTG>PIX>COMP (e.g., vertex graphics>pixel graphics>compute); and in compute greedy mode, the SM can be scheduled with the following priorities: COMP>VTG>PIX.

[0182] The SCG-SM arbitrator arbitrates between compute / graphics and can provide input to a selector within the MPC that selects between work types (e.g., simply graphics and compute, or vertex graphics, pixel graphics, and compute). The MPC can provide some feedback to enable the arbitrator to make the right decision. Once the SCG arbitrator decides to start a compute, the MPC generates CTA requests to the CWD and allocates space for those CTAs on the SM. Pre-arbitration of CTAs can be done to prevent queuing CTAs in the MPC and to ensure that once a CTA arrives, they are always selected and sent to the SM without stalls. Despite how things are arbitrated, in ComputeInGraphics mode, graphics and compute may essentially compete for the following SM resources: TRAM may be dedicated to pixel work; VTG and compute may compete for a shared pool of ISBE / shared memory; and VTG, PIX, and compute will compete for local register files (LRFs) and thread bundle slots. In ComputeInGraphics mode, MPC can also consider graphics running on SM for CTA slot computation, and then send CTA request to CWD, and it can request CTA asynchronously based on SCG-SM arbiter decision. Thread warps from VTG, pixel and compute can be allowed to execute simultaneously on SM.

[0183] Fig.10A flow diagram of a process 1000 that may be performed by a hardware arbiter, such as arbiter 710 , is shown, according to some example embodiments.

[0184] After entering process 1000 , in operation 1002 , an arbitrator (or other hardware unit) monitors a predetermined set of performance and / or utilization metrics of resources associated with the SM.

[0185] According to some embodiments, the MPC collects statistics about graphics resource occupancy based on DPC usage of warp IDs, register file space, ISBE memory, etc. It may also collect interface statistics about whether graphics input is starved and graphics output is stalled. These interface statistics and occupancy statistics may not be instantaneous, but integrated over some configurable time period.

[0186] MPC can be configured to collect statistics about compute resource occupancy based on DPC usage of warp IDs, register file space, shared memory space, etc. It can also collect interface statistics about whether the compute inputs are being starved. These interface statistics may also not be instantaneous, but (similar to the case of graph statistics) integrated over some configurable time period.

[0187] Decisions based on the monitored statistics depend on the activity priority mode.Thus, in operation 1004, it is determined whether the scheduler and arbiter are in graph greedy mode or in computation greedy mode.

[0188] The MPC compares these sampled statistics to the corresponding policy controls set by the software. According to some embodiments, there is a software threshold corresponding to each sampled statistic.

[0189] According to one embodiment, the MPC may provide the following available settings and statistics for the SCG-SM arbiter logic: PRIORITY_TYPE, INPUT_STARVED_ALPHA, INPUT_STARVED_BETA, INPUT_STARVED_PIX, INPUT_STARVED_COMP, PE_ALPHA_OUT_STALL, PE_BETA_OUT_STALL, GPM_PIX_OUT_STALL, COMP_WARP_OCCUPANCY, COMP_SHM_OCCUPANCY, COMP_RF_OCCUPANCY, GFX_WARP_OCCUPANCY, GFX_ISBE_OCCUPANCY, and GFX_RF_OCCUPANCY.

[0190] The SCG - SM arbiter logic can calculate each of the following DPCs: isGraphicsGreedy = (PRIORITY_TYPE == GFX); isAlphaInputEmpty = (INPUT_STARVING_ALPHA < INPUT_STARVING_ALPHA_THRESHOLD); isBetaInputEmpty = (INPUT_STARVING_BETA < INPUT_STARVING_BETA_THRESHOLD); isPixInputEmpty = (INPUT_STARVING_PIX < INPUT_STARVING_PIX_THRESHOLD); isComputeInputEmpty = (INPUT_STARVING_COMP < INPUT_STARVING_COMP_THRESHOLD); isAlphaOutputStalled = (PE_ALPHA_OUT_STALL > PE_ALPHA_OUT_STALL_THRESHOLD); isBetaOutputStalled = (PE_BETA_OUT_STALL > PE_BETA_OUT_STALL_THRESHOLD); isPixOutputStalled = (GPM_PIX_OUT_STALL > GPM_PIX_OUT_STALL_THRESHOLD); isGraphicsEmptyOrStalled = (isAlphaInputEmpty || isAlphaOutputStalled) && (isBetaInputEmpty || isBetaOutputStalled) && (isPixInputEmpty || isPixOutputStalled); isGraphicsGreedyEnough = ((GFX_WARP_OCCUPANCY > GFX_WARP_OCCUPANCY_THRESHOLD) && (GFX_RF_OCCUPANCY > GFX_RF_OCCUPANCY_THRESHOLD) && (GFX_ISBE_OCCUPANCY > GFX_ISBE_OCCUPANCY_THRESHOLD));isComputeGreedyEnough=((COMP_WARP_OCCUPANCY>COMP_WARP_OCCUPANCY_THRESHOLD)&&(COMP_RF_OCCUPANCY>COMP_RF_OCCUPANCY_THRESHOLD)&&(COMP_SHM_OCCUPANCY>GFX_SHM_OCCUPANCY_THRESHOLD)). ;

[0191] If in graph greedy mode, then in operation 1006, the monitored statistics are evaluated primarily based on statistics related to the graph to determine whether a vulnerability can be found in the current resource utilization. In operation 1010, the current statistics are used to determine whether a vulnerability has been identified. For example, with the exemplary statistics above, an evaluation of "!isGraphicsGreedyEnough||isGraphicsEmptyOrStalled" being TRUE or "!isGraphicsGreedyEnough&&isGraphicsEmptyOrStalled" being TRUE may represent a vulnerability determined in graph greedy mode.

[0192] If a "hole" exists, then parameters for requesting compute work items may be determined in operation 1012. For example, a trickle rate for compute work items (eg, COMP_MPC_RESOURCE_RESERVE) may be determined from a policy configuration.

[0193] Based on whether the priority is to put the MPC into graph greedy mode or compute greedy mode, and based on how the graph / compute statistics compare to the corresponding thresholds, the arbiter chooses whether graph or compute should be started next.

[0194] For example, after the above calculation, the SCG-SM arbiter logic can decide to start graphics or compute in the following way: if (isGraphicsGreedy): if (isGraphicsEmptyOrStalled && !isComputelnputEmpty) then start compute; if (!isGraphicsGreedyEnough && !isComputelnputEmpty) then start compute. Otherwise, the scheduler will continue to start graphics.

[0195] Graphics work can be started immediately because it is typically waiting in the MPC input queue for processing. However, in some embodiments, compute work cannot be started immediately and it must first be negotiated with the CWD. Therefore, when the arbiter grants a compute, the MPC checks whether the number of CTAs specified in COMP_MPC_RESOURCE_RESERVE(NCTA) matches the remaining space on this TPC. It exposes this NCTA count to the CWD and reserves resources for the NCTA (since we want CTAs to trickle into empty space while the graph is running, the value of NCTA is typically set to 1 for graph greed). The CWD must respond by launching up to N CTAs or by releasing the remaining reservation once all CTAs have been launched into other TPCSs (or by unscheduling the task from the CWD for some reason).

[0196] In operation 1014, the arbiter notifies the scheduler with a signal (eg, a launch command) to launch one or more computing work items. The signal may indicate a number or other indication of how many such computing work items are to be launched.

[0197] If, in operation 1004, it is determined that the active priority mode is a compute greedy mode, then in operation 1008, the monitored statistics are evaluated primarily based on statistics related to computation to determine whether a "hole" can be found in the current resource utilization.

[0198] At operation 1016, a determination is made as to whether a "hole" has been identified using the current statistics.

[0199] If a "hole" exists, then parameters for requesting graphics work items may be determined in operation 1018. For example, a trickle rate for graphics work items (eg, GFX_MPC_RESOURCE_RESERVE) may be determined from a policy configuration.

[0200] For example, if (isComputeGreedy): if (isComputeInputEmpty && !isGraphicsEmptyOrStalled) then start graphics; while if (isComputeGreedyEnough && !isGraphicsEmptyOrStalled) then start graphics.

[0201] After a "no" determination at operation 1010 or 1016, after operation 1014 or operation 1020, process 1000 may terminate.

[0202] Fig.11 and 12 Processes associated with some exemplary embodiments are described in which multiple scheduling profiles may be configured and used.

[0203] Fig.11 A flow chart of a process 1100 is shown, which may be executed by an application or other program at a host processor such as a CPU to configure one or more scheduling profiles and timers for switching between scheduling profiles.

[0204] In operation 1102, the program configures one or more scheduler profiles and associated policies. Each profile may include a different combination of policies and / or different values ​​for certain thresholds in the policies. The policies may include, for example, thresholds for resource utilization for graphics and for computing, trickle rates for graphics and for computing, etc.

[0205] In operation 1104, the program may configure a timer that may be used to switch between configured scheduling profiles.

[0206] Fig.12 A flow diagram of process 1200 is shown, which may be performed in a GPU or, in some embodiments, in an MPC such as MPC 702 to switch a scheduler profile among a series of configured scheduler profiles.

[0207] Software (e.g., an application and / or driver executing on the main processor / CPU) may have the option to statically set most of the arbitrator thresholds throughout the frame, or may dynamically adjust them in sync with the workload by directly inserting threshold change methods into the graphics workflow or compute workflow.

[0208] In addition, process 1200 provides the ability to dynamically change arbiter settings in an asynchronous manner using microcode. Software can set several sets of arbitration parameters. Each set of parameters is called an arbiter "profile". Each profile contains a complete set of graphics scheduling parameters and compute scheduling parameters as defined above. It may also contain graphics priorities. The compute priority can be determined from the compute work item data structure. Each profile also has a time slice value (for example, in a Sysclk cycle) and a valid bit, which can indicate whether each profile is available. In some embodiments, the microcode can support up to 8 profiles.

[0209] In operation 1202, a profile timer expires. When the profile timer expires, in some embodiments, a non-blocking interrupt may be inserted into a profile switch block (eg, in a front end unit) that may fetch a data structure in memory containing an arbiter profile.

[0210] In operation 1204, the next profile is selected. The profile switch block may find the next valid profile and update (all or only some) scheduling parameters in the MPC. In operation 1206, the policy is configured according to the selected next profile.

[0211] In this way, the arbiter can be reconfigured on the fly without any software intervention. One use case might be toggling between two profiles. The first profile might be a graphics greedy profile that runs a certain number (e.g., X) of cycles, and the second profile might be a compute greedy profile that runs another predetermined number (e.g., Y) of cycles. If X=4*Y, then this will provide a guaranteed service of 20% for compute work, regardless of how much graphics work there is. Of course, this use case is just an example, and many other ways of leveraging the profile switching capability in embodiments can be envisioned.

[0212] Fig.13 A flow chart of an idle detection process 1300 is shown according to some example embodiments. The process 1300 may be operated to switch the active priority mode of the scheduler when the current active priority mode is detected to be idle.

[0213] After entering process 1300, it is detected that the active greedy mode has become idle in operation 1302. For example, in graphics greedy mode, the scheduler may detect that a graphics queue (eg, any of the alpha queue, beta queue, or pixel queue) is empty.

[0214] In operation 1304, optionally, a hysteresis timer is set and process 1300 is delayed for some configurable time interval. If a hysteresis timer is set, process 1300 proceeds to operation 1306 after the hysteresis timer expires.

[0215] In operation 1306, it is determined whether the active priority mode is still idle, and if so, the active priority mode is changed at operation 1308. For example, if the current active priority mode is graphics greedy mode and is determined to be idle, the active priority mode is switched to compute greedy mode.

[0216] In some example embodiments, operations 1302-1306 may include monitoring the MPC of a bit for each compute queue and graphics queue, wherein each bit has a hysteresis such that they will slowly indicate idleness over time rather than instantaneously. In addition, in order to switch the active priority mode, in addition to determining that the active priority mode is idle, it is also necessary to determine that the current non-greedy queue is not empty.

[0217] If the switch from graphics greedy to compute greedy is caused by idle detection logic, then by definition the graphics pipeline is empty. In this case, the MPC can switch to compute greedy immediately, but may need to start a new CTA request with all available CWD free slots so that it can receive a CTA launch. If the switch from compute greedy to graphics greedy is caused by idle detection logic, then by definition the compute pipeline is empty. In this case, the MPC can switch to graphics greedy immediately and start processing graphics work.

[0218] Other SCG-SM arbiter types

[0219] In some embodiments, different types of SCG-SM arbiters may be used as alternative hardware arbiters, each with its own advantages and disadvantages: a round-robin arbiter located in the MPC, a DPC-level SCG-SM arbiter located in the MPC (described above as an "unbalanced" arbiter), a balanced GPC-level SCG-SM arbiter located in the GPM so that it has control over multiple TPCs, and a dynamically partitioned SCG-SM arbiter in the GPM that also has control over multiple TPCs.

[0220] With a round-robin arbiter, the arbiter decides to launch compute for graphics types such as alpha, beta, and pixel queues in a round-robin fashion. When compute is on its turn, the round-robin arbiter may launch one (or other predetermined number of) CTAs. When graphics is on its turn, the round-robin arbiter may launch 1 batch, or task, or child, depending on what the graphics arbitration logic decides among alpha, beta, and pixel work. As described above with respect to the unbalanced arbiter, compute and graphics launches can be distinct.

[0221] For example, assuming there are infinite compute and graphics workflows in the respective queues, the SM can accommodate up to 20 work units, each graphics request requires 2 units, and each compute request requires 5 units, the sequence of work granted by the round-robin arbiter may be: G2, CS, G2, CS, G2, no more compute is satisfied, so G2, G2. As warps complete, more work is granted.

[0222] The GPC-level SCG-SM arbiter that is balanced inside the GPM attempts to consider the workload of SMs across the GPC and balance the work. More specifically, the arbiter sits in the center of the GPM and considers many SMs to decide when to start non-greedy work.

[0223] This arbiter aggregates feedback / statistics from many SMs, rather than looking at them individually, to determine holes in resource utilization by comparing to policy-specified thresholds. Once the arbiter decides to run non-greedy work, the decision is broadcast to all SMs in the GPC. This way of distributing work may result in a more balanced distribution of greedy work between SMs.

[0224] The policy controls for the balanced arbiter may include some or all of the policy controls described above for the unbalanced arbiter. The policy controls for the arbiter may also include SCG_GRANULARITY_SEL, which is programmed to select the granularity of the arbiter's dynamic allocation (e.g., SCG_GRANULARITY_SEL=SUB_SM means that the SCG arbiter will dynamically allocate / deallocate between compute and graphics at a sub-SM granularity); BALANCE_TPC_IN_GPC, which is set with a Boolean value, 'True' notifies the arbiter to balance all DPCs in the GPC ('False' means to leave the DPCs independent); GFX_TPC_OCCUPANCY_MIN, which indicates the guaranteed minimum DPC allocation for graphics; and COMP_TPC_OCCUPANCY_MIN, which indicates the guaranteed minimum allocated DPC for compute.

[0225] The dynamically partitioned SCG-SM arbiter inside the GPM is another arbiter that attempts to balance work across multiple SMs on a GPC. Like the balanced arbiter type, this arbiter is also centrally located and aggregates inputs across multiple SMs. This arbiter dynamically arbitrates resources at the SM granularity, rather than negotiating between compute and graphics at the warp granularity. This arbiter does not cause drain interlocks that lead to underutilization when switching SMs between graphics and compute. Instead, drain of one type of work can occur simultaneously while the SM is starting work from another type. This arbiter can provide a way to seamlessly transition SMs from one type to another based on the requirements of the workload (through dynamic hardware arbitration) without spending cycles to explicitly drain.

[0226] The policy controls for the balanced arbitrator may include some or all of the policy controls described above with respect to the unbalanced arbitrator. The policy controls for the arbiter may also include: SCG_GRANULARITY_SEL, which is programmed to select the granularity of the arbiter's dynamic allocation (e.g., SCG_GRANULARITY_SEL=TPC means that the SCG arbiter will first dynamically allocate / deallocate DPCs between compute and graphics before using sub-SM allocations); BALANCE_TPC_IN_GPC, which is always set to "True" (e.g., asserted if "False"); TPC_MASK_MIXED, which is a fixed mask of DPCs for each GPC that will run both graphics and compute; MIN_TPC_MASK_GFX, which is the minimum number of DPCs in each GPC that is guaranteed for graphics (excluding mixed DPCs); MIN_TPC_MASK_COMP, which is the minimum number of DPCs in each GPC that is guaranteed for compute; and CURR_GFX_EN[numTPCperGPC], which is an output request sent by the arbiter at the MPC granularity and notifies the MPC when to switch to graphics and when to switch to compute.

[0227] Arbiter internal states may include CURR_GFX_TPC_MASK, which is a state that tracks which DPCs in a GPC are assigned to graphics by the SCG-SM arbiter, and CURR_COMP_TPC_MASK, which is a state that tracks which DPCs in a GPC are assigned to computation by the SCG arbiter.

[0228] Example use cases

[0229] The above scheduling techniques and profile time slicing techniques can be controlled in various ways depending on the workload requirements. It is contemplated that scheduling and time slicing can be controlled, for example, synchronously with the 3D / compute work or asynchronously with the 3D / compute work. Example embodiments provide applications with the ability to exercise such control over processing in the PPU.

[0230] In some aspects, the scheduling profile may be changed synchronously with the 3D / compute work. For example, software may insert new scheduling parameters via a graphics work item in a manner that is synchronous with the work in the pipeline. The work item in the pipeline may overwrite the current profile in the MPC. Control that is synchronous with the 3D / compute work may involve changing only the graphics priority and the compute priority, or may involve all (or a larger set of) profile parameters.

[0231] In some examples where the scheduling profile is changed synchronously with 3D / compute work, all scheduling parameters in the MPC can be set statically and only the graphics and compute priorities can be changed. As described above, the compute priority can be attached to each compute work item data structure at construction time, and the graphics priority can be provided by the command in the 3D pipeline. Changing the priority affects whether the scheduler runs in graphics greedy mode or compute greedy mode. For example, the driver can keep the graphics priority stable at 16 and mark low priority compute work items as 8 and high priority compute work items as 24. When there is only graphics and low priority compute work, the arbiter will run in graphics greedy mode, and when a high priority compute work item arrives, it will force the CWD to stop allocating low priority grids and switch to high priority grids. The MPC will see the increased compute priority and switch the arbiter to compute greedy mode until all high priority compute work is started.

[0232] Software can mark synchronous compute work as higher priority than asynchronous compute work, causing CWD to favor starting synchronous compute work, which is usually done before more 3D or 2D work can be started, to allow for more simultaneous compute and graphics overlap.

[0233] Note that the graphics pipeline can include three sequential stages: alpha, beta, and pixel, and that in some embodiments, changes to graphics priority are decoded before the pixel shader stage. For example, in the following command sequence: graphics priority = 16; draw A; graphics priority = 32; draw B, the pixel work of draw A is guaranteed to be performed at priority 16, and the pixel work of draw B is guaranteed to be performed at priority 32. The impact on related VTG work is less clear. The VTG work of draw A is guaranteed to be performed at priority 16, but the VTG work of draw B may be performed at 16 or 32, depending on how long A's pixel work delays the command to raise the graphics priority. However, it may be beneficial to tie graphics priority to the pixel shader stage, as most games are typically pixel shader-heavy.

[0234] The compute priority is usually provided by one compute work item of CWD rasterization in the example embodiment. Since the compute pipeline has only one stage, the compute shader stage, there is no pipeline problem like graphics. The SCG-SM arbiter in the MPC can compare the compute priority of the currently launched compute work item from the CWD with the graphics priority in the pixel pipeline, i.e., the SCG-SM arbiter in the MPC is completely unaware of the multiple compute work item priorities.

[0235] In some examples of changing the scheduling profile in sync with 3D / compute work, the software can change not only the priority, but also the graphics and compute scheduling parameters. In example embodiments, this can be done synchronously with the 3D work item flow to ensure that pixel work is affected. The software can increase the priority of a certain draw to ensure that it executes in graphics greedy mode, or it can increase the graphics greediness of a certain draw (e.g., make it very greedy).

[0236] In contrast, compute workitem flow and compute workitem launches are not necessarily synchronized in the compute pipeline. Changes to compute scheduling parameters may not be blocked by previous compute workitems that have not yet been launched, but may flow immediately to the MPC. Therefore, if software wants to guarantee that the first compute workitem sees the first set of parameters and the second compute workitem sees the second set of parameters, it may need to trigger synchronization.

[0237] Another way that software uses the SCG-SM arbiter is through multiple profiles and microcode. The following are scheduling parameters that can be saved in a context buffer in memory. Software can create a predetermined number (e.g., 8) of profiles, and each profile can include a valid bit and a time slice value. Software may not send any scheduling parameters through graphics commands, but can provide them through microcode writing to registers. However, software can provide graphics priorities through commands, or these can also come from profiles and microcode writes. Software can program N valid profiles into memory and associate each profile with a time slice value. Profile timers can be set when each profile is activated, and when the timer expires, the hardware can move to the next valid profile and restart the timer. By hardware / microcode writing to the MPC, the scheduling parameters for compute and graphics can be updated, and optionally, the graphics priority can also be updated. These writes can be broadcast to all MPCs at the same time because they can all be programmed the same. The compute priority can still be determined from the compute work item data structure. In this way, microcode can be used to asynchronously move schedulers between various profiles. This can be used to allow a certain amount of guaranteed service for compute, or a certain amount of guaranteed service for graphics, or any other desired combination of compute and graphics at the same time.

[0238] Similarly, in some embodiments, instead of rotating between N profiles using a fixed time slice, the microcode itself can select the best profile. Here the interval timer can be set to some fixed value (e.g., assuming 100K cycles = ~100us). Every time the microcode sees an interrupt, it can read registers around the chip to determine if the current regime is framebuffer limited, L2 limited, shader math limited, graphics heavy but compute light, etc. The microcode can use this information to select between N pre-computed profiles that are tuned for various application regimes.

[0239] Example embodiments provide many improvements to GPUs and GPU-based processing. Programmable control in the hardware scheduler of certain embodiments enables flexible response to different work mixes and other requirements imposed by new games and other applications. This programmability of the hardware scheduler also allows different mixes of compute and graphics work, enabling game developers and the like to explore new applications and programming techniques.

[0240] In some example embodiments, a portion of a computational workload, such as certain frames using computational techniques to post-process graphics data at the end of a frame, may be processed at the highest priority without extending frame processing time by executing graphics to process the graphics data, and performing computations wherever resource availability is found.

[0241] Example embodiments may also accelerate simulations implemented by PhysX, a library for adding physical simulations (particle-based fluids, life-like explosions, etc.) to games. When running on a GPU, PhysX typically forms a second thread of computational work, independent of the computational techniques already present in a typical game. PhysX computational work may also be fully trickled in between graphics work items being processed in graphics greedy mode.

[0242] Certain example embodiments may allow CUDA workloads to be efficiently combined with traditional graphics, which may be useful in certain deep learning or other applications accelerated by CUDA such as within games. The hardware scheduler may also enable ray tracing by allowing computations to take precedence over typical graphics work running in the system. Due to the programmability of the hardware scheduler, certain example embodiments may also provide improved availability for GPU-based physics applications by reducing the percentage of frame time that must be dedicated to physics computations. Certain example embodiments may enable improved virtual reality applications. For example, computations are used to modify the final frame image based on the latest sampling of the head position, and asynchronous computation work is expected to be executed with the highest priority so that it can be guaranteed to be completed before the next display event.

Claims

1. A processing system comprising: a single instruction multiple data (SIMD) processor or a single instruction multiple thread (SIMT) processor that executes parallel instruction streams and is configured to operate in either a graphics greedy mode or a computationally greedy mode at respective times; as well as a hardware scheduler coupled to the processor, the hardware scheduler scheduling the processor to concurrently execute at least one graphics warp and at least one compute warp in parallel by selecting between: (a) scheduling at least one compute warp to the processor while operating in the graphics greedy mode to repeatedly schedule graphics warps from a graphics pipeline to the processor, and (b) scheduling at least one graphics warp to the processor while operating in the compute greedy mode to repeatedly schedule compute warps from a compute pipeline to the processor; as well as a hardware arbiter configured to, in response to underutilization of resources associated with the processor detected during the scheduling, determine a current operating mode of the processor and send a signal to the hardware scheduler to perform scheduling of at least one compute warp when the current operating mode is the graphics greedy mode, or to perform scheduling of at least one graphics warp when the current operating mode is the compute greedy mode.

2. A parallel processing unit, comprising: a plurality of processing units, each processing unit configured to operate in a graphics greedy mode or a compute greedy mode at a respective time and to concurrently run graphics work items from a graphics queue and compute work items from a compute queue; a hardware scheduler configured to: continuously select graphics work items from the graphics queue to run on a specific processing unit of the plurality of processing units when the specific processing unit is configured to operate in the graphics greedy mode, and continuously select computation work items from the computation queue to run on the specific processing unit when the specific processing unit is configured to operate in the computation greedy mode; as well as a hardware arbiter configured to, in response to a result of comparing at least one monitored performance or utilization metric to a user-configured threshold, cause the particular processing unit to run one or more compute work items from the compute queue when the particular processing unit is configured to operate in the graphics greedy mode, and cause the particular processing unit to run one or more graphics work items from the graphics queue when the particular processing unit is configured to operate in the compute greedy mode.

3. The parallel processing unit of claim 2, wherein each of the plurality of processing units is a single instruction multiple data (SIMD) processor or a single instruction multiple thread (SIMT) processor.

4. The parallel processing unit of claim 2, wherein the hardware scheduler is further configured to select the graphics greedy mode or the computational greedy mode based at least on software-configured priority values ​​associated with the graphics work items and the computational work items. 5 . The PPU of claim 4 , wherein the hardware arbiter is further configured to select the computing work item or the graphics work item to be executed based on a scheduling policy configured by software.

6. The parallel processing unit of claim 5, wherein the hardware arbitrator is further configured to select the computing work item or the graphics work item to be executed based on an occupancy metric corresponding to occupancy of processing and memory resources of the graphics work item and the computing work item.

7. The PPU of claim 6, wherein the hardware arbiter is further configured to select the compute work item or the graphics work item to run based on a metric in the particular processing unit.

8. The PPU of claim 6, wherein the hardware arbiter is further configured to select the computational work item or the graphics work item to be executed based on metrics in the specific processing unit and other processing units.

9. A parallel processing unit as described in claim 6, wherein the hardware arbiter is further configured to: select to execute the computing work item or the graphics work item further based on an output stall metric associated with the output of the graphics work item from the processing unit and based on an input starvation metric associated with the input of the graphics work item and the computing work item to the processing unit.

10. The parallel processing unit of claim 9, wherein the hardware arbiter is further configured to select to run the compute work item or the graphics work item further based on a time average of the occupancy metric, the output stall metric associated with the graphics work item, and the input starvation metric associated with inputs of the graphics work item and the compute work item.

11. The parallel processing unit of claim 10, wherein the occupancy metric comprises one or more of an occupancy metric of a register file, an occupancy metric of a warp resource, an occupancy metric of a shared memory, and an occupancy metric of an ISBE memory, wherein the input starvation metric associated with the graphics work item comprises at least one of a vertex associated queue and a pixel associated queue, wherein the input starvation metric associated with the compute work item comprises a starvation metric associated with the compute queue, and wherein the output stall metric associated with the graphics work item comprises an output stall metric for at least one of the vertex associated queue and the pixel associated queue.

12. The PPU of claim 9, wherein the output stall metric includes an effect of back pressure from one or more fixed function units processing graphics work items.

13. The parallel processing unit of claim 4, wherein the hardware scheduler or the hardware arbiter is further configured to determine a number of work items to be selected from the graphics queue or the compute queue based on corresponding trickle parameters specified in a software-specified policy.

14. The PPU of claim 2, wherein the hardware scheduler is further configured to: In response to determining to launch a set of graphics work items to the particular processing unit, launching one or more graphics work items that have been assigned to the hardware scheduler; and Initiating a set of computational work items in response to determining: reserving resources associated with the particular processing unit for a particular number of computing work items; and The specific number of compute work items is requested from the compute queue.

15. The parallel processing unit of claim 14, wherein the hardware scheduler is further configured to: in response to determining to initiate the set of computing work items: launching a computational work item received in response to a request on the particular processing unit, or The computing work item is not initiated in response to receiving a negative acknowledgement of the request.

16. The PPU of claim 15, wherein the hardware scheduler is further configured to: pass priority information to the specific processing unit in the event that the graphics work item is launched or the computing work item is launched.

17. The PPU of claim 2, wherein the hardware scheduler is further configured to: automatically change an active scheduling policy, and wherein the changing comprises changing the user-configured threshold.

18. The PPU of claim 17, wherein the automatic changing is adapted to workload.

19. The PPU of claim 17, wherein the automatic changing comprises: Asynchronously switching between a plurality of pre-configured scheduling profiles to change the active scheduling policy, each pre-configured scheduling profile including a respective different set of scheduling policies.

20. The PPU of claim 2, wherein the hardware scheduler and / or the hardware arbiter receives metrics from the plurality of processing units.

21. A method for concurrently executing graphics work items and computational work items on a parallel processor having a plurality of processing units, comprising: receiving graphics work items from a graphics pipeline and computing work items from a computing pipeline; as well as scheduling the first group of graphics work items and the second group of compute work items for concurrent execution on selected single instruction multiple data (SIMD) or single instruction multiple thread (SIMT) processing units of the plurality of processing units, The scheduling further comprises selecting the first group and the second group further based on an output stall metric associated with output of the graphics work items from the processing unit and based on an input starvation metric associated with input of the graphics work items and the computing work items to the processing unit.

22. The method of claim 21, wherein the scheduling comprises: The first group and the second group are selected based at least on software configured priority values ​​associated with respective groups of the graphics work items and the compute work items.

23. The method of claim 22, wherein the scheduling comprises: The first group and the second group are selected based further on a scheduling policy configured by software.

24. The method of claim 22, wherein the scheduling further comprises: The first group and the second group are selected further based on occupancy metrics corresponding to occupancy of processing and memory resources of the graphics work items and the compute work items.

25. The method of claim 21, wherein the selection is further based on a time average of occupancy metrics corresponding to occupancy of processing and memory resources of the graphics work item and the compute work item, the output stall metric associated with the graphics work item, and the input starvation metric associated with inputs of the graphics work item and the compute work item.

26. A processing system comprising: CPU, configured to execute application programs; a memory configured to have a graphics queue and a computation queue, wherein graphics work items from the application are enqueued into the graphics queue and computation work items from the application are enqueued into the computation queue; and Graphics Processing Unit (GPU), including: a plurality of processing units, each processing unit configured to operate in a graphics greedy mode or a compute greedy mode at a respective time and to concurrently run graphics work items from the graphics queue and compute work items from the compute queue; a hardware scheduler configured to: continuously select graphics work items from the graphics queue to run on a specific processing unit among the plurality of processing units when the specific processing unit is configured to operate in the graphics greedy mode, and continuously select computing work items from the computing queue to run on the specific processing unit when the specific processing unit is configured to operate in the computing greedy mode; and A hardware arbiter configured to, in response to a result of comparing at least one monitored performance or utilization metric to a user-configured threshold, selectively: cause the specific processing unit to run one or more computational work items from the computational queue when the specific processing unit is configured to operate in the graphics greedy mode, and cause the specific processing unit to run one or more graphics work items from the graphics queue when the specific processing unit is configured to operate in the computationally greedy mode.