Processor and mesh segmentation method for processor

By performing balanced prediction checksum on the benchmark dimension of the multidimensional grid, the problem of reducing processor computing efficiency caused by multidimensional grid segmentation is solved, and the computing efficiency of the processor and load balancing of the core unit are improved.

CN120371553AActive Publication Date: 2025-07-25SHANGHAI BIREN TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510888549.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-30
Publication Date
2025-07-25
Estimated Expiration
2045-06-30

AI Technical Summary

Technical Problem

In the prior art, grid segmentation of multidimensional grids leads to a decrease in processor computing efficiency, mainly due to the increased interaction time and unbalanced load of kernel units.

Method used

By determining the benchmark dimension of the multidimensional grid in multiple grid dimensions and performing balanced prediction verification on that dimension, the single-dimensional slicing granularity is adjusted to ensure that the slicing grid can be evenly distributed to the kernel cells, reducing interaction time and load imbalance.

Benefits of technology

The computing efficiency of the processor is improved, and by suppressing the increase in interaction time-consuming between the command processor and the core unit, the reduction in the utilization rate of the core unit is avoided, and more efficient computing performance is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371553A_ABST
    Figure CN120371553A_ABST
Patent Text Reader

Abstract

The invention relates to a processor and a grid segmentation method for the processor. On the basis of the method and the device, the segmentation granularity of the multi-dimensional grid on multiple grid dimensions can be reduced to one reference dimension, and the dimension-reduced single-dimensional segmentation granularity can be subjected to adaptive adjustment with the multi-dimensional grid on the basis of the preset single-dimensional maximum granularity. Therefore, the segmented grids obtained by segmenting the multi-dimensional grids can be equally divided by the kernel units as much as possible with the size as large as possible, and then the computing efficiency of the processor can be improved by suppressing the time consumption increase of interaction between the command processor and the multiple kernel units; and the calculation efficiency of the processor can be improved by inhibiting the reduction of the utilization rate of the plurality of kernel units.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of integrated circuit chip design, and particularly to a processor and a grid segmentation method for a processor. Background Art

[0002] A processor may include a command processor (CP) and multiple core units. Moreover, the command processor can split the computing tasks for core computing such as support vector machine (SVM) computing and dispatch them to multiple core units, so that the core computing corresponding to the computing task can be concurrently executed by multiple core units using their respective kernel functions.

[0003] Core computing usually involves grid search using a multi-dimensional grid. In this case, the task splitting of the computing tasks involving core computing will involve the grid splitting of the multi-dimensional grid, and the command processor can split the multi-dimensional grid according to the splitting granularity set respectively in multiple grid dimensions.

[0004] However, the grid sizes of the multi-dimensional grid are diverse, that is, the single-dimensional grid sizes of the multi-dimensional grid in each grid dimension are diverse. Therefore: If the splitting granularity set in any grid dimension is small, then for a multi-dimensional grid with a large grid size in that grid dimension, the number of split grids obtained by splitting will be large, resulting in an increase in the interaction for dispatching between the command processor and multiple core units, and further resulting in a decrease in the proportion of the effective time for the core units to actually execute the computing, that is, the computing efficiency of the processor is reduced due to the increase in the interaction time between the command processor and multiple core units; If the splitting granularity set in any grid dimension is large, then for a multi-dimensional grid with a small grid size in that grid dimension, the number of split grids obtained by splitting is small and insufficient to be allocated to all core units, resulting in a load imbalance between multiple core units, that is, the computing efficiency of the processor is reduced due to the decrease in the utilization rate of multiple core units.

[0005] It can be seen that how to avoid the reduction in the computing efficiency of the processor caused by grid splitting has become a technical problem to be solved in the prior art. Summary of the Invention

[0006] Embodiments of this application provide a processor and a grid segmentation method for a processor, which helps to improve the computing efficiency of the processor.

[0007] In an embodiment of this application, a processor is provided, including: At least two core units; and A command processor for: Determine a reference dimension among multiple grid dimensions of the current multi-dimensional grid; Use the reference grid size of the current multi-dimensional grid in the reference dimension to perform an equalization prediction check on a preset one-dimensional maximum granularity; wherein, the target conditions of the equalization prediction check include: the predicted segmentation quantity of multiple segmentation grids obtained by segmenting the current multi-dimensional grid in the reference dimension using the one-dimensional maximum granularity is an integer multiple of the number of core units of the at least two core units; Determine a one-dimensional segmentation granularity of the current multi-dimensional grid in the reference dimension according to the check result of the equalization prediction check; wherein, if the check result indicates that the target conditions are met, then determine the one-dimensional maximum granularity as the one-dimensional segmentation granularity; otherwise, determine the one-dimensional segmentation granularity according to the reference grid size and the smallest integer multiple of the number of core units that is not less than the predicted segmentation quantity; Use the one-dimensional segmentation granularity to segment the current multi-dimensional grid in the reference dimension to obtain the multiple segmentation grids respectively corresponding to the at least two core units.

[0008] Exemplarily, in an embodiment of the present application, the command processor is specifically configured to: determine the reference dimension based on the one-dimensional grid sizes of the current multi-dimensional grid in the multiple grid dimensions respectively.

[0009] Exemplarily, in an embodiment of the present application, the command processor is specifically configured to: determine the maximum one-dimensional size among the one-dimensional grid sizes of the current multi-dimensional grid in the multiple grid dimensions respectively; determine a grid dimension where the maximum one-dimensional size is located as the reference dimension; wherein, the reference grid size is the maximum one-dimensional size.

[0010] Exemplarily, in an embodiment of the present application, the command processor is specifically configured to: perform the equalization prediction check on the one-dimensional maximum granularity based on the segmented prediction result of the reference grid size using the one-dimensional maximum granularity.

[0011] Exemplarily, in an embodiment of the present application, the command processor is specifically configured to: predict the number of segmented estimation segments of the reference grid size using the one-dimensional maximum granularity; wherein, the number of segmented estimation segments is used to represent the predicted segmentation quantity; determine the check result according to the number of segmented estimation segments and the number of core units; wherein, if the number of segmented estimation segments is an integer multiple of the number of core units, the check result indicates that the target conditions are met; if the number of segmented estimation segments is a non-integer multiple of the number of core units, the check result indicates that the target conditions are not met.

[0012] Exemplarily, in an embodiment of the present application, the command processor is specifically configured to: determine an equal division number of a plurality of divided grids obtained by dividing the current multi-dimensional grid in the reference dimension according to the predicted division number and the number of kernel units; wherein, the equal division number is the smallest integer multiple of the number of kernel units that is not less than the predicted division number; if the predicted division number is less than the number of kernel units, then the equal division number is one times the number of kernel units; if the predicted division number is greater than the number of kernel units, then the equal division number is at least two times the number of kernel units; determine the one-dimensional division granularity according to the reference grid size and the equal division number.

[0013] Exemplarily, in an embodiment of the present application, the command processor is specifically configured to: determine the one-dimensional division granularity according to the size equal division granularity obtained by equally dividing the reference grid size by the equal division number.

[0014] In another embodiment of the present application, a grid division method for a processor is provided, including: Determine a reference dimension among a plurality of grid dimensions of the current multi-dimensional grid; Perform an equal division prediction check on a preset one-dimensional maximum granularity by using a reference grid size of the current multi-dimensional grid in the reference dimension; wherein, the target conditions for the equal division prediction check include: a predicted division number of a plurality of divided grids obtained by dividing the current multi-dimensional grid in the reference dimension by using the one-dimensional maximum granularity is an integer multiple of the number of kernel units of at least two kernel units in the processor; Determine a one-dimensional division granularity of the current multi-dimensional grid in the reference dimension according to a check result of the equal division prediction check; wherein, if the check result indicates that the target conditions are met, then determine the one-dimensional maximum granularity as the one-dimensional division granularity; otherwise, determine the one-dimensional division granularity according to the reference grid size and the smallest integer multiple of the number of kernel units that is not less than the predicted division number; Divide the current multi-dimensional grid in the reference dimension by using the one-dimensional division granularity to obtain the plurality of divided grids respectively corresponding to the at least two kernel units.

