Method and device for scheduling thread bundles for data missing

By obtaining the historical missing cumulative scores of thread bundles in the parallel computing chip, and prioritizing the execution of high-scoring thread bundles, the problem of the locality and reusability of thread bundle data is solved, and the execution efficiency is improved.

CN120448049APending Publication Date: 2025-08-08YUANQIXIN (SHANDONG) SEMICONDUCTOR TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510335496.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-20
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

In the parallel computing chip, when the thread bundle is switched back and forth, when the cache is full, the data in the cache is written and evicted back and forth, resulting in serious damage to the data locality and reusability of the thread bundle, resulting in low execution efficiency.

Method used

By obtaining the historical missing cumulative score of the target cache data of the thread bundle to be dispatched, updating the current missing cumulative score, and determining priority execution of the thread bundle according to the score level, squeezing the cache space of the low-score thread bundle, and executing the high-score thread bundle first, avoiding data being evicted back and forth in the cache space.

Benefits of technology

Improves the locality and reusability of data in the cache space and improves the overall execution efficiency of thread bundles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448049A_ABST
    Figure CN120448049A_ABST
Patent Text Reader

Abstract

The invention provides a thread bundle scheduling method and device for data missing, and the method comprises the steps: obtaining a historical missing cumulative score of target cache data corresponding to a thread bundle to be scheduled from a score table through matching under the condition that a first cache space is full and the target cache data is memory access missing, updating the historical missing cumulative score, and storing the updated historical missing cumulative score in a database; obtaining a current missing accumulated score; and executing the to-be-scheduled thread bundle according to the current missing accumulated score. According to the method provided by the invention, the historical missing cumulative score of the target cache data corresponding to the to-be-scheduled thread bundle is obtained through matching from the score table, so that the current missing cumulative score is obtained through updating; according to the method, the to-be-scheduled thread bundle is executed according to the current missing cumulative score, so that the target cache data with relatively high current missing cumulative score is prevented from being evicted and accessed back and forth in the cache space, the locality and reusability of the data are improved, and the execution efficiency of the thread bundle is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for thread warp scheduling with data loss. Background Art

[0002] Parallel computing chips contain a large number of thread warps. This multi-threaded architecture introduces a new dimension to fine-grained hardware cache management. The order in which threads issue instructions in a system significantly affects the access flow seen by the cache system. Previous cache optimization research has focused on improving cache hierarchies, replacement, or insertion strategies. However, in parallel computing chips, during each scheduling cycle, the chip must determine which thread warps will execute instructions.

[0003] However, due to the large number of thread warps, when the thread warps switch back and forth, when the cache is full, the data in the cache is written and evicted back and forth, and the locality and reusability of the thread warp data are seriously damaged. It often happens that the cache of a thread warp is just evicted and then accessed, resulting in low execution efficiency of the thread warp. Summary of the Invention

[0004] The present invention provides a method and apparatus for scheduling warps with data loss, which are used to solve the defect in the prior art that the locality and reusability of warp data are severely damaged, resulting in low execution efficiency of the warp.

[0005] The present invention provides a thread warp scheduling method for data loss, comprising: Get the target cache data of the thread warp to be scheduled in the current scheduling cycle; When the first cache space is full and the target cache data is a memory miss, updating the historical miss cumulative score of the target cache data corresponding to the to-be-scheduled thread warp to obtain a current miss cumulative score of the target cache data; the historical miss cumulative score is obtained by matching the target cache data from a scoring table; the scoring table is obtained based on a frequency of successful matches between historical target cache data corresponding to the to-be-scheduled thread warp in a historical scheduling cycle and historical eviction data of the to-be-scheduled thread warp; According to the current missing cumulative score, a priority execution warp of the current scheduling period is determined from the to-be-scheduled warps, and scheduling is performed on the priority execution warp.

[0006] According to a warp scheduling method for data missing provided by the present invention, determining a priority warp for the current scheduling period from the warps to be scheduled according to the current cumulative missing score, and scheduling the priority warp, including: Determine the cache space ratio of the thread warp to be scheduled in the previous scheduling cycle; occupying a proportion of the cache space corresponding to the first to-be-scheduled thread warp to schedule the priority execution thread warp; The current cumulative missing score of the first to-be-scheduled warp is lower than the current cumulative missing score of the priority execution warp.

[0007] According to a warp scheduling method for data loss provided by the present invention, the method of occupying the cache space proportion corresponding to the first warp to be scheduled to schedule the priority warp includes: The first to-be-scheduled thread warp whose current missing cumulative score is greater than the score threshold is used as the to-be-squeezed thread warp; Based on the cache space required for the target cache data of the priority execution warp and the number of the warps to be squeezed, the cache space proportions corresponding to the warps to be squeezed are squeezed on average to schedule the priority execution warp.

