Efficient memory virtualization in multi-stranded processing units
Concurrent execution of thread programs with different virtual address spaces in a parallel processing subsystem using ASIDs addresses inefficiencies in GPU utilization, improving performance and reliability in HPC applications.
Patent Information
- Application Number
- DE102013017509
- Authority / Receiving Office
- DE · DE
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2012-10-25
- Filing Date
- 2013-10-23
- Publication Date
- 2024-09-26
- Estimated Expiration
- 2033-10-23
AI Technical Summary
Conventional GPU execution models in high-performance computing (HPC) applications limit GPU utilization and performance due to the sequential execution of thread programs requiring different virtual address spaces, leading to inefficient resource allocation and poor overall application performance.
A method for concurrently executing multiple thread programs with different virtual address spaces in a parallel processing subsystem by using address space identifiers (ASIDs) to schedule and manage virtual to physical address mappings, allowing simultaneous execution on multiple processing cores.
Improves GPU utilization and performance by enabling concurrent execution of tasks with different virtual address spaces, enhancing reliability and reducing development effort through address space separation and efficient resource management.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
BACKGROUND OF THE INVENTION Area of the invention
[0001] The present invention relates generally to multi-stranded computer architectures and in particular to efficient memory virtualization in multi-stranded processing units. Description of the state of the art
[0002] In conventional computer systems with both a central processing unit (CPU) and a graphics processing unit (GPU), the CPU performs some of the application calculations, allocates resources, and manages the overall application execution, while the GPU performs high-throughput calculations specified by the CPU. In certain application domains, such as high-performance computing (HPC), the GPU typically performs the majority of the calculations required for a given application. Consequently, the overall performance of the application is directly dependent on GPU utilization. In such applications, high application performance is achieved with high GPU utilization, meaning a state characterized by a relatively large proportion of the GPU's processing units simultaneously performing useful work.The work is divided into strand programs, which are executed in parallel in processing units.
[0003] A typical string program is executed as highly parallel, very similar operations across a parallel dataset, such as an image or a group of images, residing in a single virtual address space. If an application needs to execute multiple distinct string programs, the GPU conventionally executes them sequentially, each within its own corresponding virtual address space, until each string program has completed its assigned task. Each string program is loaded into a specific context for execution within the GPU. This context encompasses the state of the virtual address space, which is loaded into page tables located within the GPU. Because each distinct string program conventionally requires a private virtual address space, only one string program can be executed on the GPU at any given time.
[0004] HPC applications are typically run in an HPC cluster, which conventionally contains a group of nodes, each comprising a CPU and a GPU. Each node is typically assigned a group of tasks that can communicate with other tasks executing on other nodes via a message forwarding interface (MPI) task. A typical GPU computation task is efficiently executed with high GPU utilization as a group of parallel string program instances within a shared virtual memory space. However, in given conventional GPU execution models, only a single MPI task is executed per unit of time on a given GPU. Each MPI task can encompass a range of GPU workloads, thus creating a corresponding range of GPU utilization.In one scenario, only a single strand or a small number of strands are executed on the GPU as an MPI task, resulting in poor GPU utilization and overall poor application performance. Consequently, certain HPC applications run inefficiently in GPU-based HPC processing clusters. Generally, applications that require the GPU to sequentially process tasks containing a small number of strand instances, each requiring an independent virtual address space, exhibit poor performance. US 2003 / 013 5711 A1 discloses a multi-strand processor capable of executing multiple strands simultaneously. US 2009 / 0193 222 A1 describes a processing system that uses different address space identifiers.
[0005] As can be seen from the foregoing, a technique is needed in this field that enables the simultaneous GPU execution of tasks with different virtual address spaces. In particular, it is a challenge to perform this simultaneous GPU execution effectively and quickly. OVERVIEW OF THE INVENTION
[0006] This problem is solved by the features of the independent claims. Preferred embodiments are described in the dependent claims. One embodiment of the present invention provides a method for the simultaneous execution of two or more string programs having different virtual address spaces in a parallel processing subsystem according to claim 1, wherein the method includes, among other things: retrieving a set of task metadata containing a first page lookup table associated with a first virtual address space characterized by a first address space identifier (ASID), and a second page lookup table associated with a second virtual address space characterized by a second ASID; and disposing of a first string program associated with the first virtual address space.to be executed in a first processing kernel of the parallel processing subsystem, and disposing of a second strand program linked to the second virtual address space to be executed in the first processing kernel or another processing kernel of the parallel processing subsystem, wherein virtual address requests generated by the first strand program during execution contain the first ASID, and wherein virtual address requests generated by the second strand program contain the second ASID.
[0007] Other embodiments of the present invention include a system according to claim 2.
[0008] One advantage of the present invention is that a GPU can simultaneously execute different tasks with different virtual address spaces, thereby improving GPU utilization and performance in certain applications. A further advantage of the present invention is that GPU tasks can be executed with address space separation, thereby improving reliability and reducing the development effort associated with debugging. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] To explain in more detail how the aforementioned features of the present invention are to be understood, a more precise description of the invention, which is briefly summarized above, is given with reference to embodiments, some of which are illustrated in the attached drawings. It should be noted, however, that the attached drawings represent only typical embodiments of this invention and are not intended to limit its scope of protection, since the invention permits other equally effective embodiments. Fig. 1 is a block view representing a computer system configured to implement one or more aspects of the present invention; Fig. Figure 2 is a block view of a parallel processing subsystem for the computer system from Fig. 1 according to an embodiment of the present invention; Fig. 3A is a block view of the front area from Fig. 2 according to an embodiment of the present invention; Fig. 3B is a block view of a general processing cluster in one of the parallel processing units from Fig. 2 according to an embodiment of the present invention; Fig. 3C is a block view of a portion of a data stream multiprocessor. Fig. 2 according to an embodiment of the present invention; Fig. Figure 4A shows a parallel processing subsystem configured to realize multiple simultaneous virtual address spaces according to an embodiment of the present invention; Fig. Figure 4B shows a table entry of an address space identifier according to an embodiment of the present invention; Fig. 4C shows a page table entry according to an embodiment of the present invention; Fig. 4D shows an entry of a translational side-view buffer according to an embodiment of the present invention; Fig. Figure 5 shows the translation of an address space identifier and a virtual address into a physical address according to an embodiment of the present invention; Fig. Figure 6 shows two simultaneous virtual address spaces existing side by side within a single physical address space, according to an embodiment of the present invention; Fig. Figure 7 shows the configuration of a parallel processing subsystem to execute multiple strand programs with different virtual address spaces according to an embodiment of the present invention; Fig. Figure 8 is a flowchart of process steps to simultaneously execute two or more strand programs, which have different virtual address spaces, in the parallel processing subsystem according to an embodiment of the present invention; Fig. Figure 9 is a flowchart of process steps for performing an assignment of virtual addresses to physical addresses in one of several different virtual address spaces according to an embodiment of the present invention; and Fig. Figure 10 is a flowchart of process steps for performing a deep disposition of tasks in the context of a graphic processing unit according to an embodiment of the present invention. DETAILED DESCRIPTION
[0010] The following description provides numerous specific details to facilitate a more thorough understanding of the present invention. However, the person skilled in the art will recognize that the present invention can also be implemented without one or more of these specific details. System overview
[0011] Fig. Figure 1 is a block view depicting a computer system 100 configured to implement one or more aspects of the present invention. The computer system 100 comprises a central processing unit (CPU) 102 and a system memory 104, which communicate via a connection path containing a memory bridge 105. The memory bridge 105, which may be, for example, a north-bridge chip, is connected via a bus or another communication path 106 (for example, a HyperTransport connection) to an I / O (input / output) bridge 107. The I / O bridge 107, which may be, for example, a south-bridge chip, receives user input from one or more user input devices 108 (for example, keyboard, mouse) and forwards the input to the CPU 102 via the communication path 106 and the memory bridge 105.A parallel processing subsystem 112 is connected to the memory bridge 105 via a bus or a second communication path 113 (for example, a peripheral component connection (PCI) express connection, an accelerated graphics port, or a HyperTransport connection); in one embodiment, the parallel processing subsystem 112 is a graphics subsystem that delivers pixels to a display device 110 (for example, a monitor based on a conventional cathode ray tube or a liquid crystal display). A system disk 114 is also connected to the I / O bridge 107. A switch 116 provides connections between the I / O bridge 107 and other components, such as a network adapter 118 and various expansion cards 120 and 121.Other components (not explicitly shown), including a universal serial bus (USB) or other port connections, compact floppy disk (CD) drives, digital video disk (DVD) drives, movie recording devices, and the like, can also be connected to I / O bridge 107. The various [in...] Fig. The communication paths shown in Figure 1, including the specifically designated communication paths 106 and 113, can be implemented using any suitable protocols, such as PCI-Express, AGP (accelerated graphics port), HyperTransport or any other bus or point-to-point connection protocol(s), and connections between different facilities using different protocols are known in the prior art.
[0012] In one embodiment, the parallel processing subsystem 112 includes a circuit optimized for graphics and video processing, including, for example, a video output circuit, and this circuit forms a graphics processing unit (GPU). In another embodiment, the parallel processing subsystem 112 includes a circuit optimized for general-purpose processing, while retaining the underlying computing architecture, which is described in more detail herein. In yet another embodiment, the parallel processing subsystem 112 can be integrated into one or more other system elements within a single subsystem, for example, by combining the memory bridge 105, the CPU 102, and the I / O bridge 107 to form a system-on-a-chip (SoC).
[0013] It should be noted that the system shown herein is for illustrative purposes only and that variations and modifications are possible. The connection topology, including the number and arrangement of bridges, the number of CPUs 102, and the number of parallel processing subsystems 112, can be modified as required. For example, in some embodiments, the system memory 104 is directly connected to the CPU 102 instead of via a bridge, and other devices communicate with the system memory 104 via the memory bridge 105 and the CPU 102. In other alternative topologies, the parallel processing subsystem 112 is connected to the I / O bridge 107 or directly to the CPU 102 instead of the memory bridge 105. In still other embodiments, the I / O bridge 107 and the memory bridge 105 can be integrated on a single chip instead of being provided as one or more discrete components.Larger embodiments can include two or more CPUs 102 and two or more parallel processing subsystems 112. The specific components shown herein are optional; for example, any number of expansion cards or peripheral devices can be supported. In some embodiments, the switch 116 is omitted, and the network adapter 118 and the expansion cards 120, 121 are directly connected to the I / O bridge 107.
[0014] Fig. Figure 2 shows a parallel processing subsystem 112 according to an embodiment of the present invention. As shown, the parallel processing subsystem 112 comprises one or more parallel processing units (PPUs) 202, each of which is connected to a local parallel processing (PP) memory 204. In general, a parallel processing subsystem contains a number U of PPUs, where U ≥ 1. (Herein, multiple representatives of the same object are designated by reference numerals that denote the object, and the numbers in parentheses indicate the representative where necessary.) The PPUs 202 and the parallel processing memories 204 can be implemented using one or more integrated circuit devices, such as programmable processors, application-specific integrated circuits (ASICs), or memory devices, or can be implemented in another technically feasible manner.
[0015] It was back on Fig. 1 and Fig. 2 referred to; in some embodiments, some or all of the PPUs 202 in the parallel processing subsystem 112 are graphics processors with image generation pipelines, which may be configured to perform various operations related to the generation of pixel data from graphic data provided by the CPU 102 and / or the system memory 104 via the memory bridge 105 and the second communication path 113, interacting with the local parallel processing memory 204 (which can be used as a graphics memory and contains, for example, a conventional block buffer) to store and update pixel data, deliver the pixel data to the display device 110, etc. In some embodiments, the parallel processing subsystem 112 may include one or more PPUs 202 operating as graphics processors and may include one or more other PPUs 202 used for general-purpose computations.The PPUs can be identical or different, and each PPU can have one or more dedicated parallel processing memories or no dedicated parallel processing memories. One or more of the PPUs 202 in the parallel processing subsystem 112 can output data to the display device 110, or each PPU 202 in the parallel processing subsystem 112 can output data to one or more display devices 110.
[0016] During operation, the CPU 102 is the master processor of the computer system 100 and controls and coordinates the operation of other system components. In particular, the CPU 102 issues instructions that control the operation of the PPUs 202. In some embodiments, the CPU 102 writes a stream of instructions for each PPU 202 into a data structure (in Fig. 1 or Fig. (2 not explicitly shown), which may reside in system memory 104, parallel processing memory 204, or another memory location accessible to both the CPU 102 and the PPU 202. A pointer to each data structure is written to a shift buffer to initiate the processing of the stream of instructions in the data structure. The PPU 202 reads instruction streams from one or more shift buffers and then executes instructions asynchronously relative to the operation of the CPU 102. Execution priorities for each shift buffer can be specified by an application program via the device driver 103 to control the allocation of the different shift buffers.
[0017] It is now referred back to Fig. 2 as well as Fig. 1; Each PPU 202 comprises an I / O (input / output) unit 205, which is connected to the rest of the computer system 100 via the communication path 113, which is connected to the memory bridge 105 (or, in an alternative embodiment, directly to the CPU 102). The connection of the PPU 202 to the rest of the computer system 100 can also be different. In some embodiments, the parallel processing subsystem 112 is implemented as an add-in card that can be inserted into an expansion slot of the computer system 100. In other embodiments, a PPU 202 can be integrated into a single chip with a bus bridge, such as the memory bridge 105 or the I / O bridge 107. In still other embodiments, some or all elements of the PPU 202 can be integrated into a single chip together with the CPU 102.
[0018] In one embodiment, the communication path 113 is a PCI Express connection in which dedicated lanes are assigned to each PPU 202, as is known in the prior art. Other communication paths can also be used. An I / O unit 205 generates packets (or other signals) for transmission on the communication path 113 and also receives all incoming packets (or other signals) from the communication path 113 and forwards the incoming packets to suitable components of the PPU 202. For example, instructions related to processing tasks can be routed to a higher-level interface or main interface 206, whereas instructions involving memory operations (for example, reading from or writing to the parallel processing memory 204) can be routed to a memory crossover unit 210.The main interface 206 reads each shift buffer and outputs the command stream stored in the shift buffer to a front area 212.
[0019] Each PPU 202 advantageously implements a highly parallel processing architecture. As detailed, the PPU 202(0) comprises a processing cluster array 230 containing a number C of general-purpose processing clusters (GPCs) 208, where C ≥ 1. Each GPC 208 is capable of executing a large number (for example, hundreds or thousands) of strands concurrently, each strand being an instance of a program. In various applications, different GPCs 208 can be reserved for processing different types of programs or performing different types of computations. The allocation of the GPCs 208 can depend on the workload resulting from each type of program or computation.
[0020] The GPCs 208 receive processing tasks to be executed from a workload distribution unit in a task / work unit 207. The workload distribution unit receives pointers to the processing tasks, which are encoded as task metadata (TMD) and stored in memory. The data for the TMD is contained in the instruction stream, which is stored as a shift buffer and received by the front-area unit 212 from the main interface 206. Processing tasks, which can be encoded as TMD, contain indices of data to be processed, as well as state parameters and instructions that specify how the data is to be processed (for example, which program is to be executed). The task / work unit 207 receives tasks from the front area 212 and ensures that the GPCs 208 are configured to a valid state before the processing specified by the respective TMDs is initialized.A priority can be specified for each TMD record, which is used to schedule the execution of processing tasks. Processing tasks can also be received from the processing cluster array 230. Optionally, the TMD can contain a parameter that controls whether the TMD is added to the beginning or the end of a list of processing tasks (or the list of pointers to the processing tasks), thus providing an additional level of control above the priority.
[0021] The memory interface 214 contains a number D of partition units 215, each directly connected to an area of the parallel processing memory 204, where 0 ≥ 1. As shown, the number of partition units 215 is generally equal to the number of dynamic random access memory (DRAM) units 220. In other embodiments, the number of partition units 215 is not equal to the number of memory devices. Those skilled in the art will recognize that the DRAM 220 can be replaced by other suitable memory devices and can generally be of a conventional design. A detailed description is therefore omitted.Image generation targets, such as block buffers or texture mappings, can be stored across the DRAMs 220, enabling the partition units 215 to write areas of each image generation target in parallel to efficiently utilize the available bandwidth of the parallel processing memory 204.
[0022] Each of the GPCs 208 can process data to be written to one of the DRAMs 220 in the parallel processing memory 204. The junction unit 210 is configured to route the output of each GPC 208 to the input of a partition unit 215 or another GPC 208 for further processing. The GPCs 208 communicate with the memory interface 214 via the junction unit 210 to read from or write to various external storage devices. In one embodiment, the junction unit 210 has a connection to the memory interface 214 to communicate with the I / O unit 205 and also has a connection to the local parallel processing memory 204, enabling the processing cores in the different GPCs 208 to communicate with the system memory 104 or other memory not located locally with the PPU 202. In the Fig. In the embodiment shown in Figure 2, the crossing unit 210 is directly connected to the I / O unit 205. The crossing unit 210 can use virtual channels to separate traffic flows between the GPCs 208 and the partition units 215.
[0023] The GPCs 208 can in turn be programmed to perform processing tasks related to a wide variety of applications, including, but not limited to: linear and non-linear data transformations, filtering of video and / or audio data, modeling operations (for example, applying physical laws to determine position, velocity, and other attributes of objects), image generation operations (for example, tiling shading, vertex shading, geometry shading, and / or pixel shading programs), etc.The PPUs 202 can transfer data from system memory 104 and / or local parallel processing memories 204 into an internal (chip-internal) memory, process the data and write the result data back to system memory 104 and / or the local parallel processing memories 204, where such data can then be accessed by other system components, including the CPU 102 or another parallel processing subsystem 112.
[0024] A PPU 202 can be provided with any size of local parallel processing memory 204, which may or may not include local memory, and it can use local memory and system memory in any combination. For example, a PPU 202 can be a graphics processor in a unified memory architecture (UMA) embodiment. In such embodiments, little or no dedicated graphics (parallel processing) memory is provided, and the PPU 202 can use all or almost all of the system memory. In UMA embodiments, a PPU 202 can be integrated into a bridge chip or a processor chip, or it can be provided as a discrete chip with a high-speed interface (for example, PCI Express) that connects the PPU 202 to the system memory via a bridge chip or other communication means.
[0025] As previously stated, a number of PPUs 202 can be contained in a parallel processing subsystem 112. For example, multiple PPUs 202 can be provided in a single add-on card, or multiple add-on cards can be connected to the communication path 113, or one or more PPUs 202 can be integrated into a bridge chip. The PPUs 202 in a multi-PPU system can be identical or different from each other. For example, different PPUs 202 can have a different number of processing cores, a different size of local parallel processing memory, and so on. When multiple PPUs 202 are present, these PPUs can be operated in parallel to process data at a higher throughput than would be possible with a single PPU 202.Systems containing one or more PPUs 202 can be implemented in a variety of configurations and form factors, including desktop computers, mobile computers or handheld personal computers, service provider computers, workstation computers, game consoles, embedded systems, etc. Multiple simultaneous task scheduling
[0026] Multiple processing tasks can be executed simultaneously in the GPCs 208, and a processing task can generate one or more child processing tasks during execution. The task / work unit 207 receives the tasks and dynamically schedules the processing tasks and child processing tasks for execution by the GPCs 208.
[0027] Fig. 3A is a block view of task / work unit 207 from Fig. 2 according to an embodiment of the present invention. The task / work unit 207 comprises a task management unit 300 and the work distribution unit 340. The task management unit 300 arranges the tasks based on execution priority levels. For each priority level, the task management unit 300 stores a list of pointers to the TMD 322 corresponding to the tasks in the scheduling table 321, wherein the list can be implemented as a linked list. The TMD 322 can be stored in the PP memory 204 or in the system memory 104. The rate at which the task management unit 300 accepts tasks and stores them in the scheduling table 321 is independent of the rate at which the task management unit 300 schedules tasks for execution. Therefore, the task management unit 300 can collect several tasks before scheduling them.The collected tasks can then be scheduled based on priority information or using other techniques, such as round-robin or circulation scheduling.
[0028] The work distribution unit 340 comprises a task table 345 with columns or windows occupied by the TMD 322 for a task that is currently executing. The task management unit 300 can schedule tasks for execution if there is a time window available in the task table 345. If no free window is available, a higher-priority task that does not occupy a window displaces a lower-priority task that does. When a task is displaced, the task is paused, and if the task's execution is not yet complete, a pointer to the task is added to a list of task pointers to be scheduled, allowing the task's execution to resume at a later time. If a child processing task is created while a task is executing, a pointer to the child task is added to the list of task pointers to be executed.A child task can be created from a set at TMD 322, which is executed in the processing cluster array 230.
[0029] Unlike a task received in task / work unit 207 from front area 212, child tasks are received from processing cluster array 230. Child tasks are not inserted into shift buffers or sent to the front area. CPU 102 is not notified when a child task is created or when data for the child task is stored in memory. Another difference between tasks provided via shift buffers and child tasks is that tasks provided via shift buffers are defined by the application program, whereas child tasks are created dynamically during task execution. Overview of task processing
[0030] Fig. 3B is a block view of a GPC 208 in one of the PPUs 202 from Fig. 2 according to an embodiment of the present invention. Each GPC 208 can be configured to execute a large number of strands in parallel, the term "strand" denoting an instance of a specific program that is executed on a specific set of input data. In some embodiments, single-instruction, multiple-data (SIMD) instruction output techniques are used to support the parallel execution of a large number of strands without providing multiple independent instruction units. In other embodiments, single-instruction, multiple-strand (SIMT) techniques are used to perform the parallel execution of a large number of generally synchronized strands using a common instruction unit configured to issue instructions to a group of processing units in each of the GPCs 208.Unlike a SIMD execution regime, in which all processing units typically execute identical instructions, a SIMT execution regime allows different branches to follow more divergent execution paths through a given branch program. Those skilled in the art recognize that a SIMD processing regime is a functional subset of a SIMT processing regime.
[0031] The operation of the GPC 208 is advantageously controlled by a pipeline manager 305, which distributes processing tasks to data stream multiprocessors (SMs) 310. The pipeline manager 305 can also be configured to control a work distribution junction unit 330 by specifying destinations for processed data output by the SMs 310.
[0032] In one embodiment, each GPC 208 contains a number M of SMs 310, where M ≥ 1, and each SM 310 is configured to process one or more strand groups. Furthermore, each SM 310 advantageously contains an identical group of functional execution units (for example, execution units and load-storage units – referred to as Exec units 302 and LSUs 303, respectively) in Fig. (as shown in Figure 3C), which can be operated in parallel or as a pipeline, allowing a new instruction to be issued before a previous instruction has completed, as is known in the prior art. Any combination of function execution units can be provided. In one embodiment, the function units support many operations, including integer and floating-point arithmetic (for example, addition and multiplication), comparison operations, Boolean operations (AND, OR, EXCLUSIVE OR), bit shifting, and the computation of various algebraic functions (for example, plane interpolation, trigonometric, exponential, and logarithmic functions, etc.); and the same hardware of the function units can be more advantageously used to perform other operations.
[0033] The sequence of instructions sent by a dedicated GPC 208 forms a strand, as defined previously, and the collection of a certain number of concurrently executed strands across the parallel processing units (not shown) in an SM 310 is referred to as a "bulge" or "strand group." As used here, a "strand group" is a group of strands simultaneously executing the same program on different input data, each strand of the group being assigned to a different processing unit within an SM 310. A strand group may contain fewer strands than the number of processing units within the SM 310, in which case processing units are idle during certain cycles while that strand group is being processed.A strand group can also contain more strands than the number of processing units within the SM 310, in which case processing will take place over successive clock cycles. Since each SM 310 can support up to G strand groups simultaneously, it follows that up to G*M strand groups can be executed in the GPC 208 at any given time.
[0034] Furthermore, several related strand groups can be active simultaneously in an SM 310 (at different stages of execution). This collection of strand groups is referred to herein as a "cooperative strand array" ("CTA") or "strand array." The size of a particular CTA = m*k, where k is the number of strands executing concurrently in a strand group and is typically an integer multiple of the number of parallel processing units within the SM 310, and where m is the number of strand groups active concurrently in the SM 310. The size of a CTA is generally determined by the programmer and the amount of hardware resources, such as memory or registers, available to the CTA.
[0035] Each SM 310 contains a Level 1 (L1) cache memory (in Fig. (3C shown) or uses a space in a corresponding L1 cache memory outside the SM 310, which is used to load and store operations. Each SM 310 also has access to Level 2 (L2) cache memory shared by all GPCs 208, which can also be used to exchange data between strands. Finally, the SMs 310 also have access to off-chip “global” memory, which may include, for example, Parallel Processing Memory 204 and / or System Memory 104. Note that any memory outside the PPU 202 can be used as global memory. Furthermore, a one-point-five (L1.5) Cache memory 325 is included in the GPC 208 and is configured to receive and hold data retrieved from memory via memory interface 214 and requested by the SM 310, including instructions, uniform data, and constant data, and wherein the requested data is routed to the SM 310. Embodiments with multiple SMs 310 in the GPC 208 use common instructions and data stored in the L1.5 cache memory 335.
[0036] Each GPC 208 can include a memory management unit (MMU) 328 configured to map virtual addresses to physical addresses. In other embodiments, the MMU(s) 328 can be located in the memory interface 214, in the multiprocessor SM 310, or in the L1 cache memory 320. The MMU 328 is configured to map virtual addresses to physical addresses using page tables 420. The MMU 328 can include address translation sideshow buffers (TLBs) or cache memory for storing portions of the page tables 420. The physical address is processed to distribute a surface data access locality to enable efficient nesting of requests between the partition units 215. The cache memory row index can be used to indicate whether a request for a cache row is a match or a miss.
[0037] In graphics and computing applications, a GPC 208 can be configured such that each SM 310 is connected to a texture unit 315 for performing texture mapping operations, such as determining texture sample positions, reading texture data, and filtering texture data. Texture data is read from an internal texture L1 cache (not shown) or, in some embodiments, from the L1 cache in the SM 310 and retrieved from an L2 cache shared by all GPCs 208, the parallel processing memory 204, or the system memory 104 as needed. Each SM 310 outputs processed tasks to the work distribution junction unit 330 to forward the processed task to another GPC 208 for further processing or to store the processed task in an L2 cache memory, in the parallel processing memory 204 or in the system memory 104 via the junction unit 210.A pre-ROP (pre-raster operations) 325 is trained to receive data from the SM 310, route data to ROP units in the partition units 215, and perform optimizations for color mixing, manage pixel color data, and perform address translations.
[0038] It should be noted that the core architecture described herein is for illustrative purposes only and that variations and modifications are possible. Any number of processing units, for example, 310 SMs or 315 texture units, or 325 pre-ROPs, can be contained in a GPC 208. As further explained in Fig. As shown in Figure 2, a PPU 202 can have any number of GPCs 208, which are advantageously similar to each other in functional terms, so that the performance does not depend on which GPC 208 receives a specific processing task. Furthermore, each GPC 208 advantageously operates independently of other GPCs 208 using separate and distinct processing units and L1 cache memories to execute tasks for one or more application programs.
[0039] The expert in the field recognizes that the ones in the Fig. 1, Fig. 2, Fig. 3A and Fig. The architecture described in Section 3B does not in any way limit the scope of protection of the present invention and the techniques taught herein can be implemented in any suitably configured processing unit, which, without limitation, includes one or more CPUs, one or more multi-core CPUs, one or more PPUs 202, one or more GPCs 208, one or more graphics processing units or general-purpose processing units or the like, without deviating from the scope of protection of the present invention.
[0040] In embodiments of the present invention, it is desirable to use the PPU 202 or another processor or processors of a computer system to perform general-purpose calculations using strand arrays. Each strand in the strand array is assigned a unique strand identifier (“strand ID”) which the strand can access during its execution. The strand ID, which can be defined as a one-dimensional or multi-dimensional numerical value, controls various aspects of the strand's processing behavior. For example, a strand ID can be used to determine which portion of the input data set a strand is to process and / or to determine which portion of an output data set a strand is to generate or write.
[0041] A sequence of instructions per strand can contain at least one instruction that defines cooperative behavior between the representative strand and one or more other strands of the strand array. For example, the sequence of instructions per strand can contain: an instruction to pause the execution of operations for the representative strand at a specific point in the sequence until one or more of the other strands have reached that specific point; an instruction for the representative strand to store data in a shared memory accessible to one or more of the other strands; an instruction for the representative strand to atomically read and update data in a shared memory accessible to one or more of the other strands based on their strand ID; or similar instructions.The CTA program can further include an instruction to compute an address in the shared memory from which data is to be read, where the address is a function of the strand ID. By defining suitable functions and providing synchronization techniques, data can be written to a given memory location in shared memory by a single strand of a CTA and read from that memory location by another strand of the same CTA in a predictable manner. Consequently, a desired pattern for shared data usage among the strands can be supported, and each strand in a CTA can share data with another strand in the same CTA.The extent, if negotiated, of shared data use between strands of a CTA is determined by the CTA program; it is therefore evident that in a particular application using CTAs, the strands of a CTA may or may not actually share data, depending on the CTA program, and the terms 'CTA' and 'strand array' are used synonymously herein.
[0042] Fig. 3C is a block view of the SM 310 from Fig. 3B according to an embodiment of the present invention. The SM 310 includes an instruction L1 cache memory 370 configured to receive instructions and constants from memory via the L1.5 cache memory 335. A bulging disposition and instruction unit 312 receives instructions and constants from the instruction L1 cache memory 370 and, according to the instructions and constants, controls a local register file 304 and functional units of the SM 310. The functional units of the SM 310 include N Exec (execution or processing) units 302 and P Load-store units (LSUs) 303.
[0043] The SM 310 provides on-chip (internal) data storage space with different levels of accessibility. Special registers (not shown) are readable but not writable by the LS 303 and are used to store parameters that define a "position" of each strand. In one embodiment, the special registers contain one register per strand (or per Exec Unit 302 in the SM 310) that stores a strand ID; each strand ID register is accessible only by a single Exec Unit 302.Special registers may also contain additional registers that are readable by all strands performing the same processing task represented by a set of TMD 322 (or by all LSUs 303) storing a CTA identifier, the CTA dimensions, the dimensions of a grid to which the CTA belongs (or queue position if the TMD 322 specifies a queue task instead of a grid task), and an identifier of the TMD 322 associated with the CTA.
[0044] When TMD 322 is represented as a grid, its execution causes a specified number of CTAs to be launched and the specified amount of data stored in queue 525 to be executed. The number of CTAs is determined by the product of the grid width, height, and depth. The specified amount of data can be stored in the TMD 322, or the TMD 322 can store a pointer to the data processed by the CTAs. The TMD 322 can also store a starting address of the program executed by the CTAs.
[0045] If the TMD 322 represents a queue TMD, a queue property of the TMD 322 is used, meaning that the amount of data to be processed is not necessarily fixed. Queue entries store data for processing by the CTAs associated with the TMD 322. The queue entries can also represent a child task created by other TMD 322s during the execution of a strand, thus providing embedded parallelism. Typically, the execution of the strand or the CTA containing that strand is paused until the execution of the child task is complete. The queue can be stored within the TMD 322 or separately from the TMD 322, in which case the TMD 322 stores a queue pointer to the queue.Advantageously, data generated by the child task can be written to the queue while the TMD 322, representing the child task, is being executed. The queue can be implemented as a ring queue, so the total amount of data is not limited by the size of the queue.
[0046] CTAs belonging to a grid have implicit parameters for grid width, height, and depth, which specify the position of the respective CTA within the grid. Special registers are written during initialization in response to instructions received from the device driver 103 via the front panel 212, and these registers do not change during the execution of a processing task. The front panel 212 schedules each processing task for execution. Each CTA is linked to special TMD 322s for the simultaneous execution of one or more tasks. Furthermore, a single GPC 208 can execute multiple tasks concurrently.
[0047] A parameter memory (not shown) stores runtime parameters (constants) that can be read but not written by each strand within the same CTA (or LSU 303). In one embodiment, the device driver 103 supplies parameters to the parameter memory before the SM 310 is instructed to begin executing a task that uses these parameters. Each strand in a CTA (or an Exec Unit 302 in the SM 310) can access the global memory via a memory interface 214. Ranges of the global memory can be stored in the L1 cache memory 320.
[0048] The local register file 304 is used by each strand as its working area. Each register is reserved for the exclusive use of a single strand, and data in each local register file 304 is accessible only to the strand for which the register is reserved. The local register file 304 can be implemented as a register file that is physically or logically subdivided into P lanes, each containing a certain number of entries (each entry being able to store, for example, a 32-bit word). Each of the N Exec Units 302 and each of the P Load-Store Units LSU 303 is assigned a single lane, and corresponding entries in different lanes can be enriched with data for different strands executing the same program to enable SIMD execution.Different parts of the paths can be assigned to different groups of the G simultaneous strand groups, so that a given entry in the local register file 304 is only accessible from a specific strand. In one embodiment, certain entries within the local register file 304 are reserved for storing strand identifiers, thereby implementing one of the special registers. Furthermore, a uniform L1 cache memory 375 stores uniform or constant values for each path of the N Exec units 302 and the P load-store units LSU 303.
[0049] The shared memory 306 can be accessed by strands within a single CTA; in other words, any memory location in the shared memory 306 can be addressed by any strand within the same CTA (or any processing unit within the SM 310). The shared memory 306 can be implemented as a shared register file or a shared on-chip cache memory with a connection that allows a processing unit to read or write any location in the shared memory. In other embodiments, a shared state space can be mapped to a region per CTA of an off-chip memory and can be cached in the L1 cache memory 320.The parameter memory can be implemented as a special section within the same shared register file or shared cache memory, forming the shared memory 306, or the parameter memory can be implemented as a separate shared register file or an on-chip cache memory for which the LSUs 303 have read-only access. In one embodiment, the area implementing the parameter memory is also used to store the CTA ID and task ID, as well as the CTA dimensions and grid dimensions or queue position, thereby implementing areas of the special registers.Each LSU 303 in the SM 310 is connected to a Unified Address Allocation Unit 352, which translates an address provided for load and store instructions specified in a unified memory area into an address in each separate memory area. Consequently, an instruction can be used to access the local, shared, or global memory area by specifying an address in the unified memory area.
[0050] The L1 cache memory 320 in each SM 310 can be used to cache private local data per strand and also global data per application. In some embodiments, the shared data per CTA can be cached in the L1 cache memory 320. The LSUs 303 are connected to the shared memory 306 and the L1 cache memory 320 via a memory and cache binding 380. Independent virtual address spaces
[0051] Embodiments of the present invention enable a parallel processing subsystem, such as a GPU, to simultaneously execute strand programs with different independent virtual address spaces. Each virtual address space can exist concurrently with one or more other virtual address spaces, thus enabling the GPU to execute the strand programs simultaneously. Each strand program can operate within a virtual address space associated with a corresponding application process that can allocate memory and pass virtual address references to the strand program. By enabling the parallel processing subsystem to execute multiple strand programs simultaneously in different virtual address spaces, greater GPU utilization and improved performance can be achieved for a wider range of applications.
[0052] Fig. 4A shows the parallel processing subsystem 112. Fig. 1, which is configured to realize multiple concurrent virtual address spaces according to an embodiment of the present invention. In certain embodiments, the parallel processing subsystem 112 includes a GPU. For embodiments that realize a unified virtual memory (UVM), each application process 460 can contain GPU computation tasks to be executed within a virtual address space that is unified for the application process 460 and any associated GPU computation task. This unification allows the application process 460 and the GPU computation tasks to seamlessly exchange memory references. In general, each application process 460 operates in a different virtual address space with respect to other application processes 460.Each application context includes an application context page table, maintained by a higher-level operating system, to map the virtual address space associated with the application to a physical address space that is typically shared by the application processes.
[0053] A given application process 460 can initiate the execution of a GPU computation task by means of an execution request to the driver 103, which responds by adding execution information for the GPU computation task to a GPU context 450 and by adding the GPU context 450 to a queue for GPU work jobs. The GPU context 450 includes task metadata (TMD) 452, which contains information for executing one or more string programs that implement one or more GPU processing tasks that can be executed concurrently on the GPU. The one or more string programs can be associated with one or more different virtual address spaces defined in the same GPU context 450. A page table for a single virtual address space is defined for a single instance of the TMD 452.Each instance of the TMD 452 contains execution information for a single associated string program within a single GPU context 450.
[0054] A page table within a given TMD 452 can be derived from a corresponding application context page table. Alternatively, a page table within a given TMD 452 can reference a corresponding application context page table. In one embodiment, the application contexts 450 reside within system memory 104. A resource manager (RM) 454 in the driver 103 is configured to package the one or more strand programs, each assigned a set to TMD 452, into a single GPU context 450 for concurrent execution within that single GPU context. In one embodiment, an agent 456 comprises an application space process configured to route requests to the RM 454. For example, certain execution requests and allocation requests can be sent from the RM 454 via the agent 456.
[0055] As before in Fig. As described in Figure 2, the higher-level unit 206 is configured to retrieve data stored in memory, such as system memory 104. This data may include information relating to one or more GPU contexts 450 that are queued for execution. The higher-level unit 206 selects one GPU context 450 for execution in turn per unit of time. The front-level unit 212 reads the TMDs 452 within a GPU context 450 and configures the PPU 202 to execute one or more string programs based on that GPU context 450. A front-level context switch (FECS) 407 configures the MMU 328 to provide an appropriate virtual address-to-physical address mapping. The execution of a given GPU context 450 must wait until all page tables belonging to GPU context 450 have been configured by FECS 407.In one implementation, the FECS 407 generates a "finished" signal to indicate that the page table and its associated configuration steps are complete. This prompts the FE 212 to notify Task / Work Unit 207 that the page table configuration is complete. This notification allows Task / Work Unit 207 to begin scheduling tasks associated with the page table.
[0056] Each page table within the TMD 452 is linked to an address space identifier (ASID) by the FECS 407 via a link command issued by the MMU 328. Each string program is linked to an ASID that is appended to each virtual memory request generated by the string program during execution. For example, if a given GPU context 450 contains execution information for two different string programs, and each is linked to a different virtual address space, then one of the two string programs can be linked with ASID = 0 and the other with ASID = 1. In this example, the GPU context 450 also contains a single page table for a virtual address space zero (ASID = 0) and another page table for a virtual address space one (ASID = 1).During execution, each virtual memory access request generated by the first program string contains a virtual address and an ASID of 0. Page table lookup and read requests from this program string are directed to the page table with ASID = 0. Similarly, each virtual memory access request generated by the second program string contains a virtual address and an ASID of 1. Page table lookup requests from this program string are directed to the page table with ASID = 1.
[0057] The processing core 440 is configured to perform a certain set of predetermined tasks, such as copying a memory block from one address range to another. The processing core 440 receives work from the FECS 407 and can operate in conjunction with the SMs 310, but may not require general programming capability. In one embodiment, the higher-level unit 206 monitors the operation of the processing core 440.
[0058] The MMU 328 contains the ASID table 410, the page tables 420, and the TLB 430. The ASID table 410 contains one or more ASID table entries that associate an ASID with a corresponding page table 420. Generally, each memory request generated by a string program running within an SM 310 includes a virtual address and an ASID value to select a single page table 420 to perform a mapping from the virtual address to a physical address. The ASID table 410 maps an ASID value to a corresponding page table 420. The page table 420 then provides a mapping from a virtual address to a physical address. The page tables 420 are shown within the MMU 328 but can also reside in any technically feasible memory subsystem, such as system memory 104 or PP memory 204.
[0059] The TLB 430 is configured to cache virtual address-to-physical address mappings, with each mapping represented as a cache entry. Each cache entry marker includes an ASID and a virtual address. Each cache entry value includes a physical address. A TLB match occurs when the TLB 430 contains a cache entry that matches both the ASID and the virtual address inputs for a memory access request. In the case of a TLB match, the TLB provides a corresponding physical address for the memory access request. A TLB failure occurs when the TLB 430 does not contain a cache entry that matches both the ASID and the virtual address inputs. The TLB 430 can implement any technically feasible technique to determine whether the ASID input and the virtual address input together represent a TLB match or a TLB failure.In one embodiment, a content-addressable memory circuit is configured to store a pair consisting of an ASID and a virtual address as a search token for determining a hit or miss. A corresponding physical address stored in the TLB is selected to complete a virtual-to-physical address mapping when the content-addressable memory matches a given ASID-virtual address pair with a previously stored token, thus indicating a TLB hit. Such a technique is fully associative with respect to the search token. Other techniques can achieve a different degree of associativity.In the event of a TLB mismatch, the MMU 328 selects a single page table 420, identified by an ASID, that contains the memory access request and performs a virtual address-to-physical address translation using the identified page table 420 based on the memory access request for a virtual address. Any technically feasible technique can be used to perform the virtual-to-physical address translation once a single page table 420 is identified to provide page table information for the translation operation. If the page table 420 is unable to map the virtual address to the physical address, the memory access request generates an error indicating that the memory access request is invalid.
[0060] A special ASID used by a string program in an SM 310 can be linked to a special page table 430 via a link command generated by the FECS 407 and sent to the MMU 328. The link command can also be used to invalidate virtual-to-physical address mapping data located in the TLB 430. This allows ASID values to be reused for sequentially executed GPU contexts 450.
[0061] Fig. Figure 4B shows an ASID table entry 412 according to an embodiment of the present invention. The ASID table entry 412 contains an ASID field 414 and a corresponding page data connection (PDBID) field 416, which points to a page table located in the memory for the ASID value specified in the ASID field 414. In one embodiment, the PDBID 416 is a page directory base (PDB) corresponding to a physical address reference for page tables 420 in memory. The page table may be located in the PPU memory 204 or in the system memory 104.
[0062] Fig. Figure 4C shows a page table entry 422 according to an embodiment of the present invention. The page table entry (PTE) 422 contains a virtual address field 424 and a corresponding physical address field 426. A given page table is associated with a specific ASID, which is implicitly linked to a virtual address specified in the virtual address field 424.
[0063] Fig. Figure 4D shows a TLB entry 432 according to an embodiment of the present invention. The TLB entry 432 contains an ASID field 434, a virtual address field 436, and a corresponding physical address field 438. The ASID field 434 and the virtual address field 436 contain a search marker and a read marker, respectively, for locating the physical address field 438. A given TLB 430 can contain multiple TLB entries 432, which have a mixture of ASID values within the ASID field 434. The TLB 430 is able to cache virtual address-to-physical address mappings for independent virtual address spaces by including the ASID field 434 as part of the search marker in a virtual-to-physical address mapping operation specified by the TLB entry 432.
[0064] Fig. Figure 5 shows a translation of an ASID and a virtual address (VA) into a physical address (PA) according to an embodiment of the present invention. This operation can be performed in response to a mismatch within a TLB 430. The ASID 510 and the VA 520 contain a search request. The ASID 510 is used to perform a search operation in the ASID table 410. In this example, the search operation, or call, corresponds to the ASID stored in the ASID table entry 412(1), which references the page table 420(1). In this example, the call corresponds to the VA field 424 of the PTE 422(e). A corresponding PA field 426 in the PTE 422(e) completes a mapping operation to the PA 530, which is set to the value of the PA field 426 in the PTE 422(e).Multiple Page Tables 420 can remain active at any given time, and TLBs 420 can retrieve virtual-to-physical address mappings from any of the multiple Page Tables 420 in the event of a TLB mismatch. Maintaining a distinct Page Table 420 for each virtual address space, as specified by the ASID, allows multiple virtual address spaces to coexist and be mapped to a common physical address space, as shown below. Fig. Figure 6 is shown. In one embodiment, the ASID specifies both a GPU context and a special page table identifier associated with the GPU context.
[0065] Fig. Figure 6 shows two simultaneous virtual address spaces 610(0) and 610(1) that exist simultaneously within a single physical address space 620 according to one embodiment of the present invention. A virtual address space 610(0) contains multiple virtual address pages that are mapped to corresponding physical address pages within the physical address space 620 via a mapping function 630. Similarly, the virtual address space 610(1) contains multiple virtual address pages that are mapped to corresponding physical address pages in the physical address space 620.
[0066] As shown, VA space 610(0) contains a VA page at 0x0..0000, which is mapped to PA page 0x0..0000, and a VA page at 0x0..0001, which is mapped to PA page 0x0..0001. VA space 610(1) also contains VA pages at 0x0..0000 and 0x0..0001, but these VA pages are mapped to PA pages 0x0..0002 and 0x0..0003, respectively. One application context 405 can contain memory reserved in virtual address space 610(0), and another application context can contain memory reserved in virtual address space 610(1). By maintaining distinct virtual address spaces identified by the ASID, resources can be managed and allocated consistently by the application code running on CPU 102 through string programs executed on the parallel processing subsystem 112. In one utilization model, a specific PA page is mapped to two or more VA spaces.In such a usage model, the PA page comprises a shared memory page with two or more different virtual address representations in corresponding execution contexts.
[0067] Fig. Figure 7 shows the initialization of the parallel processing subsystem 112 to execute multiple strand programs with different virtual address spaces containing a single context, according to an embodiment of the present invention. The FE 212 reads the TMDs 452 from Fig. 4A, which contain a GPU context 450 selected for execution by the parent unit 206. Each set of TMD 452 contains an ASID 714. In one embodiment, the RM 454 assigns an ASID 714 to each distinct set of TMD 452. A dispatch unit 710 determines that specific TMD 452 should be dispatched for execution and sends an execution request to a computational work distribution unit (CWD) 720, which distributes the work for the TMD 452 among one or more SMs 310 to establish a grid of one or more CTAs specified by the TMD 452. As previously described in Fig. As explained in section 3B, each CTA can contain one or more strand groups. Each strand group of a CTA is connected to a common ASID 714. In one embodiment, the dispatching unit 710 comprises the task management unit 300. Fig. 3A and the CWD 720 comprise the work distribution unit 340.
[0068] Different distribution strategies can be implemented for mapping a grid of CTAs to available SMs 310. One approach, referred to herein as "deep allocation," preferentially assigns CTAs belonging to the same grid to a minimal number of distinct SMs 310 to generally maximize cache affinity for both TLB caching and data caching. For example, if a single SM 310 is capable of handling an entire grid, then the CWD 720 assigns all CTAs for the grid to a single SM 310. In this example, grid 760 further comprises the CTAs 750 assigned to SM 310(0). Similarly, grid 762 includes the CTAs 752 assigned to SM 310 1), and grid 764 includes the CTAs 754 assigned to SM 310(n).The CTAs 750 are highly likely to exhibit cache affinity for both TLB calls and data caching. Similarly, the CTAs 752 are highly likely to have a similar cache affinity, which generally improves overall performance.
[0069] Deep allocation is suitable for scenarios where multiple different virtual address spaces are needed to handle the simultaneous execution of different string programs bundled into a common GPU context. Deep allocation generally maximizes GPU utilization by allowing multiple smaller grids to run concurrently. Deep allocation is enabled in embodiments of the present invention that allow multiple virtual address spaces required for the different grids to coexist in the TLBs 430 and the MMU 328. Wide allocation distributes CTAs associated with a specific grid across available SMs 310. Wide allocation is suitable for scenarios where a single grid requires a large number of CTAs operating within the same virtual address space.A wide allocation generally maximizes the performance of a single task by maximizing the parallelism between strands associated with that task. The ability to recognize when a deep allocation should be used is enabled by the ASID 714 attribute of the set of TMDs 452. For example, if multiple different ASID values are represented under multiple TMDs 452 within a single GPU context 450 that are available for execution, then a deep allocation may be preferred over a wide allocation.
[0070] Fig. Figure 8 is a flowchart of a method 800 for the simultaneous execution of two or more strand programs that have different virtual address spaces in the parallel processing subsystem according to an embodiment of the present invention. Although the method 800, in conjunction with the systems of Fig. 1, Fig. 2, Fig. 3A, Fig. 3B, Fig. 3C, Fig. 4A, Fig. 5, and Fig. As described in section 7, the person skilled in the art will recognize that any system configured to execute the process steps in any order is within the scope of protection of the invention. In one embodiment, the process 800 is performed by a GPU, for example the PPU 202. Fig. 2 executed.
[0071] Procedure 800 begins in step 810, in which the PPU retrieves a set of TMD descriptions for tasks associated with a GPU context, such as GPU context 450 from Fig. 4A. Each set of TMD contains information for executing a task in the PPU. The information includes references to a string program that implements the task and a corresponding page table for translating virtual addresses generated by the task into physical addresses. In step 820, a scheduling unit in the PPU assigns each task to execution in an available SM, such as an SM 310. Fig. 3B. In step 830, a front-area context switching unit in the PPU connects each distinct page table and corresponding ASID within the GPU context to a SM and a TLB. The connection has the effect of associating a page table and its ASID with a string program configured to utilize the virtual address space specified by the ASID and mapped by the page table. The connection can also invalidate a TLB during preparation for the execution of the GPU context, which represents a new context unrelated to the previously cached mappings contained within that TLB.
[0072] In step 840, the PPU executes each scheduled task in a corresponding SM. During execution, each task can generate one or more memory access requests for an associated virtual address space. The virtual address space is identified by an ASID value associated with the task. A memory access request for a virtual address will initially result in a TLB failure. A first TLB failure occurs as a consequence of a first SM generating a first memory access request for a first virtual address for the first time. A second TLB failure will occur as a consequence of a second SM generating a second memory access request for a second virtual address for the first time. Each memory access request contains a virtual address and an ASID.Both the virtual address and the ASID must match a TLB entry marker located in a destination TLB for the TLB to generate a match. A TLB match indicates that the virtual address and ASID containing a memory access request have a cached mapping in a destination TLB. A TLB failure indicates that the TLB currently does not have a cached mapping for a requested virtual address and ASID. In step 850, an MMU in the PPU, such as MMU 328, executes this. Fig. Step 3B makes an initial call to, or search in, the page table in response to the first TLB mismatch from the first SM. This initial page table call creates an initial mapping from the combination of a first virtual address and a first ASID to a corresponding physical address. The initial mapping is cached in the first target TLB. In step 852, the MMU makes a second page table call in response to the second TLB mismatch. The second memory access request includes a second ASID, which requires the MMU to execute the second page table call using a second page table specified by the second ASID. The second mapping is cached in the second target TLB. The first and second target TLBs comprise the same TLB unit, such as a TLB 430.In one embodiment, each page table call includes traversing the page table to find a suitable assignment for each virtual address within the corresponding virtual address space. Any technically feasible search technique for the page table can be implemented without deviating from the scope of protection and the fundamental concept of the present invention.
[0073] The process ends in step 890.
[0074] Fig. Figure 9 is a flowchart of process steps for performing a mapping of virtual to physical addresses in one of several different virtual address spaces according to an embodiment of the present invention. Although the method 900 in conjunction with the systems of Fig. 1, Fig. 2, Fig. 3A, Fig. 3B, Fig. 3C, Fig. 4A, Fig. 5 and Fig. As described in section 7, a person skilled in the art in this field will recognize that any system configured to execute the process steps in any order falls within the scope of protection of the invention. In one embodiment, the process 900 is carried out by a PPU, for example the PPU 202. Fig. 2, executed.
[0075] Procedure 900 begins in step 910, where a MMU in the PPU receives a request to map a virtual address to a physical address. The request includes a virtual address and an ASID to specify which of several different virtual address spaces should be used to perform the mapping. If the mapping request does not return a TLB match in step 920, the procedure proceeds to step 930. In step 930, the MMU maps the ASID to a page table reference using an ASID table, such as ASID table 410. In step 940, the MMU maps the virtual address to a physical address using the page table specified by the page table reference. In step 950, the MMU sends the virtual address-to-physical address mapping to the destination TLB for caching and later use.In step 960, the MMU associates a physical address with the allocation request to enable the continuation of a linked memory access request. The process ends in step 990.
[0076] Returning to step 920, if the assignment request has a TLB match, the process continues to step 960.
[0077] Fig. Figure 10 is a flowchart of process steps for performing deep scheduling for tasks within the context of a graphics processing unit according to an embodiment of the present invention. Although the method 1000 in conjunction with the systems from the Fig. 1, Fig. 2, Fig. 3A, Fig. 3B, Fig. 3C, Fig. 4A, Fig. 5 and Fig. As described in section 7, a person skilled in the art in this field will recognize that any system configured to execute the process steps in any sequence falls within the scope of protection of the invention. In one embodiment, the process 1000 is carried out by a PPU, for example the PPU 202. Fig. 2, executed.
[0078] Procedure 1000 begins in step 1010, where a Computational Work Distribution Unit (CWD) in the Power Processing Unit (PPU) receives a GPU context, such as GPU context 450, which contains multiple tasks to be executed concurrently within the PPU. In step 1020, the CWD selects one task from the multiple tasks that comprise the GPU context. In step 1030, the CWD selects one or more Service Modules (SMs) from a multitude of SMs based on the execution requirements of the selected task and for which resources are simultaneously available in the multitude of SMs. In this step, the CWD attempts to minimize the number of different SMs within which the selected task is available for execution. Any technically feasible technique can be implemented to allocate available resources to fulfill task requirements.In step 1040, the CWD schedules the selected task for execution in the one or more SMs chosen from the group of multiple SMs. If, in step 1050, the selected task is not the last task located in the GPU context, the process continues to step 1020. Otherwise, the process ends in step 1060.
[0079] In one embodiment, the CWD is configured to dispose of an entire GPU context according to deep or broad disposition techniques based on explicit instructions. These explicit instructions can be conveyed programmatically or via one or more environment variables. In other embodiments, the CWD can dispose of each task within a GPU context individually according to a deep or broad disposition technique based on explicit instructions. Alternatively, the CWD can deduce which disposition technique to implement for a given task based on different ASID values associated with that task.
[0080] Although the above explanation refers to the management of different tasks for execution in a common GPU context, parallel co-processors designed to execute multiple simultaneous contexts with different virtual address spaces are also within the scope of protection and the basic idea of embodiments of the present invention.
[0081] In certain embodiments, data cache memory is tagged with respect to physical addresses. In alternative embodiments, data cache memory is tagged with respect to virtual addresses and requires an ASID as part of each tag. Both masking schemes can be combined in a single GPU.
[0082] In summary, a technique is disclosed for simultaneously executing different tasks with different virtual address spaces on the same GPU. A task is associated with a virtual address space via an address space identifier (ASID). A virtual memory request generated by a currently executing task contains the ASID, which is used to select a corresponding page table. The selected page table is then used to map the virtual address containing the virtual memory request to a physical address. The page tables are established from corresponding page tables maintained by an operating system for user application processes that call the tasks. A translation sideshow buffer (TLB) stores the virtual memory allocation requests for future use.A TLB entry contains a tag that includes the ASID and the virtual address, and a data field with the corresponding physical address. In one embodiment, the tasks are grouped together in a common context for execution. The tasks can be scheduled according to a deep scheduling scheme, allowing the tasks to be executed with a common virtual address space in a minimal number of different SMs.
[0083] One advantage of the present invention is that a GPU can simultaneously perform different tasks with different virtual address spaces, thereby improving GPU utilization and performance in certain applications.
[0084] Another advantage of embodiments of the present invention is that GPU tasks can be performed with address space separation, thereby improving reliability and reducing the development effort associated with debugging.
[0085] Although the foregoing relates to embodiments of the present invention, other and further embodiments of the invention can be conceived without deviating from its fundamental scope of protection. For example, aspects of the present invention can be implemented in hardware or software, or in a combination of hardware and software. One embodiment of the invention can be implemented as a program product for use in a computer system. The program(s) of the program product define functions of the embodiments (including the methods described herein) and can be contained in a variety of computer-readable storage media.Examples of computer-readable storage media include, but are not limited to: (i) non-writable storage media (for example, read-only storage devices in a computer, such as CD-ROM disks readable by a CD-ROM drive, flash memory, ROM chips, or other types of non-volatile semiconductor electronic storage) on which information is permanently stored; and (ii) writable storage media (for example, floppy disks in a floppy disk drive or a hard disk drive, or any other type of random-access semiconductor electronic storage) on which modifiable information is stored. Such computer-readable storage media, when they contain computer-readable instructions that direct the functions of the present invention, are embodiments of the present invention.
[0086] Therefore, the scope of protection of the present invention is defined by the following patent claims.
Claims
[1] A method for simultaneously executing two or more thread programs having different virtual address spaces in a parallel processing subsystem, the method comprising: Reading a first page table associated with a first virtual address space identified by a first address space identifier, ASID, and a second page table associated with a second virtual address space identified by a second ASID; Scheduling a first thread program associated with the first virtual address space for execution in a first processing core of the parallel processing subsystem and executing the first thread program in the first processing core to generate a first virtual access request including a first virtual address in the first virtual address space and the first ASID; Scheduling a second thread program associated with the second virtual address space for execution in the first processing core or another processing core of the parallel processing subsystem, and executing the second thread program in the first processing core or the another processing core to generate a second virtual access request including a second virtual address in the second virtual address space and the second ASID; Performing a first read operation using the first page table to generate a first mapping from the first virtual address to a first physical address in response to a first miss generated by a first translation sidebar buffer (TLB) associated with the first processing core; and Store the first mapping as a first entry in the first TLB. [2] A parallel processing subsystem configured to: read a first page table associated with a first virtual address space identified by a first address space identifier (ASID), and read a second page table associated with a second virtual address space identified by a second ASID; schedule a first thread program associated with the first virtual address space for execution in a first processing core of the parallel processing subsystem and execute the first thread program in the first processing core to generate a first virtual access request including a first virtual address in the first virtual address space and the first ASID; scheduling a second thread program associated with the second virtual address space for execution in the first processing core or another processing core of the parallel processing subsystem, and executing the second thread program in the first processing core or another processing core to generate a second virtual access request including a second virtual address in the second virtual address space and the second ASID; and perform a first fetch operation using the first page table to generate a first mapping from the first virtual address to a first physical address in response to a first miss generated by a first translation sidebar buffer (TLB) associated with the first processing core; and to store the first mapping as a first entry in the first TLB. [3] The parallel processing subsystem of claim 2, wherein the parallel processing subsystem is further configured to: perform a second read operation using the second page table to generate a second mapping from the second virtual address to a second physical address in response to a second miss generated by a second TLB associated with the first processing core or the further processing core; and store the second mapping as a second entry in the second TLB. [4] The parallel processing subsystem of claim 3, wherein the first mapping includes a tag comprising the first ASID and the first virtual address, and wherein the second mapping includes a tag comprising the second ASID and the second virtual address. [5] The parallel processing subsystem of claim 2, wherein an execution context for the parallel processing subsystem comprises the first page table, the first thread program, the second page table, and the second thread program. [6] The parallel processing subsystem of claim 2, wherein the first page table is generated from a first application context page table, and wherein the second page is generated from a second application context page table. [7] The parallel processing subsystem of claim 2, wherein the first thread program and the second thread program are executed in the first processing core.
Citation Information
Patent Citations
Apparatus and method for scheduling threads in multi-threading processors
US20030135711A1
Maintaining Processor Resources During Architectural Events
US20090193222A1