[0015] Exemplarily, in an embodiment of the present application, the determining a reference dimension among a plurality of grid dimensions of the current multi-dimensional grid includes: determining the reference dimension based on one-dimensional grid sizes of the current multi-dimensional grid in the plurality of grid dimensions respectively.

[0016] Exemplarily, in an embodiment of the present application, determining the reference dimension based on the single-dimensional grid sizes of the current multi-dimensional grid in the multiple grid dimensions respectively includes: determining the maximum single-dimensional size among the single-dimensional grid sizes of the current multi-dimensional grid in the multiple grid dimensions respectively; determining the grid dimension where the maximum single-dimensional size is located as the reference dimension; wherein, the reference grid size is the maximum single-dimensional size.

[0017] Exemplarily, in an embodiment of the present application, using the reference grid size of the current multi-dimensional grid in the reference dimension to perform an equalization prediction check on a preset single-dimensional maximum granularity includes: performing the equalization prediction check on the single-dimensional maximum granularity based on the segmented prediction result of the reference grid size using the single-dimensional maximum granularity.

[0018] Exemplarily, in an embodiment of the present application, performing the equalization prediction check on the single-dimensional maximum granularity based on the segmented prediction result of the reference grid size using the single-dimensional maximum granularity includes: predicting the number of segmented estimation segments of the reference grid size using the single-dimensional maximum granularity; wherein, the number of segmented estimation segments is used to represent the prediction segmentation quantity; determining the check result according to the number of segmented estimation segments and the number of kernel units; wherein, if the number of segmented estimation segments is an integer multiple of the number of kernel units, the check result indicates that the target condition is satisfied; if the number of segmented estimation segments is a non-integer multiple of the number of kernel units, the check result indicates that the target condition is not satisfied.

[0019] Exemplarily, in an embodiment of the present application, determining the single-dimensional segmentation granularity according to the reference grid size and the smallest integer multiple of the number of kernel units that is not less than the prediction segmentation quantity includes: determining the equalization segmentation quantity of the multiple segmented grids obtained by segmenting the current multi-dimensional grid in the reference dimension according to the prediction segmentation quantity and the number of kernel units; wherein, the equalization segmentation quantity is the smallest integer multiple of the number of kernel units that is not less than the prediction segmentation quantity; if the prediction segmentation quantity is less than the number of kernel units, the equalization segmentation quantity is one times the number of kernel units; if the prediction segmentation quantity is greater than the number of kernel units, the equalization segmentation quantity is at least two times the number of kernel units; determining the single-dimensional segmentation granularity according to the reference grid size and the equalization segmentation quantity.

[0020] Exemplarily, in an embodiment of the present application, determining the single-dimensional segmentation granularity according to the reference grid size and the equalization segmentation quantity includes: determining the single-dimensional segmentation granularity according to the size equalization granularity obtained by equally dividing the reference grid size by the equalization segmentation quantity.

[0021] In another embodiment of the present application, an electronic device is provided, including a processor as described in the foregoing embodiment.

[0022] Based on the embodiments of the present application, the segmentation granularity of the multi-dimensional grid in multiple grid dimensions can be reduced to a reference dimension, and the reduced one-dimensional segmentation granularity can be adaptively adjusted with the multi-dimensional grid based on a preset maximum one-dimensional granularity. Thus, the segmented grids obtained by segmenting the multi-dimensional grid can be evenly divided by the kernel units as much as possible with as large a size as possible, and further, the computing efficiency of the processor can be improved by suppressing the increase in the interaction time between the command processor and the multiple kernel units, and the computing efficiency of the processor can also be improved by suppressing the reduction in the utilization rate of the multiple kernel units. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The following drawings only schematically illustrate and explain the present application, and do not limit the scope of the present application: Figure 1 It is an example schematic diagram of the internal structure of the processor in the embodiments of the present application; Figure 2 It is an example structural schematic diagram of the multi-dimensional grid segmented by the processor in the embodiments of the present application; Figure 3 It is an example schematic diagram of the one-dimensional segmentation granularity determination logic of the processor in the embodiments of the present application; Figure 4 It is an exemplary flowchart of the grid segmentation method for the processor in the embodiments of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0024] To make the objectives, technical solutions and advantages of the present application more clear and understandable, the following examples are given with reference to the accompanying drawings to further elaborate on the present application in detail.

[0025] Figure 1 It is an example schematic diagram of the internal structure of the processor in the embodiments of the present application. Please refer to Figure 1 , in the embodiments of the present application, the processor may include a command processor 10 and at least two kernel units 20.

[0026] Exemplarily, in an embodiment of the present application, the processor may be any one of, for example, a CPU (Central Processing Unit, central processing unit), a GPU (Graphics Processing Unit, graphics processing unit), a TPU (Tensor Processing Unit, tensor processing unit), an NPU (Neural network Processing Unit, neural network processing unit), a DPU (Deep learning Processing Unit, deep learning processing unit), an APU (Accelerated Processing Unit, accelerated processing unit), and a GPGPU (General-Purpose computing on Graphics Processing Units, general-purpose graphics processing unit).

[0027] Exemplarily, in an embodiment of the present application, if the processor is a GPU or a GPGPU, then the processor may be deployed in a heterogeneous architecture, and the processor (i.e., the command processor 10 of the processor) may receive a task including a multi-dimensional grid from a host in the heterogeneous architecture. For example, the heterogeneous architecture where the processor is located may include a CPU as the host, and the CPU as the host may send a task including a multi-dimensional grid to the processor (i.e., the command processor 10 of the processor).

[0028] Exemplarily, in an embodiment of the present application, if the processor is a GPU or a GPGPU, then the processor may include a large number of streaming processor clusters (SPCs) for kernel computing. The streaming processor clusters may implement kernel computing using kernel functions, and these streaming processor clusters may be divided into at least two partitions (Partitions). In this case, a kernel unit 20 in an embodiment of the present application may be a partition of a streaming processor cluster.

[0029] Exemplarily, in an embodiment of the present application, the command processor 10 may be used to divide the multi-dimensional grid corresponding to each task into multiple sliced grids respectively corresponding to at least two kernel units 20, and dispatch the multiple sliced grids to the at least two kernel units 20, so as to prompt the at least two kernel units 20 to complete the corresponding task by concurrently using the sliced grids to perform kernel computing.

[0030] Figure 2 Schematic diagram of an example structure of a multi-dimensional grid sliced for the processor in an embodiment of the present application. Please refer to Figure 2, in an embodiment of the present application, taking a multi-dimensional grid with three grid dimensions (i.e., X, Y, Z) as an example, the multi-dimensional grid has corresponding single-dimensional grid sizes in the three grid dimensions respectively. For example, the multi-dimensional grid has a single-dimensional grid size m in the grid dimension X, a single-dimensional grid size n in the grid dimension Y, and a single-dimensional grid size k in the grid dimension Z. Among them, m, n, and k are all positive integers greater than or equal to 1, m, n, and k can be the same or not all the same, and at least one of m, n, and k is greater than 1.

[0031] Exemplarily, in an embodiment of the present application, the smallest grid unit in the multi-dimensional grid is a thread block cluster (ThreadBlock Cluster), each thread block cluster includes at least two thread blocks (Thread Block), each thread block can include any number of threads (Thread), and the single-dimensional grid size of the multi-dimensional grid in any one grid dimension can refer to the arrangement number of the thread block clusters of the multi-dimensional grid in this grid dimension. That is, the arrangement number of the thread block clusters of the multi-dimensional grid in the grid dimension X is m, the arrangement number of the thread block clusters of the multi-dimensional grid in the grid dimension Y is n, and the arrangement number of the thread block clusters of the multi-dimensional grid in the grid dimension Z is k. Figure 2 In [the figure], the boundaries of the thread block clusters are represented by solid lines and the boundaries of the thread blocks are represented by dashed lines. Correspondingly, Figure 2 in [the figure], an example where a thread block cluster includes 2×2×1 thread blocks is used for illustration.