[0008] According to a warp scheduling method for data loss provided by the present invention, based on the cache space required for target cache data of the priority execution warp and the number of the warps to be squeezed, the cache space corresponding to the warps to be squeezed is squeezed out on average to schedule the priority execution warp, and then further includes: Scheduling the first to-be-scheduled thread warp with the smallest current missing cumulative score; The cache space ratio corresponding to the first to-be-scheduled thread warp with the smallest current cumulative miss score is not occupied.

[0009] According to a warp scheduling method for data missing provided by the present invention, the step of constructing the scoring table includes: Recording data tags of historical evicted data corresponding to the to-be-scheduled warp in the historical scheduling cycle; Obtaining historical target cache data corresponding to the to-be-scheduled thread warp in the historical scheduling cycle; Matching the data tags of the historical target cache data corresponding to the to-be-scheduled thread warp with the data tags of the historical evicted data corresponding to the to-be-scheduled thread warp; If the matching is successful, the historical missing cumulative score corresponding to the historical eviction data of the thread warp to be scheduled is updated.

[0010] According to a warp scheduling method for data missing provided by the present invention, the method determines a priority warp for the current scheduling period from the warps to be scheduled according to the current cumulative missing score, schedules the priority warp, and then includes: Scheduling is performed on the to-be-scheduled thread warps excluding the priority execution thread warp based on the second cache space.

[0011] According to a thread warp scheduling method for data missing provided by the present invention, the distance between the second cache space and the central computing unit is greater than the distance between the first cache space and the central computing unit.

[0012] According to a warp scheduling method for data loss provided by the present invention, the step of obtaining target cache data of a warp to be scheduled in a current scheduling period further includes: When the first cache space is not full and / or the target cache data is a non-memory miss, the thread warp to be scheduled is scheduled according to a round-robin scheduling strategy.

[0013] The present invention also provides a thread warp scheduling device for data loss, comprising: An acquisition unit obtains target cache data of the thread bundle to be scheduled in the current scheduling cycle; a miss scoring unit that, when the first cache space is full and the target cache data is a memory access miss, updates a historical miss cumulative score of the target cache data corresponding to the to-be-scheduled thread warp to obtain a current miss cumulative score of the target cache data; the historical miss cumulative score is obtained by matching the target cache data from a scoring table; the scoring table is obtained based on a frequency of successful matches between historical target cache data corresponding to the to-be-scheduled thread warp in a historical scheduling cycle and historical eviction data of the to-be-scheduled thread warp; The scheduling unit determines a priority execution warp of the current scheduling period from the to-be-scheduled warps according to the current missing cumulative score, and schedules the priority execution warp.

[0014] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the above-described methods for thread warp scheduling in the event of data loss is implemented.

[0015] The present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described methods for thread warp scheduling with data missing.

[0016] The present invention further provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above methods for thread warp scheduling in the event of data loss.

[0017] The thread bundle scheduling method and device for data missing provided by the present invention obtain the historical missing cumulative score of the target cache data corresponding to the thread bundle to be scheduled from the scoring table when the first cache space is full and the target cache data is a memory access missing, so as to update the current missing cumulative score of the target cache data; according to the level of the current missing cumulative score, the priority execution thread bundle of the current scheduling cycle is determined from the thread bundle to be scheduled, and the priority execution thread bundle is scheduled, thereby avoiding the target cache data with a higher current missing cumulative score from being evicted and accessed back and forth in the cache space, improving the locality and reusability of the data in the cache space, and thus improving the overall execution efficiency of the thread bundle to be scheduled. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0019] Figure 1 This is one of the flow charts of the method for thread warp scheduling with data loss provided by the present invention; Figure 2 This is a schematic diagram of allocation of the first cache space provided by the present invention; Figure 3 It is a schematic diagram of the process of constructing a scoring table provided by the present invention; Figure 4 This is the second flow chart of the method for thread warp scheduling with data loss provided by the present invention; Figure 5 is a schematic diagram of the architecture of the graphics processor provided by the present invention; Figure 6 1 is a schematic structural diagram of a thread warp scheduling device for data loss provided by the present invention; Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0020] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0021] It should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the described features. In the description of the embodiments of the present invention, "plurality" means two or more, unless otherwise specifically defined.

[0022] To address the above problems, the present invention provides a warp scheduling method for data missing, so as to improve the locality and reusability of data in the cache, thereby improving the execution efficiency of the warp. Figure 1 This is one of the flow charts of the method for scheduling warps with data loss provided by the present invention, such as Figure 1 As shown, the method includes: Step 110: Obtain target cache data of the warp to be scheduled in the current scheduling cycle.

[0023] Here, a "schedulable warp" refers to the set of threads waiting to be assigned computing resources for execution during the current scheduling cycle. There are multiple "schedulable warps" in the current scheduling cycle. Furthermore, "target cache data" refers to the memory data that the "schedulable warp" needs to access during the current scheduling cycle. This is the basis for the "scheduled warp" to execute General-Purpose Computing on Graphics Processing Units (GPGPU) computing tasks.

[0024] Specifically, memory access requests for all pending thread warps in the current scheduling cycle are obtained. The memory address and data size indicated by the memory access requests are the target cache data. It is understood that the target cache data of any pending thread may or may not be in the cache space corresponding to the pending thread warp.

