Resource management

By using cache to manage the allocation and reuse of shared registers in the GPU, the problem of limited shared register resources is solved, the performance and resource utilization of the GPU are improved, and redundant work and resource waste are reduced.

CN118733486APending Publication Date: 2024-10-01IMAGINATION TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410357762.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-03-29
Filing Date
2024-03-27
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

The limited resources of shared registers in GPUs lead to performance bottlenecks, and existing technologies are difficult to efficiently manage the allocation and release of shared registers, resulting in redundant work and resource waste.

Method used

Use cache to manage the allocation of shared registers, record and reuse shared registers by searching for matching cache entries, reduce the number of auxiliary program runs and data loads, and delay the release of shared registers when the referencing task terminates to improve resource utilization .

Benefits of technology

It effectively reduces the number of runs of auxiliary programs and the release frequency of shared registers, improves GPU performance and resource utilization, and avoids redundant work and resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733486A_ABST
    Figure CN118733486A_ABST
Patent Text Reader

Abstract

The invention relates to resource management. A method of managing shared register allocation in a GPU is described. The method includes, in response to receiving an allocation task, searching a shared register allocation cache for a cache entry having a cache index identifying an auxiliary program associated with the allocation task. In response to identifying a cache entry having a cache index identifying the secondary program associated with the allocation task, the method returns an identifier of the cache entry and status information indicating a cache hit. The identifier of the cache entry is returned such that the identifier of the cache entry is associated with the allocation task, and the state information indicating a cache hit is returned such that the allocation task is not published.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to UK patent application 2304585.9 filed on March 29, 2023, which is incorporated herein by reference in its entirety. Technical Field

[0003] The present invention relates to the management of resources in a graphics processing unit (GPU), and in particular to the management of shared registers. Background Art

[0004] There is a finite pool of resources, such as registers, within the GPU, and increasing the available resources in the GPU (e.g., by adding more registers) results in an increase in the size of the GPU. Various techniques are used to optimize the use of registers, including designating some registers as shared registers and other registers as local registers. Shared registers can then be used to store values ​​accessible to several tasks, while local registers can only be accessed by the tasks to which they have been assigned.

[0005] The embodiments described below are provided by way of example only, and are not limiting of implementations that address any or all disadvantages of known methods of managing shared register allocation. Summary of the invention

[0006] This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.

[0007] A method for managing shared register allocation in a GPU is described. The method includes: in response to receiving an allocation task, searching a shared register allocation cache for a cache entry having a cache index that identifies an auxiliary program associated with the allocation task. In response to identifying a cache entry having a cache index that identifies an auxiliary program associated with the allocation task, the method returns an identifier of the cache entry and status information indicating a cache hit. Returning the identifier of the cache entry causes the identifier of the cache entry to be associated with the allocation task, and returning the status information indicating a cache hit causes the allocation task to not be issued.

[0008] A first aspect provides a method for managing shared register allocation in a GPU, the method comprising: performing the following operations in response to receiving an allocation task, wherein the allocation task is associated with an auxiliary program: searching a shared register allocation cache for a cache entry having a cache index that identifies the auxiliary program associated with the allocation task; and returning an identifier of the cache entry and status information indicating a cache hit in response to identifying a cache entry having a cache index that identifies the auxiliary program associated with the allocation task, wherein returning the identifier of the cache entry causes the identifier of the cache entry to be associated with the allocation task, and returning the status information indicating a cache hit causes the allocation task to not be issued.

[0009] Searching the shared register allocation cache for a cache entry having a cache index identifying an auxiliary program associated with the allocation task may include searching the shared register allocation cache for a cache entry having a cache index with a matching data address for the auxiliary program.

[0010] The allocation task may be associated with both an auxiliary program and a main unit identifier, and wherein searching the shared register allocation cache for a cache entry having a cache index identifying the auxiliary program associated with the allocation task comprises searching the shared register allocation cache for a cache entry having a cache index with both a matching data address for the auxiliary program and a matching main unit identifier.

[0011] The method may also include: in response to determining that no cache entry has a cache index that identifies the auxiliary program associated with the allocation task, allocating a shared register to the allocation task and assigning a cache entry to record the allocation; and returning an identifier of the cache entry recording the allocation and status information indicating a cache miss, wherein returning the identifier of the cache entry causes the identifier of the cache entry to be associated with the allocation task, and returning the status information indicating a cache miss causes the allocation task to be released.

[0012] Allocating a shared register to an allocation task and updating a cache entry to record the allocation may include: searching for an available shared register for allocation to the allocation task; in response to identifying an available shared register, allocating the shared register and assigning a cache entry to record the allocation; and in response to not identifying an available shared register for allocation to the allocation task, identifying an eligible cache entry for eviction in a shared register allocation cache, evicting the eligible cache entry and releasing the shared register identified in the eligible cache entry, and then repeating the search for an available shared register for allocation to the allocation task.

[0013] The method may also include: in response to determining that no cache entry has a cache index that identifies the auxiliary program associated with the allocation task, incrementing a counter for an identifier of the cache entry that records the allocation; in response to receiving a reference task, performing the following operations, wherein the reference task is associated with the allocation task: incrementing a counter for the identifier of the cache entry associated with the allocation task; in response to termination of the allocation task, decrementing a counter for the identifier of the cache entry associated with the allocation task; and in response to termination of the reference task, performing the following operations, wherein the reference task is associated with the allocation task: decrementing a counter for the identifier of the cache entry associated with the allocation task, wherein a cache entry in the shared register allocation cache is eligible for eviction only when the counter for the identifier of the cache entry is zero.

[0014] The method may also include: locking a cache entry having the returned identifier; and in response to receiving a referencing task, wherein the referencing task is associated with the allocating task, unlocking a cache entry having the identifier associated with the allocating task, wherein a cache entry in the shared register allocation cache is eligible for eviction only if the cache entry is not locked.

[0015] In response to the allocation task terminating, the shared resource identified in the cache entry having the identifier associated with the allocation task may remain valid.