[0032] Exemplarily, in an embodiment of the present application, the divided grid obtained by the command processor 10 for the multi-dimensional grid can include at least one thread block cluster, and the single-dimensional grid size (such as the arrangement number of the thread block clusters) of the divided grid in at least one grid dimension (such as at least one of X, Y, Z) is less than the single-dimensional grid size (such as the arrangement number of the thread block clusters) of the multi-dimensional grid in the corresponding grid dimension.

[0033] Assume that the division granularities set in multiple grid dimensions are 2, 4, 2 respectively, and the number of kernel units is 4: If as Figure 2 shown, the m, n, and k of the current multi-dimensional grid are 4, 8, and 2 respectively, then the multi-dimensional grid can be divided into 4 divided grids, and thus, the 4 divided grids can be evenly distributed to 4 kernel units 20; If the current multi-dimensional grid is a multi-dimensional grid with m being 8, and / or n being 16, and / or k being 4, then the predicted number of divisions performed with the division granularities of 2, 4, 2 set in multiple grid dimensions respectively reaches 8, 16, or 32, that is, greater than the number of kernel units 4. At this time, even if the divided grids can still be evenly distributed to 4 kernel units 20, it will increase the interaction between the command processor 10 and the 4 kernel units 20; If the current multi - dimensional grid has dimensions m, n, and k of 2, 8, and 2 respectively, then the predicted number of splits performed with split granularities of 2, 4, and 2 set respectively in multiple grid dimensions is only 2, that is, less than the number of kernel units 4. At this time, although the interaction between the command processor 10 and the 4 kernel units 20 will not increase, only 2 kernel units 20 will be assigned split grids, while the other 2 kernel units 20 will be idle, resulting in an unbalanced load among the 4 kernel units 20.

[0034] Therefore, in the embodiments of the present application, in order to facilitate suppressing the above - mentioned increase in interaction and load imbalance, the split granularity of the multi - dimensional grid in multiple grid dimensions can be reduced to a reference dimension.

[0035] Exemplarily, in the embodiments of the present application, in order to achieve the reduction of the split granularity of the multi - dimensional grid in multiple grid dimensions, the command processor 10 needs to select one of the multiple grid dimensions as the reference dimension, that is, the command processor 10 can be used to: determine the reference dimension of the current multi - dimensional grid among multiple grid dimensions.

[0036] Exemplarily, in the embodiments of the present application, the command processor 10 can select the reference dimension according to the size characteristics of different multi - dimensional grids in multiple grid dimensions to improve the adaptability to diverse multi - dimensional grids, that is, the command processor 10 can be specifically configured to: based on the single - dimensional grid sizes of the current multi - dimensional grid in multiple grid dimensions respectively, determine the reference dimension of the current multi - dimensional grid among multiple grid dimensions.

[0037] Exemplarily, in the embodiments of the present application, in order to make the single - dimensional split granularity reduced to the reference dimension have as high an accuracy as possible, the command processor 10 can preferably select the grid dimension with the largest single - dimensional grid size as the reference dimension. For example, if the current multi - dimensional grid is a multi - dimensional grid with m, n, and k being 4, 8, and 2 as shown in Figure 2 Since n is the largest single - dimensional size among the single - dimensional grid sizes of the current multi - dimensional grid in multiple grid dimensions X, Y, and Z respectively, the grid dimension Y can be determined as the reference grid dimension. In this case, the command processor 10 can be specifically configured to: determine the largest single - dimensional size among the single - dimensional grid sizes of the current multi - dimensional grid in multiple grid dimensions respectively; and determine the grid dimension where the largest single - dimensional size is located as the reference dimension of the current multi - dimensional grid among multiple grid dimensions.

[0038] Exemplarily, in the embodiments of the present application, the dimension-reduced single-dimensional segmentation granularity may not be fixed, but may be adaptively adjusted in accordance with the multi-dimensional grid based on a preset maximum single-dimensional granularity. The preset maximum single-dimensional granularity may be an empirical value or a parameter set according to the hardware performance of the kernel unit 20. Moreover, the maximum single-dimensional granularity is intended to: ensure that the segmented grids obtained by segmenting the multi-dimensional grid are as large as possible within the capacity of the kernel unit 20. Therefore, in the embodiments of the present application, priority may be given to using the preset maximum single-dimensional granularity for segmentation, but it is necessary to verify whether it can satisfy the load balance among at least two kernel units 20. Correspondingly, the command processor 10 may also be used to: perform an equilibrium prediction check on the preset maximum single-dimensional granularity by using the reference grid size of the current multi-dimensional grid in the reference dimension (e.g., the maximum single-dimensional size among the single-dimensional grid sizes of the current multi-dimensional grid in multiple grid dimensions). The target conditions for the equilibrium prediction check may include: the predicted segmentation quantity of the multiple segmented grids obtained by segmenting the current multi-dimensional grid in the reference dimension using the maximum single-dimensional granularity is an integer multiple of the number of kernel units of at least two kernel units 20.

[0039] For example, if the reference grid size of the current multi-dimensional grid in the reference dimension is denoted as Grid_ref_size, and the number of kernel units is denoted as NumKer, then the predicted segmentation quantity NumPreCut of the multiple segmented grids obtained by segmenting the multi-dimensional grid in the reference dimension using the maximum single-dimensional granularity Grid_cut_maxsize can be expressed as: , that is, the predicted segmentation quantity NumPreCut may be the ceiling result of the quotient of the reference grid size Grid_ref_size of the current multi-dimensional grid in the reference dimension and the maximum single-dimensional granularity Grid_cut_maxsize. Here, the " " represents the ceiling operation.

[0040] For example, if the current multi-dimensional grid is a multi-dimensional grid with m, n, and k being 4, 8, and 2 respectively as shown in Figure 2 (i.e., the reference grid size Grid_ref_size of the current multi-dimensional grid in the grid dimension Y is 8), the number of kernel units is 4, and the preset maximum single-dimensional granularity Grid_cut_maxsize is 2, then the predicted segmentation quantity NumPreCut of the multiple segmented grids obtained by segmenting the current multi-dimensional grid in the reference dimension using the maximum single-dimensional granularity Grid_cut_maxsize may be 4, which is equal to the number of kernel units NumKer. In this case, the result of the equilibrium prediction check satisfies the above target conditions.

[0041] For example, if m, n, and k of the current multi-dimensional grid are 4, 6, and 2 respectively (i.e., the reference grid size of the current multi-dimensional grid in the grid dimension Y is Grid_ref_size = 6), the number of kernel units is 4, and the preset one-dimensional maximum granularity Grid_cut_maxsize is 2, then the predicted cut number NumPreCut of the multiple cut grids obtained by cutting the current multi-dimensional grid in the reference dimension using this one-dimensional maximum granularity Grid_cut_maxsize is 3, and it is not an integer multiple of the number of kernel units NumKer (i.e., 4). At this time, the result of the balanced prediction check does not meet the above target condition.

[0042] For another example, if m, n, and k of the current multi-dimensional grid are 4, 12, and 2 respectively (i.e., the reference grid size of the current multi-dimensional grid in the grid dimension Y is Grid_ref_size = 12), the number of kernel units is 4, and the preset one-dimensional maximum granularity Grid_cut_maxsize is 2, then the predicted cut number NumPreCut of the multiple cut grids obtained by cutting the current multi-dimensional grid in the reference dimension using this one-dimensional maximum granularity Grid_cut_maxsize is 6, and it is not an integer multiple of the number of kernel units NumKer (i.e., 4). At this time, the result of the balanced prediction check does not meet the above target condition.

[0043] Exemplarily, in the embodiments of the present application, in order to support the adaptation adjustment of the one-dimensional cut granularity based on the one-dimensional maximum granularity to the multi-dimensional grid, the command processor 10 can also be used to: determine the one-dimensional cut granularity of the current multi-dimensional grid in the reference dimension of the current multi-dimensional grid according to the check result of the balanced prediction check of the one-dimensional maximum granularity.