[0025] Step 120: When the first cache space is full and the target cache data is a memory miss, update the historical miss cumulative score of the target cache data corresponding to the to-be-scheduled thread warp to obtain a current miss cumulative score of the target cache data. The historical miss cumulative score is obtained by matching the target cache data from a scoring table; the scoring table is obtained based on the frequency of successful matches between historical target cache data corresponding to the to-be-scheduled thread warp in a historical scheduling cycle and historical eviction data of the to-be-scheduled thread warp.

[0026] Here, the first cache space refers to the cache space closest to the core computing unit, with the fastest access speed but relatively small capacity. The first cache space here can be L0 Cache, which is a cache closer to the computing unit than L1 Cache.

[0027] Furthermore, the scoring table here refers to the frequency of successful matches between the historical target cache data corresponding to the to-be-scheduled thread warp and the historical eviction data of the to-be-scheduled thread warp in the historical scheduling cycle. The scoring table can reflect the number of times the historical eviction data corresponding to each to-be-scheduled thread warp was reaccessed after being evicted in the historical scheduling cycle. Therefore, the current cumulative miss score here can reflect the number of times the historical eviction data corresponding to the target cache data of the to-be-scheduled thread warp was reaccessed in the current scheduling cycle.

[0028] It can be understood that, the higher the current cumulative miss score of the target cache data, the more times the historical evicted data corresponding to the target cache data of a certain to-be-scheduled thread warp is missed when accessed again after being replaced, which means that the to-be-scheduled thread warp corresponding to the target cache data has a high access frequency to this target cache data. This target cache data should not be evicted from the first cache space, so that this to-be-scheduled thread warp can directly access the memory, thereby improving the scheduling priority of this to-be-scheduled thread warp.

[0029] Specifically, after determining the target cache data of the thread bundle to be scheduled, when the first cache space is full and the target cache data of the thread bundle to be scheduled is a memory access miss, that is, when the target cache data of the thread bundle to be scheduled is not in the first cache space, the historical miss cumulative score of the target cache data of each thread bundle to be scheduled can be obtained by matching from the scoring table to update the current miss cumulative score of the target cache data of each thread bundle to be scheduled.

[0030] For example, for the current cumulative missing score of the target cache data of any to-be-scheduled thread bundle, the data tag of the historical evicted data of the to-be-scheduled thread bundle in the scoring table can be retrieved and matched through the data tag of the target cache data, and the historical cumulative missing score of the historical evicted data with successful matching is updated, for example, by adding one, to obtain the current cumulative missing score of the target cache data in the current scheduling cycle.

[0031] Step 130 : determining a priority execution warp of the current scheduling period from the to-be-scheduled warps according to the current missing cumulative score, and scheduling the priority execution warp.

[0032] Specifically, the priority execution warp for the current scheduling cycle can be determined from among the to-be-scheduled warps based on the current cumulative miss scores of the target cache data of all to-be-scheduled warps. For example, if the current scheduling cycle includes to-be-scheduled warps A, B, and C, and the current cumulative miss score of the target cache data of warp A is 7, the current cumulative miss score of the target cache data of warp B is 6, and the current cumulative miss score of the target cache data of warp C is 5, then warp A is the priority execution warp for the current scheduling cycle, and warp A can be scheduled preferentially.

[0033] For example, by occupying the first cache space corresponding to the to-be-scheduled thread bundle B and the to-be-scheduled thread bundle C, and replacing the historical target cache data stored in the first cache space of the to-be-scheduled thread bundle B or C with the target cache data of the to-be-scheduled thread bundle A in the current scheduling cycle, a larger implicit cache space is divided for the to-be-scheduled thread bundle A, so that the data reusability and locality of the target cache data frequently accessed by the to-be-scheduled thread bundle A are higher, and the data hit rate is higher, thereby improving the overall execution efficiency of the to-be-scheduled thread bundle.

[0034] The method provided by the embodiment of the present invention matches the historical missing cumulative score of the target cache data corresponding to the thread warp to be scheduled from the scoring table when the first cache space is full and the target cache data is a memory access miss, so as to update the current missing cumulative score of the target cache data; according to the level of the current missing cumulative score, the priority execution thread warp of the current scheduling cycle is determined from the thread warp to be scheduled, and the priority execution thread warp is scheduled, thereby avoiding the target cache data with a higher current missing cumulative score from being evicted and accessed back and forth in the cache space, improving the locality and reusability of the data in the cache space, and thus improving the overall execution efficiency of the thread warp to be scheduled.

[0035] Based on any of the above embodiments, step 130 includes: Determine the cache space ratio of the thread warp to be scheduled in the previous scheduling cycle; occupying a proportion of the cache space corresponding to the first to-be-scheduled thread warp to schedule the priority execution thread warp; The current cumulative missing score of the first to-be-scheduled warp is lower than the current cumulative missing score of the priority execution warp.

