Efficient memory virtualization in multi-stranded processing units
Patent Information
- Application Number
- DE102013017510
- Authority / Receiving Office
- DE · DE
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2012-10-25
- Filing Date
- 2013-10-23
- Publication Date
- 2024-10-02
- Estimated Expiration
- 2033-10-23
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
BACKGROUND OF THE INVENTION Field of the invention
[0001] The present invention relates generally to multi-threaded computer architectures and, more particularly, to efficient Memory virtualization in multi-threaded processing units. Description of the state of the art
[0002] In conventional computer systems with both a central processing unit (CPU) and a graphical Processing Unit (GPU), the CPU performs part of the application calculations, allocates resources and manages the entire execution of the application, with the GPU performing high-throughput calculations that are not performed by the CPU In certain application areas, such as high performance computing (HPC) applications, the GPU typically performs the majority of the calculations associated with a given application. As a result, The overall performance of the application is directly dependent on GPU utilization. In such applications high application performance is achieved with high GPU utilization, ie, a condition that characterized by the fact that a relatively large proportion of the GPU processing units perform useful work simultaneously. Work is divided into thread programs that are executed in parallel in processing units.
[0003] A typical thread program is executed in the form of highly parallel, very similar operations over a parallel across a data set, such as an image or a group of images stored in a single virtual address space If an application needs to execute several different thread programs, the GPU conventionally, the different strand programs are executed one after the other, each within a corresponding virtual address space until the different thread programs have completed their assigned work. Each Thread program is loaded into a corresponding context for execution within the GPU. The context includes the state of the virtual address space, which is loaded into page tables located in the GPU. Since each different thread program conventionally requires a private virtual address space, can lead to a At any given time, only a single thread program can be executed in the GPU.
[0004] HPC applications are typically executed in an HPC cluster or collection that conventionally contains a group of nodes, each of which contains a CPU and a GPU. Each node is typically assigned to a group of tasks that interact with other tasks that are processed in other nodes communicate via a message passing interface (MPI) task. A typical GPU Computation task is efficiently performed with high GPU utilization as a group of parallel thread 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 include a range of workloads for the GPU, resulting in a corresponding range of GPU utilization In one scenario, only a single thread or a small number of threads in the GPU are used as an MPI Task executed, resulting in poor GPU utilization and poor overall As a result, certain HPC applications run inefficiently on GPU-based HPC processing clusters. In general, applications that require the GPU sequentially processes tasks that contain a small number of thread instances, each of which independent virtual address space is required. US 7 409 487 B1 discloses a system with virtual machines that access the same hardware
[0005] As can be seen from the foregoing, a technique is needed in this field that allows simultaneous GPU execution of tasks with different virtual address spaces enables simultaneous Execution of thread programs to increase the utilization of the components involved. OVERVIEW OF THE INVENTION
[0006] An embodiment of the present invention provides a method for simultaneously executing two or several thread programs having different virtual address spaces according to claim 1.
[0007] An advantage of the present invention is that a GPU can simultaneously perform different tasks with different virtual address spaces, which reduces GPU utilization and performance in certain applications. Another advantage of the present invention is that GPU Tasks can be executed with address space separation, which improves reliability and Development effort associated with debugging is reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] In order to understand in more detail the manner in which the above-mentioned features of the present invention are, a more detailed description of the invention, briefly summarized above, will be given with reference to embodiments, some of which are illustrated in the attached drawings. However, it should be noted that the attached drawings represent only typical embodiments of this invention and are not intend to limit its scope because the invention may have other equally effective embodiments allows. Fig. 1 is a block diagram illustrating a computer system configured to perform one or more aspects of to realize the present invention; Fig. 2 is a block diagram of a parallel processing subsystem for the computer system of Fig. 1 according to an embodiment of the present invention; Fig. 3A is a block diagram of the front portion of Fig. 2 according to an embodiment of the present Invention; Fig. 3B is a block diagram 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 diagram of a portion of a data stream multiprocessor of Fig. 2 according to a Embodiment of the present invention; Fig. 4A shows a parallel processing subsystem designed to process multiple simultaneous virtual to implement address spaces according to an embodiment of the present invention; Fig. 4B shows a table entry of an address space identifier according to an embodiment of the present Invention; Figure 4C shows a page table entry according to an embodiment of the present invention; Fig. 4D shows an entry of a translation sideshow buffer according to an embodiment of the present Invention; Fig. 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. 6 shows two simultaneous virtual address spaces within a single physical address space coexist, according to an embodiment of the present invention; Fig. 7 shows the configuration of a parallel processing subsystem to process multiple thread programs with different virtual address spaces according to an embodiment of the present invention to carry out; Fig. 8 is a flow chart of process steps to simultaneously process two or more strand programs that have different virtual address spaces, in the parallel processing subsystem according to a embodiment of the present invention; Fig. 9 is a flowchart of process steps for performing a mapping of virtual addresses to physical addresses in one of several different virtual address spaces according to a Embodiment of the present invention; and Fig. 10 is a flowchart of process steps for performing deep scheduling of tasks in Context of a graphics processing unit according to an embodiment of the present invention. DETAILED DESCRIPTION
[0009] In the following description, numerous specific details are set forth in order to provide a more thorough understanding of the However, those skilled in the art will recognize that the present invention can be implemented without one or more several of these specific details can be practiced. System overview
[0010] Fig. 1 is a block diagram illustrating a computer system 100 configured to implement one or more aspects of the present invention. The computer system 100 includes 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 a northbridge chip, for example, is connected via a bus or other Communication path 106 (for example, a HyperTransport connection) with an I / O (input / output) bridge 107 The I / O bridge 107, which may be a south bridge chip, for example, receives a user input from one or more user input devices 108 (e.g. 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 (at for example, a Peripheral Component Interconnect (PCI) Express connection, an accelerated graphics port or a HyperTransport connection); in one embodiment, the parallel processing subsystem 112 is a graphic subsystem that delivers pixels to a display device 110 (for example, a monitor based on a conventional cathode ray tube or 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 add-on cards 120 and 121. Other components (not explicitly shown) including a universal serial bus (USB) or other port connections, compact disk (CD) drives, Digital video disk (DVD) drives, film recorders and the like can also be connected to the I / O bridge 107. The various communication paths shown in Fig. 1, including the specially designated Communication paths 106 and 113 can be implemented using any suitable protocols, such as PCI Express, AGP (accelerated graphics port), HyperTransport or another bus or point-to-point Connection protocol(s), and connections between different facilities using different protocols are known in the state of the art.
[0011] In one embodiment, the parallel processing subsystem 112 includes circuitry for graphic Processing and video processing, which includes, for example, a video output circuit, and this Circuit forms a graphic processing unit (GPU). In a further embodiment, the Parallel processing subsystem 112 comprises a circuit optimized for general purpose processing, while the underlying computing architecture, which is described in more detail herein, is retained. In a still further embodiment, the parallel processing subsystem 112 may be implemented in one or more other system elements in be integrated into 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).
[0012] It should be noted that the system shown herein is illustrative in nature and that variations and modifications 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 of the system memory 104 connected to the CPU 102 directly rather than 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 be integrated into a single chip, rather than being provided as one or more discrete components. Large Embodiments may 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 add-on cards or peripheral devices. In some embodiments, the switch 116 is omitted, and the Network adapter 118 and the add-on cards 120, 121 are connected directly to the I / O bridge 107.
[0013] Fig. 2 shows a parallel processing subsystem 112 according to an embodiment of the present invention. As As shown, the parallel processing subsystem 112 includes one or more parallel processing units (PPUs) 202, of which each of which is connected to a local parallel processing (PP) memory 204. In general, a Parallel processing subsystem a number U of PPUs, where U ≥1. (Here, several representatives of the same objects with reference symbols that designate 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 can be implemented, for example by programmable processors, application-specific integrated circuits (ASIC) or memory devices or can be implemented in another technically feasible manner.
[0014] Referring again to Figures 1 and 2, in some embodiments, some or all of the PPUs 202 are in the Parallel processing subsystem 112 graphics processors with image generation pipelines, which can be configured to perform various To perform operations related to the generation of pixel data from graphic data received from the CPU 102 and / or the system memory 104 via the memory bridge 105 and the second communication path 113 be used, with the local parallel processing memory 204 (which can be used as a graphics memory and for example, contains 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 one or more other PPUs 202 used for general purpose calculations. The PPUs may be identical or different, and each PPU may have one or more special parallel processing memories or no special Have parallel processing memory. 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.
[0015] During operation, the CPU 102 is the higher-level 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 (not explicitly shown in Fig. 1 or Fig. 2) stored in the system memory 104 in which parallel processing memory 204 or another memory location accessible by both the CPU 102 and the PPU 202. A pointer to each data structure is written into a shift buffer to to initiate processing of the stream of instructions in the data structure. The PPU 202 reads instruction streams from one or multiple shift buffers and then executes instructions in an asynchronous manner relative to the operation of the CPU 102. Execution priorities can be set for each shift buffer by an application program via the device driver 103 to control the scheduling of the different sliding buffers.
[0016] Referring now to Fig. 2 and Fig. 1, each PPU 202 comprises an I / O (input / output) Unit 205, which communicates with 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 the PPU 202 with the rest of the computer system 100 may also be different. In some embodiments, the Parallel processing subsystem 112 is implemented as an add-on card that plugs into an expansion slot connector of the computer system 100. In other embodiments, a PPU 202 may be incorporated into a single chip be integrated with a bus bridge, such as the memory bridge 105 or the I / O bridge 107. In still other Embodiments may incorporate some or all elements of the PPU 202 into a single chip along with the CPU 102 be integrated.
[0017] In one embodiment, the communication path 113 is a PCI Express connection in which special lanes assigned to each PPU 202, as is known in the art. Other communication paths may also be 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 appropriate components of the PPU 202. For example, commands related to processing tasks can be routed to a higher-level interface or main interface 206, whereas commands that involve memory operations (for example, reading from the parallel processing memory 204 or write to it) to a memory intersection unit 210 The main interface 206 reads each shift buffer and outputs the value stored in the shift buffer. Command stream to a front area 212.
[0018] Each PPU 202 advantageously implements a highly parallel processing architecture. As shown in detail, the PPU 202(0) comprises a processing cluster array 230 comprising a number C of general processing clusters (GPCs) 208, where C ≥ 1. Each GPC 208 is capable of storing a large number (for example, hundreds or thousands) of threads simultaneously, where each thread is an instance of a program. In various Applications can use different GPCs 208 for processing different types of programs or for to perform different types of calculations. The allocation of GPCs 208 can be determined by the workload that results for each type of program or calculation.
[0019] The GPCs 208 receive processing tasks to be executed from a work distribution unit in a Tasks / Work Unit 207. The work distribution unit receives pointers to the processing tasks that are Task metadata (TMD) is encoded and stored in memory. The data on the TMD is in the instruction stream which is stored as a sliding buffer and is sent from the front end unit 212 to the main interface 206 is received. Processing tasks, which can be coded as TMD, contain indices of data to be processed, as well as state parameters and commands that specify how the data is to be processed (for example, which program The task / work unit 207 receives tasks from the front area 212 and ensures that the GPCs 208 must be configured to a permissible state before processing specified by respective TMDs A priority can be specified for each TMD record that is used to initialize the Execution of processing tasks. Processing tasks may also be received from the processing cluster array 230. Optionally, the TMD may include a parameter that controls whether the TMD is to be added to the beginning or the end of a list of processing tasks (or the list of pointers to the processing tasks), which provides another level of control above the priority is provided.
[0020] The memory interface 214 contains a number D of partition units 215, each of which is directly connected to an area of the parallel processing memory 204, where D ≥1. As shown, the number of partition units 215 is generally equal to the number of dynamic random access memories (DRAM) 220. In other embodiments, the number of partition units 215 is not equal to the number of storage devices. Those skilled in the art will recognize that DRAM 220 may be replaced by other suitable memory devices and can generally be of conventional design. A detailed description is therefore omitted. Image generation targets, such as block buffers or texture maps, can be shared across the DRAMs 220 be stored, thereby enabling the partition units 215 to process areas of each image generation target in parallel describe in order to efficiently utilize the available bandwidth of the parallel processing memory 204.
[0021] Each of the GPCs 208 can process data stored in one of the DRAMs 220 in the parallel processing memory 204 The intersection unit 210 is configured to connect 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 intersection unit 210 to read various external storage devices or to describe them. In one embodiment, the intersection 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, which enables the processing cores in the different GPCs 208 be communicated with the system memory 104 or other memory that is not local to the PPU 202. communicate. In the embodiment shown in Fig. 2, the intersection unit 210 is directly connected to the I / O unit 205 The intersection unit 210 may use virtual channels to manage traffic flows between the GPCs 208 and to separate the partition units 215.
[0022] The GPCs 208 may in turn be programmed to perform processing tasks related with a wide range of applications, including, but not limited to: linear and non-linear Data transformations, filtering of video and / or audio data, modeling operations (e.g. Application of physical laws to determine position, speed and other attributes of objects), image generation operation (e.g. tessellation shading, vertex shading, geometry Shading, and / or pixel shading programs), etc. The PPUs 202 can read data from the system memory 104 and / or transferred from local parallel processing memories 204 to an internal (on-chip) memory, the data process and transfer the result data back to the system memory 104 and / or the local parallel processing memories 204, where such data can then be accessed by other system components, for which the CPU 102 or another parallel processing subsystem 112.
[0023] A PPU 202 may be provided with any size of local parallel processing memory 204, for which no local memory belongs to it, and this can use the local memory and the system memory in any combination For example, a PPU 202 may be a graphics processor in one embodiment with unified Memory Architecture (UMA). In such embodiments, little or no dedicated graphics (Parallel processing) memory is provided, and the PPU 202 can exclusively or almost exclusively use the system memory. In UMA embodiments, a PPU 202 may be incorporated into a bridge chip or a processor chip integrated, or can be implemented as a discrete chip with a high-speed connection (e.g. PCI Express) be provided that connects the PPU 202 to the system memory via a bridge chip or other connects communication facilities.
[0024] As previously stated, a number of PPUs 202 in a parallel processing subsystem 112 may be included For example, multiple PPUs 202 may be provided in a single add-on card, or there may be multiple Additional cards can be connected to the communication path 113, or one or more PPUs 202 can be connected in a The PPUs 202 in a multi-PPU system may be identical or may be interconnected. different. For example, different PPUs 202 may have a different number of processing cores, different amounts of local parallel processing memory, etc. If multiple PPUs 202 are present, these PPUs can be operated in parallel to transfer data with a higher throughput. than would be possible with a single PPU 202. Systems that support one or containing multiple 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
[0025] Multiple processing tasks can be executed simultaneously in the GPCs 208, and a Processing task can create one or more 'child' processing tasks during execution. Tasks / Work Unit 207 receives the tasks and schedules the processing tasks and the child Processing tasks for execution by the GPCs 208 in a dynamic manner.
[0026] Fig. 3A is a block diagram of the task / work unit 207 of 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 ensures that the tasks are allocated on the basis of of 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, the list being 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 the tasks in the Scheduling table 321 is independent of the rate at which the task management unit 300 creates tasks for the execution. Therefore, the task management unit 300 can collect several tasks before Tasks are scheduled. The collected tasks can then be assigned based on priority information or Application of other techniques, such as round trip or circulation scheduling.
[0027] The work distribution unit 340 comprises a task table 345 with columns or windows defined by the TMD 322 are occupied for a task that is currently being executed. The task management unit 300 can create tasks for the Schedule execution if there is a time slot in task table 345. If no free slot is available, displaces a higher priority task that does not occupy a window, a lower priority task that window. When a task is displaced, the task is paused, and when the task execution is not completed, then a pointer to the task is added to a list of task pointers that are to be dispatched. added so that the task can be resumed at a later time. If a child processing task is created during the execution of a task, a pointer to the child task of the list from 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.
[0028] Unlike a task received in the task / work unit 207 from the front area 212, Child tasks are received from the processing cluster array 230. Child tasks are not stored in sliding buffers inserted or sent to the front area. The 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 the tasks, which are provided via sliding buffers, and child tasks is that the via the sliding buffers provided tasks are defined by the application program, whereas the child tasks are defined during the Execution of tasks is generated dynamically. Overview of task processing
[0029] Fig. 3B is a block diagram of a GPC 208 in one of the PPUs 202 of 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 ´´thread´´ refers to an instance of a special program that operates on a special set of input data In some embodiments, single instruction, multiple data (SIMD) instruction issue techniques used to support parallel execution of a large number of threads without requiring multiple independent instruction units are provided. In other embodiments, single instruction, multiple thread (SIMT) techniques are used to enable parallel execution of a large number of generally synchronized threads to be carried out using a common command unit that is trained to issue orders to a group of processing units in each of the GPCs 208. Unlike in a SIMD execution regime, in which all processing units typically execute identical instructions, SIMT execution allows different threads can more easily follow divergent execution paths through a given thread program. The skilled person recognizes that a SIMD processing regime is a functional subset of a SIMT processing regime represents.
[0030] The operation of the GPC 208 is advantageously controlled by a pipeline manager 305, which processes tasks to data stream multiprocessors (SM) 310. The pipeline manager 305 may also be configured to Work distribution intersection unit 330 by specifying destinations for processed data output from the SM 310 to be controlled.
[0031] In one embodiment, each GPC 208 includes a number M of SMs 310, where M ≥ 1, each SM 310 designed to process one or more strand groups. Furthermore, each SM 310 advantageously contains a identical group of function execution units (for example, execution units and load-store units - shown as Exec units 302 and LSUs 303 in Fig. 3C), which can be operated in parallel or as a pipeline, whereby a new command can be issued before a previous command is completed, as in the state known in the art. Any combination of functional execution units can be provided. In In one embodiment, the functional units support many operations, including integer arithmetic and Floating-point arithmetic (e.g. addition and multiplication), comparison operations, Boolean operations (AND, OR, EXCLUSIVE OR), bit shifting and the calculation of various algebraic functions (for example, plane interpolation, trigonometric, exponential and logarithmic functions, etc.); and the same hardware as the Functional units can be used more advantageously to perform other operations.
[0032] The series of commands sent by a particular GPC 208 forms a thread, as previously described defined, and the accumulation of a certain number of simultaneously executed threads over the Parallel processing units (not shown) into an SM 310 is referred to as a ´´bulge´´ or ´´strand group´´ As used herein, a ´´strand group´´ refers to a group of strands that simultaneously execute the same program on different input data, with each individual strand of the group being another processing unit within an SM 310. A strand group can contain fewer strands than the Number of processing units within the SM 310, in which case processing units during certain cycles are idle when this thread group is currently being processed. A thread group can also have more Strands as the number of processing units within the SM 310, in which case processing via consecutive 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 time.
[0033] Furthermore, several related strand groups can be active simultaneously in an SM 310 (in different phases of execution). This collection of strand groups is referred to herein as a ´´cooperative strand- Array'' (''CTA'') or ''string array''. The size of a special CTA = m*k, where k is the number of simultaneous executed strands 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 thread groups that can be simultaneously 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.
[0034] Each SM 310 contains a Level 1 (L1) cache memory (shown in Fig. 3C) or uses a space in a corresponding L1 cache memory outside the SM 310, which is used to load and execute operations Each SM 310 also has access to Level 2 (L2) cache memory, which is shared by all GPCs 208 and can also be used to exchange data between threads. Finally, The SMs 310 also have access to off-chip ´´global´´ memory, which, for example, Parallel processing memory 204 and / or system memory 104. It should be noted that any Memory outside the PPU 202 can be used as global memory. Furthermore, a one-point-five (L1.5) cache Memory 325 may be included in the GPC 208 and configured to receive data from the memory via the memory interface 214 and requested by the SM 310, including commands, uniform data and constant data, and wherein the requested data is forwarded 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 are stored.
[0035] Each GPC 208 may include a memory management unit (MMU) 328 configured to allocate virtual addresses physical addresses. In other embodiments, the MMU or MMUs 328 in the Memory interface 214, in the multiprocessor SM 310 or in the L1 cache memory 320. The MMU 328 is designed to map virtual addresses to physical addresses using page tables 420. The MMU 328 can Address translation sidebar buffer (TLB) or cache memory for storing areas of the page tables 420 included. The phy physical address is processed to distribute a surface data access locality to ensure efficient To enable nesting of requests between the partition units 215. The cache line index can be used to indicate whether a request for a cache line is a hit or a miss.
[0036] In graphics and computing applications, a GPC 208 may be configured such that each SM 310 is provided with a Texture unit 315 for performing texture mapping operations, for example for determining Texture sample positions, for reading texture data and for filtering the texture data. Texture data is retrieved from a internal texture L1 cache (not shown) or, in some embodiments, from the L1 cache in the SM 310 and retrieved from an L2 cache memory shared by all GPCs 208, the Parallel processing memory 204 or system memory 104 when needed. Each SM 310 outputs processed tasks to the work distribution intersection unit 330 to forward the processed task to another GPC 208 for for further processing or to store the processed task in an L2 cache memory in which Parallel processing memory 204 or in the system memory 104 via the intersection unit 210. A pre- ROP (Pre-Raster Operations) 325 is configured to receive data from the SM 310, send data to ROP units in the Partition units 215 and perform optimizations for color mixing, manage pixel color data and To perform address translations.
[0037] It should be noted that the core architecture described herein is illustrative and that variations and Modifications are possible. Any number of processing units, for example SMs 310 or Texture units 315, pre-ROPs 325 may be included in a GPC 208. As further shown in Fig. 2, a PPU 202 have any number of GPCs 208, which are advantageously functionally similar to each other, so that the performance does not depend on which GPC 208 receives a specific processing task. Furthermore Advantageously, each GPC 208 operates independently of other GPCs 208 using separate and different processing units, L1 cache memories to perform tasks for one or more application programs to execute.
[0038] The person skilled in the art will recognize that the device described in Fig. 1, Fig. 2, Fig. 3A and Fig. 3B Architecture in no way limits the scope of the present invention and that the methods taught herein Techniques can be implemented in any suitably configured processing unit, for which purpose, without Restriction, 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 departing from the scope of the present invention.
[0039] 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 Each thread in the thread array is assigned a unique thread identifier ('thread ID') which the thread can access during the thread's execution. The thread ID, which is used as a one-dimensional or multi-dimensional numerical value can be defined, controls various aspects of the Processing behavior of the thread. For example, a thread ID can be used to determine which area of the input data set a string has to process, and / or to determine which area of a output data set has to create or write a thread.
[0040] A sequence of instructions per thread may contain at least one instruction that provides cooperative behavior between the representative strand and one or more other strands of the strand array. For example, the sequence of instructions per thread may contain: an instruction to perform operations for to interrupt the representative strand at a specific point in the sequence, until a time when one or several of the other strands have reached this particular point, a command for the representative strand to write data into a shared memory accessible to one or more of the other threads, an instruction for the representative strand, data stored in a shared memory accessed by one or more of the other strands have access based on their thread ID, to read and update in an atomic manner, or the like. The CTA- The program may further include an instruction to calculate an address in the shared memory from which Data is to be read, where the address is a function of the string ID. By defining suitable functions and by Providing synchronization techniques, data can be transferred to a given storage location in a common Memory is written by a single thread of a CTA and written from that memory location by another thread of the same CTA can be read in a predictable manner. Consequently, a desired pattern for the common Data usage among the threads is supported, and each thread in a CTA can share data with another thread in the same CTA. The extent to which negotiate, data sharing between strands of a CTA is determined by the CTA program; it is It is therefore clear that in a specific application that uses CTAs, the strands of a CTA actually contain data may or may not be used jointly, depending on the CTA program, and the terms ´´CTA´´ and ´´Strand array´´ are used herein as synonyms.
[0041] Fig. 3C is a block diagram of the SM 310 of Fig. 3B according to an embodiment of the present invention. SM 310 includes an instruction L1 cache 370 configured to retrieve instructions and constants from memory via the L1.5 cache 335. A camber scheduling and instruction unit 312 receives instructions and Constants from the instruction L1 cache 370 and controls a local Register file 304 and functional units of the SM 310. The functional units of the SM 310 contain N Exec (execution or processing) units 302 and P load-store units (LSU) 303.
[0042] 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 thread. In one embodiment, the special registers contain a Register per thread (or per Exec unit 302 in the SM 310) that stores a thread ID; each thread ID register is only by a respective one of the Exec units 302. Special registers may also contain additional registers that are readable by all threads that perform the same processing task, which is determined by a set of TMD 322 is represented (or by all LSUs 303) that have a CTA identifier, the CTA dimensions, the dimensions of a grid, to which the CTA belongs (or queue position if the TMD 322 is a queue task instead of a grid task), and store an identifier of the TMD 322 assigned to the CTA.
[0043] If the TMD 322 represents TMD in the form of a grid, the execution of the TMD 322 causes a specified number of CTAs is started and the specified amount of data stored in the queue 525 are executed. The number of CTAs is determined by the product of the grid width, height, and depth. A specified amount of data can be stored in the TMD 322, or the TMD 322 can store a pointer to the Store data processed by the CTAs. The TMD 322 can also store a start address of the program save that is executed by the CTAs.
[0044] If the TMD 322 represents queue TMD, a queue property of the TMD 322 used, which means 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 may also represent a child task executed by further TMD 322 during the execution of a thread, providing embedded parallelism. Typically, the Execution of the thread or the CTA containing this thread is interrupted until the execution of the child task is completed. The queue can be stored in the TMD 322 or separately from the TMD 322, in which In this case, the TMD 322 stores a queue pointer to the queue. Advantageously, data received from the child task are written to the queue, while the TMD 322 that the child task represent, are executed. The queue can be implemented as a ring queue, so that the total amount of data is not limited by the size of the queue.
[0045] CTAs belonging to a grid have implicit parameters for grid width, height and depth, which determine the position of the respective CTA within the grid. Special registers are created during initialization in response to Commands are described that are received via the front area 212 from the device driver 103, and the registers do not change during the execution of a processing task. The front area 212 disposes of each Processing task for execution. Each CTA is equipped with special TMD 322 for the simultaneous execution of one or multiple tasks. Furthermore, a single GPC 208 can perform multiple tasks simultaneously.
[0046] A parameter memory (not shown) stores runtime parameters (constants) used by each thread within the same CTA (or an LSU 303) can be read but not written. In one embodiment, the Device driver 103 parameters to the parameter memory before the SM 310 is instructed to execute a task to begin using these parameters. Each thread in a CTA (or an Exec unit 302 in the SM 310) can access the global memory via a memory interface 214. Regions of the global memory can be in the L1 Cache memory 320.
[0047] The local register file 304 is used by each thread as a work area, each register is for the exclusive Reserved for use by a single thread, and data in each local register file 304 is only accessible by that thread accessible to the user for whom the register is reserved. The local register file 304 can be implemented as a register file, which is physically or logically divided into P lanes, each of which has a certain number of entries (each entry can store a 32-bit word, for example). Each of the N Exec units 302 and each of the P Load-Store Units LSU 303 are assigned a single lane, and corresponding entries in different lanes can be Data for different threads executing the same program are enriched to enable SIMD execution Different parts of the tracks can be assigned to different groups of the G simultaneous strand groups assigned so that a given entry in the local register file 304 can only be used by a specific thread In one embodiment, certain entries within the local register file 304 are available for storage of string identifiers, which implements one of the special registers. Furthermore, a uniform L1- Cache memory 375 uniform or constant values for each lane of the N Exec units 302 and the P Load-Store Units LSU 303.
[0048] The shared memory 306 can be accessed by threads within a single CTA; in other In other words, any memory location in the shared memory 306 can be accessed by any thread within the same CTA (or any processing unit within the SM 310). Shared memory 306 may be implemented as a shared register file or a shared on-chip Cache memory can be implemented with a connection that allows a processing unit to access any location in to read or write to the shared memory. In other embodiments, a shared used state space can be mapped to an area per CTA of an off-chip memory and can be used in the L1 Cache memory 320. The parameter memory can be defined as a special section within the the same shared register file or shared cache memory, which the shared memory 306, or the parameter memory may be used as a separate shared used register file or a chip-internal cache memory for which the LSUs 303 have read-only access In one embodiment, the area that implements the parameter storage is also used to store the CTA ID and the task ID as well as the CTA dimensions and the grid dimensions or the queue position to store, thereby realizing areas of the special registers. Each LSU 303 in the SM 310 is equipped with a unified address allocation unit 352, which provides an address used for load and store instructions executed in a unified memory area, is provided, into an address in each separate memory area. Consequently, one command can be used to access the local, the shared or access the global memory area by specifying an address in the unified memory area becomes.
[0049] The L1 cache 320 in each SM 310 can be used to store private local data per thread and also global data per application. In some embodiments, the shared Data per CTA is cached in the L1 cache memory 320. The LSUs 303 are connected to the common used memory 306 and the L1 cache 320 via a memory and cache link 380. Independent virtual address spaces
[0050] Embodiments of the present invention enable a parallel processing subsystem, such as a GPU to simultaneously execute thread programs with different independent virtual address spaces. Each virtual address space can be used simultaneously with one or more other virtual address spaces be present, which enables the GPU to execute the thread programs simultaneously. Each Thread program can work within a virtual address space that is assigned to a corresponding application process that allocates memory and virtual address references to the thread program By activating the parallel processing subsystem to simultaneously execute multiple Thread programs in different virtual address spaces can achieve greater GPU utilization and better Performance can be achieved for a wider range of applications.
[0051] Fig. 4A shows the parallel processing subsystem 112 of Fig. 1, which is designed to process several simultaneous 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 use a unified virtual Memory (UVM), each application process can contain 460 GPU computation tasks that are executed within a virtual address space that is uniform 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 parent operating system to manage the virtual address space associated with the application in to map a physical address space that is typically shared by the application processes 460 becomes.
[0052] A given application process 460 may request the execution of a GPU computation task by means of a Initiate execution request to driver 103, which responds by providing execution information for the GPU computation task is added to a GPU context 450, and by adding the GPU context 450 to a queue for work orders for the GPU. The GPU context 450 includes task metadata (TMD) 452, which Contains information for executing one or more thread programs that use one or more GPU Processing tasks that can be executed simultaneously in the GPU. One or more Thread programs can be linked to one or more different virtual address spaces, which are the same GPU context 450. A page table for a single virtual address space is for a single instance of the TMD 452. Each instance of the TMD 452 comprises execution information for a single associated thread program within a single GPU context 450.
[0053] A page table within a given TMD 452 may be derived from a corresponding application context page table Alternatively, a page table within a given TMD 452 can contain a corresponding Application context page table. In one embodiment, the application contexts 450 are located within of the system memory 104. A resource manager (RM) 454 in the driver 103 is configured to several thread programs, each assigned a set of TMD 452, into a single GPU context 450 for concurrent execution within a single GPU context. In one embodiment, a Authorized Representative 456 a user space process that is trained to forward requests to the RM 454. For example, certain execution requests and assignment requests can be made from the RM 454 via the Authorized representative 456.
[0054] As previously described in Fig. 2, the higher-level unit 206 is designed to retrieve data stored in a Memory, such as system memory 104. The data may include information related to one or more GPU contexts 450 that are queued for execution. The parent unit 206 selects sequentially selects a GPU context 450 per time unit for execution. The front area 212 reads the TMDs 452 within a GPU context 450 and configures the PPU 202 to execute one or more thread programs based on the GPU context 450. A front-end context switch (FECS) 407 configures the MMU 328, to provide a suitable mapping of virtual address to physical address. The execution of a given GPU context 450 must wait until all page tables belonging to the GPU context 450 are fetched from the FECS 407 are configured. In one implementation, the FECS 407 generates a ´´ready´´ signal to indicate that the Page table and the associated configuration steps are completed, which prompts the FE 212 to Completion of the page table configuration of the task / work unit 207. This information allows the Tasks / Work Unit 207 to begin scheduling tasks belonging to the page table.
[0055] Each page table within the TMD 452 is assigned an address space identifier (ASID) by the FECS 407 via a connection command issued by the MMU 328. Each thread program is linked to an ASID, which is attached to each virtual memory request generated by the thread program during execution For example, if a given GPU context 450 contains execution information for two different contains two thread programs and each is linked to a different virtual address space, then one of the two Thread programs with ASID = 0 and the other of the two thread programs with ASID = 1. In this Example, 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 thread program, a virtual address and a ASID of 0. Page table search requests or read requests from this thread program are sent to the page table for ASID = 0. Similarly, each virtual memory access request made by the second thread program, a virtual address and an ASID of 1. Page table search requests from this strand pro program are directed to the page table for ASID = 1.
[0056] The processing core 440 is designed to perform a certain group of predetermined tasks, such as copying of a memory block from one address range to another address range. The processing core 440 receives work from the FECS 407 and can work in conjunction with the SMs 310, but may require no general programming capability. In one embodiment, the higher-level unit 206 monitors the operation of the Processing core 440.
[0057] 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 link an ASID to a corresponding page table 420. In general, each memory request made by a thread program running within an SM 310 contains is generated, a virtual address and an ASID value to select a single page table 420 to create a mapping from the virtual address to a physical address. The ASID table 410 forms an ASID Value to a corresponding page table 420. The page table 420 then provides an assignment from a virtual Address into a physical address. The page tables 420 are shown within the MMU 328, but can also be any technically feasible memory subsystem, such as system memory 104 or PP memory 204 lay.
[0058] The TLBs 430 are configured to cache virtual address to physical address mappings, where each mapping is 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 hit occurs when the TLB 430 contains a cache entry that corresponds to both the ASID and the virtual address inputs for a memory access request. In case of a TLB hit, the TLB provides a corresponding physical Address for the memory access request. A TLB miss occurs when the TLB 430 does not have a cache entry that matches both the ASID and the virtual address inputs. The TLB 430 can contain any technically feasible technique to determine whether the ASID input and the virtual address input together constitute a TLB hit or a TLB miss. In one embodiment, a content-addressable Memory circuit configured to use a pair of an ASID and a virtual address as a search mark for determining of 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 Store a given ASID and virtual address pair with a previously stored mark in accordance , indicating a TLB hit. Such a technique is fully associative with respect to the Search mark. In other techniques, a different degree of associativity can be realized. In the case of a TLB miss the MMU 328 selects a single page table 420, identified by an ASID, which contains the memory access request, and performs a translation from virtual address to physical address using the marked page table 420 based on a memory access request for a virtual address. It Any technically feasible technique can be used to translate from virtual to physical address as soon as a single page table 420 is detected to obtain page table information for the translation process. If the page table 420 is unable to map the virtual address to the physical address, then the memory access request generates an error indicating that the Memory access request is not allowed.
[0059] A special ASID used by a thread program in an SM 310 can be configured with a special Page table 430 may be linked via a link command that is generated and sent from the FECS 407 to the MMU 328 The connect command can also be used to send data for the assignment of virtual to physical address located in TLB 430. In this way, ASID values for sequentially executed GPU contexts 450 are reused.
[0060] Fig. 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 field (PDBID) 416, that points to a page table located in memory for the ASID value specified in ASID field 414. In 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 can be in the PPU memory 204 or in the system memory 104 lie.
[0061] Fig. 4C shows a page table entry 422 according to an embodiment of the present invention. Page table entry (PTE) 422 contains a virtual address field 424 and a corresponding physical address field 426. A A given page table is associated with a special ASID, which is implicitly linked to a virtual address defined in the virtual address field 424.
[0062] 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 mark or read mark for finding the physical address field 438. A given TLB 430 may contain multiple TLB entries 432 that may be a mixture of ASID values within the ASID field 434. The TLB 430 is capable of mapping virtual Addresses to physical addresses for independent virtual address spaces by using the ASID Field 434 as part of the search mark in a virtual to physical address mapping process performed by the TLB entry 432 contains.
[0063] Fig. 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 may be performed in response to a miss within a TLB 430. ASID 510 and VA 520 contain a search request. ASID 510 is used to perform a search in the ASID table 410. In this example, the search or call is consistent with the ASID stored in the ASID table entry 412(1) that references the page table 420(1). In In this example, the call matches 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 based on the value of the PA field 426 in the PTE 422(e) Multiple page tables 420 may remain active at any time, and the TLBs 420 may have allocations of virtual to physical address from each of the multiple page tables 420 upon a TLB miss. Maintaining a different page table 420 per virtual address space, specified by the ASID, allows multiple virtual address spaces to exist side by side and access a common physical address space, as shown below in Figure 6. In one embodiment, the ASID specifies both a GPU context and a special page table identifier associated with the GPU context.
[0064] Fig. 6 shows two simultaneous virtual address spaces 610(0), 610(1) located in a single physical Address space 620 according to an embodiment of the present invention are present simultaneously. A VA space 610 (0) contains several virtual address pages, the corresponding physical address pages within the PA space 620 via a mapping function 630. Similarly, the VA space 610(1) contains several virtual Address pages that are mapped to corresponding physical address pages in the PA space 620.
[0065] As shown, the VA space 610(0) contains a VA page at 0x0..0000, which is associated with the PA page 0x0..0000, and a VA page at 0x0..0001, which is associated with the PA page 0x0..0001. The 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. Application context 405 may include memory reserved in virtual address space 610(0) and a other application context may contain memory reserved in the virtual address space 610(1). Maintaining different virtual address spaces identified by the ASID allows resources to be consistent manner from the application code executed in the CPU 102 by thread programs running in the Parallel processing subsystem 112 are executed, managed, and allocated. In a usage model, a special PA page is mapped to two or more VA rooms. In such a usage model, the PA page includes a shared memory page with two or more different virtual address representations in corresponding execution contexts.
[0066] Fig. 7 shows the initialization of the parallel processing subsystem 112 to process several thread programs with different virtual address spaces containing a single context, according to one embodiment of the present invention. The FE 212 reads the TMDs 452 from Fig. 4A, which contain a GPU context 450 that selected for execution by the parent unit 206. Each set at TMD 452 contains an ASID 714. In In one embodiment, the RM 454 assigns an ASID 714 to each different set of TMD 452. A Scheduling unit 710 determines that special TMD 452 should be scheduled for execution and sends a Execution request to a calculation work distribution unit (CWD) 720, which distributes the work for the TMD 452 between one or more SMs 310 to establish a grid of one or more CTAs that are controlled by the TMD 452 are specified. As previously explained in Fig. 3B, each CTA can contain one or more strand groups. Each Strand group of a CTA is associated with a common ASID 714. In one embodiment the scheduling unit 710 comprises the task management unit 300 from Fig. 3A and the CWD 720 comprises the Work distribution unit 340.
[0067] Different distribution strategies can be used for mapping a grid of CTAs to available SMs 310 A procedure referred to herein as ´´deep assignment´´ preferentially assigns CTAs that belong to belonging to the same grid to a minimum number of different SMs 310 in order to generally determine the cache affinity for to maximize both TLB caching and data caching. For example, if a single SM 310 is able to handle a complete grid, then the CWD 720 assigns all CTAs for the grid a single SM 310. In this example, the grid 760 further includes the CTAs 750 assigned to the SM 310(0) Similarly, the grid 762 includes the CTAs 752 assigned to the SM 310 1), and the grid 764 includes the CTAs 754 associated with the SM 310(n). The CTAs 750 most likely have a cache affinity for both the TLB calls and the data caching. Similarly, the CTAs 752 most likely has a similar cache affinity, which generally improves the overall performance is improved.
[0068] Deep allocation is suitable for scenarios where several different virtual address spaces are required be used to handle the simultaneous execution of different thread programs that are integrated into a common GPU context. Deep allocation generally maximizes GPU utilization by bundling several smaller Grids are allowed simultaneously. Deep allocation is used in embodiments of the present invention which allows multiple virtual address spaces required for the different grids to be the TLBs 430 and the MMU 328. A wide allocation distributes CTAs that are linked to a special grid, to available SMs 310. A wide allocation is suitable for scenarios where a single grid is designed to require a large number of CTAs that are located within the same virtual address space. A wide allocation generally maximizes the performance of a single task by generally maximizing the parallelism between threads associated with the task. Recognition that a deep assignment should be used is made possible by the ASID 714 attribute of the set of TMD 452. For example, if several different ASID values exist under multiple TMDs 452 within a single GPU context 450 that are scheduled for execution, then the deep allocation can be preference should be given to a broad allocation.
[0069] Fig. 8 is a flowchart of a method 800 for simultaneously executing two or more Thread programs that use different virtual address spaces in the parallel processing subsystem according to a embodiment of the present invention. Although the method 800 in connection with the systems of Fig. 1 , Fig. 2, Fig. 3A, Fig. 3B, Fig. 3C, Fig. 4A, Fig. 5, and Fig. 7, the person skilled in the art will recognize that any system designed to carry out the method steps in any order within the scope of the invention. In one embodiment, the method 800 is performed by a GPU, such as the PPU 202 from Fig. 2.
[0070] The method 800 begins in step 810, in which the PPU generates a set of TMD descriptions for tasks associated with a GPU context, such as GPU context 450 in Fig. 4A. Each set of TMDs contains Information for executing a task in the PPU. The information contains references to a thread program that executes the task, and contains a corresponding page table for translating virtual addresses used by the task generated into physical addresses. In step 820, a scheduling unit in the PPU schedules each task for Execution in an available SM, such as an SM 310 from Fig. 3B. In step 830, a front area Context switching unit in the PPU each different page table and corresponding ASID within the GPU context with an SM and a TLB. The connection has the effect of creating a page table and an ASID for the page table be linked to a thread program that is designed to use the virtual address space provided by the ASID is specified and is assigned by the page table. The connection can also have the effect of TLB is invalidated when preparing for the execution of the GPU context, which creates a new context that is not related to the previously cached mappings residing in the TLB.
[0071] In step 840, the PPU executes each scheduled task in a corresponding SM. During execution Each task can make 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 cause a TLB miss. A first TLB Miss occurs as a consequence of a first SM making a first memory access request for a first virtual address is generated for the first time. A second TLB miss will occur as a consequence of a second SM generating a second memory access request to a second virtual address is generated for the first time. Each A memory access request contains a virtual address and an ASID. Both the virtual address and the ASID must match a TLB entry tag located in a target TLB for the TLB to generate a hit. TLB hit indicates that the virtual address and ASID containing a memory access request is a cached mapping in a target TLB. A TLB miss indicates that the TLB currently has no cached mapping for a requested virtual address and ASID. In step 850, an MMU in the PPU, such as the MMU 328 in Fig. 3B, makes a first call to or a search in the page table in response to the first TLB miss from the first SM. This first page table call generates a first allocation from the Combination of a first virtual address and a first ASID to a corresponding physical address. The first The allocation is cached in the first target TLB. In step 852, the MMU makes a second call to the page table in response to the second TLB miss. The second memory access request includes a second ASID, which requires the MMU to perform 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 The first target TLB and the second target TLB comprise the same TLB unit, such as a TLB 430. In one embodiment Each page table call involves traversing the page table to find a suitable allocation for each virtual address within the corresponding virtual address space. It can be any technically feasible Search technology for the page table can be realized without deviating from the scope of protection and the basic idea of present invention. The method ends in step 890.
[0072] Fig. 9 is a flowchart of method steps for performing a virtual to physical address in one of several different virtual address spaces according to one embodiment of the present invention. Although the method 900 in connection with the systems of Fig. 1, Fig. 2, Fig. 3A, Fig. 3B , Fig. 3C, Fig. 4A, Fig. 5 and Fig. 7, the person skilled in the art will recognize that any System designed to carry out the process steps in any order within the protected area of the invention. In one embodiment, the method 900 is performed by a PPU, such as the PPU 202 of Fig. 2 , executed.
[0073] The method 900 begins in step 910, in which an MMU in the PPU sends a request to allocate a virtual address to a physical address, where the request includes a virtual address and an ASID to specify which of the several different virtual address spaces to use to run the mapping should be used. If in step 920 the mapping request does not contain a TLB hit, then the method continues to step 930. In step 930, the MMU assigns the ASID to a page table reference using a ASID table, such as using ASID table 410. In step 940, the MMU assigns 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 target TLB for Buffering and later use. In step 960, the MMU associates a physical address with the Allocation request to allow continuation of a linked memory access request. The The process ends in step 990.
[0074] Returning to step 920, if the allocation request has a TLB hit, then the method continue to step 960.
[0075] Fig. 10 is a flowchart of method steps for performing deep scheduling for tasks within a context of a graphics processing unit according to an embodiment of the present invention. Although the method 1000 in connection with the systems of Fig. 1, Fig. 2, Fig. 3A, Fig. 3B, Fig. 3C, Fig. 4A, Fig. 5 and Fig. 7, the person skilled in the art will recognize that any system used for Carrying out the method steps in any order is within the scope of the invention. In one embodiment, method 1000 is performed by a PPU, such as PPU 202 of Figure 2 .
[0076] The method 1000 begins in step 1010, wherein a computational work distribution unit (CWD) in the PPU receives a GPU context, such as GPU context 450, which includes multiple tasks that are running simultaneously in the PPU In step 1020, the CWD selects a task from the multiple tasks that form the GPU context, In step 1030, the CWD selects one or more SMs from a plurality of SMs based on Execution requirements for the selected task, and for the simultaneous allocation of resources in the multitude of SMs are available. In this step, the CWD tries to determine the number different SMs within which the selected task is scheduled for execution. It can be a any technically feasible technique can be implemented to allocate task requirements to available resources, to fulfill the task requirements. In step 1040, the CWD schedules the selected task for the Execution in the one or more SMs selected from the group of multiple SMs. If in step 1050 the selected task is not the last task that is in the GPU context, then the procedure continues to step 1020. Otherwise, the method ends in step 1060.
[0077] In one embodiment, the CWD is configured to store an entire GPU context according to deep Disposition or further disposition based on explicit commands. The explicit commands can transported programmatically or via one or more environment variables. In other Embodiments, the CWD may individually execute each task in a GPU context according to a technique for deep Dispatch or further dispatch according to the explicit commands. Alternatively, the CWD derive which scheduling technology is to be implemented for which task, whereby this is done on the basis of different ASID values associated with this task.
[0078] Although the above explanation refers to the management of different tasks for execution in a common GPU context, there are also parallel co-processors that are designed to process multiple simultaneous To execute contexts with different virtual address spaces, within the protection area and the Basic idea of embodiments of the present invention.
[0079] In certain embodiments, data caches are marked with respect to physical addresses. In In alternative embodiments, data caches are marked with respect to virtual addresses and require ASID as part of each marker. Both masking schemes can be combined in a single GPU.
[0080] In summary, a technique is disclosed for simultaneously performing different tasks with different virtual address spaces in the same GPU. The task is to be executed with a virtual Address space is linked via an address space identifier (ASID). A virtual memory request made by a currently executed task contains the ASID, which is used to create a corresponding page table The selected page table is then used to determine the virtual address that a virtual memory request to a physical address. The page tables are created from corresponding Page tables maintained by an operating system for user application processes that use the Call tasks. A translation sidebar buffer (TLB) stores the requests for virtual memory allocations for future use. A TLB entry contains a tag that contains the ASID and the virtual address, and contains a data field with the corresponding physical address. In one embodiment, the tasks are stored in a common context for execution. The tasks can be scheduled according to a deep scheduling scheme which allows the tasks to be allocated to a common virtual address space in a minimal number of different SMs.
[0081] An 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 can be improved.
[0082] Another advantage of embodiments of the present invention is that GPU tasks with Address space separation can be performed, which improves reliability and reduces development effort, associated with troubleshooting.
[0083] Although the foregoing is directed to embodiments of the present invention, other and Further embodiments of the invention may be devised without departing from its basic scope. For example, aspects of the present invention may be embodied in hardware or software or in a combination of Hardware and software. An 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 may be implemented in a variety of computer-readable storage media. Illustrative computer-readable storage media include, without limitation, to be restrictive: (i) non-writable storage media (for example, read-only memory devices in a Computers, such as CD-ROM disks readable by a CD-ROM drive, flash memory, ROM chips or other types of non-volatile electronic semiconductor memories) 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 another type of electronic semiconductor memory Random access storage devices (RAMs) on which alterable information is stored. Such computer-readable storage media, if they contain computer-readable instructions instructing the functions of the present invention, Embodiments of the present invention.
[0084] Therefore, the scope of the present invention is defined by the following claims.
Claims
1. A method performed by a parallel processing subunit for allocating a virtual address associated with a first virtual address space contained in a group of different virtual address spaces, linked to a physical address, with simultaneous execution of thread programs that have different virtual address spaces, the procedure includes: Receiving a virtual memory access request from a first thread program that includes the virtual address and an address space identifier, ASID, (510) associated with the first virtual address space; Determining that for the virtual memory access request in a first translation sideshow buffer, TLB, ( 430) of multiple translation sideshow buffers no entry with the requested virtual address and the address space identifier, ASID, is cached, resulting in a TLB miss; in response to the TLB miss, mapping the request address to a physical address with mapping the Address space identifier, ASID, (510) to a page table reference based on the ASID and assigning the virtual Address to the physical address using the page table reference; and Linking the physical address to the request address.
2. The method of claim 1, wherein assigning the ASID (510) to a page table reference comprises: performing a Table search in an ASID table (410), wherein the ASID comprises an index into the ASID table (410), and wherein an indexed entry in the ASID table contains a memory reference to a corresponding page table.
3. The method of claim 1, wherein assigning the first virtual address to the physical address comprises: Traverse a page table associated with the page table reference.
4. The method of claim 1, wherein the page table reference comprises a pointer to the physical address.
5. The method of claim 1, wherein determining that the request address is not cached comprises: Performing an associative search in the TLB (430).
6. The method of claim 5, wherein the TLB (430) is configured to store multiple entries, each entry has a trademark and a corresponding physical address and where the associative search includes: Compare the request address with each brand within the multiple entries.
7. The method of claim 1, wherein the ASID (510) is associated with a first execution context, and a another ASID is associated with a second execution context, and wherein the TLB (430) is configured to provide virtual address to-physical address mappings for the first execution context and the second execution context to cache.
8. A parallel processing subunit configured to provide a virtual address associated with a first virtual address space that is contained in a group of different virtual address spaces, a physical address when simultaneously executing thread programs that use the different have virtual address spaces by performing the steps: Receiving a virtual memory access request from a first thread program that includes the virtual address and an address space identifier, ASID, (510) associated with the first virtual address; Determining that for the virtual memory access request in a first translation sideshow buffer, TLB, (430) of multiple translation sideshow buffers no entry with the requested virtual address and the Address space identifier, ASID, (510) is cached, resulting in a TLB miss; in response to the TLB miss, mapping the request address to a physical address with mapping the Address space identifier, ASID, (510) to a page table reference based on the ASID and assigning the virtual Address to the physical address using the page table reference; and Linking the physical address to the request address.
Citation Information
Patent Citations
Virtualization system for computers that use address space indentifiers
US7409487B1