[0044] Exemplarily, in the embodiments of the present application, if the check result of the balanced prediction check of the one-dimensional maximum granularity indicates that the above target condition is met, that is, the predicted cut number of the multiple cut grids obtained by cutting the current multi-dimensional grid in the reference dimension using the one-dimensional maximum granularity is exactly an integer multiple of the number of kernel units, then the command processor 10 can determine this one-dimensional maximum granularity as the one-dimensional cut granularity of the current multi-dimensional grid in the reference dimension of the current multi-dimensional grid. Thus, on the premise of ensuring the load balance of at least two kernel units 20, the cut grids obtained by cutting the current multi-dimensional grid can be maximized.

[0045] Exemplarily, in an embodiment of the present application, if the verification result of the balanced prediction verification of the single-dimensional maximum granularity indicates that the above target conditions are not satisfied, the command processor 10 may determine the single-dimensional segmentation granularity of the current multi-dimensional grid in the reference dimension of the current multi-dimensional grid according to the reference grid size of the current multi-dimensional grid in the reference grid direction and the smallest integer multiple of the number of kernel units that is not less than the predicted segmentation number. Wherein, the unit segmentation granularity determined in this way is an integer, and the optimal ideal value of the unit segmentation granularity determined in this way is an integer multiple of the number of kernel units. However, on the premise of taking into account that the unit segmentation granularity is an integer, the unit segmentation granularity determined in this way is not necessarily an integer multiple of the number of kernel units.

[0046] Exemplarily, in an embodiment of the present application, the smallest integer multiple of the number of kernel units that is not less than the predicted segmentation number can be considered as the balanced segmentation number of the multiple segmentation grids obtained by segmenting the current multi-dimensional grid in the reference grid direction. This balanced segmentation number can be considered as: the ideal segmentation number that enables the multiple segmentation grids obtained by segmenting the current multi-dimensional grid in the reference grid direction to be evenly divided by all the kernel units 20 as much as possible with the largest possible size.

[0047] Exemplarily, in an embodiment of the present application, the command processor 10 may be specifically configured to: if the verification result of the balanced prediction verification of the single-dimensional maximum granularity indicates that the above target conditions are not satisfied, then determine the balanced segmentation number of the multiple segmentation grids obtained by segmenting the current multi-dimensional grid in the reference dimension according to the predicted segmentation number of the current multi-dimensional grid in the reference dimension and the number of kernel units; and determine the single-dimensional segmentation granularity of the current multi-dimensional grid in the reference dimension of the current multi-dimensional grid according to the reference grid size of the current multi-dimensional grid and the balanced segmentation number.

[0048] Exemplarily, in an embodiment of the present application, if the verification result of the balanced prediction verification of the single-dimensional maximum granularity indicates that the above target conditions are not satisfied, then the single-dimensional segmentation granularity determined by the command processor 10 according to the reference grid size of the current multi-dimensional grid and the balanced segmentation number (that is, the smallest integer multiple of the number of kernel units that is not less than the predicted segmentation number) can enable: the multiple segmentation grids obtained by segmenting the current multi-dimensional grid in the reference grid direction can be evenly distributed to all the kernel units 20 as much as possible when the granularity is as large as possible.

[0049] Exemplarily, in an embodiment of the present application, the command processor 10 may be specifically configured to: if the verification result of the equalization prediction verification of the single-dimensional maximum granularity indicates that the above target condition is not satisfied, then, based on the reference grid size of the current multi-dimensional grid and the size equalization granularity evenly divided by the equalization division quantity, determine the single-dimensional division granularity of the current multi-dimensional grid in the reference dimension of the current multi-dimensional grid. For example, the size equalization granularity may be the quotient of the reference grid size of the current multi-dimensional grid and the equalization division quantity. Therefore, the size equalization granularity may be an integer or a non-integer. Thus, the command processor 10 may determine the ceiling result of the size equalization granularity as the single-dimensional division granularity of the current multi-dimensional grid in the reference dimension of the current multi-dimensional grid.

[0050] Exemplarily, in an embodiment of the present application, the size equalization granularity, which may be an integer or a non-integer, is generally different from the single-dimensional maximum granularity, and the ceiling result of the size equalization granularity (i.e., the single-dimensional division granularity of the current multi-dimensional grid in the reference dimension of the current multi-dimensional grid) may be different from the single-dimensional maximum granularity but may also be equal to the single-dimensional maximum granularity, where: If the ceiling result of the size equalization granularity is different from the single-dimensional maximum granularity, then, using this ceiling result as the single-dimensional division granularity can make the divided grid more balanced than using the unit maximum granularity when the size is as large as possible, that is, relatively balanced. If the ceiling result of the size equalization granularity is equal to the single-dimensional maximum granularity, and thus, in the case where the verification result of the equalization prediction verification of the single-dimensional maximum granularity indicates that the above target condition is not satisfied, the single-dimensional maximum granularity is still determined as the single-dimensional division granularity of the current multi-dimensional grid in the reference dimension of the current multi-dimensional grid, then, it indicates that the unit maximum granularity that does not satisfy the target condition is the relatively optimal division granularity compared to other granularities. At this time, determining the single-dimensional maximum granularity as the single-dimensional division granularity can achieve at least taking into account the maximized relative balance of the divided grid.

[0051] Thus, based on the embodiment of the present application, even if the predicted division quantity of the multiple divided grids obtained by dividing the current multi-dimensional grid using the single-dimensional maximum granularity in the reference dimension is not an integer multiple of the number of kernel units, it is still possible to seek a relatively optimal division granularity by determining a single-dimensional division granularity different from the single-dimensional maximum granularity, so that the divided grids obtained by dividing the multi-dimensional grid can be evenly divided by at least two kernel units 20 as much as possible with as large a size as possible. Exemplarily, in an embodiment of the present application, the cases where the verification result indicates that the target condition is not satisfied include two types, that is, the predicted division quantity that is not an integer multiple of the number of kernel units is less than the number of kernel units, and the predicted division quantity that is not an integer multiple of the number of kernel units is greater than the number of kernel units.

[0052] Exemplarily, in an embodiment of the present application, if the predicted segmentation quantity that is not an integer multiple of the number of kernel units is less than the number of kernel units, it indicates that: the multiple segmentation grids obtained by segmenting the current multi-dimensional grid on the reference dimension using the single-dimensional maximum granularity are not sufficient to be assigned to all the kernel units 20. At this time, the command processor 10 may determine the balanced segmentation quantity (i.e., the smallest integer multiple of the number of kernel units that is greater than the predicted segmentation quantity) as one times the number of kernel units, and, using the reference grid size of the current multi-dimensional grid and the number of kernel units (i.e., one times the number of kernel units as the balanced segmentation quantity), determine the size equalization granularity obtained by equally dividing the reference grid size of the current multi-dimensional grid on the reference dimension by the number of kernel units, and then determine the single-dimensional segmentation granularity of the current multi-dimensional grid on the reference dimension according to the size equalization granularity. For example, the rounded-up result of the size equalization granularity is determined as the unit segmentation granularity, so that: the actual segmentation quantity of the segmentation grids obtained by segmenting the current multi-dimensional grid on the reference dimension using the single-dimensional segmentation granularity is equal to or approaches the number of kernel units.