[0036] Here, the proportion of the cache space occupied by the thread warp to be scheduled in the previous scheduling cycle can reflect the data capacity of the first cache space occupied by each thread warp to be scheduled after the previous scheduling cycle ends.

[0037] In addition, the first warp to be scheduled here refers to the warp to be scheduled whose current cumulative miss score is lower than that of the priority warp. The first warp to be scheduled may include multiple warps. For example, the current cumulative miss scores of the target cache data of warp A, B, and C are 7, 6, and 5, respectively.

[0038] Specifically, the cache space share of each warp to be scheduled in the previous scheduling cycle can be calculated by first obtaining the capacity of the first cache space occupied by each warp to be scheduled in the previous scheduling cycle. The cache space share of each warp to be scheduled in the previous scheduling cycle can then be calculated using the capacity corresponding to each warp to be scheduled and the total capacity of the first cache space. For example, the cache space share of warp A to be scheduled is 40%, the cache space share of warp B to be scheduled is 30%, and the cache space share of warp C to be scheduled is 30%.

[0039] Then, the cache space share corresponding to the first to-be-scheduled thread warp with the lowest current cumulative miss score can be occupied. That is, the data in the first cache space of the first to-be-scheduled thread warp can be evicted and replaced with the target cache data of the priority execution warp in the current cycle, thereby increasing the cache space share of the priority execution warp in the first cache space. For example, if to-be-scheduled thread warp A is the priority execution warp, and to-be-scheduled thread warps B and C are the first to-be-scheduled thread warps, the cache space share of to-be-scheduled thread warps B and C can be occupied. For example, if the target cache data of to-be-scheduled thread warp A requires 20% of the cache space share, only the cache space share of to-be-scheduled thread warp B can be occupied, for example, by increasing the cache space share of to-be-scheduled thread warp B to 10%. Alternatively, the cache space shares of to-be-scheduled thread warp B and to-be-scheduled thread warp C can be occupied simultaneously, for example, by increasing the cache space share of to-be-scheduled thread warp B to 20%, and the cache space share of to-be-scheduled thread warp C to 20%.

[0040] It is understood that when there are multiple first warps to be scheduled, the cache lines of the first warps to be scheduled can be prioritized based on the cache lines required for the target cache data of the prioritized warp, with priority given to occupying first warps to be scheduled with higher current cumulative miss scores to ensure a lower data hit rate for first warps to be scheduled with higher current cumulative miss scores. It is also understood that a lower current cumulative miss score for a warp to be scheduled indicates a higher data hit rate and greater data reusability and locality, thus reducing the need to evict data from its cache space, thereby improving warp execution efficiency.

[0041] The method provided by the embodiment of the present invention schedules the priority execution warp by occupying the cache space proportion corresponding to the first to-be-scheduled warp whose current cumulative miss score is lower than that of the priority execution warp. This method does not directly change the cache hierarchy and the underlying replacement strategy. Instead, it crowds out the cache at the warp scheduling level, so that the buffer capacity of the priority execution warp with a higher number of cache data missing when accessed again due to replacement is expanded, thereby improving the reusability and locality of the target cache data, thereby improving the overall execution efficiency of the warp.

[0042] Based on any of the foregoing embodiments, occupying the cache space proportion corresponding to the first to-be-scheduled warp to schedule the priority warp includes: The first to-be-scheduled thread warp whose current missing cumulative score is greater than the score threshold is used as the to-be-squeezed thread warp; Based on the cache space required for the target cache data of the priority execution warp and the number of the warps to be squeezed, the cache space proportions corresponding to the warps to be squeezed are squeezed on average to schedule the priority execution warp.

[0043] Specifically, a score threshold can be determined. Here, the score threshold can be determined based on the current cumulative missing scores of all the warps to be scheduled. For example, the median of the current cumulative missing scores of all the warps to be scheduled can be taken. Then, the first warp to be scheduled whose current cumulative missing score is greater than the score threshold can be determined as the warp to be squeezed. Therefore, there can be multiple warps to be squeezed.

[0044] Then, the priority warp can be scheduled by averaging the cache space occupied by the target cache data of the priority warp and the number of warps to be squeezed. For example, if the cache space required by the target cache data of the priority warp is 20% of the cache space, and there are two warps to be squeezed, 10% of the cache space of each warp to be squeezed can be squeezed.

[0045] It should be noted that when the current cumulative missing score of the thread warp to be scheduled is small, it means that the cache data of the thread warp to be scheduled in the most recent scheduling cycle has high reusability, that is, the data hit rate stored in the cache space corresponding to the thread warp to be scheduled is high.

[0046] To further improve the overall execution efficiency of thread warps, based on any of the above embodiments, the cache space required for the target cache data of the priority execution warp and the number of the warps to be squeezed out are averagely squeezed out to schedule the priority execution warp, and the following further comprises: Scheduling the first to-be-scheduled thread warp with the smallest current missing cumulative score; The cache space ratio corresponding to the first to-be-scheduled thread warp with the smallest current cumulative miss score is not occupied.

