Decompression of work item coordinate data for work items in work group
By compressing the work item coordinate data and utilizing shuffling indexes and masking techniques, the problem of limited interface sending rate in the computing system was solved, the instance scheduling rate of the computing execution unit was improved, and the overall performance of the computing system was enhanced.
Patent Information
- Application Number
- CN202510588108.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-05-10
- Filing Date
- 2025-05-08
- Publication Date
- 2025-11-11
AI Technical Summary
In the prior art, the rate at which the interface between the computing request unit and the computing sequencing unit in the computing system sends work item information is limited, resulting in insufficient instance scheduling rate for computing workloads.
By compressing the coordinate data of work items and sending the compressed data across interfaces, and using shuffle indexes and shuffle masks to determine the coordinates of work items, the amount of data that needs to be sent across interfaces in each cycle is reduced, thereby improving the data transmission rate.
This improves the rate at which the computing execution unit executes instances and reduces the amount of data that needs to be sent across interfaces in each cycle, thereby enhancing the overall computing performance of the computing system.
Smart Images

Figure CN120929433A_ABST
Abstract
Description
[0001] Cross-references to related applications
[0002] This application claims priority to UK Patent Application No. 2406641.7, filed on 10 May 2024, and UK Patent Application No. 2406638.3, also filed on 10 May 2024, both of which are incorporated herein by reference in their entirety. Technical Field
[0003] This application relates to techniques for compressing and decompressing work item coordinate data. This can increase the rate of computational task scheduling in a computing system. Background Technology
[0004] In computing systems that can be used for graphics processing, computations are performed to process data such as graphics data. A computing system may contain a graphics processing unit (GPU). A GPU can be used to process graphics data, for example, to render images. Furthermore, a GPU can be used to process more general data (which may be referred to as "computational data"), for example, to perform general computational processes on that data. GPUs are particularly well-suited for performing parallel processing, for example, using Single Instruction Multiple Data (SIMD) methods. The computational workload of a GPU is formed by tasks, each task consisting of multiple instances of computation.
[0005] Figure 1A GPU 101, a component of a computing system that can be used for graphics processing, is shown. The GPU 101 includes several computing units. The GPU includes a compute request unit 102 and processing logic 103. The processing logic 103 includes a compute sequencing unit 104 and a compute execution unit 105. The compute request unit 102 may be referred to as a data master, such as a compute data master (CDM), the compute sequencing unit 104 may be referred to as a programmable data sequencer (PDS), and the compute execution unit 105 may be referred to as a unified shader cluster (USC). The interface between the compute request unit 102 and the compute sequencing unit 104 is indicated by a dashed line 106. The compute execution unit 105 is configured to execute tasks, each task consisting of multiple instances. The compute sequencing unit 104 may be configured to receive requests for tasks to be executed from one or more compute request units (e.g., a compute data master requesting to perform compute work, a pixel data master requesting to perform pixel processing work, and / or a vertex data master requesting to perform vertex processing work). The computation sequencing unit 104 can be configured to determine the desired order of tasks to be executed and instruct the computation execution unit 105 to execute the tasks in the desired order determined by the sequencing unit. The computation sequencing unit can also be configured to determine the desired order of instances to be executed within each task and instruct the computation execution unit 105 to execute the instances in the desired order. In this manner, the computation sequencing unit 104 assembles the tasks and instructs the computation execution unit 105 to schedule and then execute the workload.
[0006] The computation request unit 102 is configured to request that the processing logic 103 perform computations. To request that certain tasks or instances be executed by the processing logic 103, the computation request unit 102 sends information about work items across the interface. The work items are then executed as instances at the computation execution unit 105.
[0007] Therefore, the rate at which instances can be scheduled and executed as part of a computational workload is affected by the rate at which information about work items can be sent across the interface between the computation request unit 102 and the computation sequencing unit 104. Therefore, it is desirable to develop a technique that can improve, i.e., increase, the rate at which work item information can be sent across the interface. Summary of the Invention
[0008] This summary is provided to introduce, in a simplified form, a series of concepts further described below in the detailed description. This summary is not intended to identify key or essential features of the claimed subject matter, nor is it intended to limit the scope of the claimed subject matter.
[0009] According to a first embodiment, a method is provided for receiving compressed work item coordinate data of work items in a workgroup and decompressing the compressed work item coordinate data at an interface between a computation request unit and a computation sequencing unit, wherein each work item in the workgroup can be identified by a shuffle index. The method includes: receiving a work item validity mask from the computation request unit, the work item validity mask indicating valid work items in the workgroup; calculating the shuffle index of each valid work item in the workgroup, as indicated by the work item validity mask; receiving a first shuffle mask from the computation request unit, the first shuffle mask indicating which bits of the shuffle index of each work item in the workgroup correspond to the value of a first coordinate of the work item; receiving a second shuffle mask from the computation request unit, the second shuffle mask indicating which bits of the shuffle index of each work item in the workgroup correspond to the value of a second coordinate of the work item; determining the first coordinate of the valid work item based on the first shuffle mask and the shuffle index calculated for each valid work item; and determining the second coordinate of the valid work item based on the second shuffle mask and the shuffle index calculated for each valid work item.
[0010] A workgroup may have a first dimension, where the first coordinate of a work item indicates the position of the work item in the workgroup in the first dimension; and a workgroup may have a second dimension, where the second coordinate of a work item indicates the position of the work item in the workgroup in the second dimension.
[0011] Each work item in a workgroup can be associated with a work item index, which indicates the order of work items in the workgroup.
[0012] The number of distinct work item positions within a workgroup in the first dimension can be a power of 2, and for each valid work item in the workgroup, calculating the shuffle index of the valid work item can include setting the shuffle index to be equal to the work item index of the valid work item.
[0013] In the first dimension, the number of different work item positions within a work group does not have to be a power of two.
[0014] Calculating the shuffle index of each work item at the first work item position in the first dimension may include setting the shuffle index of the work item to be equal to the work item index of the work item in the reference work group, wherein the number of distinct work item positions in the reference work group is equal to the next power of 2 greater than the number of distinct work item positions in the work group.
[0015] For one or more valid work items in a workgroup, a shuffle index can be calculated for the valid work items such that it is not equal to the work item index of the valid work items.
[0016] A shuffle index can be calculated for each valid work item, such that the shuffle index of a valid work item with a first coordinate 0 and a second coordinate Y is determined to be YK, where K is greater than x. max The least power of two, where x max It is the maximum value of the first coordinate of the work item in the work group.
[0017] Determining the first coordinate of a valid work item based on a first shuffle mask and a shuffle index calculated for each valid work item may include determining the first coordinate of the valid work item as a number represented by the bits of the shuffle index of the valid work item indicated by the first shuffle mask.
[0018] Determining the second coordinates of a valid work item based on a second shuffle mask and a shuffle index calculated for each valid work item may include determining the second coordinates of the valid work item as a bit representation of the shuffle index of the valid work item indicated by the second shuffle mask.
[0019] The method may include receiving the first shuffle mask and the second shuffle mask only once for each workgroup.
[0020] The workgroup may have a third dimension, wherein the third coordinate of a work item indicates the position of the work item in the workgroup in the third dimension, and wherein the method may include receiving a third shuffle mask that indicates which bits of the shuffle index of each work item in the workgroup correspond to the value of the third coordinate of the work item; and determining the third coordinate of a valid work item based on the third shuffle mask and the shuffle index calculated for each valid work item by determining the third coordinate of the valid work item as a number represented by the bits of the shuffle index of the valid work item indicated by the third shuffle mask.
[0021] The work item validity mask can indicate up to 64 valid work items for a work group.
[0022] For a workgroup comprising more than a threshold number of work items, the method may include receiving another work item valid mask; and calculating a shuffle index for each valid work item in the workgroup, as indicated by either the work item valid mask or the other work item valid mask.
[0023] The method may further include, for each valid work item in the work group, accessing the valid work item at the first and second coordinates and ordering the computation of the valid work items.
[0024] According to a second embodiment, processing logic is provided that is configured to receive compressed work item coordinate data of work items in a workgroup from a compute request unit across an interface and decompress the compressed work item coordinate data. Each work item in the workgroup can be identified by a shuffle index. The processing logic is configured to: receive a work item validity mask from the compute request unit, the work item validity mask indicating valid work items in the workgroup; calculate the shuffle index of each valid work item in the workgroup, as indicated by the work item validity mask; receive a first shuffle mask from the compute request unit, the first shuffle mask indicating which bits of the shuffle index of each work item in the workgroup correspond to the value of a first coordinate of the work item; receive a second shuffle mask from the compute request unit, the second shuffle mask indicating which bits of the shuffle index of each work item in the workgroup correspond to the value of a second coordinate of the work item; determine the first coordinate of the valid work item based on the first shuffle mask and the shuffle index calculated for each valid work item; and determine the second coordinate of the valid work item based on the second shuffle mask and the shuffle index calculated for each valid work item.
[0025] The processing logic may include a computation ordering unit and a computation execution unit. The computation ordering unit is configured to receive a work item validity mask from the computation request unit, the work item validity mask indicating valid work items in the work group; calculate the shuffle index of each valid work item in the work group, as indicated by the work item validity mask; receive a first shuffle mask from the computation request unit, the first shuffle mask indicating which bits of the shuffle index of each work item in the work group correspond to the value of a first coordinate of the work item; and receive a second shuffle mask from the computation request unit, the second shuffle mask indicating which bits of the shuffle index of each work item in the work group correspond to the value of a second coordinate of the work item; and the computation execution unit is configured to determine the first coordinate of the valid work item based on the first shuffle mask and the shuffle index calculated for each valid work item; and determine the second coordinate of the valid work item based on the second shuffle mask and the shuffle index calculated for each valid work item.
[0026] A computing system is also provided, comprising the processing logic and computing request unit described herein. The computing request unit is configured to: create a work item validity mask based on the number of work items in the workgroup and the position of the work items in the workgroup, the work item validity mask indicating valid work items in the workgroup; calculate a first shuffle mask indicating which bits of the index of each work item in the workgroup correspond to the value of a first coordinate of the work item; calculate a second shuffle mask indicating which bits of the index of each work item in the workgroup correspond to the value of a second coordinate of the work item; and send the first and second shuffle masks and the work item validity mask to the computing ordering unit across the interface.
[0027] Alternatively, a method can be provided for compressing work item coordinate data of work items in a workgroup and transmitting the compressed work item coordinate data across an interface between a computation request unit and a computation sequencing unit, wherein each work item in the workgroup can be identified by a shuffle index. The method includes creating a work item validity mask based on the number of work items in the workgroup and the position of the work items in the workgroup, the work item validity mask indicating valid work items in the workgroup; calculating a first shuffle mask indicating which bits of the shuffle index of each work item in the workgroup correspond to the value of a first coordinate of the work item; calculating a second shuffle mask indicating which bits of the shuffle index of each work item in the workgroup correspond to the value of a second coordinate of the work item; and transmitting the first and second shuffle masks and the work item validity mask across the interface to the computation sequencing unit.
[0028] A workgroup may have a first dimension, where the first coordinate of a work item indicates the position of the work item in the workgroup in the first dimension; and a workgroup may have a second dimension, where the second coordinate of a work item indicates the position of the work item in the workgroup in the second dimension.
[0029] Each shuffle mask can be calculated based on the size of the workgroup in one dimension.
[0030] Calculating the first shuffle mask may include determining that the maximum value of the first coordinate of the work item in the work group is equal to r-1, where r is the number of different work item positions in the work group in the first dimension.
[0031] Calculating the second shuffle mask may include determining that the maximum value of the second coordinate of the work item in the work group is equal to z-1, where z is the number of different work item positions in the work group in the second dimension.
[0032] Calculating the first shuffle mask may include assigning a first binary value to the m least significant bits of the first shuffle mask, where m is the number of bits required to represent the maximum value of the first coordinate of the work item in the work group; and assigning a second binary value to the remaining bits of the first shuffle mask, where the first binary value is different from the second binary value.
[0033] Calculating the second shuffle mask may include assigning a first binary value to a set of p consecutive bits of the second shuffle mask, where p is the number of bits required to represent the maximum value of the second coordinate of the work item in the work group, and wherein the least significant bit of the set of p consecutive bits is the (m+1)th least significant bit of the second shuffle mask; and assigning a second binary value to the remaining bits of the second shuffle mask.
[0034] Calculating the first shuffle mask may include assigning a first binary value to the m least significant even bits of the first shuffle mask, where m is the number of bits required to represent the maximum value of the first coordinate of the work item in the work group; and assigning a second binary value to the remaining bits of the first shuffle mask, where the first binary value is different from the second binary value.
[0035] Calculating the second shuffle mask may include assigning a first binary value to the p least significant odd bits of the second shuffle mask, where p is the number of bits required to represent the maximum value of the second coordinate of the work item in the work group; and assigning a second binary value to the remaining bits of the second shuffle mask.
[0036] The number of different work item positions within a work group in the first dimension can be a power of 2.
[0037] In the first dimension, the number of different work item positions within a work group does not have to be a power of 2.
[0038] Calculating the first shuffle mask may include determining the augmentation size of the workgroup in the first dimension as a power of two that is also greater than the minimum number of different work item positions within the workgroup in the first dimension; and calculating the first shuffle mask based on the augmentation size of the workgroup in the first dimension.
[0039] Calculating the second shuffle mask may include determining the expansion size of the workgroup in the second dimension as a power of two that is also greater than the minimum number of different work item positions within the workgroup in the second dimension; and calculating the second shuffle mask based on the expansion size of the workgroup in the second dimension.
[0040] The workgroup may have a third dimension, the third coordinate of the work item indicates the position of the work item in the workgroup in the third dimension, and the method may include calculating a third shuffle mask that indicates which bits of the shuffle index of each work item in the workgroup correspond to the value of the third coordinate of the work item.
[0041] The workgroup may have n dimensions, and the method may include computing an nth shuffle mask that indicates which bits of the shuffle index of each work item in the workgroup correspond to the value of the nth coordinate of the work item.
[0042] The method may include sending the first and second shuffle masks to the computation sequencing unit only once for each workgroup across the interface.
[0043] Creating a work item validity mask may include assigning a first binary value to each bit of the work item validity mask that corresponds to the position of the valid work item in the work group.
[0044] Valid work items in a work group can form a contiguous group of work items, and creating a work item validity mask can include assigning a first binary value to the q least significant bits of the work item validity mask, where q is the number of valid work items in the work group.
[0045] The workgroup may include more than a threshold number of work items, and the method may include creating another work item valid mask based on the number of work items in the workgroup and the position of the work items in the workgroup; and sending the other work item valid mask to the computational sequencing unit across the interface.
[0046] Each work item in a workgroup can be associated with a work item index, which indicates the order of work items in the workgroup.
[0047] The shuffle index for each work item can be equal to the work item index of that work item.
[0048] The shuffle index for each work item may not be equal to the work item index of that work item.
[0049] Alternatively, a calculation request unit can be provided, configured to compress work item coordinate data of work items in a workgroup and send the compressed work item coordinate data to a calculation and sequencing unit across an interface. Each work item in the workgroup can be identified by a shuffle index. The calculation request unit is configured to create a work item validity mask based on the number of work items in the workgroup and the position of the work items in the workgroup. The work item validity mask indicates the valid work items in the workgroup. The unit calculates a first shuffle mask, which indicates which bits of the shuffle index of each work item in the workgroup correspond to the value of the first coordinate of the work item. It calculates a second shuffle mask, which indicates which bits of the shuffle index of each work item in the workgroup correspond to the value of the second coordinate of the work item. The unit then sends the first and second shuffle masks and the work item validity mask to the calculation and sequencing unit across the interface.
[0050] A computing system can also be provided that includes a computing request unit and processing logic including a computing ordering unit. The processing logic is configured to receive a work item validity mask from the computing request unit, the work item validity mask indicating valid work items in a work group; calculate a shuffle index for each valid work item in the work group, as indicated by the work item validity mask; receive a first shuffle mask from the computing request unit, the first shuffle mask indicating which bits of the shuffle index of each work item in the work group correspond to the value of a first coordinate of the work item; receive a second shuffle mask from the computing request unit, the second shuffle mask indicating which bits of the shuffle index of each work item in the work group correspond to the value of a second coordinate of the work item; determine the first coordinate of the valid work item based on the first shuffle mask and the shuffle index calculated for each valid work item; and determine the second coordinate of the valid work item based on the second shuffle mask and the shuffle index calculated for each valid work item.
[0051] A computer-readable code is also provided, configured to cause any of the methods described herein to be executed when the code is run. A computer-readable storage medium on which computer-readable code is encoded, the computer-readable code being configured to cause the methods described herein to be executed when the code is run.
[0052] An integrated circuit definition dataset is also provided, which, when processed in an integrated circuit manufacturing system, configures the integrated circuit manufacturing system to manufacture the processing logic or computing system described herein.
[0053] Also provided is a non-transitory computer-readable storage medium having stored thereon a computer-readable description of the processing logic or computing system described herein, the computer-readable description causing the integrated circuit manufacturing system to manufacture an integrated circuit embodying the processing logic or the computing system when processed in an integrated circuit manufacturing system.
[0054] A method for manufacturing the processing logic or computing system described herein using an integrated circuit manufacturing system is also provided.
[0055] A computing system can be embodied in hardware on an integrated circuit. A non-transitory computer-readable storage medium storing a computer-readable description of a computing system thereon can be provided, which, when processed in an integrated circuit manufacturing system, causes the integrated circuit manufacturing system to manufacture an integrated circuit embodying the computing system.
[0056] An integrated circuit manufacturing system may be provided, comprising: a non-transitory computer-readable storage medium storing a computer-readable description of a graphics processing system thereon; a layout processing system configured to process the computer-readable description to generate a circuit layout description of an integrated circuit embodying a computing system; and an integrated circuit generation system configured to manufacture the computing system according to the circuit layout description.
[0057] Computer program code for performing any of the methods described herein may be provided. A non-transitory computer-readable storage medium having computer-readable instructions stored thereon, which, when executed in a computer system, cause the computer system to perform any of the methods described herein.
[0058] As will be apparent to those skilled in the art, the above features can be appropriately combined and can be combined with any aspect of the examples described herein. Attached Figure Description
[0059] The example will now be described in detail with reference to the accompanying drawings, in which:
[0060] Figure 1 The components of the computing system are shown.
[0061] Figure 2 The workgroup and the index of the work items associated with the workgroup are shown.
[0062] Figure 3 Two examples are shown, illustrating workgroups and work item indexes that can be associated with work items in a workgroup.
[0063] Figure 4 A method is shown for compressing work item coordinate data in a workgroup and sending the compressed work item coordinate data across the interface between the calculation request unit and the calculation sequencing unit.
[0064] Figure 5 The valid mask for the work item is shown.
[0065] Figure 6 The first shuffle mask and the second shuffle mask are shown.
[0066] Figure 7 Two sets of first and second shuffle masks are shown.
[0067] Figure 8 A method for receiving compressed work item coordinate data and decompressing the compressed work item coordinate data is shown.
[0068] Figure 9 The diagram shows the workgroups containing work items, as well as the work item indexes and shuffle indexes associated with the workgroups.
[0069] Figure 10 The shuffle mask and shuffle index used to determine the coordinates of work items are shown.
[0070] Figure 11 The shuffle index and shuffle mask used to determine the work item coordinates of the work group are shown.
[0071] Figure 12 The valid work items of the work group and the valid work item mask of the work group are shown.
[0072] Figure 13 The workgroup, the work item valid mask, and the first and second shuffle masks associated with the workgroup are shown.
[0073] Figure 14 The workgroup and the work item index and shuffle index associated with the workgroup are shown.
[0074] Figure 15 The three-dimensional workgroup and the three shuffle masks associated with the workgroup are shown.
[0075] Figure 16 A computer system in which a computing system is implemented is shown; and
[0076] Figure 17 An integrated circuit manufacturing system for generating integrated circuits that embody a computing system is shown.
[0077] The accompanying drawings illustrate various examples. Those skilled in the art will understand that the element boundaries (e.g., boxes, groups of boxes, or other shapes) shown in the drawings represent one example of a boundary. In some examples, it may be that one 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 drawings to indicate similar features. Detailed Implementation
[0078] The following description is presented with the aid of examples to enable those skilled in the art to make and use the invention. The 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.
[0079] GPUs typically comprise compute request units, compute sequencing units, and compute execution units. For a request unit to request a compute execution unit to execute a task comprised of multiple compute instances, the compute request unit needs to send information about the work items to be executed to the compute execution unit via the compute sequencing unit. Conventional methods of sending this data involve sending the coordinates of each work item to be executed within the workgroup across the interface between the compute request unit and the compute sequencing unit. Such methods involve sending a large amount of data across the interface per cycle. It is generally desirable to keep the interface size small, thereby keeping the overall silicon area of the compute system low, and thus limiting the rate at which data can be sent across the interface. The rate at which the compute execution unit executes instances can be limited by the rate at which the compute request unit can send work item coordinates across the interface to the compute sequencing unit. The technique described herein provides a method for compressing work item coordinate data at the compute request unit before sending the compressed data across the interface. The data can be decompressed by the compute sequencing and execution units for use by the compute execution unit to execute compute instances. The method described herein reduces the amount of data that needs to be sent across the interface per cycle, and thus increases the rate at which data is sent. Therefore, compute execution speed can be improved.
[0080] The embodiments will now be described using only examples.
[0081] Return to Figure 1 The GPU 101 seen in the diagram, with computation request unit 102, can be referred to as the computation data master unit. The computation sequencing unit 104 can be referred to as the programmable data sequencer. The GPU 101 may include, in addition to Figure 1 Other units besides the one shown. For example, GPU 101 may include one or more other requesting units configured to request computation from processing logic 103. Other requesting units may include pixel data master units and vertex data master units.
[0082] The function of the computation sequencing unit 104 is to prioritize the execution times of tasks and instances and instruct the computation execution unit 105 to execute tasks and instances in an order that takes into account the priority ranking. The computational workload can include tasks related to processing any type of data, such as graphical data, to generate image data.
[0083] In order for the request instance to be executed by the processing logic 103, the computation request unit 102 sends the work item corresponding to the requested instance to the processing logic 103. The work item is scheduled by the computation sequencing unit 104 and the computation execution unit 105, and then executed as an instance. The work items are grouped into workgroups. Workgroups can be packaged into tasks to be executed by the computation execution unit 105. For example, a task can contain up to 128 instances from up to 8 workgroups.
[0084] Figure 2A work group 201 comprising multiple work items 202 is shown. Figure 2 In the example seen, the workgroup comprises eight work items 202a through 202h. Figure 2 Only work items 202a and 202h are marked in the text. Figure 2 The workgroup 202 seen in the image is a two-dimensional (2D) workgroup. Workgroup 202 has a first dimension. In the following example, the first dimension is the x-dimensional. Workgroup 202 has a second dimension. In the following example, the second dimension is the y-dimensional. Work items in a workgroup can represent graphical data of an image rendered by the GPU.
[0085] like Figure 2 As shown, each work item has a set of coordinates indicating its position within a work group. Work group 201 has eight distinct work item positions. For example, work item 202a has coordinates (0,0). Work item 202h has coordinates (1,3). The first coordinate of a work item indicates its position within the work group along the first dimension. The second coordinate of a work item indicates its position within the work group along the second dimension. The size of the first dimension is equal to the number of distinct work item positions within the work group along the first dimension. The size of the second dimension is equal to the number of distinct work item positions within the work group along the second dimension. Figure 2 The workgroup 201 seen in the image has a first dimension of 2. There are two distinct work item positions in the x-axis. Workgroup 201 also has a second dimension of 4. There are four distinct work item positions in the y-axis.
[0086] According to one example, each coordinate of a work item comprises 10 bits. Therefore, for 2D work group 201, each work item has two coordinates that can be represented by 20 bits. For 3D work group, each work item has three coordinates that can be represented by 30 bits.
[0087] Each work item 202 in workgroup 201 is associated with a work item index 203 (203a to 203h). Work item indices 203 indicate the order of work items within the workgroup. A work item index can be referred to as a work item ID. Therefore, the number of work item indices 203 equals the number of work items in the workgroup. Figure 2 In the example, there are eight work item indices 203 associated with the workgroup. Figure 2 In the example shown, work item indices are assigned using a linear order. Work item index 203a is 0 and is associated with work item 202a. Work item index 203h is 7 and is associated with work item 202h.
[0088] Figure 3 Another example of work group 301 is shown. Work group 301 includes 16 work items 302a to 302p. Figure 3This demonstrates that work item indices can be assigned to work items in a workgroup using two different orders. According to... Figure 2 Use linear order allocation Figure 3 The work item index is 303. Figure 3 It also shows the use of another order, namely the Morton order for assigning work item index 304.
[0089] Existing methods for sending information about work items in a workgroup through interface 106 between computation request unit 102 and computation sequencing unit 104 involve sending the coordinates of each work item in the workgroup. Known methods involve sending the coordinates of each work item required to execute each instance across the interface.
[0090] As described above, the rate at which processing logic 103 can schedule and execute instances is affected by the rate at which information about work items can be sent across the interface between computation request unit 102 and computation sequencing unit 104. Therefore, the rate at which the GPU can process data is limited by the rate at which work item information can be sent across interface 106.
[0091] According to existing methods for sending the coordinates of each work item across the interface, only one work item's work item information is sent across the interface per clock cycle. Each coordinate of a work item comprises 10 bits. Therefore, for a 2D work group 201, the coordinates of each work item could comprise 20 bits. Thus, sending the coordinates of one work item across the interface per cycle could involve sending 20 bits across the interface per cycle. In the example where the work group is three-dimensional, sending the coordinates of one work item across the interface per cycle could involve sending 30 bits across the interface per cycle.
[0092] Sending a set of work item coordinates per cycle (i.e., the work item coordinates of one work item) means that executing N instances requires N transactions between the computation request unit 102 and the computation sequencing unit 103. In other words, on average, only one instance can be executed per cycle. As an example, N could be 128. Therefore, to execute a task consisting of 128 instances, at least 128 transactions would be needed to transmit all the necessary work item information.
[0093] By increasing the size of the interface (and optionally other interfaces and hardware structures within the GPU), more work item information can be sent across the interface each clock cycle; however, this increases the size of the GPU and the associated cost. Furthermore, since the coordinates of work items within a single workgroup are highly uniform, sending the coordinates of each work item across interface 106 means sending redundant data each cycle.
[0094] The inventors of this invention have developed a method for increasing the instance scheduling rate of computational workloads. This invention relates to compressing work item coordinate data and sending the compressed data across an interface, instead of sending the coordinates of each work item separately for each instance across interface 106 between the compute request unit and the compute sequencing unit. Specifically, this invention relates to compressing the work item coordinate data of work items within a workgroup and sending the compressed data across an interface. According to the invention, the coordinates of each work item to be executed can be calculated by processing logic 103 after receiving the compressed data. As will be explained in more detail below, using this method means fewer transactions between compute request unit 102 and compute sequencing unit 103 required to execute instances corresponding to work items in a workgroup. Specifically, to execute a task consisting of 128 instances, according to one example, five transactions are required to transmit all the necessary work item information corresponding to the workgroup of the task.
[0095] Figure 4 The diagram illustrates a method for compressing work item coordinate data in a workgroup. Method 401 includes: creating a work item validity mask based on the number of work items in the workgroup and the orientation of the work items in the workgroup, the work item validity mask indicating valid work items in the workgroup (402); calculating a first shuffle mask indicating which bits of the shuffle index of each work item in the workgroup correspond to the value of a first coordinate of the work item (403); and calculating a second shuffle mask indicating which bits of the shuffle index of each work item in the workgroup correspond to the value of a second coordinate of the work item (404). Method 401 is performed by a calculation request unit 102.
[0096] As will be explained in more detail below, workgroups can have more than two dimensions. Therefore, compressing work item coordinate data can involve calculating more than two shuffle masks, as in other examples. Typically, for a workgroup with n dimensions, compressing work item coordinate data can include calculating n shuffle masks, each shuffle mask indicating which bit(s) of the shuffle index of each work item in the workgroup corresponds to the value of the corresponding coordinate among the n coordinates of that work item. Therefore, for a workgroup with n dimensions, it is possible to extend... Figure 4 The method seen in [the document] may include additional steps for calculating n shuffle masks. The method may also include sending the calculated n shuffle masks to the computation ordering unit across an interface.
[0097] Figure 5 Showing the target Figure 2 The work item created by work item 202 in work group 201 is shown in the image. The valid mask for work item 501 is 501. Figure 5The work item validity mask 501 seen in the diagram comprises 64 bits. Each bit of the work item validity mask indicates whether the corresponding work item in the workgroup is valid. Therefore, the work item validity mask 501 indicates a maximum of 64 valid work items in the workgroup. According to another example, the work item validity mask can indicate more or fewer work items in the workgroup. For example, the work item validity mask can include 16 bits.
[0098] The valid work item mask indicates the valid work items in the workgroup. Valid work items are those work items from the workgroup required to perform the desired task or instance as part of the desired computation workload. In other words, valid work items are those work items whose data will be sent across the interface from the computation request unit to the computation sequencing unit. Therefore, the valid work item mask 501 indicates which work items from the workgroup will be sent to the computation execution unit as part of the computation workload.
[0099] The work item validity mask is created based on the number of work items in a workgroup and the orientation of the work items within the workgroup. Specifically, the work item validity mask can be created based on the orientation (or position) of the valid work items within the workgroup. Creating the work item validity mask may include assigning a value of 1 to each bit of the work item validity mask corresponding to the position of the valid work item within the workgroup. Workgroup 201 comprises eight work items. Therefore, the work item validity mask 501 created for workgroup 201 contains 8 bits that have been assigned the value 1, indicating that all eight work items in workgroup 201 are valid. The remaining 56 bits of the work item validity mask 501 are assigned the value 0. According to this example, all work items 202a to 202h in workgroup 201 are valid work items. Therefore, valid work items 202a to 202h form a consecutive work item group. Therefore, creating the work item validity mask 501 includes assigning a value of 1 to the q least significant bits of the work item validity mask. Figure 5 In the example shown, q equals 8, which is the number of valid work items in the workgroup. As will be explained in more detail below, valid work items that do not form consecutive groups in the workgroup can be masked in different ways.
[0100] Compressing work item coordinate data also includes calculating the shuffling mask. Figure 6 The first shuffle mask 601 and the second shuffle mask 602 are shown. Figures 2 to 4In the example shown, workgroup 201 is a two-dimensional workgroup. A shuffle mask is calculated for each dimension of the workgroup. Therefore, the method involves generating a first shuffle mask 601 corresponding to the first dimension of workgroup 201 and a second shuffle mask 602 corresponding to the second dimension of workgroup 201. As will be explained in more detail below, the first shuffle mask 601 indicates which bits(s) of the shuffle index of each work item in the workgroup correspond to the value of the first coordinate of that work item. The second shuffle mask 602 indicates which bits(s) of the shuffle index of each work item in the workgroup correspond to the value of the second coordinate of that work item. Figure 6 In the example shown, each shuffle mask contains 11 bits.
[0101] Each shuffle mask is calculated based on the size of the workgroup in one dimension of the workgroup. As will be explained in more detail below, a workgroup can have more than two dimensions. Therefore, compressing work item coordinate data may involve calculating more than two shuffle masks, according to other examples. Typically, for a workgroup with n dimensions, compressing work item coordinate data may include calculating n shuffle masks, each shuffle mask indicating which bits(s) of the shuffle index of each work item in the workgroup correspond to the value of the corresponding coordinate among the n coordinates of that work item. The method may include calculating an nth shuffle mask that indicates which bits of the shuffle index of each work item in the workgroup correspond to the value of the nth coordinate of that work item.
[0102] Each shuffle mask is calculated based on the order in which the work item indices are assigned to the work group. As previously mentioned, work group 201 has work item indices assigned to the work group in a linear order. Therefore, shuffle masks 601 and 602 are calculated taking into account the linear order of the work item indices.
[0103] The shuffling mask 601 is calculated based on the size of workgroup 201 in the first dimension (x-dimension) of workgroup 201. The size of workgroup 201 in the first dimension is two. As will be explained in more detail below, for workgroups whose size in the first dimension is not a power of two, the shuffling mask can be calculated in different ways. Calculating the first shuffling mask 601 involves assigning the value 1 to the m least significant bits of the first shuffling mask, where m is the number of bits required to represent the maximum value of the first coordinate of the work item in the workgroup, and assigning the value 0 to the remaining bits of the first shuffling mask. This document uses x0, x1, x2, ... x m This represents the number of bits required to represent the maximum value of the first coordinate of a work item within a work group. For work item 202 in work group 201, the maximum value of the first (x) coordinate is 1, such as... Figure 2As shown. Therefore, 1 bit is needed to represent this maximum value. Therefore, in shuffle mask 601, the least significant (1) bit has been assigned the value 1. In other words, in this example, m = 1. In other words, only one bit (x0) is needed to represent the maximum value of the first coordinate of the work item in the workgroup. The remaining bits have been assigned the value 0. The maximum value of the first coordinate of the work item in the workgroup is equal to r-1, where r is the number of distinct work item positions within the workgroup in the first dimension. In this example, the number of distinct work item positions within workgroup 201 in the first (x) dimension is 2. Therefore, the maximum value of the first coordinate of the work item in the workgroup is equal to 1.
[0104] The shuffling mask 602 is calculated based on the size of workgroup 201 in the second dimension (y-dimension) of the workgroup. Workgroup 201 has a size of four in the second dimension. Calculating the second shuffling mask 602 involves assigning the value 1 to a set of p consecutive bits of the second shuffling mask, where p is the number of bits required to represent the maximum value of the second coordinate of the work item in the workgroup, and wherein the least significant bit of the set of p consecutive bits is the (m+1)th least significant bit of the second shuffling mask; and assigning the value 0 to the remaining bits of the second shuffling mask. This document uses y0, y1, y2…y p This represents the number of bits required to represent the maximum value of the second coordinate of a work item within a work group. For work item 202 in work group 201, the maximum value of the second (y) coordinate is 3, such as... Figure 2 As shown. Therefore, 2 bits are needed to represent this maximum value. Therefore, in the second shuffle mask 602, p = 2. In other words, two bits (y0, y1) are needed to represent the maximum value of the second coordinate of the work item in the work group. Therefore, the shuffle mask 602 contains a set of two consecutive bits assigned the value 1. The least significant bit in this set of two consecutive bits is the second least significant bit of the second shuffle mask (because m = 1 in this example). The remaining bits of the second shuffle mask are assigned the value 0. The value 1 is given to the least significant bit in the second shuffle mask that is not the same bit with the value 1 in the first shuffle mask. In other words, the first and second shuffle masks do not have any common bits with the value 1.
[0105] The maximum value of the second coordinate of a work item in a workgroup is equal to z-1, where z is the number of distinct work item positions within the workgroup in the second dimension. In this example, the number of distinct work item positions within workgroup 201 in the second (y) dimension is 4. Therefore, the maximum value of the second coordinate of a work item in workgroup 201 is equal to 3.
[0106] Each shuffle mask is calculated based on the order in which the work item indexes are assigned to the workgroups. As described above, Figure 3Workgroup 301 is shown, which can use two different orders to assign work item indices: linear order (303) and Morton order (304). Since the shuffle mask is calculated based on the order in which the work item indices are assigned to the workgroup, different shuffle masks are calculated for linear order (303) and Morton order (304), as follows: Figure 7 As shown.
[0107] Shuffle masks 701 and 702 are calculated for a workgroup 301 with work item indices assigned using a linear order (303). The first shuffle mask 701 is calculated based on the size of the workgroup in the x-dimensional direction. For a linear work item index, calculating the first shuffle mask 701 involves assigning the value 1 to the m least significant bits of the first shuffle mask, where m is the number of bits required to represent the maximum value of the first coordinate of the work item in the workgroup, and assigning the value 0 to the remaining bits of the first shuffle mask. The size of workgroup 301 in the x-dimensional direction is four. The maximum value of the x-coordinate is 3. Therefore, the number of bits required to represent the maximum value of the x-coordinate is 2 (m = 2). The two bits required to represent the maximum value of the x-coordinate can be represented as x0 x1. In this example, x0 and x1 = 1. Therefore, the two least significant bits (i.e., bits 0 and 1) of the shuffle mask 701 are assigned the value 1. The remaining bits in the shuffle mask are assigned the value 0. In other words, the first shuffle mask is of the form 000000000x1x0. Typically, x a The value is assigned to bit a of the first shuffle mask.
[0108] The second shuffle mask 702 is calculated based on the size of the work group in the y-axis. For linear work item indices, a value of 1 is provided to the least significant bit in the second shuffle mask that is not the same bit with a value of 1 in the first shuffle mask. Figure 7 In the example, calculating the second shuffle mask 702 involves assigning the value 1 to a set of p consecutive bits of the second shuffle mask, where p is the number of bits required to represent the maximum value of the second coordinate of the work item in the work group, and the least significant bit of said set of p consecutive bits is the (m+1)th least significant bit of the second shuffle mask; and assigning the value 0 to the remaining bits of the second shuffle mask. The work group 301 is four in size in the y-dimension. The maximum value of the y-coordinate is 3. Therefore, the number of bits required to represent the maximum value of the y-coordinate is 2 (p = 2). The two bits required to represent the maximum value of the y-coordinate can be represented as y0 y1. Therefore, bits 2 and 3 of the shuffle mask 702 are assigned the value 1. The remaining bits in the shuffle mask 702 are assigned the value 0. In other words, the first shuffle mask is of the form 0000000y1y000. Typically, the value y a Bit m+a is assigned to the second shuffle mask.
[0109] The first and second shuffle masks have no common bits with a value of 1. Generally, for linearly ordered work item indices, the m least significant bits of shuffle mask 701 are assigned the value 1 to represent the maximum value of the x-coordinate. The next p least significant bits of shuffle mask 702 (which do not overlap with those least significant bits of shuffle mask 701) are assigned the value 1 to represent the maximum value of the y-coordinate. Those skilled in the art will understand how to compute a shuffle mask for a larger work group with work item indices assigned using a linear order, i.e., when the number of bits required to represent the maximum value of the y-coordinate is greater than 2.
[0110] It should be understood that for linearly ordered work item indices, this pattern of assigning values of 1 to bits of the shuffle mask can be extended for workgroups with n dimensions, where compressing work item coordinate data can include computing n shuffle masks, each shuffle mask indicating which bits of the shuffle index of each work item in the workgroup correspond to the value of the nth coordinate of said work item. For example, for a three-dimensional (3D) workgroup, as explained in more detail below, compressing work item coordinate data can include computing three shuffle masks. A third shuffle mask can be computed based on the size of the linear workgroup in the z-dimensional dimension. Compiling the third shuffle mask would involve assigning the value 1 to the next s least significant bits of the third shuffle mask (which do not overlap with those least significant bits of shuffle mask 501 or shuffle mask 502) to represent the maximum value of the z-coordinate. Typically, the value z a Bits m+p+a are assigned to the third shuffle mask.
[0111] Shuffle masks 703 and 704 are calculated for workgroup 301 with work item indices allocated using the Morton order (304). As mentioned above, the two bits required to represent the maximum value of the x-coordinate can be represented as x0x1. Unlike work item indices allocated using a linear order, for the Morton order (304), two bits are allocated to the alternating bits of the shuffle mask 701. The first bit x o The least significant bit of the shuffle mask 703 is assigned to the second bit, x1. The third least significant bit of the shuffle mask 703 is assigned to the third least significant bit. Therefore, bits 0 and 2 of the shuffle mask 703 are assigned the value 1. The remaining bits in the shuffle mask 703 are assigned the value 0. In other words, the first shuffle mask is in the form 00000000x10x0.
[0112] The two bits needed to represent the maximum value of the y-coordinate can be represented as y0 and y1. These two bits are assigned to alternating bits of the shuffle mask 704. For both linear and Morton order, the first and second shuffle masks have no common bits with a value of 1. Therefore, the first bit y0 is assigned to the second least significant bit of the shuffle mask 704. The second bit y1 is assigned to the fourth least significant bit of the shuffle mask 704. Thus, bits 1 and 3 of the shuffle mask 704 are assigned the value 1. The remaining bits in the shuffle mask 704 are assigned the value 0. In other words, the second shuffle mask is of the form 0000000y10y00.
[0113] In a general sense, for the Morton work item index, the even-numbered bits 0, 2, 4, etc., of the first shuffle mask are each assigned the value of the bits needed to represent the maximum value of the first coordinate. The least significant bit x0 is assigned to the least significant bit (bit 0) of the shuffle mask 703. For example, when the first coordinate is the x-coordinate, bit 0 of the shuffle mask is assigned the value of x0, and bit 2 of the shuffle mask is assigned the value of x1. It should be understood that for larger work items that require more than two bits to represent the maximum value of the first coordinate, this pattern can be extended, for example, bit 4 is assigned the value of x2, bit 6 is assigned the value of x3, etc. More generally, x a The value is assigned to bit 2a of the first shuffle mask. Calculating the first shuffle mask involves assigning a first binary value to the m least significant even bits of the first shuffle mask, where m is the number of bits required to represent the maximum value of the first coordinate of the work item in the work group; and assigning a second binary value to the remaining bits of the first shuffle mask, where the first binary value is different from the second binary value.
[0114] The odd-numbered bits 1, 3, 5, etc., of the second shuffle mask are each assigned the value of the bit required to represent the maximum value of the second coordinate. The least significant bit y0 is assigned to the second least significant bit (bit 1) of the shuffle mask 704. For example, when the second coordinate is a y-coordinate, bit 1 of the shuffle mask is assigned the value of y0, and bit 3 of the shuffle mask is assigned the value of y1. It should be understood that for larger workgroups that require more than two bits to represent the maximum value of the second coordinate, this pattern can be extended, for example, bit 5 is assigned the value of y2, bit 7 is assigned the value of y3, etc. More generally, y a The value is assigned to bit 2a+1 of the second shuffle mask. Calculating the second shuffle mask involves assigning a first binary value to the p least significant odd bits of the second shuffle mask, where p is the number of bits required to represent the maximum value of the second coordinate of the work item in the work group; and assigning a second binary value to the remaining bits of the second shuffle mask.
[0115] It should be understood that, for work item indices in the Morton order, this pattern of assigning values of 1 to bits of the shuffle mask can be extended for workgroups with n dimensions, where compressing work item coordinate data can include computing n shuffle masks, each shuffle mask indicating which bits of the shuffle index of each work item in the workgroup correspond to the value of the nth coordinate of said work item. For example, for a three-dimensional (3D) workgroup, as explained in more detail below, compressing work item coordinate data can include computing three shuffle masks. The third shuffle mask can be computed based on the size of the linear workgroup in the z-dimension. For example, for a workgroup with three dimensions, the x-coordinate can be calculated as follows: a The value is assigned to bit 3a of the first shuffle mask, which can make y a The value is assigned to bit 3a+1 of the second shuffle mask, and z can be... a The value is assigned to bit 3a+2 of the third shuffle mask.
[0116] Returning to method 401 corresponding to example workgroup 201, method 401 further includes sending compressed work item coordinate data across interface 106 between computation request unit 104 and computation sequencing unit 105. Sending compressed work item coordinate data includes sending a work item validity mask 501 and a first shuffle mask 601 and a second shuffle mask 602 across the interface to the computation sequencing unit (105).
[0117] The method may include sending a first shuffle mask and a second shuffle mask only once across the interface for each workgroup. The method may also include sending a work item valid mask only once for each workgroup. However, if a workgroup includes more efficient work items than the work item valid mask can indicate, more than one work item valid mask may be sent across the interface for each workgroup. Therefore, for workgroups including more than a threshold number of work items, at least one additional work item valid mask may be created and sent across the interface. The method may include creating another work item valid mask based on the number of work items in the workgroup and the orientation of the work items in the workgroup, and sending the other work item valid mask across the interface to the computational sequencing unit.
[0118] As mentioned earlier, the work item validity mask 501 comprises 64 bits, thus indicating a maximum of 64 valid work items. Therefore, if the work group for which the work item validity mask is created contains more than 64 valid work items, such as 100 work items, a second work item validity mask needs to be created. Therefore, these two work item validity masks are sent to the compute request unit across the interface. In other words, the threshold number of work items can be 64.
[0119] By sending at least one valid mask for each work item, a first shuffle mask, and a second shuffle mask across interfaces instead of the coordinates of each work item, the number of transactions between the computation request unit 102 and the processing logic 103 can be reduced. According to one example, the number of transactions required for a workgroup with 128 instances is reduced from 128 to 5. Therefore, this can significantly increase the execution rate of the instances.
[0120] Upon receiving the compressed work item coordinate data, processing logic 103 can calculate the coordinates of each work item to be executed. The compressed work item coordinate data includes the work item validity mask and shuffling mask sent across the interface. The compressed work item coordinate data is received and decompressed by processing logic 103.
[0121] exist Figure 8 The diagram illustrates a method for receiving compressed work item coordinate data of work items in a workgroup and decompressing the compressed work item coordinate data at an interface between a computation request unit and a computation sequencing unit. Method 801 includes receiving a work item validity mask (802), a first shuffle mask, and a second shuffle mask (804, 805) from the computation request unit; calculating a shuffle index for each valid work item in the workgroup, as indicated by the work item validity mask (803); determining a first coordinate of the valid work item based on the first shuffle mask and the shuffle index calculated for each valid work item (806); and determining a second coordinate of the valid work item based on the second shuffle mask and the shuffle index calculated for each valid work item (807). Method 801 is executed by processing logic 103, which includes a computation sequencing unit 104 and a computation execution unit 105.
[0122] Returning to this example, the computation sequencing unit 104 of processing logic 103 receives a first shuffle mask 601, a second shuffle mask 602, and a work item validity mask 501 from computation request unit 102. The first step performed by processing logic 103 to decompress the data received across the interface is to compute the shuffle index of each valid work item in the workgroup.
[0123] As previously mentioned Figure 2 Each work item 202 may be associated with a work item index 203, which indicates the order of work items in a work group. Figure 9 The same workgroup 201 and associated work item index 203 are shown. Figure 9 A shuffle index 901 associated with each work item in work group 201 is also shown. Each work item in the work group can be identified by a shuffle index.
[0124] Each work item 202 in workgroup 201 is associated with a shuffle index 901 (901a to 901h). The number of shuffle indices 901 equals the number of work items in the workgroup. Figure 9 In the example, there are eight shuffle indexes 901 associated with the workgroup. Figure 9 In the example shown, shuffle index 901a is 0 and is associated with work item 202a. Shuffle index 901h is 7 and is associated with work item 202h. In other words, each shuffle index corresponds to a single work item within the workgroup.
[0125] As mentioned, the number of distinct work item positions within workgroup 201 in the first dimension is equal to 2. Therefore, the number of distinct work item positions within workgroup 201 in the first dimension is a power of 2. For workgroups where the number of distinct work item positions within the workgroup in the first dimension is a power of 2, calculating the shuffle index for each valid work item involves setting the shuffle index to be equal to the work item index of the valid work item. Figure 9 In the example shown, the shuffle index of each work item in the workgroup is the same as the work item index of that work item. The shuffle index of each work item is equal to the work item index of that work item. It should be noted that, for ease of understanding, Figure 9 The shuffle index 901 shown is represented as a decimal integer, but it can also be represented as a binary value. (As considered...) Figure 8 It will become obvious that the system will process the shuffle index as a binary value.
[0126] As will be explained in more detail below, the shuffle index may not be equal to the work item index of all work items in the workgroup, based on other examples where the number of different work item positions within the workgroup in the first dimension is not a power of 2.
[0127] After the computation sequencing unit 104 calculates the shuffle index for each valid work item indicated by the work item validity mask, the computation request unit 104 can send the shuffle index 901 along with the first shuffle mask 601 and the second shuffle mask 602 to the computation execution unit 105. The computation sequencing unit 104 can be configured to calculate the shuffle index and send it to the computation execution unit 105, with a maximum of 16 instances per clock cycle. The shuffle index can be stored in the memory of the computation execution unit 105 at the instance granularity.
[0128] Upon receiving the shuffle index and shuffle mask, the calculation execution unit 105 determines the first coordinates of the valid work item based on the first shuffle mask and the shuffle index calculated for each valid work item, and determines the second coordinates of the valid work item based on the second shuffle mask and the shuffle index calculated for each valid work item.
[0129] Figure 10 The process of determining the first and second coordinates of a specific work item 202h is shown. Figure 11The first shuffle mask 601, the second shuffle mask 602, and the shuffle index 901h of work item 202h are shown. The system processes the shuffle index as a binary value, and therefore shuffle index 901h (in...) Figure 9 The value shown as 7 is shown as the use of Figure 10 The three digits 111 in the text represent this.
[0130] Figure 10 Bit string 1001 represents the first coordinate of work item 202h. Bit string 1002 represents the second coordinate of work item 202h. The first shuffle mask 601 indicates which bit(s) from shuffle index 901h will be considered the first coordinate 1001 of work item 202h. The first shuffle mask 601 indicates that the first coordinate 1001 is equal to bit 0 of shuffle index 901h. The second shuffle mask 602 indicates which bit(s) from shuffle index 901h will be considered the second coordinate 1002 of work item 202h. The second shuffle mask 602 indicates that the second coordinate 1002 is equal to bits 1 and 2 of shuffle index 901h. In other words, the shuffle index is a bit string corresponding to a work item, where one or more bits in the string correspond to the value of the first coordinate of the work item, and one or more (other) bits in the string correspond to the value of the second coordinate of the work item.
[0131] therefore, Figure 10 The binary value of the first coordinate is shown to be 1, while the binary value of the second coordinate is 11. Therefore, for work item 202h, the resulting coordinates are (1,3).
[0132] Figure 11 This process, which uses shuffle index 901 and first shuffle mask 601 and second shuffle mask 602 to expand and determine the first and second coordinates, is shown for each work item in work group 201. Figure 11 This illustrates how 3 bits can be used to represent each shuffle index 901 of the workgroup when the system processes the shuffle index as a binary value.
[0133] The first coordinate of a valid work item is determined by the value represented by the bits of the shuffle index of the valid work item, as indicated by a first shuffle mask. In other words, the first shuffle mask indicates which(s) of the shuffle index will be used to determine the first coordinate of the work item. The bits of the shuffle index indicated by the first shuffle mask form the bit string of the first coordinate.
[0134] exist Figure 11In the example seen, the first shuffle mask 601 indicates which bits(s) from the shuffle index will be treated as the x-coordinate of the work item. Specifically, the bits of the first shuffle mask 601, assigned the value 1, indicate which bits of the shuffle index will be used as the x-coordinate of the work item. The bits of the second shuffle mask, assigned the value 1, indicate which bits of the shuffle index will be used as the y-coordinate of the work item. Figure 11 In the example shown, the first shuffle mask 601 has a value of 1 at bit 0. The second shuffle mask 602 has values of 1 at bits 1 and 2.
[0135] The first shuffle mask 601 indicates the least significant bit of the shuffle index of the work item, i.e., bit 0 forms the bit string of the x-coordinate of the work item. Therefore, for Figure 11 The x-coordinate of work item 202a, as seen in the diagram, will be equal to bit 0 of the shuffle index 901a. Therefore, the x-coordinate of work item 202a will be determined as 0 (00). 0 Based on the previous example, for work item 202h, the x-coordinate of work item 202h will be equal to bit 0 of shuffle index 901h. Therefore, the x-coordinate of work item 202h will be determined as 1 (11 1 ).
[0136] The second coordinate of a valid work item is determined by the value represented by the bits of the shuffle index of that valid work item, as indicated by a second shuffle mask. In other words, the second shuffle mask indicates which bits(s) from the shuffle index will be used to determine the second coordinate of the work item. The bits of the shuffle index indicated by the second shuffle mask form the bit string of the second coordinate.
[0137] exist Figure 11 In the example seen, the second shuffle mask 602 indicates which bits(s) from the shuffle index will be treated as the y-coordinate of the work item. Specifically, the bits of the second shuffle mask, assigned the value 1, indicate which bits of the shuffle index will be used as the y-coordinate of the work item. Figure 11 In the example seen, the second shuffle mask 602 has a value of 1 at bits 1 and 2.
[0138] The second shuffle mask 602 indicates the second and third least significant bits of the shuffle index of the work item, i.e., bits 1 and 2 will be regarded as the values of the y-coordinate of the work item. Therefore, for Figure 11 The work item 202a seen in the image will have its y-coordinate equal to bits 1 and 2 of the shuffle index 901a. Therefore, the y-coordinate of work item 202a will be determined as 0. 00 0). Following the previous example, for work item 202h, the y-coordinate of work item 202h will be equal to bits 1 and 2 of the shuffle index 901h. Therefore, the y-coordinate of work item 202h will be determined to be 3 ( 11 1).
[0139] This method is used to determine the first and second coordinates of each work item in the work group. Figure 11 In the example shown, the coordinates of all eight valid work items 202a to 202h in workgroup 201 are determined. After the calculation execution unit 105 determines the coordinates of each valid work item in the workgroup, the calculation execution unit 105 accesses the valid work item at the determined coordinates and performs the calculation for the valid work item. In other words, the method includes, for each valid work item in the workgroup, accessing the valid work item at first and second coordinates and performing the calculation for the valid work item.
[0140] The computation sequencing unit 104 can be configured to compute the shuffle index and send it to the execution unit 105, up to 16 instances per clock cycle. Therefore, the computation execution unit 105 requires 9 cycles to serve one task consisting of 128 instances. In other words, after 9 cycles, the computation execution unit 105 will have the work item coordinates required for 128 instances. Using the previous method of sending work item coordinate data for each work item, at least 128 cycles would be required to collect the work item coordinates required for 128 instances. It should be understood that this method therefore significantly improves the scheduling and execution rate of instances.
[0141] It should be understood that, for the example described so far, the work item coordinate data of all work items 202 in workgroup 201 is compressed and sent across interface 106. All work items 202a to 202h in workgroup 201 will be sent to the computational sequencing unit to be used as part of the computational workload. In other words, in the described example, all work items 202a to 202h in the workgroup are valid work items.
[0142] Figure 12 Workgroup 1201, which has the same dimensions as workgroup 201 previously described, is shown. Workgroup 1201 also includes eight work items 1202. However, not all eight work items 1202 in workgroup 1201 are valid work items. Invalid work items are indicated by shading. Work items 1202a, 1202b, 1202c, 1202e, 1202f, and 1202h are valid work items. Work items 1202d and 1202g are invalid work items. Therefore, information about the coordinates of work items 1202d and 1202g is not compressed and is not sent across the interface to processing logic 103.
[0143] For workgroups that contain both valid and invalid work items, a work item validity mask will be created to reflect this.
[0144] Figure 12 The valid mask for the work item is shown as 1203. Figure 12The work item validity mask 1203 seen in the example comprises 64 bits. Therefore, the work item validity mask 1203 indicates a maximum of 64 valid work items in the workgroup. According to another example, the work item validity mask can indicate more or fewer work items in the workgroup.
[0145] The work item validity mask indicates the valid work items in a workgroup. Valid work items are those work items from the workgroup required to perform the desired task or instance as part of the desired computation workload. In other words, valid work items are those work items whose data will be sent across interfaces from the computation request unit to the computation sequencing unit. Therefore, the valid work item mask indicates which work items from the workgroup will be sent to the computation sequencing unit as part of the computation workload.
[0146] The work item validity mask is created based on the number of work items in a workgroup and their orientation within the workgroup. Specifically, the work item validity mask can be created based on the orientation of the valid work items within the workgroup. Creating a work item validity mask may involve assigning a value of 1 to each bit of the work item validity mask corresponding to the position of the valid work item within the workgroup.
[0147] Workgroup 1201 comprises eight work items. Workgroup 1201 includes six active work items. The active work items in workgroup 1201 do not form a single contiguous group of work items. Therefore, the work item active mask 1203 created for workgroup 1201 contains 6 bits, which have been assigned the value 1. The remaining 58 bits have been assigned the value 0.
[0148] Based on this example, not all work items 1202a through 1202h in workgroup 1201 are valid work items. Creating a work item validity mask involves assigning a value of 1 to each bit of the work item validity mask corresponding to the position of a valid work item in the workgroup. Figure 12 Work item indices 1204, assigned to each work item in workgroup 1201, are also shown, as previously described. It should be understood that the value of the work item index corresponds to the bit value of each bit in the work item validity mask 1203. When a work item with a work item index equal to the number of bits in the validity mask is a valid work item, the bits in the work item validity mask are assigned the value 1. Figure 12 In the example shown, work items 1202a, 1202b, 1202c, 1202e, 1202f, and 1202h are valid work items. These work items have work item indices 0, 1, 2, 4, 5, and 7. Therefore, bits 0, 1, 2, 4, 5, and 7 of the work item valid mask are assigned the value 1. The remaining bits of the work item valid mask are assigned the value 0. The shuffle mask for work group 1201 is calculated using the linear order described above.
[0149] In the example described herein, a task can contain up to 128 instances from up to 8 workgroups. Therefore, a work item validity mask can indicate valid work items from up to eight different workgroups.
[0150] As previously described, the cross-interface 106 sends compressed work item coordinate data, including sending a work item valid mask 1201, a first shuffle mask 601, and a second shuffle mask 602 to the calculation and sequencing unit 104. The compressed work item coordinate data is received and decompressed by the processing logic 103.
[0151] Return to Figure 12 In the example shown, the computation sequencing unit 104 of processing logic 103 receives a first shuffle mask 601, a second shuffle mask 602, and a work item validity mask 1201 from the computation request unit 102. The first step performed by processing logic 103 to decompress the data received across the interface is to compute the shuffle index of each valid work item in the workgroup. Valid work items in the workgroup are indicated by the work item validity mask 1201. Therefore, the computation sequencing unit computes the shuffle index of each valid work item, as indicated by the work item validity mask. The number of distinct work item positions within workgroup 1201 in the first dimension is a power of 2. Therefore, computed to compute the shuffle index of each valid work item 1202 includes setting the shuffle index to be equal to the work item index 1204 of the valid work item. Thus, for workgroup 1201, the shuffle index of each work item 1202 in workgroup 1201 is the same as the work item index 1204 of the work item. The shuffle index of each work item is equal to the work item index of the work item.
[0152] After the calculation sequencing unit 104 calculates the shuffle index of each valid work item indicated by the work item validity mask 1203, the calculation request unit 104 can send the shuffle index 901 together with the first shuffle mask 601 and the second shuffle mask 602 to the calculation execution unit 105. Upon receiving the shuffle index and the shuffle mask, the calculation execution unit 105 determines the first coordinate of the valid work item based on the first shuffle mask and the shuffle index calculated for each valid work item, and determines the second coordinate of the valid work item based on the second shuffle mask and the shuffle index calculated for each valid work item, as described above.
[0153] It should be understood that workgroups 201 and 1201 mentioned above have two different work item positions within the workgroup in the first dimension (x-dimension). Therefore, workgroup 201 has multiple different work item positions within the workgroup in the first dimension, the number of which is a power of 2. For workgroups where the number of different work item positions within the workgroup in the first dimension is a power of 2, the methods for compressing work item coordinate data and sending compressed work item coordinate data across interfaces, receiving compressed work item coordinate data, and decompressing the data are as described above.
[0154] For work item indexes that use linear ordering and where the number of distinct work item positions within the work group on the first dimension is not a power of 2, a slightly different approach is used. This approach may be referred to as the linear correction mode in this paper.
[0155] Figure 13 Workgroup 1301, comprising multiple work items 1302, is shown. Figure 13 In the example seen, work group 1301 includes twelve work items 1302a to 1302l. Figure 13 The workgroup 1302 seen in the image is a two-dimensional workgroup. Workgroup 1302 has a first dimension. In the following example, the first dimension is the x-dimensional dimension. Workgroup 1302 has a second dimension. In the following example, the second dimension is the y-dimensional dimension.
[0156] like Figure 13 As shown, each work item has a set of coordinates corresponding to its position within the work group. There are twelve distinct work item positions in work group 1301. For example, work item 1302a has coordinates (0,0). Work item 1302l has coordinates (2,3). The first coordinate of a work item indicates its position within the work group in the first dimension. The second coordinate of a work item indicates its position within the work group in the second dimension. The size of the first dimension is equal to the number of distinct work item positions within the work group in the first dimension. The size of the second dimension is equal to the number of distinct work item positions within the work group in the second dimension. Figure 13 The workgroup 1301 seen in the image has a first dimension of 3. There are three distinct work item positions in the x-axis. Workgroup 1301 also has a second dimension of 4. There are four distinct work item positions in the y-axis.
[0157] Figure 13 The work item validity mask 1303 created for work item 1302 in work group 1301 is shown. Figure 13 The work item validity mask 1303 seen in the example comprises 64 bits. Work item validity mask 1303 is determined in the same manner as the previously described work item validity mask 501. Creating a work item validity mask may include assigning the value 1 to each bit of the work item validity mask corresponding to the position of a valid work item in the work group. Work group 1301 comprises twelve work items. Therefore, the work item validity mask 1303 created for work group 1001 contains 12 bits, which have been assigned the value 1. The remaining 52 bits are assigned the value 0. According to this example, all work items 1302a to 1302l in work group 1301 are valid work items. Therefore, valid work items 1302a to 1302l form a consecutive work item group. Therefore, creating work item validity mask 1301 includes assigning the value 1 to the q least significant bits of the work item validity mask. Figure 10In the example shown, q equals 12, which is the number of valid work items in the workgroup.
[0158] Based on previous examples related to Working Group 201, compressing work item coordinate data also includes calculating a shuffling mask. Figure 13 The first shuffle mask 1304 and the second shuffle mask 1305 are shown.
[0159] The shuffling mask 1304 is calculated based on the size of workgroup 1301 in the first dimension (x dimension). The size of workgroup 1301 in the first dimension is three.
[0160] The shuffle mask 1304 is also calculated based on the order in which work item indices are assigned to workgroups. In this example, workgroup indices are assigned to workgroup 1301 in a linear order. Therefore, shuffle masks 1304 and 1305 are calculated in a similar manner to the previously described shuffle masks 601, 602, 701, and 702. However, workgroup 1301 comprises three columns, meaning the number of distinct work item positions in the first dimension is three. Therefore, the number of distinct work item positions within the workgroup in the first dimension is not a power of 2 for workgroup 1301. Typically, for workgroups where the number of distinct work item positions within the workgroup in the first dimension is not a power of 2, the first shuffle mask is calculated as if the number of distinct work item positions within the workgroup in the first dimension is the next power of 2 greater than the actual number of distinct work item positions. Therefore, calculating the first shuffle mask involves determining the augmentation size of the workgroup in the first dimension to be both a power of 2 and greater than the minimum value of the number of distinct work item positions within the workgroup in the first dimension.
[0161] For workgroup 1301, the next power of 2 greater than the actual number of distinct work item positions is four. In other words, the first shuffle mask is generated as if the workgroup had four distinct work item positions in the first dimension. The augmentation size of workgroup 1301 in the first dimension is 4.
[0162] Calculating the first shuffle mask typically involves assigning the value 1 to the m least significant bits of the first shuffle mask, where m is the number of bits required to represent the maximum value of the first coordinate of the work item in the workgroup, and assigning the value 0 to the remaining bits of the first shuffle mask. In this example where the workgroup's augmentation size is four in the first dimension, the maximum value of the first (x) coordinate of the work item is three. Therefore, 2 bits are required to represent this maximum value. Thus, in shuffle mask 1304, two least significant bits have been assigned the value 1. In other words, in this example, m = 2. The remaining bits have been assigned the value 0. The maximum value of the first coordinate of the work item in the augmented workgroup is equal to r - 1, where r is the number of distinct work item positions within the workgroup in the first dimension. In this example, the number of distinct work item positions within workgroup 1301 in the first (x) dimension (the augmentation size of the workgroup in the first dimension) is four. Therefore, the maximum value of the first coordinate of the work item in the workgroup is equal to 3.
[0163] The shuffling mask 1305 is calculated based on the size of workgroup 1301 in the second dimension (y-dimension). The size of workgroup 1301 in the first dimension is four.
[0164] Calculating the second shuffle mask 1305 includes assigning the value 1 to a set of p consecutive bits of the second shuffle mask, where p is the number of bits required to represent the maximum value of the second coordinate of the work item in the work group, and wherein the least significant bit in the set of p consecutive bits is the (m+1)th least significant bit of the second shuffle mask; and assigning the value 0 to the remaining bits of the second shuffle mask.
[0165] For work item 1302 in work group 1301, the maximum value of the second (y) coordinate is 3, such as Figure 13 As shown. Therefore, 2 bits are needed to represent this maximum value. Therefore, in the second shuffle mask 1305, p = 2. Therefore, the shuffle mask 1305 contains a set of two consecutive bits assigned the value 1. The least significant bit in the set of two consecutive bits is the third least significant bit of the second shuffle mask (because m = 2). The remaining bits of the second shuffle mask are assigned the value 0. The value 1 is given to the least significant bit in the second shuffle mask that is not the same bit with the value 1 in the first shuffle mask. In other words, the first and second shuffle masks do not have any common bits with the value 1. The maximum value of the second coordinate of the work item in the work group is equal to z-1, where z is the number of different work item positions in the work group in the second dimension. In this example, the number of different work item positions in work group 1301 in the second (y) dimension is 4. Therefore, the maximum value of the second coordinate of the work item in work group 1001 is equal to 3.
[0166] As previously discussed, the method further includes sending compressed work item coordinate data across interface 106 between computation request unit 104 and computation sequencing unit 105. Sending compressed work item coordinate data corresponding to work item 1302 includes sending a work item validity mask 1303 and a first shuffle mask 1304 and a second shuffle mask 1305 to the computation sequencing unit across the interface.
[0167] The computation sequencing unit 104 of the processing logic 103 receives a first shuffle mask 1304, a second shuffle mask 1305, and a work item validity mask 1303 from the computation request unit 102. The first step performed by the processing logic 103 to decompress the data received across the interface is to compute the shuffle index of each valid work item in the work group 1301.
[0168] As previously mentioned, each work item 1302 can be associated with a work item index 1401, which indicates the order of work items in a work group. Figure 14 The diagram shows how to assign work item indices for workgroup 1301 using either linear or Morton order. Figure 14 The same workgroup 1301 and the associated work item indexes assigned using linear order 1401 and work item indexes assigned using Morton order 1403 are shown.
[0169] As previously stated, for a workgroup where the number of distinct work item positions within the workgroup in the first dimension is a power of 2, calculating the shuffle index for each valid work item involves setting the shuffle index to be equal to the work item index of that valid work item. However, for a workgroup where the number of distinct work item positions within the workgroup in the first dimension is not a power of 2, the shuffle index may not be equal to the work item indices of all work items in the workgroup.
[0170] Group 1301 has three distinct work item positions in the first (x) dimension. Therefore, the number of distinct work item positions of group 1301 within the group in the first dimension is not a power of 2. Thus, since the number of distinct work item positions of group 1301 within the group in the first dimension is not a power of 2, a corrected pattern can be used to assign shuffle indices. The shuffle indices can be obtained by applying a shuffle function to the x and y coordinates and a shuffle mask. The inverse function of the shuffle function can be used to obtain the work item coordinates from the shuffle indices and the shuffle mask. A more specific method for determining shuffle indices using a corrected pattern is described below.
[0171] For work item indexes that use linear ordering (e.g., 1401), shuffle indexes (1402) are assigned using linear correction mode. Figure 14The shuffle index 1402 assigned using a linear correction mode is shown. Each work item in a workgroup can be identified using a shuffle index. Each work item 1302 in workgroup 1301 is associated with a shuffle index 1402 (1402a to 14012l). The number of shuffle indices 1402 is equal to the number of work items in the workgroup. Figure 14 In the example, there are twelve shuffled indexes 1402 associated with workgroups. Figure 14 In the example shown, shuffle index 1402a is 0 and is associated with work item 1302a. Shuffle index 1402l is 14 and is associated with work item 1302l.
[0172] Since the number of distinct work item positions within workgroup 1301 in the first dimension is not a power of 2, the shuffle index may not be equal to the work item indices of all work items in the workgroup. For one or more valid work items in the workgroup, a shuffle index is calculated for each valid work item such that it is not equal to the work item index of that valid work item. Figure 14 As shown, for the work items in the first row of the workgroup (y=0), the shuffle index is equal to the work item index of those work items. Shuffle indices 1402a, 1402b, and 1402c are equal to work item indices 1401a, 1401b, and 1401c, respectively. However, for the work items in the second, third, and fourth rows of the workgroup (y=1, y=2, y=3), the shuffle index is not equal to the work item index of those work items.
[0173] On the contrary, Figure 14 In the example shown, each work item in the first column (x = 0) is assigned a shuffled index that is a multiple of 4. More generally, the maximum value of the first x-coordinate in the work group is x. max greater than x max The least power of two can be represented as K. Then, each work item in the first column (x = 0) is assigned a shuffled index that is a multiple of K. Figure 14 In the example shown, x max =2 and K=4. For row Y of the work group, the work items in the first column (x=0) are assigned a shuffle index equal to YK, and the other work items in this row are assigned a shuffle index that increases consecutively from the shuffle index of the work items in the first column.
[0174] More generally, for workgroup 1301, this technique can be thought of as assigning the shuffled index to each of the three columns of the workgroup in a linear order, as if the workgroup contained four columns. In other words, the shuffled index is assigned to each work item as if the number of distinct work item positions within the workgroup in the first dimension is a power of two greater than the actual number of distinct work item positions. According to this example, workgroup 1301 has three distinct work item positions in the first dimension, and the shuffled index is assigned as if the workgroup had four distinct work item positions in the first dimension (where the fourth work item position in each row is missing).
[0175] For work item indexes allocated using Merton order (e.g., 1403), a shuffled index is allocated using the Merton correction pattern (1404). For workgroups with work item indexes allocated using Merton order, the shuffled index is allocated using the Merton correction pattern when the number of distinct work item positions within the workgroup in the first dimension or the number of distinct work item positions within the workgroup in the second dimension is not equal to a power of 2. More generally, for workgroup 1301, the Merton correction pattern technique can be considered as allocating the shuffled index to each of the three columns of the workgroup using Merton order, as if the workgroup contained four columns. In other words, the shuffled index is allocated to each work item as if: (i) the number of distinct work item positions within the workgroup in the first dimension is a power of 2 greater than or equal to the next (i.e., minimum) power of 2 of the actual number of distinct work item positions within the workgroup in the first dimension, and (ii) the number of distinct work item positions within the workgroup in the second dimension is a power of 2 greater than or equal to the next (i.e., minimum) power of 2 of the actual number of distinct work item positions within the workgroup in the second dimension. Based on this example, workgroup 1301 has three distinct work item positions in the first dimension, and is assigned a shuffle index in the same way that workgroup has four distinct work item positions in the first dimension (where the fourth work item position in each row is missing).
[0176] For both the linear correction mode and the Morton correction mode, when the number of distinct work item positions within a workgroup in the first dimension is not a power of two, the shuffle index of each work item is calculated to be equal to the work item index of that work item in a reference workgroup, which has an augmented size. The number of distinct work item positions in the reference workgroup in the first dimension is equal to the next power of two greater than the number of distinct work item positions within the workgroup in the first dimension. In other words, the augmented size includes the number of distinct work item positions in the first dimension, which is equal to the next power of two greater than the number of distinct work item positions within the workgroup in the first dimension.
[0177] The shuffling mask for the Merton correction mode is calculated based on the order in which the work item indexes are assigned to work groups. Therefore, the shuffling mask for work item 1403 indexed using the Merton order is calculated in a similar manner to the previously described shuffling masks 703 and 704. However, for work groups where the number of distinct work item positions within the work group in the first dimension is not a power of 2, the first shuffling mask is calculated as if the number of distinct work item positions within the work group in the first dimension is a power of 2 greater than the actual number of distinct work item positions within the work group in the first dimension. Similarly, for work groups where the number of distinct work item positions within the work group in the second dimension is not a power of 2, the first shuffling mask is calculated as if the number of distinct work item positions within the work group in the second dimension is a power of 2 greater than the actual number of distinct work item positions within the work group in the second dimension. Therefore, calculating the first shuffling mask involves determining the amplification size of the work group in the first dimension to be a power of 2 that is also greater than the minimum number of distinct work item positions within the work group in the first dimension. Regarding the second shuffle mask, for a work group having a work item index assigned using the Morton order: (i) if the number of distinct work item positions of the work group within the work group in the first dimension is not a power of 2, then the second shuffle mask is computed as if the number of distinct work item positions of the work group within the work group in the first dimension is a power of 2 greater than the actual number of distinct work item positions within the work group in the first dimension, and (ii) if the number of distinct work item positions of the work group within the work group in the second dimension is not a power of 2, then the second shuffle mask is computed as if the number of distinct work item positions of the work group within the work group in the second dimension is a power of 2 greater than the actual number of distinct work item positions within the work group in the second dimension.
[0178] Returning to the linear correction mode example (work item index 1401 and shuffle index 1402), after the calculation request unit 104 calculates the shuffle index 1402 for each valid work item 1302 indicated by the work item validity mask, the calculation request unit 104 can send the shuffle index 1402 together with the first shuffle mask 1304 and the second shuffle mask 1305 to the calculation execution unit 105. Upon receiving the shuffle index and shuffle mask, the calculation execution unit 105 determines the first and second coordinates of each valid work item in the manner previously discussed.
[0179] The working groups described so far are two-dimensional (2D) working groups; however, the methods described can be applied equally to three-dimensional (3D) working groups, or even more generally to n-dimensional working groups. Figure 15 The three-dimensional working group 1501 is shown. Figure 15In the example shown, workgroup 1501 comprises sixteen work items 1502a to 1502p. Workgroup 1502 has a first dimension. In the following example, the first dimension is the x-dimensional. Workgroup 1502 has a second dimension. In the following example, the second dimension is the y-dimensional. The workgroup has a third dimension. In the following example, the third dimension is the z-dimensional.
[0180] Workgroup 1501 contains 16 distinct work item positions. For example, work item 1502a has coordinates (0,0,0). Work item 1502p has coordinates (1,3,1). The first coordinate of a work item indicates its position within the workgroup in the first dimension. The second coordinate indicates its position within the workgroup in the second dimension. The third coordinate indicates its position within the workgroup in the third dimension. The size of the first dimension is equal to the number of distinct work item positions within the workgroup in the first dimension. The size of the second dimension is equal to the number of distinct work item positions within the workgroup in the second dimension. The size of the third dimension is equal to the number of distinct work item positions within the workgroup in the third dimension. Figure 15 The workgroup 1501 seen in the image has a first dimension of 2. There are two distinct work item positions in the x-axis. Workgroup 1501 has a second dimension of 5. There are four distinct work item positions in the y-axis. Workgroup 1501 has a third dimension of 2. There are two distinct work item positions in the z-axis.
[0181] As previously mentioned Figure 7 As mentioned, for a workgroup with n dimensions, compressing work item coordinate data may include calculating n shuffle masks, each shuffle mask indicating which bits of the shuffle index of each work item in the workgroup correspond to the value of the nth coordinate of that work item. Each shuffle mask is calculated based on the size of the workgroup in one dimension and the order in which the work item indices are assigned to the workgroup. Figure 15 The example workgroup 1501 seen in the example uses a linear order to assign work item indices to the workgroup.
[0182] Therefore, 3D workgroups can be processed by generating and sending three shuffling masks. Thus, compressing work item coordinate data can include generating it using the previously described linear order method. Figure 15 The three shuffle masks 1503, 1504, and 1505 seen in the diagram. Therefore, all three shuffle masks 1503, 1504, and 1505 can be sent from the calculation request unit 104 to the calculation execution unit 105, and the calculation execution unit 105 can determine the first, second, and third coordinates of each valid work item in the manner previously discussed.
[0183] According to the present invention, a 3D workgroup can alternatively be processed by slicing it into 2D slices. The computation request unit 102 can slice the 3D workgroup into 2D slices. For example, a 3D workgroup 1501 can be sliced into two slices (z = 0, z = 1). In other words, work items 1502a to 1502h can form a first 2D slice. Work items 1502i to 1502p can form a second 2D slice. Each 2D slice of the workgroup can be processed in the same manner as previously described with respect to 2D workgroups, so that the x and y coordinates of each work item in the workgroup slice are compressed and subsequently decompressed. Using this method, the work item index associated with each work item in the workgroup will be used to indicate the order of the work items in the workgroup slice. Therefore, the number of work item indices is not equal to the number of work items in the workgroup. Figure 15 In the example shown, work item indices 0, 1, 2, 3, 4, 5, 6, and 7 will be associated with each slice of the 3D workgroup. Using this method, the x and y coordinates of each work item in workgroup 1501 are compressed and decompressed, with work items 1502a and 1502i associated with work item index 0. Work items 1502h and 1502p are associated with work item index 7.
[0184] When a 3D workgroup is sliced into 2D slices, only the shuffling masks 1503 and 1504 corresponding to the x and y coordinates can be calculated and sent to the computation execution unit 105. Based on this example, different methods can be used to send the z-coordinate of each work item in workgroup 1501 to the computation execution unit 105.
[0185] According to another example, the shuffling mask can be calculated relative to the x and z coordinates (1503 and 1505) or y and z coordinates (1504 and 1505) of the work items in the workgroup. When calculating the shuffling mask relative to the x and z coordinates of the work items, the y coordinates of the work items can be sent to the computation execution unit in different ways. When calculating the shuffling mask relative to the y and z coordinates of the work items, the x coordinates of the work items can be sent to the computation execution unit in different ways.
[0186] One approach to sending coordinates without a computed shuffle mask could involve sending these coordinates to the computation execution unit without performing any compression. For example, the z-coordinate of each work item in work group 1501 could be sent across the interface from computation request unit 102 to processing logic 103 without compression. This approach offers at least some of the advantages described above compared to conventional methods, which involve sending all three uncompressed coordinates of each work item across the interface.
[0187] As previously described, workgroups can be packaged into tasks to be executed at computation execution unit 105. When a 3D workgroup is sliced into 2D slices, more than one 2D slice can be packaged into a single task. Computation request unit 102 has the capability to accumulate up to eight distinct 2D slices in a task. According to a specific example, each task can contain up to 128 instances. According to this example, if a 2D slice contains more than 64 instances, only one slice can be packaged into a single task. However, if a 2D slice contains fewer than 65 instances, more than one 2D slice can be packaged into a single task. Work items from different 2D slices within a single task can be distinguished by their work item z-coordinate.
[0188] The computation request unit 102 can assign a base z-coordinate to all work items within a single workgroup. Furthermore, each slice within a workgroup is associated with its own z-coordinate. Therefore, a work item within a 2D slice will have a z-coordinate equal to the base z-coordinate of the workgroup plus the z-coordinate of the slice. Thus, for a task containing a single 2D slice of a workgroup, each work item in the task will have the same z-coordinate. For a task containing at least two different 2D slices, work items from different slices will have different z-coordinates. In this way, different 2D slices can be packaged into a single task.
[0189] The examples described herein relate to the compression and decompression of work item coordinates for work items associated with any type of data, such as graphic data that can be processed to generate image data.
[0190] It should be noted that the meaning of binary values (0 and 1) in a mask (e.g., a shuffle mask and a job item valid mask) can be switched in different implementations.
[0191] Figure 16 A computing system in which the GPU described herein can be implemented is illustrated. The computing system includes a CPU 1602, a GPU 1604, memory 1606, a neural network accelerator (NNA) 1608, and other devices 1614, such as a display 1616, a speaker 1618, and a camera 1622. A processing block 1610 is implemented on the GPU 1604. The processing block 1610 may include... Figure 1 The computing unit is shown in the diagram. In other examples, one or more of the depicted components may be omitted from the system, and / or the processing block 1610 may be implemented on the CPU 1602 or within the NNA 1608. Components of the computing system may communicate with each other via a communication bus 1620. Storage device 1612 is implemented as part of memory 1606.
[0192] Figure 1The computation request unit 102 and processing logic 103 (including the computation scheduling unit 104 and the computation execution unit 105) are shown as comprising multiple functional blocks. This is merely illustrative and is not intended to define a strict division between different logical elements of such entities. Each functional block can be provided in any suitable manner. It should be understood that intermediate values described herein as being formed by units of the GPU need not be physically generated by the GPU at any point, and may simply represent logical values that conveniently describe the processing performed by the GPU between its inputs and outputs.
[0193] The computing units described herein can be embodied as hardware on an integrated circuit. The computing units described herein can be configured to perform any of the methods described herein. Generally, any of the functions, methods, techniques, or components described above can be implemented in software, firmware, hardware (e.g., fixed logic circuitry), or any combination thereof. The terms “module,” “function,” “component,” “element,” “unit,” “block,” and “logic” are used herein to generally denote software, firmware, hardware, or any combination thereof. In the case of a software implementation, a module, function, component, element, unit, block, or logic represents program code that, when executed on a processor, performs a specified task. The algorithms and methods described herein can be executed by one or more processors that execute code that causes the processor to perform the algorithm / method. Examples of computer-readable storage media include random access memory (RAM), read-only memory (ROM), optical disk, flash memory, hard disk storage, and other memory devices that can use magnetic, optical, and other techniques to store instructions or other data and are accessible by a machine.
[0194] As used herein, the terms computer program code and computer-readable instructions refer to any kind of executable code for a processor, comprising code expressed in machine language, interpreted language, or scripting language. Executable code includes binary code, machine code, bytecode, code defining integrated circuits (e.g., hardware description languages or netlists), and code expressed in programming languages 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, or run in a virtual machine or other software environment, causes the processor of a computer system supporting the executable code to perform tasks specified by said code.
[0195] A processor, computer, or computing system can be any kind of device, machine, or special-purpose circuit, or a collection or part thereof, having processing capabilities that enable it to execute instructions. A processor can be or includes any kind of general-purpose or special-purpose processor, such as a CPU, GPU, NNA, system-on-a-chip, state machine, media processor, application-specific integrated circuit (ASIC), programmable logic array, field-programmable gate array (FPGA), etc. A computer or computing system may include one or more processors.
[0196] This invention is also intended to cover software (e.g., HDL (Hardware Description Language) software) that defines the configuration of hardware as described herein, said software for designing integrated circuits or for configuring programmable chips to perform desired functions. That is, a computer-readable storage medium may be provided having computer-readable program code encoded thereon in the form of an integrated circuit definition dataset, which, when processed (i.e., run) in an integrated circuit manufacturing system, configures the system to manufacture a computing system configured to perform any of the methods described herein, or to manufacture a computing system including any of the devices described herein. The integrated circuit definition dataset may, for example, be an integrated circuit description.
[0197] Therefore, a method for manufacturing a computing system as described herein can be provided at an integrated circuit manufacturing system. Furthermore, an integrated circuit definition dataset can be provided, which, when processed in the integrated circuit manufacturing system, enables the method for manufacturing the computing system to be executed.
[0198] Integrated circuit definition datasets can be in the form of computer code, such as netlists, code for configuring programmable chips, hardware description languages defining hardware suitable for manufacturing at any level in integrated circuits, including register-transfer level (RTL) code, high-level circuit representations (such as Verilog or VHDL), and low-level circuit representations (such as OASIS(RTM) and GDSII). Higher-level representations (e.g., RTL) that logically define hardware suitable for manufacturing in integrated circuits can be processed at a computer system configured to generate manufacturing definitions of integrated circuits within the context of a software environment that includes definitions of circuit elements and rules for combining those elements to generate the manufacturing definition of the integrated circuit so defined by the representation. As is typically the case where software executes at a computer system to define the machine, one or more intermediate user steps (e.g., providing commands, variables, etc.) may be required to configure the computer system to generate the manufacturing definition of the integrated circuit, executing code that defines the integrated circuit to generate the manufacturing definition of the integrated circuit.
[0199] Now refer to Figure 17This describes an example of processing an integrated circuit definition dataset at an integrated circuit manufacturing system in order to configure the system as a manufacturing computing system.
[0200] Figure 17 An example of an integrated circuit (IC) manufacturing system 1702 configured to manufacture the computing systems described in any of the examples herein is shown. Specifically, the IC manufacturing system 1702 includes a layout processing system 1704 and an integrated circuit generation system 1706. The IC manufacturing system 1702 is configured to receive an IC definition dataset (e.g., defining the computing systems described in any of the examples herein), process the IC definition dataset, and generate ICs based on the IC definition dataset (e.g., which embodies the computing systems described in any of the examples herein). The processing of the IC definition dataset configures the IC manufacturing system 1702 to manufacture integrated circuits embodying the computing systems described in any of the examples herein.
[0201] The layout processing system 1704 is configured to receive and process an IC definition dataset to determine a circuit layout. Methods for determining a circuit layout based on an IC definition dataset are known in the art and may involve, for example, synthesizing RTL code to determine a gate-level representation of the circuit to be generated, for example, in relation to logic components (e.g., NAND, NOR, AND, OR, MUX, and FLIP-FLOP components). By determining the location information of the logic components, the circuit layout can be determined from the gate-level representation of the circuit. This can be done automatically or with user intervention to optimize the circuit layout. Once the layout processing system 1704 has determined the circuit layout, it can output the circuit layout definition to the IC generation system 1706. The circuit layout definition may be, for example, a circuit layout description.
[0202] As is known in the art, IC generation system 1706 generates ICs according to a circuit layout definition. For example, IC generation system 1706 may implement a semiconductor device manufacturing process for generating ICs, which 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, which can be used in a photolithography process for generating ICs according to the circuit definition. Alternatively, the circuit layout definition provided to IC generation system 1706 may be in the form of computer-readable code, which IC generation system 1706 may use to form a suitable mask for generating ICs.
[0203] The various processes performed by the IC manufacturing system 1702 can all be implemented in one location, for example, by one party. Alternatively, the IC manufacturing system 1702 can be a distributed system, allowing some processes to be performed in different locations and by different parties. For example, some of the following stages can be performed in different locations and / or by different parties: (i) synthesizing RTL code representing an IC definition dataset to form a gate-level representation of the circuit to be generated, (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.
[0204] In other examples, processing of an integrated circuit definition dataset at an integrated circuit manufacturing system can configure the system to manufacture a computing system without processing the IC definition dataset to determine circuit layout. For example, an integrated circuit definition dataset can define the configuration of a reconfigurable processor such as an FPGA, and processing of the dataset can configure the IC manufacturing system (e.g., by loading the configuration data into the FPGA) to generate a reconfigurable processor with the defined configuration.
[0205] In some embodiments, when processed in an integrated circuit manufacturing system, an integrated circuit manufacturing definition dataset can enable the integrated circuit manufacturing system to generate devices as described herein. For example, the integrated circuit manufacturing definition dataset referenced above... Figure 14 The described method configures an integrated circuit manufacturing system to produce devices as described herein.
[0206] In some examples, the integrated circuit definition dataset may contain software running on hardware defined at the dataset, or software running in combination with hardware defined at the dataset. Figure 17 In the example shown, the IC generation system can be further configured by the integrated circuit definition dataset to load firmware onto the integrated circuit according to the program code defined at the integrated circuit definition dataset during the manufacturing of the integrated circuit, or otherwise provide the integrated circuit with program code for use with the integrated circuit.
[0207] Compared to known implementations, the concepts set forth in this application can improve performance in devices, apparatuses, modules, and / or systems (and in the methods implemented herein). Performance improvements may include one or more of increased computational performance, reduced latency, increased throughput, and / or reduced power consumption. During the manufacture of such devices, apparatuses, modules, and systems (e.g., in integrated circuits), trade-offs can be made between performance improvements and physical implementation methods, thereby improving manufacturing processes. For example, a trade-off can be made between performance improvements and layout area to match the performance of known implementations but using less silicon. This can be accomplished, for example, by reusing functional blocks serially or sharing functional blocks among elements of a device, apparatus, module, and / or system. Conversely, the concepts set forth in this application that cause improvements in the physical implementation of devices, apparatuses, modules, and systems (e.g., reduced silicon area) can be traded against performance improvements. This can be accomplished, for example, by manufacturing multiple instances of a module within a predefined area budget.
[0208] The applicant has independently disclosed each individual feature described herein, as well as any combination of two or more such features, to the extent that such features or combinations can be implemented based on the specification as a whole, in view of the common knowledge of those skilled in the art, regardless of whether such features or combinations of features solve any problem disclosed herein. In light of the foregoing description, those skilled in the art will understand that various modifications can be made within the scope of this invention.
Claims
1. A method for receiving compressed work item coordinate data of work items in a workgroup and decompressing the compressed work item coordinate data at an interface between a computation request unit and a computation sequencing unit, wherein each work item in the workgroup can be identified by a shuffle index, the method comprising: The calculation request unit receives a valid work item mask, which indicates the valid work items in the work group. Calculate the shuffle index for each valid work item in the work group, as indicated by the work item validity mask; The calculation request unit receives a first shuffle mask, the first shuffle mask indicating which bits of the shuffle index of each work item in the work group correspond to the value of the first coordinate of the work item; The calculation request unit receives a second shuffle mask, the second shuffle mask indicating which bits of the shuffle index of each work item in the work group correspond to the value of the second coordinate of the work item; The first coordinates of the valid work item are determined based on the first shuffle mask and the shuffle index calculated for each valid work item; as well as The second coordinates of the valid work item are determined based on the second shuffle mask and the shuffle index calculated for each valid work item.
2. The method of claim 1, wherein the workgroup has a first dimension, the first coordinate of the work item indicates the position of the work item in the workgroup in the first dimension; and wherein the workgroup has a second dimension, the second coordinate of the work item indicates the position of the work item in the workgroup in the second dimension.
3. The method according to any of the preceding claims, wherein each work item in the workgroup is associated with a work item index, the work item index indicating the order of work items in the workgroup.
4. The method of claim 3, wherein the number of different work item positions within the workgroup on the first dimension is a power of 2, and wherein for each valid work item in the workgroup, calculating the shuffle index of the valid work item comprises setting the shuffle index to be equal to the work item index of the valid work item.
5. The method of claim 3, wherein the number of different work item positions within the workgroup on the first dimension is not a power of two, and calculating the shuffle index of each work item at the first work item position on the first dimension includes setting the shuffle index of the work item to be equal to the work item index of the work item in the reference workgroup, wherein the number of different work item positions in the reference workgroup is equal to the next power of 2 greater than the number of different work item positions within the workgroup.
6. The method of claim 2 or 3, wherein the number of different work item positions within the workgroup on the first dimension is not a power of 2, and wherein for one or more of the valid work items in the workgroup, the shuffle index is calculated for the valid work item such that it is not equal to the work item index of the valid work item.
7. The method of claim 6, wherein the shuffle index is calculated for each valid work item such that the shuffle index of a valid work item having a first coordinate 0 and a second coordinate Y is determined to be YK, where K is greater than x. max The least power of 2, where x max It is the maximum value of the first coordinate of the work item in the work group.
8. The method according to any preceding claim, wherein determining the first coordinates of the valid work item based on the first shuffle mask and the shuffle index calculated for each valid work item comprises determining the first coordinates of the valid work item as a bit representation of the shuffle index of the valid work item indicated by the first shuffle mask.
9. The method according to any preceding claim, wherein determining the second coordinates of the valid work item based on the second shuffle mask and the shuffle index calculated for each valid work item comprises determining the second coordinates of the valid work item as a bit representation of the shuffle index of the valid work item indicated by the second shuffle mask.
10. The method according to any of the preceding claims, wherein the method includes receiving the first shuffle mask and the second shuffle mask only once for each workgroup.
11. The method of claim 2, wherein the workgroup has a third dimension, wherein a third coordinate of a work item indicates the position of the work item in the workgroup on the third dimension, and wherein the method comprises: Receive a third shuffle mask, which indicates which bits of the shuffle index of each work item in the work group correspond to the value of the third coordinate of the work item; as well as The third coordinate of a valid work item is determined by defining the third coordinate as a number represented by the bits of the shuffle index of the valid work item indicated by the third shuffle mask, based on the third shuffle mask and the shuffle index calculated for each valid work item.
12. The method according to any of the preceding claims, wherein the work item validity mask indicates a maximum of 64 valid work items of the work group.
13. The method according to any preceding claim, wherein for a workgroup comprising more than a threshold number of work items, the method includes: Receive another valid mask for a work item; as well as Calculate the shuffle index for each valid work item in the work group, as indicated by the work item validity mask or the other work item validity mask.
14. The method according to any preceding claim, wherein the method further comprises, for each valid work item in the work group, accessing the valid work item at the first and second coordinates and ordering the calculations of the valid work items.
15. Processing logic configured to receive compressed work item coordinate data of work items in a workgroup from a compute request unit across an interface and decompress the compressed work item coordinate data, wherein each work item in the workgroup can be identified by a shuffle index, the processing logic being configured to: The calculation request unit receives a valid work item mask, which indicates the valid work items in the work group. Calculate the shuffle index for each valid work item in the work group, as indicated by the work item validity mask; The calculation request unit receives a first shuffle mask, the first shuffle mask indicating which bits of the shuffle index of each work item in the work group correspond to the value of the first coordinate of the work item; The calculation request unit receives a second shuffle mask, the second shuffle mask indicating which bits of the shuffle index of each work item in the work group correspond to the value of the second coordinate of the work item; The first coordinates of the valid work item are determined based on the first shuffle mask and the shuffle index calculated for each valid work item; and The second coordinates of the valid work item are determined based on the second shuffle mask and the shuffle index calculated for each valid work item.
16. The processing logic according to claim 15, wherein the processing logic includes a computation sequencing unit and a computation execution unit, and the computation sequencing unit is configured to: The calculation request unit receives a valid work item mask, which indicates the valid work items in the work group. Calculate the shuffle index for each valid work item in the work group, as indicated by the work item validity mask; The calculation request unit receives a first shuffle mask, the first shuffle mask indicating which bits of the shuffle index of each work item in the work group correspond to the value of the first coordinate of the work item; and A second shuffle mask is received from the computation request unit, the second shuffle mask indicating which bits of the shuffle index of each work item in the workgroup correspond to the value of the second coordinate of the work item; and The computation execution unit is configured to: The first coordinates of the valid work item are determined based on the first shuffle mask and the shuffle index calculated for each valid work item; and The second coordinates of the valid work item are determined based on the second shuffle mask and the shuffle index calculated for each valid work item.
17. A computing system comprising: The processing logic according to claim 15 or 16; as well as The computation request unit is configured to: A work item validity mask is created based on the number of work items in the work group and the position of the work items in the work group. The work item validity mask indicates the valid work items in the work group. Calculate the first shuffle mask, which indicates which bits of the index of each work item in the workgroup correspond to the value of the first coordinate of the work item; Calculate the second shuffle mask, which indicates which bits of the index of each work item in the workgroup correspond to the value of the second coordinate of the work item; and The first and second shuffle masks and the work item validity mask are sent to the computation sequencing unit across the interface.
18. A non-transitory computer-readable storage medium having computer-readable code encoded thereon, the computer-readable code being configured to enable the method according to any one of claims 1 to 14 to be executed when the code is run.
19. A non-transitory computer-readable storage medium having an integrated circuit definition dataset stored thereon, the integrated circuit definition dataset configuring the integrated circuit manufacturing system to manufacture the processing logic according to claim 15 or 16 or the computing system according to claim 17 when processed in an integrated circuit manufacturing system.
20. A non-transitory computer-readable storage medium having stored thereon a computer-readable description of processing logic according to claim 15 or 16 or a computing system according to claim 17, wherein the computer-readable description, when processed in an integrated circuit manufacturing system, causes the integrated circuit manufacturing system to manufacture an integrated circuit embodying the processing logic or the computing system.
21. A method for manufacturing the processing logic according to claim 15 or 16 or the computing system according to claim 17 using an integrated circuit manufacturing system.