[0053] For example, if m, n, and k of the current multi-dimensional grid are 40, 60, and 20 respectively (i.e., the reference grid size of the current multi-dimensional grid in grid dimension Y is Grid_ref_size = 60), the number of kernel units is 6, and the preset maximum single-dimensional granularity Grid_cut_maxsize is 12, then the predicted cut number NumPreCut of the multiple cut grids obtained by splitting the current multi-dimensional grid with the maximum single-dimensional granularity Grid_cut_maxsize in the reference dimension is 5, and it is not an integer multiple of the number of kernel units NumKer (i.e., 6). At this time, the result of the balanced prediction check does not meet the above target condition. The smallest integer multiple (i.e., the balanced cut number NumBlcCut) of the number of kernel units NumKer (i.e., 6) that is not less than the predicted cut number NumPreCut (i.e., 5) is one times the number of kernel units NumKer (i.e., 6). At this time, based on the reference grid size Grid_ref_size (i.e., 60) of the current multi-dimensional grid and this smallest integer multiple (i.e., 6) representing the balanced cut number NumBlcCut, the size equal division granularity obtained by evenly dividing the reference grid size Grid_ref_size (i.e., 60) of the current multi-dimensional grid by the balanced cut number NumBlcCut (i.e., 6) can be determined to be 10, which is different from the maximum single-dimensional granularity Grid_cut_maxsize (i.e., 12). And the ceiling result of this size equal division granularity (i.e., 10) (which is still 10) can be determined as the single-dimensional cut granularity Grid_cut_size of the current multi-dimensional grid in the reference dimension Y, that is, Grid_cut_size = 10. Furthermore, the actual cut number of the cut grids obtained by splitting the current multi-dimensional grid with the single-dimensional cut granularity Grid_cut_size (i.e., 10) in the reference dimension is 6, which is equal to the number of kernel units NumKer (i.e., 6).

[0054] For another example, if m, n, and k of the current multi-dimensional grid are 4, 6, and 2 respectively (i.e., the reference grid size of the current multi-dimensional grid in the grid dimension Y is Grid_ref_size = 6), the number of kernel units is 4, and the preset maximum single-dimensional granularity Grid_cut_maxsize is 2, then the predicted cut number NumPreCut of the multiple cut grids obtained by cutting the current multi-dimensional grid with the maximum single-dimensional granularity Grid_cut_maxsize in the reference dimension is 3, and it is not an integer multiple of the number of kernel units NumKer (i.e., 4). At this time, the result of the balanced prediction check does not meet the above target condition. The smallest integer multiple (i.e., the balanced cut number) of the number of kernel units NumKer (i.e., 4) that is not less than the predicted cut number NumPreCut (i.e., 3) is one times the number of kernel units NumKer (i.e., 4). At this time, based on the reference grid size Grid_ref_size (i.e., 6) of the current multi-dimensional grid and this smallest integer multiple (i.e., 4) representing the balanced cut number, it can be determined that the size equal division granularity obtained by equally dividing the reference grid size Grid_ref_size (i.e., 6) of the current multi-dimensional grid by the balanced cut number (i.e., 4) is 1.5, which is different from the maximum single-dimensional granularity Grid_cut_maxsize (i.e., 2). Moreover, the ceiling result (i.e., 2) of this size equal division granularity (i.e., 1.5) can be determined as the single-dimensional cut granularity Grid_cut_size of the current multi-dimensional grid in the reference dimension Y of the current multi-dimensional grid, that is, Grid_cut_size = Grid_cut_maxsize = 2. Furthermore, the actual cut number of the cut grids obtained by cutting the current multi-dimensional grid with the single-dimensional cut granularity Grid_cut_size (i.e., 2) in the reference dimension is 3, which is close to the number of kernel units NumKer (i.e., 4).

[0055] Exemplarily, in an embodiment of the present application, if the predicted segmentation quantity that is not an integer multiple of the number of kernel units is greater than the number of kernel units, it means that although the multiple segmentation grids obtained by segmenting the current multi-dimensional grid on the reference dimension using the single-dimensional maximum granularity are sufficient to be assigned to all the kernel units 20, however, the number of segmentation grids assigned to at least two kernel units 20 is not all the same, that is, the load of at least two kernel units 20 is unbalanced. At this time, the command processor 10 may determine the balanced segmentation quantity (that is, the smallest integer multiple of the number of kernel units that is greater than the predicted segmentation quantity) to be at least twice the number of kernel units, and, using the reference grid size of the current multi-dimensional grid and the number of kernel units (that is, at least twice the number of kernel units as the balanced segmentation quantity), determine the size equalization granularity obtained by equally dividing the reference grid size of the current multi-dimensional grid on the reference dimension by the number of kernel units, and then, based on this size equalization granularity, determine the single-dimensional segmentation granularity of the current multi-dimensional grid on the reference dimension of the current multi-dimensional grid. For example, the rounded-up result of the size equalization granularity is determined as the unit segmentation granularity, so that: the actual segmentation quantity of the segmentation grids obtained by segmenting the current multi-dimensional grid on the reference dimension using the single-dimensional segmentation granularity is equal to or approaches at least twice the number of kernel units.

[0056] For example, if m, n, and k of the current multi-dimensional grid are 40, 60, and 20 respectively (i.e., the reference grid size of the current multi-dimensional grid, Grid_ref_size, in grid dimension Y is 60), the number of kernel units is 6, and the preset maximum single-dimensional granularity Grid_cut_maxsize is 8, then the predicted number of cuts NumPreCut of the multiple cut grids obtained by dividing the current multi-dimensional grid in the reference dimension using this maximum single-dimensional granularity Grid_cut_maxsize is 8 (i.e., the ceiling result of 7.5) and is not an integer multiple of the number of kernel units NumKer (i.e., 6). At this time, the result of the balanced prediction check does not meet the above target condition. The smallest integer multiple of the number of kernel units NumKer (i.e., 6) that is not less than the predicted number of cuts NumPreCut (i.e., 8) (i.e., the balanced number of cuts NumBlcCut) is twice the number of kernel units NumKer (i.e., 12). At this time, based on the reference grid size Grid_ref_size of the current multi-dimensional grid (i.e., 60) and this smallest integer multiple (i.e., 12) representing the balanced number of cuts NumBlcCut, the size equal division granularity obtained by evenly dividing the reference grid size Grid_ref_size of the current multi-dimensional grid (i.e., 60) by the balanced number of cuts NumBlcCut (i.e., 12) can be determined to be 5, which is different from the maximum single-dimensional granularity Grid_cut_maxsize (i.e., 8). Moreover, the ceiling result of this size equal division granularity (i.e., 5) (which is still 5) can be determined to be the single-dimensional cut granularity Grid_cut_size of the current multi-dimensional grid in the reference dimension Y of the current multi-dimensional grid, i.e., Grid_cut_size = 5. Furthermore, the actual number of cuts of the cut grids obtained by dividing the current multi-dimensional grid in the reference dimension using the single-dimensional cut granularity Grid_cut_size (i.e., 5) is 12, which is equal to twice the number of kernel units NumKer (i.e., 6).

[0057] For another example, if m, n, and k of the current multi-dimensional grid are 4, 12, and 2 respectively (i.e., the reference grid size of the current multi-dimensional grid is that the reference grid size Grid_ref_size in the grid dimension Y is 12), the number of kernel units is 4, and the preset one-dimensional maximum granularity Grid_cut_maxsize is 2, then the predicted cut number NumPreCut of the multiple cut grids obtained by splitting the current multi-dimensional grid using the one-dimensional maximum granularity Grid_cut_maxsize in the reference dimension is 6, and it is not an integer multiple of the number of kernel units NumKer (i.e., 4). At this time, the result of the balanced prediction check does not meet the above target condition. The smallest integer multiple of the number of kernel units NumKer (i.e., 4) that is not less than the predicted cut number NumPreCut (i.e., 3) is twice the number of kernel units NumKer (i.e., 8). At this time, based on the reference grid size Grid_ref_size of the current multi-dimensional grid (i.e., 12) and this smallest integer multiple (i.e., 8) representing the balanced cut number, the size equal division granularity obtained by equally dividing the reference grid size Grid_ref_size of the current multi-dimensional grid (i.e., 12) by the balanced cut number (i.e., 8) can be determined to be 1.5, which is different from the one-dimensional maximum granularity Grid_cut_maxsize (i.e., 2). And the ceiling result of this size equal division granularity (i.e., 1.5) (i.e., 2) can be determined as the one-dimensional cut granularity Grid_cut_size of the current multi-dimensional grid in the reference dimension Y, that is, Grid_cut_size = Grid_cut_maxsize = 2. Furthermore, the actual cut number of the cut grids obtained by splitting the current multi-dimensional grid using the one-dimensional cut granularity Grid_cut_size (i.e., 2) in the reference dimension is 6, which is 1.5 times the number of kernel units NumKer (i.e., 4).