[0047] Specifically, after scheduling the priority warp, the first warp to be scheduled with the lowest current cumulative missing score is scheduled first. The cache space corresponding to the first warp to be scheduled with the lowest current cumulative missing score is not occupied, and the cache capacity corresponding to the first warp to be scheduled with the lowest current cumulative missing score is maintained. In other words, data in the cache space corresponding to the first warp to be scheduled with the lowest current cumulative missing score is not evicted.

[0048] In one embodiment, Figure 2 This is a schematic diagram of the allocation of the first cache space provided by the present invention, such as Figure 2 As shown in the figure, W3, W2, W1, and W0 represent the thread warps to be scheduled. L0 Cache represents the first cache space. Initially, there are only a few thread warps to be scheduled, including W2, W1, and W0. L0 Cache has some spare capacity, so there is no cache line eviction. Therefore, there is no accumulation of the current miss score. At this point, each thread warp to be scheduled has the same scheduling priority.

[0049] When the L0 cache is full, cache line eviction occurs. For example, the current miss cumulative scores of the four thread warps to be scheduled in the current cycle are 6, 6, 7, and 4 respectively. The current miss cumulative score of the thread warp W2 to be scheduled is the highest, followed by the current miss cumulative scores of the thread warps W0 and W1 to be scheduled, and the current miss cumulative score of the thread warp W3 to be scheduled is the lowest.

[0050] Therefore, to improve the reusability and locality of the data with the highest cumulative missing score and reduce the frequent eviction and access of this data, the memory space share of the scheduled thread warps W0 and W1 can be evenly squeezed. At the same time, to ensure that the scheduled thread warp with the lower cumulative missing score still maintains a high hit rate and good execution efficiency, the space share of the scheduled thread warp W3 is not squeezed.

[0051] Based on any of the above embodiments, the step of constructing the scoring table includes: Recording data tags of historical evicted data corresponding to the to-be-scheduled warp in the historical scheduling cycle; Obtaining historical target cache data corresponding to the to-be-scheduled thread warp in the historical scheduling cycle; Matching the data tags of the historical target cache data corresponding to the to-be-scheduled thread warp with the data tags of the historical evicted data corresponding to the to-be-scheduled thread warp; If the matching is successful, the historical missing cumulative score corresponding to the historical eviction data of the thread warp to be scheduled is updated.

[0052] Specifically, the data tags of the historical eviction data corresponding to the warp to be scheduled in the historical scheduling cycle are recorded. Furthermore, the historical target cache data corresponding to the warp to be scheduled in each historical scheduling cycle is obtained. The data tags of the historical target cache data corresponding to the warp to be scheduled are then matched with the data tags of the historical eviction data corresponding to the warp to be scheduled. If a match is successful, the cumulative historical miss score corresponding to the historical eviction data of the warp to be scheduled is updated. For example, if a match is successful, the cumulative score is incremented by one.

[0053] In one embodiment, Figure 3 It is a schematic diagram of the process of constructing the scoring table provided by the present invention, such as Figure 3 As shown in the figure, the process includes: after the memory access unit can issue a memory access address and access the first cache space, it can feedback information about each warp to be scheduled (WID), the evicted cache line corresponding to each warp to be scheduled, misses, and hits to the loss scoring unit based on the returned information. The loss scoring unit can then construct a scoring table based on the feedback information. Then, using the constructed scoring table, the warp scheduling for the current scheduling cycle is completed.

[0054] Specifically, during the scoring table construction process, each time a cache line is evicted from the primary cache space, the tag information corresponding to the evicted cache line is communicated to the loss scoring unit. The loss scoring unit then stores the eviction tag value in the table entry for the corresponding thread warp to be scheduled. In subsequent scheduling cycles, when the thread warp to be scheduled accesses a cache line again, a check is performed. If the tag (access tag) of the target cache data is equal to the tag (eviction tag) of the recorded historical eviction data, the score value is incremented by 1.

[0055] Therefore, the thread warp scheduling will select the thread warp with the highest cumulative missing score to be executed first, and the thread warp with the lowest score to be executed second.

[0056] Based on any of the above embodiments, step 130 may include: Scheduling is performed on the to-be-scheduled thread warps excluding the priority execution thread warp based on the second cache space.

[0057] Here, the second cache space refers to the lower-level cache of the first cache space, including L1 cache, L2 cache, external storage, etc. It should be noted that the second cache space is located farther from the central computing unit than the first cache space. The first cache space here can be L0 cache, and the second cache space can be L1 cache.

[0058] Specifically, after prioritizing the execution of the priority execution warp, the warp to be scheduled with the lowest cumulative miss score can be executed. Then, for the remaining warps to be scheduled, the remaining warps to be scheduled are executed in descending order of their cumulative miss scores. It should be noted that when scheduling warps to be scheduled excluding the priority execution warp, if a memory miss occurs during a memory access, the second cache space can be directly accessed, and the read-back data is directly fed back to the memory access unit and is not written back to the cache line of the first cache space.