[0016] Each cache entry in the shared register allocation cache may have an identifier and include: a valid bit indicating whether the cache entry is valid and a cache index (allocated base address, wherein the valid bit indicates whether the cache entry is valid, and the cache index includes a data address for the auxiliary program.

[0017] Each cache entry may also include a primary unit identifier.

[0018] Each cache entry may also include an allocation base address, where the allocation base address specifies a base memory address of a shared register allocation recorded by the cache entry.

[0019] A second aspect provides a method of operating a GPU, the method comprising: receiving an allocation task; determining an eviction mode associated with the allocation task; in response to determining that the eviction mode associated with the allocation task is a first eviction mode, managing shared register allocation according to the method of the first aspect; and in response to determining that the eviction mode associated with the allocation task is a second eviction mode: setting a shutdown bit in an entry in a shared register allocation cache for any previous allocation for a main unit associated with the allocation task; in response to determining that a counter for an identifier for an entry in the shared register allocation cache is zero for any previous allocation for a main unit associated with the allocation task, evicting eligible cache entries and releasing shared registers identified in eligible cache entries; searching for a shared register to allocate to the main unit; an available shared register allocated by an allocation task; in response to not identifying an available shared register for allocation to the allocation task, identifying eligible cache entries for eviction in a shared register allocation cache, evicting the eligible cache entries and releasing the shared registers identified in the eligible cache entries, and then repeatedly searching for available shared registers for allocation to the allocation task; in response to identifying an available shared register, allocating the shared register and assigning a cache entry to record the allocation; and returning an identifier of the cache entry recording the allocation and status information indicating a cache miss, wherein returning the identifier of the cache entry causes the identifier of the cache entry to be associated with the allocation task, and returning the status information indicating a cache miss causes the allocation task to be issued.

[0020] A third aspect provides a shared register allocation cache for a GPU, the shared register allocation cache comprising a shared register resource manager and a plurality of cache entries, wherein in response to receiving an allocation task, the shared register resource manager is arranged to: search for a cache entry having a cache index that identifies an auxiliary program associated with the allocation task; and in response to identifying a cache entry having a cache index that identifies an auxiliary program associated with the allocation task, return an identifier of the cache entry and status information indicating a cache hit, wherein returning the identifier of the cache entry causes the identifier of the cache entry to be associated with the allocation task, and returning the status information indicating a cache hit causes the allocation task to not be released.

[0021] Searching the shared register allocation cache for a cache entry having a cache index identifying an auxiliary program associated with the allocation task may include searching the shared register allocation cache for a cache entry having a cache index with a matching data address for the auxiliary program.

[0022] Searching the shared register allocation cache for a cache entry having a cache index identifying an auxiliary program associated with the allocation task may include searching the shared register allocation cache for a cache entry having a cache index with both a matching data address for the auxiliary program and a matching main unit identifier.

[0023] The shared register resource manager may be arranged to: in response to determining that no cache entry has a cache index identifying an auxiliary program associated with an allocated task, allocate a shared register to the allocated task and assign a cache entry to record the allocation; and return an identifier of the cache entry recording the allocation and status information indicating a cache miss, wherein returning the identifier of the cache entry causes the identifier of the cache entry to be associated with the allocated task, and returning the status information indicating a cache miss causes the allocated task to be issued.

[0024] The shared register allocation cache may further include eviction logic, wherein allocating a shared register to an allocation task and updating a cache entry to record the allocation includes: searching for an available shared register for allocation to the allocation task; and in response to identifying an available shared register, allocating the shared register and assigning a cache entry to record the allocation; and in response to the shared register resource manager not identifying an available shared register for allocation to the allocation task, performing the following operations: triggering the eviction logic to identify eligible cache entries for eviction in the shared register allocation cache, and evicting the eligible cache entries and releasing the shared registers identified in the eligible cache entries; and thereafter, repeating the search for available shared registers for allocation to the allocation task.

[0025] The shared register allocation cache may also include counter logic, and wherein the counter logic is arranged to: in response to the shared register resource manager determining that no cache entry has a cache index identifying an auxiliary program associated with an allocation task, increment a counter for an identifier of the cache entry recording the allocation; in response to the shared register resource manager receiving a reference task, wherein the reference task is associated with the allocation task: increment a counter for an identifier of the cache entry associated with the allocation task; in response to termination of the allocation task, decrement a counter for an identifier of the cache entry associated with the allocation task; and in response to termination of the reference task, wherein the reference task is associated with the allocation task: decrement a counter for an identifier of the cache entry associated with the allocation task, wherein a cache entry in the shared register allocation cache is eligible for eviction only when the counter for the identifier of the cache entry is zero.

[0026] The shared register resource manager may be further arranged to: lock a cache entry having the returned identifier; and in response to receiving a referencing task, wherein the referencing task is associated with an allocating task, unlock a cache entry having the identifier associated with the allocating task, wherein a cache entry in the shared register allocation cache is eligible for eviction only if the cache entry is not locked.

[0027] In response to the allocation task terminating, the shared resource identified in the cache entry having the identifier associated with the allocation task may remain valid.

[0028] Each cache entry in the shared register allocation cache may have an identifier and include: a valid bit indicating whether the cache entry is valid and a cache index including a data address for the auxiliary program and an allocation base address.

[0029] Each cache entry may also include a primary unit identifier.

[0030] Each cache entry may also include an allocation base address, where the allocation base address specifies a base memory address of a shared register allocation recorded by the cache entry.

[0031] A fourth aspect provides a GPU, the GPU comprising a shared register allocation cache according to the third aspect or configured to execute the method of the first aspect.

[0032] The GPU may be embodied in hardware on an integrated circuit. A method of manufacturing a GPU at an integrated circuit manufacturing system may be provided. An integrated circuit definition data set may be provided that, when processed in the integrated circuit manufacturing system, configures the system to manufacture the GPU. A non-transitory computer-readable storage medium may be provided that has a computer-readable description of the GPU stored thereon that, when processed in the integrated circuit manufacturing system, causes the integrated circuit manufacturing system to manufacture an integrated circuit embodying the GPU.

[0033] An integrated circuit manufacturing system may be provided, the integrated circuit manufacturing system comprising: a non-transitory computer-readable storage medium having stored thereon a computer-readable description of a GPU; a layout processing system configured to process the computer-readable description so as to generate a circuit layout description of an integrated circuit embodying the GPU; and an integrated circuit generation system configured to manufacture the GPU based on the circuit layout description.

[0034] Computer program code for executing any of the methods described herein may be provided.A non-transitory computer readable storage medium may be provided on which computer readable instructions are stored, which when executed in a computer system cause the computer system to execute any of the methods described herein.

[0035] As will be apparent to the skilled person, the above features may be combined as appropriate and may be combined with any aspect of the examples described herein. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Examples will now be described in detail with reference to the accompanying drawings, in which:

[0037] Figure 1 A flow chart showing a first example method of managing shared register allocation in a GPU;

[0038] Figure 2 Shown in more detail Figure 1 , Figure 3 or Figure 6 A flowchart of an implementation of one of the operations in the method;

[0039] Figure 3 A flow chart showing a second example method of managing shared register allocation in a GPU;

[0040] Figure 4 Shows that Figure 3 or Figure 8 A flowchart of a first method of updating a counter used together with the method;

[0041] Figure 5 Shows that Figure 3 , Figure 6 or Figure 8 A flowchart of a second method for updating a counter used in conjunction with the method;

[0042] Figure 6 A flowchart illustrating a third example method of managing shared register allocation in a GPU;

[0043] Figure 7 Shows that Figure 6 or Figure 8 a flowchart of a third method for updating a counter used in conjunction with the method;

[0044] Figure 8 A flowchart illustrating a fourth example method of managing shared register allocation in a GPU;

[0045] Fig. 9 Shows the implementation Figures 1 to 8 A schematic diagram of a GPU for use with any of the methods of FIG.

[0046] Fig.10 is a schematic diagram illustrating the contents of an example cache entry;

[0047] Fig.11 A computer system is shown in which a GPU is implemented; and

[0048] Fig.12 An integrated circuit manufacturing system for producing an integrated circuit embodying a GPU is shown.

[0049] The accompanying drawings illustrate various examples. It will be appreciated by the skilled person that the element boundaries (e.g., boxes, groups of boxes, or other shapes) shown in the accompanying drawings represent an example of boundaries. In some examples, it may be the case that an element can be designed as multiple elements, or multiple elements can be designed as one element. Where appropriate, common reference numerals are used throughout the accompanying drawings to indicate similar features. DETAILED DESCRIPTION

[0050] The following description is presented by way of example to enable one skilled in the art to make and use the invention.The present invention is not limited to the embodiments described herein, and various modifications to the disclosed embodiments will be apparent to those skilled in the art.

[0051] Embodiments are now described by way of example only.

[0052] Auxiliary programs (which may also be called constant calculation programs or shared programs) can be used to implement constant (or uniform) expressions within the GPU, and the results can be stored in shared registers within the GPU. This means that the results can be used by several tasks instead of being recalculated for each task, and this reduces the processing load on the GPU. However, the shared register pool is limited, and this may affect the performance of the GPU.

[0053] Shared registers can be allocated before an auxiliary program is issued, and the results are then written to the allocated shared registers when the auxiliary program is run. Once the last task that references a particular allocation is issued, the allocation is marked as closed, and then the shared register is released when the last task that references the particular allocation is completed. This invalidates any data stored in the shared register and enables the shared register to be subsequently reallocated (e.g., to a different auxiliary program). Under this process, the closing of an allocation and the subsequent release of the allocation are independent events caused by different triggering events (where both triggering events are associated with the same task (i.e., the last task that referenced the particular allocation of the shared register)).

[0054] For tile-based GPU architectures, an auxiliary program can be called for each tile touched by a draw call, even if the same auxiliary program generates the same output for each tile. This creates redundant work (due to repeatedly running auxiliary programs), but simplifies resource tracking (such as tracking of shared register allocations). The limited shared register pool also limits the number of tiles that can be running in the pipeline at any time, because there is a separate shared register allocation for each tile, and therefore the number of running tiles needs to be tracked (for example, by the driver). For programs that require a large number of shared registers (such as shaders), the number of running tiles needs to be reduced (for example, by the driver), or a limit needs to be imposed on the number of shared registers that can be statically loaded, falling back to dynamically loading registers in the main program (such as the main shader). Both situations are undesirable because they may degrade performance.

[0055] In the case of ray tracing, helper routines can be called whenever the state changes. This can again mean that the same helper routine is run several times when the ray task is resumed without knowing which objects in the scene the ray will hit.

[0056] An improved method for managing shared register allocation in a GPU is described herein, the improved method using a cache to manage the allocation of shared registers. This cache may be referred to as a shared register allocation cache. The shared register allocation cache does not replace shared registers or store data generated by auxiliary programs that would otherwise be stored in shared registers, but rather the cache stores a record of how shared registers are allocated. The method described herein provides performance improvements due to a reduction in the number of times auxiliary programs are run and the number of times the same value is loaded into a shared register.

[0057] As described below, in a first operating mode, once all tasks referencing the allocation are completed, the shared register allocation is not released immediately (e.g., when the fragment shader of the draw call is completed for the tile or when the ray shader of the accelerated structure search iteration is completed, the shared register allocation is not released), but remains valid (which may also be referred to as remaining pending). An identifier (ID) (which may be referred to as a shared ID and is stored in a shared register allocation cache) enables data stored in previously allocated shared registers to be reused by, for example, different tiles or when resuming ray tasks. In some examples, there may also be a second operating mode in which the shared register allocation is released immediately, and the method may switch between operating modes based on the identity of a hardware unit (which may be referred to as a master unit) that feeds specific data (e.g., data related to each instance shader call that is different for each shader type) to a specific GPU pipeline. There may be different types of master units within a GPU, for example, a GPU may include one or more of the following: a vertex master unit, a domain master unit, a compute master unit, a 2D master unit, a pixel master unit (which may also be referred to as a fragment master unit or a 3D master unit), and a ray master unit.

[0058] Tasks are described herein as allocation tasks or reference tasks. An allocation task is a task that updates a state and may also be referred to as a state update task. An allocation task triggers a new allocation of a shared register for the allocation task, followed by running an auxiliary program that generates data that is written to the newly allocated shared register. A reference task is a task that uses data stored in the allocated shared register. Coefficient tasks and work tasks are examples of reference tasks, and there may be one or more reference tasks associated with each allocation task (i.e., there may be one or more reference tasks that use data stored in the shared register that is allocated and filled due to the allocation task). It will be appreciated that in addition to allocation and reference tasks, there may be other types of tasks, such as housekeeping tasks.

[0059] You can refer to Figure 1 A first example method for managing shared register allocation in a GPU is described below. Figure 1 As shown in FIG, in response to receiving an allocation task (block 102), the shared register allocation cache is searched to determine if a matching entry exists (block 104). To determine if a matching entry exists, the cache is searched for a cache entry having a cache index or tag that uniquely identifies the auxiliary program triggered by executing the allocation task. A matching entry results in a cache hit, and if there is no matching entry, this is a cache miss.

[0060] A cache index or tag that uniquely identifies an auxiliary program triggered by executing an allocation task may include a combination of a data address for the auxiliary program triggered by executing an allocation task and an identifier (ID) for the primary unit that created the allocation task. The data address is a memory address that stores data executed by the auxiliary program and is different from a code address for the auxiliary program, which is a memory address that stores the auxiliary program. The data address for the auxiliary program can be specified within the allocation task or associated state information. These memory addresses can be virtual addresses. In the case where a combination of a data address and a primary unit is used as a cache index or tag, searching the allocation cache to determine whether a matching entry exists (in box 104) includes: searching the allocation cache to find a cache entry with both a matching data address for the auxiliary program triggered by executing the allocation task and a matching primary unit ID.

[0061] In the case of a cache miss ('miss' in block 106), a shared register is allocated to the allocating task, and the allocation is recorded in an available cache entry (block 108). This cache entry has an identifier, which may be referred to as an entry ID or a shared ID. The entry ID is returned along with state data (which may be referred to as a hit / miss state) that identifies that a cache miss occurred (block 110). In the case of a cache hit ('hit' in block 106), no shared register is allocated and the cache entry is not updated (i.e., block 108 is omitted), and the entry ID of the matching entry is returned along with state data that identifies that a cache hit occurred (block 110).

[0062] like Figure 1As shown in , whether there is a cache miss or a cache hit, the entry ID is returned together with the hit / miss status (box 110). This causes the entry ID to be associated with the identifier (called task ID) of the assigned task (box 112). In addition, if the hit / miss status indicates a cache miss, this causes the assigned task to be issued (box 114), and thus the auxiliary program is run (box 116) and the shared register is filled with the data generated by the auxiliary program (box 118). Although the issuance of the task (in box 114) and the operation of the task (in box 116) are presented as separate steps herein, in some architectures, the assignment task and the operation of the auxiliary program can be part of the same operation (i.e., the assignment task can be equivalent to the operation of the auxiliary program). When the auxiliary program is run (in box 116), the entry ID associated with the task ID for the assigned task is used to query the shared register allocation cache and identify the shared register allocation for the task, so that the data generated by the auxiliary program is stored in the correct shared register (in box 118). However, if the hit / miss status indicates a cache hit, this causes the allocation task not to be issued (block 120 ), and therefore the auxiliary program is not run (ie, blocks 116 to 118 are omitted).

[0063] Subsequently, when a reference task is received, the entry ID associated with the task ID for the corresponding allocation task is used to query the shared register allocation cache and identify the shared register allocation for that task so that the stored data (generated by the auxiliary program) can be accessed and used.

[0064] Without using the methods described herein, when the last task referencing a particular shared register allocation terminates, the shared registers in that allocation (which have been marked as closed) are released (as described above). Figure 1 In the context of the method, this would correspond to referencing the last task of an allocation with a particular entry ID, since multiple allocations can be associated with the same entry ID. However, when using Figure 1 In the method of , this release of the shared register is not triggered by the termination of the last referencing task. In fact, when the last referencing task terminates, the shared register remains allocated and is not released. In fact, an eviction strategy can be used that determines when to allocate a shared register. According to an example eviction strategy, in response to determining that (i) there are not enough available shared registers to perform the allocation (e.g., in block 108) and (ii) all referencing tasks that reference a particular shared register have terminated, the shared register is released. Examples of eviction strategies will be described in more detail below.

[0065] By using Figure 1In this way, the number of times the auxiliary program is run is reduced. If the data generated by the auxiliary program is already stored in the shared registers (as determined by searching the shared register allocation cache rather than searching the stored registers themselves), the auxiliary program is not run. Since the shared registers are not released when the last task that references them terminates, this means that subsequent allocation tasks with matching data addresses for the auxiliary program and matching main unit identifier (ID) will be assigned the same entry ID and the auxiliary program will not be run. As described above, the shared register allocation cache is searched rather than the stored registers themselves. The stored registers are not easy to search because the data in each shared register allocation may include a very large number of values ​​(e.g., hundreds of values) and the data is stored in a place far away from where the check (in box 104) is performed (e.g., Fig. 9 and described below).

[0066] The above Figure 1 The description assumes that in the case of a cache miss, there are sufficient shared registers that are not currently allocated and are therefore available for allocation to the received allocation task (in block 108). In various examples, the allocation of shared registers and the updating of cache entries (in block 108) may be as follows: Figure 2 This can be done as shown in .

[0067] like Figure 2As shown in, in response to a cache miss (block 202), a search is performed to identify available shared registers (block 204). This search (in block 204) is performed on the entire shared register space. It is then determined whether sufficient available shared registers have been identified (block 206). If there are not sufficient available shared registers ('no' in block 206), a search is performed to identify eligible cache entries for eviction (block 208). When performing this search, a predefined eviction policy is used to define whether a cache entry is eligible for eviction. As described above, according to the example eviction policy, if all referencing tasks that reference the shared registers allocated by the cache entry have terminated, the cache entry can be considered eligible for eviction. If no eligible entry is found ('no' in block 210), the process of allocating the task (as received in block 102) is stopped (block 212), and alternatively, the request is considered when another allocation request is received. If an eligible entry is found ('yes' in block 210), the entry is evicted and the associated shared registers (i.e., those shared registers allocated by the entry) are freed (block 214). The method then repeats the search to identify available shared registers (in block 204). Multiple iterations of evicting cache entries (in block 214) may be performed until the test for available shared registers passes (in block 206). The allocation task is stopped (in block 212) only when it is not possible to free up sufficient shared registers.

[0068] If there are sufficient shared registers available ('yes' in block 206) either initially or after evicting one or more entries (in block 214), then shared registers are allocated to the allocating task (block 216) and a cache entry is assigned to record the allocation (block 218).

[0069] When using the eviction strategy described above, an allocation task associated with one master may evict cache entries associated with the same master or a different master because the master is not a criterion specified in the eviction strategy. In a variation on the eviction strategy described above, each cache entry includes an indication of the master associated with it (i.e., the master of the allocation task that triggered the assignment of the cache entry), and when eligible cache entries for eviction are identified (in box 208), cache entries associated with the same master as the current allocation task are prioritized over cache entries associated with different masters. In such examples, more than one search (in box 208) may be performed in parallel, such as a first search for eligible entries for the master associated with the current allocation task and a second search for eligible entries for any master, and the results of one of the searches may then be identified for eviction based on other criteria defined in the eviction strategy.

[0070] Other criteria may also be specified as part of the eviction policy, such as a least recently used criterion (LRU) or an age-based criterion (e.g., oldest first). In some examples, the eviction policy may specify a combination of master units and other criteria in the form of a priority order for eviction, such as such that for an allocation task associated with a first master unit (e.g., a fragment master unit), the LRU / oldest cache entries for the same master unit are evicted in preference to entries associated with a second master unit (e.g., a ray master unit), even if the second master unit has entries with older LRU counts or ages.

[0071] Where the eviction policy allows an allocation task associated with one master to evict cache entries associated with a different master, this prevents one master from permanently consuming a majority of the shared register allocation and blocking other masters. In various examples, the eviction policy may allow this for any master configured in temporary eviction mode (as described below).

[0072] You can refer to Figures 3 to 5 A second example method for managing shared register allocation in a GPU is described below. Figure 1 A variation of the method shown in and described above. Figure 3 As shown in FIG, in response to receiving an allocation task (block 102), in addition to a cache miss ('miss' in block 106) and allocating a shared register and recording the allocation in an available cache entry (block 108, e.g., also as shown in FIG. Figure 2 In addition to incrementing the counter (block 309) in the case shown in FIG. 1 , the method can be performed with Figure 1 The counter that is incremented (in block 309) is the counter associated with the entry ID of the entry that was updated to record the allocation (in block 108). This counter is then used as part of the eviction strategy (e.g., in the case where there are insufficient available shared registers to perform the allocation (in block 108) when a subsequent allocation task is received. Figure 2 This eviction strategy is described in more detail below.

[0073] like Figure 1 As shown in FIG, whether there is a cache miss or a cache hit, the entry ID is returned together with the hit / miss status (block 112). If the hit / miss status indicates a cache miss, this causes the allocation task to be issued (block 114), and thus the auxiliary program is run. However, if the hit / miss status indicates a cache hit, this causes the allocation task to not be issued (block 120), and thus the auxiliary program is not run.

[0074] As mentioned above Figure 1 As described, subsequently, when a reference task is received, the entry ID associated with the task ID for the corresponding allocation task is used to query the shared register allocation cache and identify the shared register allocation for the task so that the stored data (generated by the auxiliary program) can be accessed and used. In addition, in response to receiving the reference task (block 402), and regardless of whether it is a cache hit or a cache miss when the allocation task is received, a counter for the entry ID associated with the task ID for the corresponding allocation task is incremented (block 404), as shown in FIG. Figure 4 As shown in .

[0075] Figure 5 1 shows what happens when a task terminates, where this task can be an assigned task (in the case where the task is issued in block 114) or a reference task. In response to task termination (block 502), a counter for the entry ID associated with the task ID for the corresponding assigned task is decremented (block 504).

[0076] use Figures 3 to 5 In the method, when the last task referencing a particular shared register allocation terminates, the counter for the particular entry ID may be decremented to zero, and then because the shared register is not released but remains allocated, the counter for the particular entry ID may then be incremented (in block 309 and then again in block 404) in response to receiving a subsequent allocation task having a data address for an auxiliary program that matches the data address stored in the cache entry and a matching primary unit identifier (ID) that matches the primary unit identifier stored in the cache entry.

[0077] In use Figures 3 to 5 In the case of the method, in response to determining that (i) there are not sufficient available shared registers to perform the allocation (e.g., in block 108) and (ii) all referencing tasks that reference the particular shared register have terminated (i.e., the counter for the entry ID corresponding to the shared register has a value of zero), the eviction policy for the shared register may release the shared register.

[0078] like Figure 3 As shown in FIG, the counter is incremented (in block 309) only in the case of a cache miss and not in response to a cache hit. This is because the allocation task is only issued in the case of a cache miss. When the allocation task issued in the case of a cache miss terminates, the counter is decremented (block 504), but in the case of a cache hit, no corresponding task for the allocation task terminates because the allocation task has not been issued. By incrementing the counter (in block 309) in this way, this prevents newly made allocations from being evicted when the auxiliary program is running.

[0079] You can refer to Figure 6 to Figure 7 A third example method for managing shared register allocation in a GPU is described below. Figures 3 to 5 A variation of the method described. Figure 6 As shown in FIG, in response to receiving an assignment task (block 102), in addition to locking the matching cache entry in the case of a cache hit (block 609) and locking the newly updated cache entry (as updated in block 108) in the case of a cache miss (in block 609), the method proceeds in the same manner as described above. Figure 3 The same method as shown in FIG. 1 and described above is performed in the same manner. Figure 7 As shown in FIG, in response to receiving a reference task (block 402), the method proceeds in the same manner as described above, except that the cache entry having the entry ID associated with the task ID for the corresponding assigned task is unlocked (block 703). Figure 4 The same method is used in Figure 7 The counter is shown incremented (in block 404) after the cache entry is unlocked (in block 703), but these two operations may be performed in any order or in parallel. In response to task termination, the method may be performed as follows: Figure 5 609. The cache entry may be locked by setting a lock bit associated with or included in the cache entry (in block 609). The cache entry may then be unlocked by clearing the lock bit (in block 703).

[0080] As described above, the use of the lock bit prevents the shared register allocation from being evicted before the first subsequent referencing task is received. This operation improves overall efficiency because it ensures that at least some of the data written to the shared register by the auxiliary program is read before being evicted. For example, in the case where the eviction policy allows an allocation task associated with one master unit to evict a cache entry associated with a different master unit, the lock bit can be used because it prevents the shared register allocation for the allocation task for the first master unit from being evicted due to the receipt of the allocation task for the second master unit before the first subsequent referencing task associated with the first master unit is received.

[0081] Although Figure 3 The method shown in shows the use of a counter without locking the cache entry, and Figure 6 Both the use of a counter and locking of cache entries are shown, but in another example, locking / unlocking of cache entries (in blocks 609 and 703) may be used without the use of a counter.

[0082] In the method described above, a shared register allocation is released only when there is insufficient space to create a new allocation (as described above with reference to Figure 2 In addition, all allocations may be released at the end of a processing phase (eg, where a processing phase corresponds to the time between when the master unit is started by the driver and when processing of work from the driver is completed).

[0083] You can refer to Figure 8 A fourth example method for managing shared register allocation in a GPU is described. In this example, there are two eviction modes—temporary and persistent—and the method operates differently for the two eviction modes. The temporary eviction mode may be referred to as a delayed release mode, and the persistent eviction mode may be referred to as an immediate release mode. In the case of using the temporary eviction mode, the allocation is not released when all tasks that reference the allocation are completed, but the allocation is later evicted when space is needed (as described above). This means that the allocation can be evicted by other master units (for example, because the eviction policy does not include criteria related to the master unit of the current allocation task). In contrast, in the case of using the persistent eviction mode, a new shared register is always allocated to the received allocation task, regardless of what is already stored in the shared register. In the persistent eviction mode, the allocation is marked as closed, and the shared register is released when the last task that references the allocation is completed. The allocation is closed for subsequent allocation tasks of the same master unit. This prevents the allocation from being evicted by other master units.

[0084] like Figure 8 As shown in FIG, an allocation task is received (block 802) and an eviction mode associated with the allocation task is determined (block 804). The eviction mode may be defined for each master unit or each cache entry. In the case where the eviction mode is defined for each cache entry, this eviction mode may be defined based on the master unit requesting the allocation associated with the cache entry, and the corresponding eviction mode may be stored in the cache entry. Alternatively, the master unit ID may be stored in the cache entry to enable the eviction mode to be determined, for example, as described below.

[0085] In case the eviction mode is defined per master, the eviction mode can be fixed as follows:

[0086] Main unit Eviction Mode Vertex Master Unit lasting Domain Master lasting Computing main unit lasting 2D Main Unit temporary Pixel Master Unit temporary Light main unit temporary

[0087] In various examples, the master units may have a default eviction mode, but some or all of the master units may be configurable so that they can operate in either eviction mode, rather than each master unit having a fixed eviction mode. A configuration register including one bit per configurable master unit may be used to indicate whether the default eviction mode is used or whether an alternative eviction mode (from the permanent eviction mode and the temporary eviction mode) is used. In other examples, the configuration register may include one bit per master unit (whether or not it is configurable), and in such examples, for those master units that are not configurable, the value of the bit for the master unit may be fixed in value. In an example, the default eviction mode and configurability may be specified as follows:

[0088] Main unit Default eviction mode Configurable Vertex Master Unit lasting no Domain Master lasting no Computing main unit lasting no 2D Main Unit temporary yes Pixel Master Unit temporary yes Light main unit temporary yes

[0089] As shown in the table above, those master units that have configurable eviction modes can have a default temporary eviction mode, with a configuration bit specifying where the persistent eviction mode should be used instead. Those master units that are not configurable can always use the persistent eviction mode. By having some or all of the master units have configurable eviction modes, this provides backward compatibility and additional flexibility.

[0090] In other examples, there may be no default eviction mode, and the value of a bit in a configuration register may define which eviction mode is used (eg, one indicating transient mode and zero indicating persistent mode, or vice versa).

[0091] Thus, the eviction mode may be determined (in block 804) based on the master associated with the assigned task (i.e., the master that created the assigned task). Thus, the determination (in block 804) may include identifying the associated master and then determining the eviction mode for the identified master (e.g., by checking a bit in a configuration register corresponding to the identified master).

[0092] For temporary eviction mode, the shared registers are allocated as above. Figure 1 , Figure 3 and Figure 6 Managed as described in any of the Figure 8 As shown in , if the eviction mode is temporary, the method changes from Figure 1 , Figure 3 and Figure 6 Proceed to block 104 in any of .

[0093] For persistent eviction mode, a determination is made as to whether there is a previous allocation for the same master associated with the current allocation task (block 806). If so ('yes' in block 806), then the off bit is set in the shared register allocation cache entry for the previous allocation (block 808). Then, a check is performed on the counter for the entry ID of the shared register allocation cache entry for the previous allocation (block 810). If the counter value is zero ('yes' in block 810), then the method proceeds from Figure 2 Box 214 ( Figure 1 , Figure 3 and Figure 6 806), the method proceeds to step 106 of block 808 and evicts the shared register allocation cache entry for the previous allocation and releases the shared register allocation. However, if the counter value is not zero ('No' in block 810), which means that there are still active (i.e., ongoing) referencing tasks, or if there are no previous allocations for the same main unit as associated with the current allocation task ('No' in block 806), the method proceeds to step 107 of block 808 and evicts the shared register allocation cache entry for the previous allocation and releases the shared register allocation. However, if the counter value is not zero ('No' in block 810), which means that there are still active (i.e., ongoing) referencing tasks, or if there are no previous allocations for the same main unit as associated with the current allocation task ('No' in block 806), the method proceeds to step 108 of block 806. Figure 2 Frame 204 (which is Figure 1 , Figure 3 and Figure 6 206) proceeds and performs a search for available shared registers. If there are not sufficient available shared registers ('No' in block 206), the only cache entries that will be available for eviction (and therefore identified in block 208) are those associated with allocations created in temporary eviction mode (because any persistent allocations to the same master will have been evicted as described above). In persistent eviction mode, (e.g. Figure 1 , Figure 3 or Figure 6 The hit / miss status returned in box 110 of always indicates a miss.

[0094] Figure 8 The method provides the flexibility to use temporary eviction mode for those types of work (and therefore those masters) where using the shared register allocation cache would provide a benefit (such as in the case of processing draw calls across multiple tiles or for ray tracing, where rays are grouped into tasks and the same shader program is run for all rays in a task), and the flexibility to use persistent eviction mode for those types of work (and therefore those masters) where using the shared register allocation cache would provide a benefit (such as in the case of processing draw calls across multiple tiles or for ray tracing, where rays are grouped into tasks and the same shader program is run for all rays in a task), and persistent eviction mode for those types of work (and therefore those masters) where using the shared register allocation cache would provide little or no advantage (such as where draw calls are unordered and sequential). In persistent eviction mode, the shared register allocation cache is not searched (bypassing Figure 1 , Figure 3 or Figure 6 104).

[0095] The method described above provides searchable allocation references by using a shared register allocation cache. This means that existing identical allocations can be reused by other tasks. Furthermore, allocations are not actively closed (thereby decoupling task termination from the release of shared register allocations), but their closing is delayed until another allocation requires the space, at which point the allocation is evicted. This keeps allocations open as long as possible and increases the likelihood that an allocation will be reused.

[0096] By using the method described above, different fragment tile IDs running on the same shader core can share shared register allocations even if the previous tasks have been completed.For ray tracing, the number of auxiliary programs that run for non-coherent task collection is reduced.

[0097] By using the methods described above, it is possible to remove the limit on the number of tiles that can be run in the pipeline at any time, which was originally used to prevent the increase of deadlock caused by shared register allocations. This is because the methods described above do not allocate shared registers on a per-tile basis, and if there are not enough shared registers available, allocations can be evicted to make room for new allocations. Since the maximum number of tiles running no longer needs to be considered, the limit on the maximum shared allocation size can be increased. In contrast, without these methods, there are shared register allocations open for each tile ID currently running, and this must take into account the possibility that each tile has been allocated a maximum size allocation in the worst case.

[0098] Fig. 9 900 is a schematic diagram of a GPU 900 for implementing the method described above. The GPU 900 includes a shared register 902, a plurality of master units 904, a processing pipeline 906, and a resource management unit 908. Fig. 9 As shown in , the shared registers are typically located inside the processing pipeline. It will be appreciated that GPU 900 may include Fig. 9 additional elements not shown, and although Fig. 9 Multiple master units are shown, but in other examples GPU 900 may include a single master unit.

[0099] The resource management unit 908 tracks resources and allocations for tasks processed by the processing pipeline 906. The resource management unit 908 includes a plurality of resource requestors 910 and a shared register allocation cache 912. The shared register allocation cache 912 includes a shared register resource manager 914, eviction logic 916, counter logic 918, and cache entries 920. It will be appreciated that in examples where counters are not used, the counter logic 918 may be omitted. Although Fig. 9A single resource management unit 908 is shown, but in other examples where the processing pipelines 906 are arranged in clusters, each cluster may have a separate resource management unit 908. Additionally, while the eviction logic 916 and the counter logic 918 are shown separately from the shared register resource manager 914, in other examples, one or both of the eviction logic 916 and the counter logic 918 may be included within the shared register resource manager 914.

[0100] The method described above is implemented by the resource management unit 908, and in particular by the shared register allocation cache 912. Most operations performed by the shared register allocation cache 912 are performed by the shared register resource manager 914, however eviction logic 916 handles evictions and counter logic 918 handles the updating of counters associated with entry IDs.

[0101] When the resource requester 910 requests a shared register allocation from the shared register allocation cache 912, the shared register allocation cache 912 receives the allocation task, triggering the shared register allocation cache to execute Figure 1 , Figure 3 and Figure 6 The shared register allocation cache 912 returns the entry ID and hit / miss status to the request resource requestor 910 (in block 110). The entry ID is ultimately provided to the processing pipeline 906 so that the processing pipeline can query the shared register allocation cache 912 to find the details of the shared register allocation for the task.

[0102] The entry ID received by the resource requestor 910 in response to requesting a shared register allocation may be stored by the resource requestor 910 and provided in response to receiving a subsequent referencing task. Alternatively, the shared register allocation cache 912 may return the entry ID in response to receiving the referencing task. Even in the case where the resource requestor 910 stores the entry ID for the allocating task, the referencing task may still be provided to the shared register allocation cache 912 so that the counter may be updated (e.g., as described above with reference to Figure 4 and Figure 7 described).

[0103] Each of the entries in the cache entries 920 has an entry ID (e.g., as returned in block 110), and the number of entry IDs is at least the same as the number of tasks that can be executed concurrently by the processing pipeline 906, so that there are always free entry IDs available. The number of available entry IDs corresponds to the maximum number of open shared register allocations, since each shared register allocation corresponds to one entry ID.

[0104] Fig.101 is a schematic diagram showing the contents of an example cache entry 1000. Cache entry 1000 has an entry ID and includes a valid bit 1002, a master unit identifier 1004, an eviction mode bit 1006, a cache index / tag 1008, an allocation base address 1010, an allocation size 1012, an LRU count or epoch 1014, a task reference count 1016, a closed bit 1018, and a locked bit 1020. It will be appreciated that in other examples, a cache entry may include only Fig.10 1004, and the cache index / tag 1008. The cache entry 1000 may include at least the valid bit 1002, the main unit identifier 1004, and the cache index / tag 1008. The entry ID is inherent, rather than stored in the cache entry, and may be, for example, the address of a structure that holds the entry.

[0105] Valid bit 1002 indicates whether cache entry 1000 is valid. When a cache entry is evicted, the valid bit is set to indicate that the cache entry is no longer valid.

[0106] The master unit identifier 1004 identifies the master unit associated with the allocation task that caused the cache entry to be assigned (in blocks 108 and 218). As described below, the master unit identifier 1004 can be used in conjunction with the cache index / tag 1008 to uniquely identify the shared register allocation request (i.e., the allocation task) that caused the cache entry to be assigned (in blocks 108 and 218). Additionally or alternatively, depending on the eviction policy used, the master unit identifier 1004 can be used when identifying eligible cache entries for eviction (in block 208).

[0107] Eviction mode bits 1006 specify an eviction mode bit (e.g., for the primary unit identified by identifier 1004. This element may be omitted from cache entry 1000, where the eviction mode may be identified in another manner (e.g., using a configuration register as described above or where there is a fixed relationship between the primary unit identifier and the eviction mode).

[0108] Alone or in combination with the main unit identifier 1004, the cache index / tag 1008 uniquely identifies the shared register allocation request (i.e., allocation task) that caused the cache entry to be assigned (in blocks 108 and 218). As described above, the cache index / tag 1008 may include a data address for the auxiliary program. In some examples, the cache index / tag 1008 may be a combination of a data address for the auxiliary program and a main unit identifier.

[0109] Allocation base address 1010 specifies the base memory address of the shared registers allocated in association with cache entry 1000. By storing the allocation base address, this enables the cache to de-allocate shared registers when an entry is evicted.

[0110] Allocation size 1012 specifies the size of the allocation of the shared register associated with cache entry 1000. By storing the allocation size, this enables the use of a variable allocation size, rather than a fixed allocation size, while still enabling the cache to de-allocate shared registers when an entry is evicted.

[0111] The LRU count or age 1014 provides data that can be used when identifying eligible cache entries for eviction (in block 208). The data included in this element will depend on the eviction policy used, such as whether, given multiple eligible cache entries, an entry is identified for eviction based on a least recently used (LRU) or age-based criteria (e.g., identifying the oldest), etc. The LRU count or age 1014 can be used by the eviction logic 916. Using an age-based criteria can simplify the eviction logic 916 and / or the logic for updating this cache element, while the benefit of using LRU is that frequently used data is less likely to be evicted.

[0112] Task reference count 1016 is a counter that is incremented in blocks 309 and 404 and decremented in block 504 and is used to track reference counts so that it can be determined whether an entry can be evicted (in block 208 ). Updates to task reference count 1016 may be implemented by counter logic 918 .

[0113] The closed bit 1018 indicates when the entry is closed and is set in block 808. As described above, this is used for entries associated with persistent eviction mode.

[0114] The lock bit 1020 indicates whether the cache entry is locked and is set in block 609 and cleared in block 703. As described above, this is used to prevent cross-master evictions between the receiving allocation task and a subsequent referencing task.

[0115] Cache entry 920 may be implemented as a CAM (content addressable memory) structure such that cache index / tag 1008 is searchable. Not all elements 1002 to 1020 in cache entry 1000 need to be searchable, so in various examples, cache entry 920 may be split into separate structures having, for example, elements that need to be searchable in one searchable structure (such as a CAM) and elements that do not need to be searchable in another non-searchable structure. Implementing a CAM or other searchable structure requires more hardware area than a non-searchable structure (e.g., so that all CAM or other searchable structures can be searched within a single clock cycle), and so splitting cache entry 920 into multiple structures may reduce the overall hardware size.

[0116] The method described above details what happens in response to receiving an assigned task and a reference task. For a reference task, there will always be a cache hit, and for an assigned task, a search will be performed unless the eviction mode is set to persistent mode. In the presence of other types of tasks (such as housekeeping tasks), these tasks can automatically trigger cache misses (e.g., using the same mechanism as described above for persistent eviction mode, but applied to task types that are independent of the eviction mode of the primary unit that created the task). The driver can indicate to the hardware which auxiliary programs are housekeeping tasks and need to be running at all times, and therefore need to be treated like assigned tasks in persistent eviction mode.

[0117] Fig.11 A computer system is shown in which the graphics processing system described herein may be implemented. The computer system includes a CPU 1102, a GPU 1104, a memory 1106, a neural network accelerator (NNA) 1108, and other devices 1114, such as a display 1116, a speaker 1118, and a camera 1122. A resource management unit 1110 (corresponding to resource management unit 908) is implemented on GPU 1104. In other examples, one or more of the depicted components may be omitted from the system. The components of the computer system may communicate with each other via a communication bus 1120.

[0118] Fig. 9 The GPU is shown as including a number of functional blocks. This is merely schematic and is not intended to define a strict division between different logical elements of such an entity. Each functional block may be provided in any suitable manner. It should be understood that intermediate values ​​described herein as being formed by the GPU need not be physically generated by the GPU at any point in time, and may merely represent logical values ​​that conveniently describe the processing performed by the GPU between its inputs and outputs.

[0119] The GPU described herein may be embodied in hardware on an integrated circuit. The GPU described herein may be configured to perform any of the methods described herein. In general, any of the functions, methods, techniques, or components described above may be implemented in software, firmware, hardware (e.g., fixed logic circuits), or any combination thereof. The terms "module," "functionality," "component," "element," "unit," "block," and "logic" may be used herein to generally represent software, firmware, hardware, or any combination thereof. In the case of software implementation, a module, functionality, component, element, unit, block, or logic represents a program code that, when executed on a processor, performs a specified task. The algorithms and methods described herein may be performed by one or more processors that execute code, which prompts the processor to perform the algorithm / method. Examples of computer-readable storage media include random access memory (RAM), read-only memory (ROM), optical disks, flash memory, hard disk storage, and other memory devices that may use magnetic, optical, and other technologies to store instructions or other data and may be accessed by a machine.

[0120] As used herein, the terms computer program code and computer readable instructions refer to any kind of executable code for a processor, including code expressed in a machine language, an interpreted language, or a scripting language. Executable code includes binary code, machine code, byte code, code that defines an integrated circuit (such as a hardware description language or a netlist), and code expressed in a programming language code such as C, Java, or OpenCL. Executable code can be, for example, any kind of software, firmware, script, module, or library that, when properly executed, processed, interpreted, compiled, run in a virtual machine or other software environment, causes a processor of a computer system supporting the executable code to perform the tasks specified by the code.

[0121] A processor, computer or computer system may be any kind of device, machine or special purpose circuit, or a collection or part thereof, which has processing capabilities so that instructions can be executed. A processor may be or include any kind of general or special purpose processor, such as a CPU, GPU, NNA, system on chip, state machine, media processor, application specific integrated circuit (ASIC), programmable logic array, field programmable gate array (FPGA), etc. A computer or computer system may include one or more processors.

[0122] It is also intended to cover software that defines the configuration of hardware as described herein, such as HDL (Hardware Description Language) software, such as for designing integrated circuits or for configuring programmable chips to implement desired functions. That is, a computer-readable storage medium may be provided having encoded thereon computer-readable program code in the form of an integrated circuit definition data set that, when processed (i.e., run) in an integrated circuit manufacturing system, configures the system to manufacture a GPU configured to perform any of the methods described herein, or to manufacture a GPU that includes any of the devices described herein. The integrated circuit definition data set may be, for example, an integrated circuit description.

[0123] Thus, a method of manufacturing a GPU as described herein at an integrated circuit manufacturing system may be provided. In addition, an integrated circuit definition data set may be provided which, when processed in an integrated circuit manufacturing system, enables the method of manufacturing a GPU to be performed.

[0124] The integrated circuit definition data set may be in the form of computer code, for example, as a netlist, code for configuring a programmable chip, as a hardware description language that defines hardware suitable for fabrication at any level in an integrated circuit, including as register transfer level (RTL) code; as a high-level circuit representation, such as Verilog or VHDL; and as a low-level circuit representation, such as OASIS (RTM) and GDSII. Higher-level representations that logically define hardware suitable for fabrication in an integrated circuit, such as RTL, may be processed at a computer system configured to generate a manufacturing definition of the integrated circuit in the context of a software environment that includes definitions of circuit elements and rules for combining those elements to generate a manufacturing definition of the integrated circuit so defined by the representation. As is typically the case with software executed at a computer system to define a machine, one or more intermediate user steps (e.g., providing commands, variables, etc.) may be required to configure the computer system to generate a manufacturing definition of the integrated circuit to execute code that defines the integrated circuit to generate the manufacturing definition of the integrated circuit.

[0125] Now refer to Fig.12 An example of processing an integrated circuit definition data set at an integrated circuit manufacturing system to configure the system to manufacture a GPU is described below.

[0126] Fig.12An example of an integrated circuit (IC) manufacturing system 1202 configured to manufacture a GPU as described in any of the examples herein is shown. In particular, the IC manufacturing system 1202 includes a layout processing system 1204 and an integrated circuit generation system 1206. The IC manufacturing system 1202 is configured to receive an IC definition data set (e.g., defining a GPU as described in any of the examples herein), process the IC definition data set, and generate an IC (e.g., which embodies a GPU as described in any of the examples herein) based on the IC definition data set. Processing of the IC definition data set configures the IC manufacturing system 1202 to manufacture an integrated circuit that embodies a GPU as described in any of the examples herein.

[0127] The layout processing system 1204 is configured to receive and process an IC definition data set to determine a circuit layout. Methods for determining a circuit layout based on an IC definition data set are known in the art and may, for example, involve synthesizing RTL code to determine a gate-level representation of a circuit to be generated, for example, in terms of logic components (e.g., NAND, NOR, AND, OR, MUX, and FLIP-FLOP components). By determining location information for the logic components, the circuit layout may be determined based on the gate-level representation of the circuit. This may be done automatically or with user involvement in order to optimize the circuit layout. When the layout processing system 1204 has determined the circuit layout, the layout processing system may output the circuit layout definition to the IC generation system 1206. The circuit layout definition may be, for example, a circuit layout description.

[0128] As is known in the art, IC generation system 1206 generates an IC according to a circuit layout definition. For example, IC generation system 1206 may implement a semiconductor device manufacturing process to generate an IC, which process may involve a multi-step sequence of photolithography and chemical processing steps during which electronic circuits are gradually formed on a wafer made of semiconductor material. The circuit layout definition may be in the form of a mask that can be used in a photolithography process for generating an IC according to the circuit definition. Alternatively, the circuit layout definition provided to IC generation system 1206 may be in the form of a computer readable code that IC generation system 1206 may use to form a suitable mask for generating an IC.

[0129] The different processes performed by the IC manufacturing system 1202 may all be implemented at one location, such as by one party. Alternatively, the IC manufacturing system 1202 may be a distributed system such that some processes may be performed at different locations and may be performed by different parties. For example, some of the following stages may be performed at different locations and / or by different parties: (i) synthesizing RTL code representing an IC definition data set to form a gate-level representation of a circuit to be produced; (ii) generating a circuit layout based on the gate-level representation; (iii) forming a mask based on the circuit layout; and (iv) using the mask to manufacture the integrated circuit.

[0130] In other examples, processing an integrated circuit definition data set at an integrated circuit manufacturing system may configure the system to manufacture a GPU without processing the IC definition data set to determine the circuit layout. For example, an integrated circuit definition data set may define a configuration of a reconfigurable processor (such as an FPGA), and processing the data set may configure the IC manufacturing system to produce a reconfigurable processor having the defined configuration (e.g., by loading the configuration data into the FPGA).

[0131] In some embodiments, when processed in an integrated circuit manufacturing system, the integrated circuit manufacturing definition data set can cause the integrated circuit manufacturing system to generate an apparatus as described herein. For example, by using the integrated circuit manufacturing definition data set as described above with reference to Fig.12 The integrated circuit manufacturing system can be configured in the described manner to manufacture the device described herein.

[0132] In some examples, the integrated circuit definition data set may include software that runs on, or in combination with, the hardware defined at the data set. Fig.12 In the example shown in , the IC production system can be further configured by the integrated circuit definition data set to load firmware onto the integrated circuit according to the program code defined at the integrated circuit definition data set when manufacturing the integrated circuit, or otherwise provide the integrated circuit with program code for use with the integrated circuit.

[0133] Compared with known specific implementations, the specific implementation of the concepts set forth in this application in devices, apparatuses, modules and / or systems (and in the methods implemented herein) can improve performance. Performance improvements may include one or more of improved computing performance, reduced latency, increased throughput and / or reduced power consumption. During the manufacture of such devices, devices, modules and systems (e.g., in integrated circuits), a trade-off may be made between performance improvements and physical implementations to improve manufacturing methods. For example, a trade-off may be made between performance improvements and layout area to match the performance of known implementations, but using less silicon. For example, this can be accomplished by reusing functional blocks in a serial manner or sharing functional blocks between elements of devices, devices, modules and / or systems. In contrast, the concepts set forth in this application that cause improvements in the physical implementation of devices, devices, modules and systems (e.g., reduced silicon area) may be weighed against performance improvements. This can be accomplished, for example, by manufacturing multiple instances of a module within a predefined area budget.

[0134] Applicants hereby independently disclose each individual feature described herein and any combination of two or more such features, to the extent that such feature or combination can be implemented based on the specification as a whole in view of the common general knowledge of a person skilled in the art, regardless of whether such feature or combination of features solves any problem disclosed herein. In view of the foregoing description, it will be clear to a person skilled in the art that various modifications can be made within the scope of the invention.

Claims

1. A method for managing shared register allocation in a GPU, the method comprising: In response to receiving an assignment, the following operations are performed, wherein the assignment is associated with an auxiliary program: searching a shared register allocation cache for a cache entry having a cache index identifying the auxiliary program associated with the allocation task; as well as In response to identifying a cache entry having a cache index that identifies the auxiliary program associated with the assigned task, an identifier of the cache entry and status information indicating a cache hit are returned, wherein returning the identifier of the cache entry causes the identifier of the cache entry to be associated with the assigned task, and returning the status information indicating the cache hit causes the assigned task to not be issued.

2. The method of claim 1 , wherein searching a shared register allocation cache for a cache entry having a cache index identifying the auxiliary program associated with the allocation task comprises: The shared register allocation cache is searched for a cache entry having a cache index with a matching data address for the auxiliary program.

3. The method of claim 1 , wherein the allocation task is associated with both the auxiliary program and a main unit identifier, and wherein searching a shared register allocation cache for a cache entry having a cache index identifying the auxiliary program associated with the allocation task comprises: The shared register allocation cache is searched for a cache entry having a cache index with both a matching data address and a matching main unit identifier for the auxiliary program.

4. The method according to claim 1, further comprising: In response to determining that no cache entry has a cache index that identifies the auxiliary program associated with the allocation task, allocating a shared register to the allocation task and assigning a cache entry to record the allocation; and returning an identifier of the cache entry recording the allocation and status information indicating a cache miss, wherein returning the identifier of the cache entry causes the identifier of the cache entry to be associated with the allocation task, and returning the status information indicating a cache miss causes the allocation task to be released.

5. The method of claim 4 , wherein allocating a shared register to the allocation task and updating a cache entry to record the allocation comprises: searching for an available shared register for allocation to the allocation task; In response to identifying an available shared register, allocating the shared register and assigning the cache entry to record the allocation; and In response to not identifying an available shared register for allocation to the allocation task, identifying eligible cache entries in the shared register allocation cache for eviction, evicting the eligible cache entries and releasing the shared registers identified in the eligible cache entries, and then repeating the search for an available shared register for allocation to the allocation task.

6. The method according to claim 5, further comprising: In response to determining that no cache entry has a cache index identifying the auxiliary program associated with the assigned task, incrementing a counter for the identifier of the cache entry recording the assignment; In response to receiving a reference task, wherein the reference task is associated with an allocation task: incrementing a counter for the identifier of the cache entry associated with the allocation task; In response to an allocation task terminating, decrementing a counter for the identifier of the cache entry associated with the allocation task; and In response to a referencing task terminating, wherein the referencing task is associated with an allocating task: decrementing a counter for the identifier of the cache entry associated with the allocating task, Wherein a cache entry in the shared register allocation cache is eligible for eviction only when the counter for the identifier of the cache entry is zero.

7. The method according to claim 5, further comprising: locking the cache entry having the returned identifier; as well as In response to receiving a reference task, wherein the reference task is associated with an assignment task, unlocking the cache entry having an identifier associated with the assignment task, Wherein a cache entry in the shared register allocation cache is eligible for eviction only if the cache entry is not locked.

8. The method of claim 1, wherein in response to an allocation task terminating, a shared resource identified in a cache entry having an identifier associated with the allocation task remains valid.

9. The method of claim 1 , wherein each cache entry in the shared register allocation cache has an identifier and comprises: A valid bit and a cache index (and an allocation base address, wherein the valid bit indicates whether the cache entry is valid, and the cache index includes a data address for an auxiliary program.

10. The method of claim 9, wherein each cache entry further comprises a home unit identifier.

11. The method of claim 9, wherein each cache entry further comprises an allocation base address, wherein the allocation base address specifies a base memory address of a shared register allocation recorded by the cache entry.

12. A method of operating a GPU, the method comprising: Receive assigned tasks; determining an eviction pattern associated with the assigned task; In response to determining that the eviction mode associated with the allocation task is a first eviction mode, managing shared register allocation according to the method of any one of claims 1 to 11; and In response to determining that the eviction mode associated with the assigned task is a second eviction mode: setting an off bit in an entry in a shared register allocation cache for any previous allocation for a master associated with the allocation task; responsive to determining that a counter for the identifier for the entry in the shared register allocation cache is zero for any previous allocation for a master associated with the allocation task, evicting an eligible cache entry and freeing a shared register identified in the eligible cache entry; searching for an available shared register for allocation to the allocation task; In response to not identifying an available shared register for allocation to the allocation task, identifying an eligible cache entry in the shared register allocation cache for eviction, evicting the eligible cache entry and releasing the shared register identified in the eligible cache entry, and then repeating the search for an available shared register for allocation to the allocation task; In response to identifying an available shared register, allocating the shared register and assigning the cache entry to record the allocation; as well as An identifier of the cache entry recording the allocation and status information indicating a cache miss are returned, wherein returning the identifier of the cache entry causes the identifier of the cache entry to be associated with the allocation task, and returning the status information indicating a cache miss causes the allocation task to be issued.

13. A shared register allocation cache for a GPU, the shared register allocation cache comprising a shared register resource manager and a plurality of cache entries, wherein in response to receiving an allocation task, the shared register resource manager is arranged to: searching a cache entry having a cache index identifying an auxiliary program associated with the assigned task; and In response to identifying a cache entry having a cache index that identifies the auxiliary program associated with the assigned task, an identifier of the cache entry and status information indicating a cache hit are returned, wherein returning the identifier of the cache entry causes the identifier of the cache entry to be associated with the assigned task, and returning the status information indicating the cache hit causes the assigned task to not be issued.

14. The shared register allocation cache of claim 13, wherein searching the shared register allocation cache for a cache entry having a cache index identifying the auxiliary program associated with the allocation task comprises: The shared register allocation cache is searched for a cache entry having a cache index with a matching data address for the auxiliary program.

15. The shared register allocation cache of claim 13, wherein searching the shared register allocation cache for a cache entry having a cache index identifying the auxiliary program associated with the allocation task comprises: The shared register allocation cache is searched for a cache entry having a cache index with both a matching data address and a matching main unit identifier for the auxiliary program.

16. A shared register allocation cache according to claim 13, in response to determining that no cache entry has a cache index identifying the auxiliary program associated with the allocation task, the shared register resource manager is arranged to: A shared register is allocated to the allocation task and a cache entry is assigned to record the allocation, and an identifier of the cache entry recording the allocation and status information indicating a cache miss are returned, wherein returning the identifier of the cache entry causes the identifier of the cache entry to be associated with the allocation task, and returning the status information indicating a cache miss causes the allocation task to be issued.

17. The shared register allocation cache of claim 16, further comprising eviction logic, wherein allocating a shared register to the allocation task and updating a cache entry to record the allocation comprises: searching for an available shared register for allocation to the allocation task; and in response to identifying an available shared register, allocating the shared register and assigning the cache entry to record the allocation; and In response to the shared register resource manager not identifying an available shared register for allocation to the allocation task, performing the following operations: triggering the eviction logic to identify eligible cache entries in the shared register allocation cache for eviction, and to evict the eligible cache entries and release the shared registers identified in the eligible cache entries; and Thereafter, the search for available shared registers to be allocated to the allocated task is repeated.

18. The shared register allocation cache of claim 17, further comprising counter logic, and wherein the counter logic is arranged to: responsive to the shared register resource manager determining that no cache entry has a cache index identifying the auxiliary program associated with the allocated task, incrementing a counter for the identifier of the cache entry recording the allocation; In response to the shared register resource manager receiving a referencing task, wherein the referencing task is associated with an allocating task: incrementing a counter for the identifier of the cache entry associated with the allocating task; In response to an allocation task terminating, decrementing a counter for the identifier of the cache entry associated with the allocation task; and In response to a referencing task terminating, wherein the referencing task is associated with an allocating task: decrementing a counter for the identifier of the cache entry associated with the allocating task, Wherein a cache entry in the shared register allocation cache is eligible for eviction only when the counter for the identifier of the cache entry is zero.

19. A GPU comprising a shared register allocation cache according to any one of claims 13 to 18.

20. An integrated circuit manufacturing system, the integrated circuit manufacturing system comprising: a non-transitory computer-readable storage medium having stored thereon a computer-readable description of the GPU of claim 19; a layout processing system configured to process the computer-readable description to generate a circuit layout description of an integrated circuit embodying the GPU; as well as An integrated circuit production system is configured to manufacture the GPU according to the circuit layout description.