[0058] Exemplarily, in the embodiments of the present application, in order to simplify the calculation process for determining the one-dimensional cut granularity, the command processor 10 may be specifically configured to: perform a balanced prediction check on the one-dimensional maximum granularity based on the segmented prediction result of the reference grid size using the one-dimensional maximum granularity.

[0059] Exemplarily, in an embodiment of the present application, the command processor 10 may be configured to implement an equalized prediction check based on the segmented prediction result in the following manner: predicting the number of segmented estimation segments of the reference grid size of the current multi-dimensional grid in the reference dimension using a one-dimensional maximum granularity (the number of segmented estimation segments may be used to characterize the prediction segmentation quantity mentioned above); and, based on the number of segmented estimation segments and the number of kernel units, determining the check result of the equalized prediction check for the one-dimensional maximum granularity; wherein, if the number of segmented estimation segments is an integer multiple of the number of kernel units, the check result indicates that the foregoing target condition is satisfied; if the number of segmented estimation segments is a non-integer multiple of the number of kernel units, the check result indicates that the foregoing target condition is not satisfied.

[0060] Exemplarily, in an embodiment of the present application, the command processor 10 may be configured to: based on the number of segmented estimation segments of the reference grid size of the current multi-dimensional grid in the reference dimension and the number of kernel units, determine the equalized segmentation quantity of the multiple segmented grids obtained by segmenting the current multi-dimensional grid in the reference dimension.

[0061] Exemplarily, in an embodiment of the present application, if the number of segmented estimation segments, which is a non-integer multiple of the number of kernel units, is less than the number of kernel units, then the command processor 10 may determine the equalized segmentation quantity (i.e., the smallest integer multiple of the number of kernel units greater than the number of segmented estimation segments) to be one times the number of kernel units, and, using the reference grid size of the current multi-dimensional grid and the number of kernel units (i.e., one times the number of kernel units as the equalized segmentation quantity), determine the size equalization granularity obtained by evenly dividing the reference grid size of the current multi-dimensional grid in the reference dimension by the number of kernel units, and then determine this size equalization granularity as the one-dimensional segmentation granularity of the current multi-dimensional grid in the reference dimension of the current multi-dimensional grid.

[0062] For example, if the reference grid size of the current multi-dimensional grid in the reference dimension is represented as Grid_ref_size, the NumPreCut used above to represent the prediction segmentation quantity may also be used to represent the number of segmented estimation segments, the number of kernel units is represented as NumKer, and the number of segmented estimation segments NumPreCut is less than the number of kernel units NumKer, then the equalized segmentation quantity NumBlcCut can be determined to be one times the number of kernel units NumKer (i.e., NumBlcCut is equal to NumKer) at this time, and the one-dimensional segmentation granularity Grid_cut_size determined based on the size equalization granularity can be expressed as: ," " indicates rounding up.

[0063] Exemplarily, in an embodiment of the present application, if the number of segmented estimation segments that is not an integer multiple of the number of kernel units is greater than the number of kernel units, then the command processor 10 may determine the equalized segmentation quantity (i.e., the smallest integer multiple of the number of kernel units that is greater than the number of segmented estimation segments) to be at least twice the number of kernel units, and, by using the reference grid size of the current multi-dimensional grid and the number of kernel units (i.e., the number of kernel units that is at least twice the number of kernel units as the equalized segmentation quantity), determine the size equalization granularity obtained by equally dividing the reference grid size of the current multi-dimensional grid in the reference dimension by the number of kernel units, and then perform a one-dimensional segmentation granularity of the current multi-dimensional grid in the reference dimension of the current multi-dimensional grid with the size equalization granularity.

[0064] Exemplarily, in an embodiment of the present application, if the number of segmented estimation segments that is not an integer multiple of the number of kernel units is greater than the number of kernel units, then the command processor 10 may determine the modulo result of the number of segmented estimation segments with respect to the number of kernel units, where the modulo result represents the remainder of dividing the number of segmented estimation segments by the number of kernel units, and the command processor 10 may further calculate the difference between the sum of the number of segmented estimation segments and the number of kernel units and the modulo result to determine the equalized segmentation quantity, that is, determine the smallest integer multiple of the number of kernel units that is greater than the number of segmented estimation segments (at least twice at this time).

[0065] For example, if the reference grid size of the current multi-dimensional grid in the reference dimension is represented as Grid_ref_size, NumPreCut used to represent the predicted segmentation quantity previously may also be used to represent the number of segmented estimation segments, the number of kernel units is represented as NumKer, and the number of segmented estimation segments NumPreCut is greater than the number of kernel units NumKer, then the equalized segmentation quantity NumBlcCut can be determined to be at least twice the number of kernel units NumKer at this time, that is: NumBlcCut = NumPreCut + NumKer – (NumPreCut % NumKer), where % here represents the modulo operation. In this case, the one-dimensional segmentation granularity Grid_cut_size determined according to the size equalization granularity can be represented as: , where the " " represents rounding up.

[0066] Figure 3 is an example schematic diagram of the one-dimensional segmentation granularity determination logic of the processor in the embodiment of the present application. Please refer to Figure 3 , in an embodiment of the present application, the command processor of the processor may determine the one-dimensional segmentation granularity based on the equalized prediction verification of the one-dimensional maximum granularity according to the following logic: S300: Predict the number of segmented estimation segments NumPreCut of the reference grid size Grid_ref_size of the current multi-dimensional grid in the reference dimension using the single-dimensional maximum granularity Grid_cut_maxsize (i.e., the predicted number of cuts of multiple cut grids obtained by dividing the current multi-dimensional grid by the single-dimensional maximum granularity Grid_cut_maxsize in the reference dimension).

[0067] S310: Determine whether the number of segmented estimation segments (i.e., the predicted number of cuts NumPreCut) is less than the number of kernel units NumKer, that is, determine whether NumPreCut < NumKer holds.

[0068] If S310 determines that the number of segmented estimation segments NumPreCut (i.e., the predicted number of cuts) < the number of kernel units NumKer does not hold, then jump to S330; If S310 determines that the number of segmented estimation segments NumPreCut (i.e., the predicted number of cuts) < the number of kernel units NumKer holds, then jump to S350.

[0069] S330: Determine whether the number of segmented estimation segments NumPreCut (i.e., the predicted number of cuts) is an integer multiple of the number of kernel units NumKer.

[0070] If S330 determines that the number of segmented estimation segments NumPreCut (i.e., the predicted number of cuts) is an integer multiple of the number of kernel units NumKer, then jump to S370; If S330 determines that the number of segmented estimation segments NumPreCut (i.e., the predicted number of cuts) is a non-integer multiple of the number of kernel units NumKer, then jump to S390.

[0071] S350: Determine the single-dimensional cut granularity Grid_cut_size of the current multi-dimensional grid in the reference dimension according to the size equalization granularity (i.e., Grid_ref_size / NumKer) obtained by equally dividing the reference grid size Grid_ref_size of the current multi-dimensional grid in the reference dimension by the number of kernel units NumKer, that is, the single-dimensional cut granularity ," " means rounding up.

[0072] S370: Set the single-dimensional maximum granularity Grid_cut_maxsize as the single-dimensional cut granularity Grid_cut_size of the current multi-dimensional grid in the reference dimension, that is, Grid_cut_size = Grid_cut_maxsize.

[0073] S390: Determine the one-dimensional segmentation granularity Grid_cut_size of the current multi-dimensional grid in the reference dimension of the current multi-dimensional grid according to the size segmentation granularity (i.e., Grid_ref_size / NumBlcCut) obtained by equally dividing the reference grid size Grid_ref_size within the current multi-dimensional grid in the reference dimension by at least twice the number of kernel units NumKer (i.e., NumBlcCut). For example, the one-dimensional segmentation granularity , where the " " here means rounding up.

[0074] In Figure 3 the logical example shown, S310 and S330 can be considered as processes belonging to the balanced prediction verification of the one-dimensional maximum granularity. And S350, S370, and S390 can belong to the process of determining the one-dimensional segmentation granularity according to the verification result of the balanced prediction verification.