[0059] It should be noted that the method provided in the embodiment of the present invention accesses the lower-level cache to execute the thread warps to be scheduled except the priority execution thread warps, thereby avoiding the eviction of cache lines in the first cache space corresponding to the thread warps to be scheduled except the priority execution thread warps, reducing the locality and reusability of the data in the first cache space, and thus improving the execution efficiency of subsequent thread warps to be scheduled.

[0060] Based on any of the foregoing embodiments, the distance between the second cache space and the central computing unit is greater than the distance between the first cache space and the central computing unit.

[0061] Based on any of the above embodiments, step 110 may further include: When the first cache space is not full and / or the target cache data is a non-memory miss, the thread warp to be scheduled is scheduled according to a round-robin scheduling strategy.

[0062] Specifically, when the first cache space is not full and / or the target cache data of the thread warp to be scheduled is a non-memory miss, all the thread warps to be scheduled may be scheduled according to the round-robin scheduling strategy.

[0063] It should be noted that, when the first cache space is not full, it means that there is still capacity remaining in the first cache space. Then, according to the polling scheduling strategy, the target cache data of the thread bundle to be scheduled that has memory access misses can be written into the free capacity, or the target cache data in the first cache space can be directly accessed to complete the scheduling of each thread bundle to be scheduled.

[0064] In addition, in the case that the target cache data is a non-memory miss, according to the polling scheduling strategy, the target cache data in the first cache space can be directly accessed to complete the scheduling of each thread warp to be scheduled.

[0065] Furthermore, when the first cache space is not full and the target cache data is not a memory miss, the target cache data of each to-be-scheduled thread warp with a memory miss can be written into the free capacity according to the polling scheduling strategy to complete the scheduling of each to-be-scheduled thread warp.

[0066] Figure 4 This is the second flow chart of the thread warp scheduling method for data loss provided by the present invention, such as Figure 4 As shown, first, the thread warp polling scheduling execution starts. In the current scheduling cycle, it is determined whether the cache (first cache space) is full. If the cache is not full, each thread number will not be lost. The cache capacity occupied by each thread warp is equal, and the scheduling priority of each thread warp cannot be changed.

[0067] When the cache is full, warps (to be scheduled) are assigned a loss score. The warp with the highest score (current cumulative loss score) is scheduled first, and can occupy the cache capacity of the remaining warps. This implicitly allocates more cache space to the warp with the highest score. The warp with the lowest score is scheduled next, maintaining its current cache capacity and preventing it from occupying it. The remaining warps are scheduled using a round-robin schedule, and their cache capacity can be based on the highest-scoring warp. This implicitly allocates less cache space to the remaining warps.

[0068] The thread warp scheduling method for data missing provided by the embodiment of the present invention improves the execution efficiency of the thread warp. When the thread warp frequently accesses memory, it can ensure that the read data is stored in the cache line, thereby increasing the multiplexing and locality of the data and thus improving the execution efficiency.

[0069] Based on any of the above embodiments, Figure 5 Schematic diagram of the architecture of the graphics processor provided by the present invention, such as Figure 5As shown, the image processor here can be a GPGPU, and the architecture includes: a thread warp scheduling unit, an internal pipeline unit, a memory access unit, an L0 cache unit, a lower-level storage unit, and a loss scoring unit. Among them, the thread warp scheduling unit can schedule multiple thread warps, and can prioritize the thread warp with the highest score and schedule the thread warp with the lowest score according to the score of each thread warp stored in the loss scoring unit. The loss scoring unit maintains a loss table for each thread warp and updates the table entries in real time based on the memory access information returned by the memory access unit. Internal pipeline refers to the commonly used pipeline architecture, namely instruction fetch, decoding, execution, writeback, etc. The memory access unit can issue memory access addresses and access the L0 cache, and feed back information on cache line evictions, misses, and hits to the loss scoring unit.

[0070] Based on any of the above embodiments, Figure 6 Schematic diagram of the structure of the thread warp scheduling device for data loss provided by the present invention, such as Figure 6 As shown, the device includes: An acquiring unit 610 acquires target cache data of a thread warp to be scheduled in a current scheduling cycle; The miss scoring unit 620 updates the historical miss cumulative score of the target cache data corresponding to the to-be-scheduled thread warp to obtain a current miss cumulative score of the target cache data when the first cache space is full and the target cache data is a memory access miss. The historical miss cumulative score is obtained by matching the target cache data with a scoring table. The scoring table is obtained based on the frequency of successful matches between historical target cache data corresponding to the to-be-scheduled thread warp in historical scheduling cycles and historical eviction data of the to-be-scheduled thread warp. The scheduling unit 630 determines a priority execution warp in the current scheduling period from the to-be-scheduled warps according to the current missing cumulative score, and schedules the priority execution warp.