[0075] Exemplarily, in the embodiments of the present application, the command processor 10 can also be used for: Using the one-dimensional segmentation granularity determined for the current multi-dimensional grid to segment the current multi-dimensional grid in the reference dimension of the current multi-dimensional grid, obtaining multiple segmented grids respectively corresponding to at least two kernel units 20. The actual number of segmented grids can be an integer multiple (including one time and at least two times) of the number of kernel units, or approach an integer multiple (including one time and at least two times) of the number of kernel units. Wherein, the one-dimensional grid size of the segmented grid in the reference dimension of the current multi-dimensional grid can be equal to the one-dimensional segmentation granularity. And the one-dimensional grid size of the segmented grid in other dimensions of the current multi-dimensional grid can maintain the one-dimensional grid size in other dimensions of the current multi-dimensional grid. Assign the multiple segmented grids as kernel tasks to the corresponding kernel units 20 respectively.

[0076] Thus, the embodiments of the present application can ensure that the segmented grids obtained by segmenting the multi-dimensional grid are as large as possible, and at the same time, the segmented grids can be evenly divided by the kernel units 20. Furthermore, it can not only improve the computing efficiency of the processor by suppressing the increase in the interaction time consumption between the command processor 10 and the multiple kernel units 20, but also improve the computing efficiency of the processor by suppressing the decrease in the utilization rate of the multiple kernel units 20. For example, taking an existing processor of a certain specification as a reference benchmark, adopting the solution of the embodiments of the present application can increase the computing efficiency of the processor from 0.74 times that of the existing processor to 1.1 times.

[0077] In the embodiments of the present application, a grid segmentation method for a processor is also provided.

[0078] Figure 4This is an exemplary flowchart of the grid segmentation method for a processor in an embodiment of the present application. Please refer to Figure 4 , in an embodiment of the present application, the grid segmentation method for a processor may include: S410: Determine the reference dimension among multiple grid dimensions of the current multi-dimensional grid; S430: Use the reference grid size of the current multi-dimensional grid in the reference dimension to perform an equalization prediction check on a preset one-dimensional maximum granularity; wherein, the target conditions for the equalization prediction check include: the predicted segmentation quantity of multiple segmentation grids obtained by segmenting the current multi-dimensional grid in the reference dimension using the one-dimensional maximum granularity is an integer multiple of the number of kernel units of at least two kernel units in the processor; S450: Determine the one-dimensional segmentation granularity of the current multi-dimensional grid in the reference dimension of the current multi-dimensional grid according to the check result of the equalization prediction check on the one-dimensional maximum granularity; wherein, if the check result of the equalization prediction check on the one-dimensional maximum granularity indicates that the target conditions are met, then determine the one-dimensional maximum granularity as the one-dimensional segmentation granularity of the current multi-dimensional grid in the reference dimension of the current multi-dimensional grid; otherwise, determine the one-dimensional segmentation granularity of the current multi-dimensional grid in the reference dimension of the current multi-dimensional grid according to the reference grid size of the current multi-dimensional grid in the reference dimension and the smallest integer multiple of the number of kernel units that is not less than the predicted segmentation quantity; S470: Use the determined one-dimensional segmentation granularity of the current multi-dimensional grid to segment the current multi-dimensional grid in the reference dimension of the current multi-dimensional grid to obtain multiple segmentation grids corresponding to at least two kernel units respectively; wherein, the one-dimensional grid size of the segmentation grid in the reference dimension of the current multi-dimensional grid may be equal to the one-dimensional segmentation granularity; the one-dimensional grid sizes of the segmentation grid in other dimensions of the current multi-dimensional grid may maintain the one-dimensional grid sizes in other dimensions of the current multi-dimensional grid; and, the multiple segmentation grids may be respectively assigned to corresponding kernel units as kernel tasks.

[0079] Based on the above process, the segmentation granularity of the multi-dimensional grid in multiple grid dimensions can be reduced to one reference dimension, and the reduced one-dimensional segmentation granularity can be adaptively adjusted to the multi-dimensional grid on the basis of the preset one-dimensional maximum granularity. Thus, it can be ensured that the segmentation grids obtained by segmenting the multi-dimensional grid can be evenly divided by the kernel units as much as possible with as large a size as possible, thereby improving the computing efficiency of the processor by suppressing the increase in the interaction time between the command processor and multiple kernel units, and also improving the computing efficiency of the processor by suppressing the decrease in the utilization rate of multiple kernel units.

[0080] Exemplarily, in an embodiment of the present application, in order to select a reference dimension according to the size characteristics of different multi-dimensional grids in multiple grid dimensions to improve the adaptation ability to diverse multi-dimensional grids, such asFigure 4 S410 in the process shown may include: determining a reference dimension of the current multi-dimensional grid among multiple grid dimensions based on the one-dimensional grid sizes of the current multi-dimensional grid on each of the multiple grid dimensions.

[0081] Exemplarily, in the embodiments of the present application, in order to enable the one-dimensional segmentation granularity after dimension reduction to the reference dimension to have as high precision as possible, when S410 determines the reference dimension based on the one-dimensional grid sizes of the current multi-dimensional grid, it may preferably select the grid dimension with the largest one-dimensional grid size as the reference dimension. That is, S410 may specifically include: determining the largest one-dimensional size among the one-dimensional grid sizes of the current multi-dimensional grid on each of the multiple grid dimensions; and determining the grid dimension where the largest one-dimensional size is located as the reference dimension of the current multi-dimensional grid among the multiple grid dimensions.

[0082] Exemplarily, in the embodiments of the present application, as Figure 4 S430 in the process shown may specifically include: determining the predicted segmentation quantity of the multiple segmentation grids obtained by segmenting the multi-dimensional grid on the reference dimension using the one-dimensional maximum granularity according to the ceiling result of the quotient of the reference grid size of the current multi-dimensional grid on the reference dimension and the one-dimensional maximum granularity.

[0083] Exemplarily, in the embodiments of the present application, in order to simplify the calculation process for determining the one-dimensional segmentation granularity, as Figure 4 S430 in the process shown may specifically include: performing an equalized prediction verification on the one-dimensional maximum granularity based on the segmented prediction result of the reference grid size using the one-dimensional maximum granularity.

[0084] Exemplarily, in the embodiments of the present application, as Figure 4 S430 in the process shown may perform the equalized prediction verification based on the segmented prediction result in the following manner: predicting the number of segmented estimation segments of the reference grid size of the current multi-dimensional grid on the reference dimension using the one-dimensional maximum granularity (the number of segmented estimation segments may be used to represent the predicted segmentation quantity mentioned above); and determining the verification result of the equalized prediction verification of the one-dimensional maximum granularity according to the number of segmented estimation segments and the number of kernel units. Among them, if the number of segmented estimation segments is an integer multiple of the number of kernel units, the verification result indicates that the foregoing target condition is satisfied; if the number of segmented estimation segments is a non-integer multiple of the number of kernel units, the verification result indicates that the foregoing target condition is not satisfied.

[0085] Exemplarily, in the embodiments of the present application, if the verification result indicates that the foregoing target condition is not satisfied, then, as Figure 4 S450 in the process shown determines the one-dimensional segmentation granularity according to the reference grid size of the current multi-dimensional grid and the smallest integer multiple of the number of kernel units that is not less than the predicted segmentation quantity, and may specifically include: Determine the balanced segmentation quantity of multiple segmented grids obtained by segmenting the current multi-dimensional grid in the reference dimension according to the predicted segmentation quantity (e.g., the estimated number of segments for segmentation) and the number of kernel units; wherein, the balanced segmentation quantity is the smallest integer multiple of the number of kernel units that is not less than the predicted segmentation quantity (e.g., the estimated number of segments for segmentation); if the predicted segmentation quantity (e.g., the estimated number of segments for segmentation) is less than the number of kernel units, then the balanced segmentation quantity is one times the number of kernel units; if the predicted segmentation quantity (e.g., the estimated number of segments for segmentation) is greater than the number of kernel units, then the balanced segmentation quantity is at least two times the number of kernel units. Determine the one-dimensional segmentation granularity of the current multi-dimensional grid in the reference dimension of the current multi-dimensional grid according to the reference grid size of the current multi-dimensional grid and the determined balanced segmentation quantity; for example, determine the one-dimensional segmentation granularity of the current multi-dimensional grid in the reference dimension of the current multi-dimensional grid according to the size segmentation granularity obtained by evenly dividing the reference grid size by the balanced segmentation quantity.