[0071] The device provided by the embodiment of the present invention, when the first cache space is full and the target cache data is a memory access miss, matches the historical miss cumulative score of the target cache data corresponding to the thread warp to be scheduled from the scoring table to update the current miss cumulative score of the target cache data; according to the level of the current miss cumulative score, the priority execution thread warp of the current scheduling cycle is determined from the thread warp to be scheduled, and the priority execution thread warp is scheduled, thereby avoiding the target cache data with a higher current miss cumulative score from being evicted and accessed back and forth in the cache space, improving the locality and reusability of the data in the cache space, and thus improving the overall execution efficiency of the thread warp to be scheduled.

[0072] Based on any of the above embodiments, the scheduling unit is specifically configured to: Determine the cache space ratio of the thread warp to be scheduled in the previous scheduling cycle; occupying a proportion of the cache space corresponding to the first to-be-scheduled thread warp to schedule the priority execution thread warp; The current cumulative missing score of the first to-be-scheduled warp is lower than the current cumulative missing score of the priority execution warp.

[0073] Based on any of the above embodiments, the scheduling unit is further specifically configured to: The first to-be-scheduled thread warp whose current missing cumulative score is greater than the score threshold is used as the to-be-squeezed thread warp; Based on the cache space required for the target cache data of the priority execution warp and the number of the warps to be squeezed, the cache space proportions corresponding to the warps to be squeezed are squeezed on average to schedule the priority execution warp.

[0074] Based on any of the above embodiments, the scheduling unit is further specifically configured to: Scheduling the first to-be-scheduled thread warp with the smallest current missing cumulative score; The cache space ratio corresponding to the first to-be-scheduled thread warp with the smallest current cumulative miss score is not occupied.

[0075] Based on any of the above embodiments, the missing score unit is specifically configured to: Recording data tags of historical evicted data corresponding to the to-be-scheduled warp in the historical scheduling cycle; Obtaining historical target cache data corresponding to the to-be-scheduled thread warp in the historical scheduling cycle; Matching the data tags of the historical target cache data corresponding to the to-be-scheduled thread warp with the data tags of the historical evicted data corresponding to the to-be-scheduled thread warp; If the matching is successful, the historical missing cumulative score corresponding to the historical eviction data of the thread warp to be scheduled is updated.

[0076] Based on any of the above embodiments, the scheduling unit is further specifically configured to: Scheduling is performed on the to-be-scheduled thread warps excluding the priority execution thread warp based on the second cache space.

[0077] Based on any of the foregoing embodiments, the distance between the second cache space and the central computing unit is greater than the distance between the first cache space and the central computing unit.

[0078] Based on any of the above embodiments, the scheduling unit is further specifically configured to: When the first cache space is not full and / or the target cache data is a non-memory miss, the thread warp to be scheduled is scheduled according to a round-robin scheduling strategy.

[0079] Figure 7 An example of a physical structure diagram of an electronic device is shown below. Figure 7 As shown, the electronic device may include: a processor 710, a communications interface 720, a memory 730, and a communication bus 740, wherein the processor 710, the communications interface 720, and the memory 730 communicate with each other via the communication bus 740. The processor 710 may call logic instructions in the memory 730 to execute a warp scheduling method for data misses, the method comprising: obtaining target cache data of a warp to be scheduled in a current scheduling cycle; when a first cache space is full and the target cache data is a memory miss, updating a historical miss cumulative score of the target cache data corresponding to the warp to be scheduled to obtain a current miss cumulative score of the target cache data; the historical miss cumulative score is obtained by matching the target cache data with a scoring table; the scoring table is obtained based on the frequency of successful matches between historical target cache data corresponding to the warp to be scheduled in historical scheduling cycles and historical eviction data of the warp to be scheduled; and determining a priority warp for the current scheduling cycle from the warp to be scheduled based on the current miss cumulative score, and scheduling the priority warp.

[0080] Furthermore, the logic instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product, stored in a storage medium, includes instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0081] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the thread bundle scheduling method for data missing provided by the above methods, the method including: obtaining target cache data of the thread bundle to be scheduled in the current scheduling cycle; when a first cache space is full and the target cache data is a memory access miss, updating the historical miss cumulative score of the target cache data corresponding to the thread bundle to be scheduled to obtain the current miss cumulative score of the target cache data; the historical miss cumulative score is obtained by matching the target cache data from a scoring table; the scoring table is obtained based on the frequency of successful matching of historical target cache data corresponding to the thread bundle to be scheduled in the historical scheduling cycle with historical eviction data of the thread bundle to be scheduled; according to the current miss cumulative score, determining the priority execution thread bundle of the current scheduling cycle from the thread bundle to be scheduled, and scheduling the priority execution thread bundle.

[0082] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the thread bundle scheduling method for data missing provided by the above methods, the method comprising: obtaining target cache data of the thread bundle to be scheduled in the current scheduling cycle; when a first cache space is full and the target cache data is a memory access miss, updating the historical miss cumulative score of the target cache data corresponding to the thread bundle to be scheduled to obtain the current miss cumulative score of the target cache data; the historical miss cumulative score is obtained by matching the target cache data from a scoring table; the scoring table is obtained based on the frequency of successful matching of historical target cache data corresponding to the thread bundle to be scheduled in the historical scheduling cycle with the historical eviction data of the thread bundle to be scheduled; according to the level of the current miss cumulative score, determining the priority execution thread bundle of the current scheduling cycle from the thread bundle to be scheduled, and scheduling the priority execution thread bundle.