[0086] It can be understood that, as Figure 4 shown, the process is only a framework description of the grid segmentation method for a processor, and S430 and S450 therein can be executed in an interleaved manner by being fused with each other like the logic Figure 3 shown.

[0087] In an embodiment of the present application, an electronic device is further provided. The electronic device can be any data processing device or computing device, and the electronic device can include a processor as described above.

[0088] It can be understood that, in an embodiment of the present application, the contents of the various parts described by way of example can be in a "and / or" relationship. In this article, the meaning of "and / or" is that the context connected by it can be a co-defining relationship of "and", or can also be an alternative defining relationship of "or". Therefore, the contents with a "and / or" relationship can be understood as including different case combinations of the "and / or" between each two parts respectively representing the co-defining relationship of "and" or the alternative defining relationship of "or", and such different case combinations can be considered to be basically equivalent to the defined scope of "at least one of the various parts".

[0089] The above are only the preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included within the scope of protection of the present application.

Claims

1. A processor, characterized in that, Comprising: At least two kernel units; And A command processor, configured to: Determine a reference dimension among a plurality of grid dimensions of the current multi-dimensional grid; Perform an equalized prediction check on a preset one-dimensional maximum granularity by using a reference grid size of the current multi-dimensional grid in the reference dimension; wherein, target conditions of the equalized prediction check include: a predicted segmentation number of a plurality of segmented grids obtained by segmenting the current multi-dimensional grid in the reference dimension by using the one-dimensional maximum granularity is an integer multiple of the number of kernel units of the at least two kernel units; Determine a one-dimensional segmentation granularity of the current multi-dimensional grid in the reference dimension according to a check result of the equalized prediction check; wherein, if the check result indicates that the target conditions are satisfied, then determine the one-dimensional maximum granularity as the one-dimensional segmentation granularity; otherwise, determine the one-dimensional segmentation granularity according to the reference grid size and the smallest integer multiple of the number of kernel units that is not less than the predicted segmentation number; Segment the current multi-dimensional grid in the reference dimension by using the one-dimensional segmentation granularity to obtain the plurality of segmented grids respectively corresponding to the at least two kernel units.

2. The processor according to claim 1, wherein The command processor is specifically configured to: Determine the reference dimension based on one-dimensional grid sizes of the current multi-dimensional grid respectively in the plurality of grid dimensions.

3. The processor according to claim 2, wherein The command processor is specifically configured to: Determine a maximum one-dimensional size among the one-dimensional grid sizes of the current multi-dimensional grid respectively in the plurality of grid dimensions; Determine a grid dimension where the maximum one-dimensional size is located as the reference dimension; wherein, the reference grid size is the maximum one-dimensional size.

4. The processor according to claim 1, wherein The command processor is specifically configured to: Perform the equalized prediction check on the one-dimensional maximum granularity based on a segmented prediction result of the reference grid size by using the one-dimensional maximum granularity.

5. The processor according to claim 4, wherein The command processor is specifically configured to: Predict a segmented estimation number of segments of the reference grid size by using the one-dimensional maximum granularity; wherein, the segmented estimation number of segments is used to represent the predicted segmentation number; Determine the check result according to the segmented estimation number of segments and the number of kernel units; wherein, if the segmented estimation number of segments is an integer multiple of the number of kernel units, then the check result indicates that the target conditions are satisfied; if the segmented estimation number of segments is a non-integer multiple of the number of kernel units, then the check result indicates that the target conditions are not satisfied.

6. The processor according to claim 1, wherein The command processor is specifically configured to: Determine the balanced segmentation quantity of multiple segmented grids obtained by segmenting the current multi-dimensional grid in the reference dimension according to the predicted segmentation quantity and the number of kernel units; wherein, the balanced segmentation quantity is the smallest integer multiple of the number of kernel units that is not less than the predicted segmentation quantity; if the predicted segmentation quantity is less than the number of kernel units, then the balanced segmentation quantity is one times the number of kernel units; if the predicted segmentation quantity is greater than the number of kernel units, then the balanced segmentation quantity is at least two times the number of kernel units. Determine the one-dimensional segmentation granularity according to the reference grid size and the balanced segmentation quantity.

7. The processor according to claim 6, wherein: The command processor is specifically configured to: Determine the one-dimensional segmentation granularity according to the size segmentation granularity obtained by equally dividing the reference grid size by the balanced segmentation quantity.

8. A grid segmentation method for a processor, characterized in that, Comprising: Determine the reference dimension among multiple grid dimensions of the current multi-dimensional grid; Perform a balanced prediction check on a preset one-dimensional maximum granularity by using the reference grid size of the current multi-dimensional grid in the reference dimension; wherein, the target conditions of the balanced prediction check include: the predicted segmentation quantity of multiple segmented grids obtained by segmenting the current multi-dimensional grid in the reference dimension by using the one-dimensional maximum granularity is an integer multiple of the number of kernel units of at least two kernel units in the processor. Determine the one-dimensional segmentation granularity of the current multi-dimensional grid in the reference dimension according to the check result of the balanced prediction check; wherein, if the check result indicates that the target conditions are met, then determine the one-dimensional maximum granularity as the one-dimensional segmentation granularity; otherwise, determine the one-dimensional segmentation granularity according to the reference grid size and the smallest integer multiple of the number of kernel units that is not less than the predicted segmentation quantity. Segment the current multi-dimensional grid in the reference dimension by using the one-dimensional segmentation granularity to obtain the multiple segmented grids corresponding to the at least two kernel units respectively.

9. The grid segmentation method according to claim 8, wherein: The determining the reference dimension among multiple grid dimensions of the current multi-dimensional grid includes: Determine the reference dimension based on the one-dimensional grid sizes of the current multi-dimensional grid in the multiple grid dimensions respectively.

10. The grid segmentation method according to claim 8, wherein: The performing a balanced prediction check on a preset one-dimensional maximum granularity by using the reference grid size of the current multi-dimensional grid in the reference dimension includes: Perform the balanced prediction check on the one-dimensional maximum granularity based on the segmented prediction result of the reference grid size by using the one-dimensional maximum granularity.

11. The grid segmentation method according to claim 8, wherein: The determining the one-dimensional segmentation granularity according to the reference grid size and the smallest integer multiple of the number of kernel units that is not less than the predicted segmentation quantity includes: Determine the balanced segmentation quantity of a plurality of segmented grids obtained by segmenting the current multi-dimensional grid in the reference dimension according to the predicted segmentation quantity and the number of kernel units; wherein, the balanced segmentation quantity is the smallest integer multiple of the number of kernel units that is not less than the predicted segmentation quantity; if the predicted segmentation quantity is less than the number of kernel units, then the balanced segmentation quantity is one times the number of kernel units; if the predicted segmentation quantity is greater than the number of kernel units, then the balanced segmentation quantity is at least two times the number of kernel units. Determine the single-dimensional segmentation granularity according to the reference grid size and the balanced segmentation quantity.

12. An electronic device, characterized in that, Comprising a processor according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • General matrix multiplication calculation optimization method and device and processor

    CN116881618A

  • Multi-dimensional parallel simulation method, device and equipment for supercomputing and storage medium

    CN117709128A

  • Task scheduling method based on thread grid, computing device, computer readable storage medium and computer program product

    CN118331717A

  • Supporting apparatus for the fire dinamics simulator, and control method thereof

    KR102113545B1

  • Operator processing method and apparatus, and chip, computing device and storage medium

    WO2024131170A1