[0083] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0084] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.

[0085] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A warp scheduling method for data loss, characterized in that: include: Get the target cache data of the thread warp to be scheduled in the current scheduling cycle; When the first cache space is full and the target cache data is a memory miss, updating the historical miss cumulative score of the target cache data corresponding to the to-be-scheduled thread warp to obtain a current miss cumulative score of the target cache data; The historical missing cumulative score is obtained by matching the target cache data from the scoring table; The scoring table is obtained based on the frequency of successful matches between historical target cache data corresponding to the warp to be scheduled in the historical scheduling cycle and historical eviction data of the warp to be scheduled; According to the current missing cumulative score, a priority execution warp of the current scheduling period is determined from the to-be-scheduled warps, and scheduling is performed on the priority execution warp.

2. The thread warp scheduling method for data loss according to claim 1, characterized in that: The determining, according to the current missing cumulative score, a priority execution warp of the current scheduling period from the to-be-scheduled warps, and scheduling the priority execution warp includes: Determine the cache space ratio of the thread warp to be scheduled in the previous scheduling cycle; occupying a proportion of the cache space corresponding to the first to-be-scheduled thread warp to schedule the priority execution thread warp; The current cumulative missing score of the first to-be-scheduled warp is lower than the current cumulative missing score of the priority execution warp.

3. The thread warp scheduling method for data loss according to claim 2, characterized in that: The occupying of the cache space proportion corresponding to the first to-be-scheduled thread warp to schedule the priority execution thread warp includes: The first to-be-scheduled thread warp whose current missing cumulative score is greater than the score threshold is used as the to-be-squeezed thread warp; Based on the cache space required for the target cache data of the priority execution warp and the number of the warps to be squeezed, the cache space proportions corresponding to the warps to be squeezed are squeezed on average to schedule the priority execution warp.

4. The thread warp scheduling method for data loss according to claim 3, characterized in that: The method further comprises: squeezing out an average proportion of the cache space corresponding to the warp to be squeezed based on the cache space required for the target cache data of the priority execution warp and the number of the warp to be squeezed, so as to schedule the priority execution warp; and then further comprising: Scheduling the first to-be-scheduled thread warp with the smallest current missing cumulative score; The cache space ratio corresponding to the first to-be-scheduled thread warp with the smallest current cumulative miss score is not occupied.

5. The warp scheduling method for data loss according to any one of claims 1 to 4, characterized in that: The steps of constructing the scoring table include: Recording data tags of historical evicted data corresponding to the to-be-scheduled warp in the historical scheduling cycle; Obtaining historical target cache data corresponding to the to-be-scheduled thread warp in the historical scheduling cycle; Matching the data tags of the historical target cache data corresponding to the to-be-scheduled thread warp with the data tags of the historical evicted data corresponding to the to-be-scheduled thread warp; If the matching is successful, the historical missing cumulative score corresponding to the historical eviction data of the thread warp to be scheduled is updated.

6. The warp scheduling method for data loss according to any one of claims 1 to 4, characterized in that: The method further includes determining a priority execution warp of the current scheduling period from the to-be-scheduled warps according to the current missing cumulative scores, and scheduling the priority execution warp. Scheduling is performed on the to-be-scheduled thread warps excluding the priority execution thread warp based on the second cache space.

7. The thread warp scheduling method for data loss according to claim 6, characterized in that: The distance between the second cache space and the central computing unit is greater than the distance between the first cache space and the central computing unit.

8. The warp scheduling method for data loss according to any one of claims 1 to 4, characterized in that: The step of obtaining target cache data of the thread warp to be scheduled in the current scheduling cycle further includes: When the first cache space is not full and / or the target cache data is a non-memory miss, the thread warp to be scheduled is scheduled according to a round-robin scheduling strategy.

9. A thread warp scheduling device for data loss, characterized in that: include: An acquisition unit obtains target cache data of the thread bundle to be scheduled in the current scheduling cycle; a miss scoring unit, which updates a historical miss cumulative score of the target cache data corresponding to the to-be-scheduled thread warp to obtain a current miss cumulative score of the target cache data when the first cache space is full and the target cache data is a memory access miss; The historical missing cumulative score is obtained by matching the target cache data from the scoring table; The scoring table is obtained based on the frequency of successful matches between historical target cache data corresponding to the warp to be scheduled in the historical scheduling cycle and historical eviction data of the warp to be scheduled; The scheduling unit determines a priority execution warp of the current scheduling period from the to-be-scheduled warps according to the current missing cumulative score, and schedules the priority execution warp.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the warp scheduling method for data missing according to any one of claims 1 to 8 is implemented.