Processor and grid partitioning method for processor

By performing balanced prediction checksum slicing granularity adjustment on the benchmark dimension of the multidimensional grid, the problem of processor computing efficiency reduction caused by multidimensional grid segmentation is solved, and more efficient kernel unit utilization and load balancing are achieved.

CN120371553BActive Publication Date: 2025-08-26SHANGHAI BIREN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510888549.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-30
Publication Date
2025-08-26
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 problems of increased interaction and unbalanced core unit load.

Method used

By determining the baseline dimension of a multidimensional grid and performing balanced prediction checksum slicing granularity adjustments on this dimension, it ensures that the slicing grid can be evenly distributed to the kernel cells, reducing interaction time and improving load balancing.

Benefits of technology

Improves the computing efficiency of the processor, and improves the utilization rate of core units by suppressing interaction increase and load imbalance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371553B_ABST
    Figure CN120371553B_ABST
Patent Text Reader

Abstract

The present application relates to a processor and a grid segmentation method for a processor. Based on the present application, the segmentation granularity of a multidimensional grid in multiple grid dimensions can be reduced to a base dimension, and the reduced single-dimensional segmentation granularity can be adapted to the multidimensional grid based on a pre-set single-dimensional maximum granularity. Thus, the segmented grid obtained by segmenting the multidimensional grid can be divided as evenly as possible by the core units with the largest possible size, thereby improving the computing efficiency of the processor by suppressing the increase in the interaction time between the command processor and the multiple core units, and improving the computing efficiency of the processor by suppressing the reduction in the utilization rate of the multiple core units.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of integrated circuit chip design, and in particular to a processor and a grid partitioning method for the processor. Background Art

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

[0003] Kernel computation typically involves a grid search using a multidimensional grid. In this case, task partitioning of computational tasks involving kernel computation involves grid partitioning of the multidimensional grid, and the command processor may partition the multidimensional grid according to partitioning granularities set separately in multiple grid dimensions.

[0004] However, the grid size of a multidimensional grid is diverse, that is, the single-dimensional grid size of a multidimensional grid in each grid dimension is diverse, so:

[0005] If the slicing granularity set on any grid dimension is small, then for a multidimensional grid with a large grid size on that grid dimension, the number of slicing grids obtained will be large, resulting in an increase in the interaction between the command processor and multiple core units for dispatching, which in turn leads to a decrease in the effective time of the core units actually executing calculations. In other words, the increased interaction time between the command processor and multiple core units reduces the processor's computing efficiency.

[0006] If the slicing granularity set on any grid dimension is large, then for a multidimensional grid with a smaller grid size on that grid dimension, the slicing grids obtained are fewer and insufficient to be allocated to all kernel units, thereby causing a load imbalance between multiple kernel units, that is, reducing the computing efficiency of the processor due to the reduced utilization of multiple kernel units.

[0007] It can be seen that how to avoid the reduction of processor computing efficiency caused by grid segmentation has become a technical problem to be solved in the existing technology. Summary of the Invention

[0008] The embodiments of the present application provide a processor and a grid partitioning method for the processor, which helps to improve the computing efficiency of the processor.

[0009] In one embodiment of the present application, a processor is provided, including:

[0010] at least two core units; and

[0011] Command processor for:

[0012] determining a base dimension of the current multidimensional grid among multiple grid dimensions;

[0013] Using a reference grid size of the current multidimensional grid on the reference dimension, a balanced prediction check is performed on a preset single-dimensional maximum granularity; wherein a target condition for the balanced prediction check includes: a predicted number of multiple grids obtained by dividing the current multidimensional grid on the reference dimension using the single-dimensional maximum granularity is an integer multiple of the number of core units of the at least two core units;

[0014] Determining a single-dimensional segmentation granularity for the current multidimensional grid on the reference dimension based on a verification result of the balanced prediction verification; wherein, if the verification result indicates that the target condition is satisfied, determining the single-dimensional maximum granularity as the single-dimensional segmentation granularity; otherwise, determining the single-dimensional segmentation granularity based on the reference grid size and a minimum integer multiple of the number of kernel units that is not less than the predicted segmentation number;

[0015] The current multi-dimensional grid is segmented on the reference dimension using the single-dimensional segmentation granularity to obtain the multiple segmented grids corresponding to the at least two kernel units respectively.

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

[0017] Exemplarily, in an embodiment of the present application, the command processor is specifically configured to: determine the maximum single-dimensional size among the single-dimensional grid sizes of the current multidimensional grid on the multiple grid dimensions; determine a 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.

[0018] Exemplarily, in an embodiment of the present application, the command processor is specifically configured to: perform the balanced 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.

[0019] Exemplarily, in an embodiment of the present application, the command processor is specifically configured to: predict the segmented estimated number of segments for the reference grid size using the single-dimensional maximum granularity; wherein the segmented estimated number of segments is used to characterize the predicted number of cuts; determine the verification result based on the segmented estimated number of segments and the number of kernel units; wherein, if the segmented estimated number of segments is an integer multiple of the number of kernel units, the verification result indicates that the target condition is met; if the segmented estimated number of segments is a non-integer multiple of the number of kernel units, the verification result indicates that the target condition is not met.

[0020] Exemplarily, in an embodiment of the present application, the command processor is specifically configured to: determine the balanced number of cuts of the multiple cut grids obtained by cutting the current multidimensional grid on the base dimension based on the predicted number of cuts and the number of kernel units; wherein the balanced number of cuts is the minimum integer multiple of the number of kernel units that is not less than the predicted number of cuts; if the predicted number of cuts is less than the number of kernel units, then the balanced number of cuts is one times the number of kernel units; if the predicted number of cuts is greater than the number of kernel units, then the balanced number of cuts is at least twice the number of kernel units; determine the single-dimensional cut granularity based on the base grid size and the balanced number of cuts.

[0021] Exemplarily, in an embodiment of the present application, the command processor is specifically configured to determine the single-dimensional segmentation granularity according to a size-averaged granularity obtained by equally dividing the reference grid size by the balanced segmentation number.

[0022] In another embodiment of the present application, a grid partitioning method for a processor is provided, comprising:

[0023] determining a base dimension of the current multidimensional grid among multiple grid dimensions;

[0024] A balanced prediction check is performed on a preset single-dimensional maximum granularity using a reference grid size of the current multidimensional grid on the reference dimension; wherein a target condition for the balanced prediction check includes: a predicted number of multiple grids obtained by dividing the current multidimensional grid on the reference dimension using the single-dimensional maximum granularity is an integer multiple of the number of core units of at least two core units in the processor;

[0025] Determining a single-dimensional segmentation granularity for the current multidimensional grid on the reference dimension based on a verification result of the balanced prediction verification; wherein, if the verification result indicates that the target condition is satisfied, determining the single-dimensional maximum granularity as the single-dimensional segmentation granularity; otherwise, determining the single-dimensional segmentation granularity based on the reference grid size and a minimum integer multiple of the number of kernel units that is not less than the predicted segmentation number;

[0026] The current multi-dimensional grid is segmented on the reference dimension using the single-dimensional segmentation granularity to obtain the multiple segmented grids corresponding to the at least two kernel units respectively.

[0027] Exemplarily, in an embodiment of the present application, determining the reference dimension of the current multidimensional grid in multiple grid dimensions includes: determining the reference dimension based on the single-dimensional grid sizes of the current multidimensional grid in the multiple grid dimensions.

[0028] Exemplarily, in an embodiment of the present application, determining the reference dimension based on the single-dimensional grid sizes of the current multidimensional grid in the multiple grid dimensions includes: determining the maximum single-dimensional size among the single-dimensional grid sizes of the current multidimensional grid in the multiple grid dimensions; determining a 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.

[0029] Exemplarily, in an embodiment of the present application, the balanced prediction verification of the pre-set single-dimensional maximum granularity is performed using the benchmark grid size of the current multi-dimensional grid on the benchmark dimension, including: performing the balanced prediction verification on the single-dimensional maximum granularity based on the segmented prediction results of the benchmark grid size using the single-dimensional maximum granularity.

[0030] Exemplarily, in an embodiment of the present application, the balanced prediction verification is performed on the single-dimensional maximum granularity based on the segmented prediction result of the benchmark grid size using the single-dimensional maximum granularity, including: predicting the segmented estimated number of segments for the benchmark grid size using the single-dimensional maximum granularity; wherein the segmented estimated number of segments is used to characterize the predicted number of cuts; determining the verification result based on the segmented estimated number of segments and the number of kernel units; wherein, if the segmented estimated number of segments is an integer multiple of the number of kernel units, then the verification result indicates that the target condition is met; if the segmented estimated number of segments is a non-integer multiple of the number of kernel units, then the verification result indicates that the target condition is not met.

[0031] Exemplarily, in an embodiment of the present application, the determining of the single-dimensional segmentation granularity based on the reference grid size and the minimum integer multiple of the number of kernel units that is not less than the predicted segmentation number includes: determining the balanced segmentation number of multiple segmentation grids obtained by segmenting the current multidimensional grid on the reference dimension based on the predicted segmentation number and the number of kernel units; wherein the balanced segmentation number is the minimum integer multiple of the number of kernel units that is not less than the predicted segmentation number; if the predicted segmentation number is less than the number of kernel units, then the balanced segmentation number is one times the number of kernel units; if the predicted segmentation number is greater than the number of kernel units, then the balanced segmentation number is at least twice the number of kernel units; the determining of the single-dimensional segmentation granularity based on the reference grid size and the balanced segmentation number.

[0032] Exemplarily, in an embodiment of the present application, determining the single-dimensional cutting granularity based on the reference grid size and the balanced cutting number includes: determining the single-dimensional cutting granularity by dividing the reference grid size by the balanced cutting number.

[0033] In another embodiment of the present application, an electronic device is provided, comprising the processor as described in the above embodiment.

[0034] Based on the embodiments of the present application, the granularity of the multidimensional grid in multiple grid dimensions can be reduced to a base dimension, and the reduced single-dimensional granularity can be adapted to the multidimensional grid based on a pre-set single-dimensional maximum granularity. Thus, the grids obtained by dividing the multidimensional grid can be divided as evenly as possible by the core units with the largest possible size, thereby improving the processor's computing efficiency by suppressing the increase in the interaction time between the command processor and the multiple core units, and by suppressing the reduction in the utilization of the multiple core units. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The following drawings are only provided for schematic illustration and explanation of the present application and do not limit the scope of the present application:

[0036] Figure 1 This is a schematic diagram of an example of the internal structure of a processor in an embodiment of the present application;

[0037] Figure 2 A schematic diagram of an example structure of a multi-dimensional grid divided by a processor in an embodiment of the present application;

[0038] Figure 3 This is a schematic diagram of an example of the logic for determining the single-dimensional segmentation granularity of the processor in an embodiment of the present application;

[0039] Figure 4 Schematic diagram of an exemplary flow chart of a grid partitioning method for a processor in an embodiment of the present application. DETAILED DESCRIPTION

[0040] In order to make the objectives, technical solutions and advantages of this application more clear, the application is further described in detail below with reference to the accompanying drawings and examples.

[0041] Figure 1 This is a schematic diagram of an example of the internal structure of the processor in the embodiment of the present application. Figure 1 In an embodiment of the present application, the processor may include a command processor 10 and at least two core units 20.

[0042] Exemplarily, in an embodiment of the present application, the processor may be any one of a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), a TPU (Tensor Processing Unit), an NPU (Neural Network Processing Unit), a DPU (Deep Learning Processing Unit), an APU (Accelerated Processing Unit), and a GPGPU (General-Purpose computing on Graphics Processing Units).

[0043] For example, in an embodiment of the present application, if the processor is a GPU or GPGPU, 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 multidimensional grid from a host in the heterogeneous architecture. For example, the heterogeneous architecture in which the processor resides may include a CPU as a host, and the CPU as a host may send a task including a multidimensional grid to the processor (i.e., the command processor 10 of the processor).

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

[0045] Exemplarily, in an embodiment of the present application, the command processor 10 can be used to divide the multidimensional grid corresponding to each task into multiple divided grids corresponding to at least two kernel units 20 respectively, and assign the multiple divided grids to at least two kernel units 20 to prompt at least two kernel units 20 to complete the corresponding tasks by concurrently using the divided grids to perform kernel calculations.

[0046] Figure 2 This is a schematic diagram of an example structure of a multi-dimensional grid divided by a processor in an embodiment of the present application. Figure 2 In the embodiments of the present application, a multidimensional grid having three grid dimensions (i.e., X, Y, and Z) is taken as an example. The multidimensional grid has corresponding single-dimensional grid sizes in each of the three grid dimensions. For example, the multidimensional grid has a single-dimensional grid size m in grid dimension X, a single-dimensional grid size n in grid dimension Y, and a single-dimensional grid size k in grid dimension Z. m, n, and k are all positive integers greater than or equal to 1. m, n, and k may or may not be the same, and at least one of m, n, and k is greater than 1.

[0047] For example, in an embodiment of the present application, the smallest grid unit in a multidimensional grid is a thread block cluster. Each thread block cluster includes at least two thread blocks. Each thread block can include any number of threads. Furthermore, the single-dimensional grid size of the multidimensional grid in any grid dimension can refer to the number of thread block clusters arranged in the multidimensional grid in that grid dimension. That is, the number of thread block clusters arranged in grid dimension X of the multidimensional grid is m, the number of thread block clusters arranged in grid dimension Y is n, and the number of thread block clusters arranged in grid dimension Z is k. Figure 2 In FIG, solid lines are used to represent the boundaries of thread block clusters, and dashed lines are used to represent the boundaries of thread blocks. Accordingly, Figure 2 In the figure, a thread block cluster including 2×2×1 thread blocks is used as an example for illustration.

[0048] Exemplarily, in an embodiment of the present application, the split grid obtained by commanding the processor 10 to split the multidimensional grid may include at least one thread block cluster, and the single-dimensional grid size (e.g., the number of permutations of thread block clusters) of the split grid in at least one grid dimension (e.g., at least one of X, Y, and Z) is smaller than the single-dimensional grid size (e.g., the number of permutations of thread block clusters) of the multidimensional grid in the corresponding grid dimension.

[0049] Assume that the granularity is set to 2, 4, and 2 in multiple grid dimensions, and the number of kernel units is 4:

[0050] If Figure 2 As shown, m, n, and k of the current multidimensional grid are 4, 8, and 2 respectively. Then, the multidimensional grid can be divided into 4 split grids, so that the 4 split grids can be evenly distributed to the 4 core units 20;

[0051] If the current multidimensional grid is a multidimensional grid with m=8, and / or n=16, and / or k=4, then the predicted number of divisions performed by division with the division granularity set at 2, 4, and 2 in the multiple grid dimensions reaches 8, 16, or 32, that is, it is greater than the number of core units 4. In this case, even if the division grid can still be evenly divided into 4 core units 20, the interaction between the command processor 10 and the 4 core units 20 will increase.

[0052] If the current multidimensional grid is a multidimensional grid in which m, n, and k are 2, 8, and 2 respectively, then the predicted number of splits performed with the splitting granularity of 2, 4, and 2 set on multiple grid dimensions is only 2, that is, less than the number of core units 4. At this time, although the interaction between the command processor 10 and the four core units 20 will not increase, only two core units 20 will be assigned to split the grid, and the other two core units 20 will be idle, resulting in an unbalanced load on the four core units 20.

[0053] Therefore, in an embodiment of the present application, in order to suppress the aforementioned increase in interactions and load imbalance, the segmentation granularity of the multi-dimensional grid in multiple grid dimensions can be reduced to a base dimension.

[0054] For example, in an embodiment of the present application, in order to achieve dimensionality reduction of the segmentation granularity of a multidimensional grid in multiple grid dimensions, the command processor 10 needs to select one from the multiple grid dimensions as a reference dimension, that is, the command processor 10 can be used to: determine the reference dimension of the current multidimensional grid in multiple grid dimensions.

[0055] Exemplarily, in an embodiment of the present application, the command processor 10 can select a reference dimension based on the size characteristics of different multidimensional grids in multiple grid dimensions to improve the adaptability to diverse multidimensional grids, that is, the command processor 10 can be specifically configured to: determine the reference dimension of the current multidimensional grid in multiple grid dimensions based on the single-dimensional grid sizes of the current multidimensional grid in multiple grid dimensions.

[0056] For example, in the embodiment of the present application, in order to make the single-dimensional segmentation granularity of the dimensionality reduction to the reference dimension have the highest possible accuracy, the command processor 10 may preferably select the grid dimension with the largest single-dimensional grid size as the reference dimension. For example, if the current multidimensional grid is as follows Figure 2In the illustrated multidimensional grid, m, n, and k are 4, 8, and 2, respectively. Since n is the maximum single-dimensional size among the single-dimensional grid sizes of the current multidimensional grid in the multiple grid dimensions X, Y, and Z, grid dimension Y can be determined as the base grid dimension. In this case, command processor 10 can be specifically configured to: determine the maximum single-dimensional size among the single-dimensional grid sizes of the current multidimensional grid in the multiple grid dimensions; and determine the grid dimension containing the maximum single-dimensional size as the base grid dimension of the current multidimensional grid in the multiple grid dimensions.

[0057] For example, in an embodiment of the present application, the single-dimensional granularity of the dimensionality reduction may not be fixed, but may be adapted to the multidimensional grid based on a pre-set single-dimensional maximum granularity. The pre-set single-dimensional maximum granularity may be an empirical value or a parameter set according to the hardware performance of the core unit 20, and the single-dimensional maximum granularity is intended to ensure that the grid obtained by slicing the multidimensional grid is as large as possible within the capabilities of the core unit 20. Therefore, in an embodiment of the present application, priority may be given to using the pre-set single-dimensional maximum granularity to perform slicing, but it is necessary to verify whether it can satisfy the load balancing of the slicing grid between at least two core units 20. Accordingly, the command processor 10 may also be configured to perform a balanced prediction check on the pre-set single-dimensional maximum granularity using the reference grid size of the current multidimensional grid in the reference dimension (e.g., the maximum single-dimensional size among the single-dimensional grid sizes of the current multidimensional grid in multiple grid dimensions). Among them, the target condition of the balanced prediction verification may include: the predicted number of divided grids obtained by dividing the current multidimensional grid on the reference dimension using the single-dimensional maximum granularity is an integer multiple of the number of core units of at least two core units 20.

[0058] For example, if the reference grid size of the current multidimensional grid in the reference dimension is denoted as Grid_ref_size, and the number of kernel units is denoted as NumKer, then the predicted number of cut grids NumPreCut obtained by cutting the multidimensional grid in the reference dimension using the single-dimensional maximum granularity Grid_cut_maxsize can be expressed as: , that is, the predicted number of cuts NumPreCut can be the result of rounding up the quotient of the reference grid size Grid_ref_size of the current multidimensional grid in the reference dimension and the single-dimensional maximum granularity Grid_cut_maxsize, and here, " ” means rounding up.

[0059] For example, if the current multidimensional grid is Figure 2The multi-dimensional grid shown has m, n, and k as 4, 8, and 2 respectively (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 single-dimensional maximum granularity Grid_cut_maxsize is 2. Then, the predicted number of cuts NumPreCut of the multiple cut grids obtained by cutting the current multi-dimensional grid in the reference dimension using the single-dimensional maximum granularity Grid_cut_maxsize can be 4, which is equal to the number of kernel units NumKer. At this time, the result of the balanced prediction check satisfies the above-mentioned target conditions.

[0060] For example, if m, n, and k of the current multidimensional grid are 4, 6, and 2 respectively (that is, the reference grid size of the current multidimensional grid is the reference grid size Grid_ref_size on the grid dimension Y is 6), the number of kernel units is 4, and the preset single-dimensional maximum granularity Grid_cut_maxsize is 2, then the predicted number of cuts NumPreCut of the multiple cut grids obtained by cutting the current multidimensional grid on the reference dimension using the single-dimensional maximum granularity Grid_cut_maxsize is 3, and is not an integer multiple of the number of kernel units NumKer (that is, 4). At this time, the result of the balanced prediction check is that the above-mentioned target conditions are not met.

[0061] For another example, if m, n, and k of the current multidimensional grid are 4, 12, and 2 respectively (that is, the reference grid size of the current multidimensional grid is the reference grid size Grid_ref_size on the grid dimension Y is 12), the number of kernel units is 4, and the pre-set single-dimensional maximum granularity Grid_cut_maxsize is 2, then, the predicted number of cut grids NumPreCut of the multiple cut grids obtained by cutting the current multidimensional grid on the reference dimension using the single-dimensional maximum granularity Grid_cut_maxsize is 6, and is not an integer multiple of the number of kernel units NumKer (that is, 4). At this time, the result of the balanced prediction check is that the above-mentioned target conditions are not met.

[0062] Exemplarily, in an embodiment of the present application, in order to support the adaptive adjustment of the single-dimensional segmentation granularity with the multidimensional grid based on the single-dimensional maximum granularity, the command processor 10 can also be used to: determine the single-dimensional segmentation granularity of the current multidimensional grid on the reference dimension of the current multidimensional grid based on the verification result of the balanced prediction verification of the single-dimensional maximum granularity.

[0063] 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-mentioned target conditions are met, that is, the predicted number of split grids obtained by splitting the current multidimensional grid on the reference dimension using the single-dimensional maximum granularity is exactly an integer multiple of the number of core units, then the command processor 10 can determine the single-dimensional maximum granularity as the single-dimensional split granularity of the current multidimensional grid on the reference dimension of the current multidimensional grid, thereby maximizing the split grids obtained by splitting the current multidimensional grid under the premise of ensuring load balancing of at least two core units 20.

[0064] For example, in an embodiment of the present application, if the check result of the balanced prediction check of the single-dimensional maximum granularity indicates that the above-mentioned target condition is not met, then the command processor 10 can determine the single-dimensional segmentation granularity of the current multidimensional grid on the reference dimension of the current multidimensional grid based on the reference grid size of the current multidimensional grid in the reference grid direction and the minimum 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, under the premise 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.

[0065] Exemplarily, in an embodiment of the present application, the number of kernel units is not less than the minimum integer multiple of the predicted split number, which can be considered as the balanced split number of multiple split grids obtained by splitting the current multidimensional grid in the direction of the reference grid. The balanced split number can be considered as: an ideal split number that enables the multiple split grids obtained by splitting the current multidimensional grid in the direction of the reference grid to be as evenly divided as possible by all kernel units 20 with the largest possible size.

[0066] Exemplarily, in an embodiment of the present application, the command processor 10 can be specifically configured as follows: if the verification result of the balanced prediction verification of the single-dimensional maximum granularity indicates that the above-mentioned target conditions are not met, then, based on the predicted number of divisions of the current multidimensional grid on the baseline dimension and the number of core units, the balanced number of divisions of the multiple division grids obtained by dividing the current multidimensional grid on the baseline dimension is determined; and, based on the baseline grid size of the current multidimensional grid and the balanced number of divisions, the single-dimensional division granularity of the current multidimensional grid on the baseline dimension of the current multidimensional grid is determined.

[0067] 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-mentioned target conditions are not met, then the command processor 10 determines the single-dimensional segmentation granularity based on the reference grid size of the current multidimensional grid and the balanced segmentation number (that is, the number of kernel units is not less than the minimum integer multiple of the predicted segmentation number), so that: the multiple segmentation grids obtained by segmenting the current multidimensional grid in the reference grid direction can be distributed as evenly as possible to all kernel units 20 while the granularity is as large as possible.

[0068] For example, in an embodiment of the present application, the command processor 10 can be specifically configured to: if the verification result of the balanced prediction verification of the single-dimensional maximum granularity indicates that the above-mentioned target condition is not met, then, based on the size-averaged granularity obtained by dividing the base grid size of the current multidimensional grid by the number of balanced divisions, determine the single-dimensional division granularity of the current multidimensional grid on the base dimension of the current multidimensional grid. For example, the size-averaged granularity can be the quotient of the base grid size of the current multidimensional grid and the number of balanced divisions. Therefore, the size-averaged granularity can be an integer or a non-integer. Thus, the command processor 10 can round up the size-averaged granularity to determine the single-dimensional division granularity of the current multidimensional grid on the base dimension of the current multidimensional grid.

[0069] For example, in the embodiments of the present application, the size average granularity, which may be an integer or a non-integer, is usually different from the single-dimensional maximum granularity, and the result of rounding up the size average granularity (i.e., the single-dimensional segmentation granularity of the current multidimensional grid at the base dimension of the current multidimensional grid) may be different from the single-dimensional maximum granularity, but may also be equal to the single-dimensional maximum granularity, wherein:

[0070] If the rounded-up result of the size-averaged granularity is different from the single-dimensional maximum granularity, then the rounded result is used as the single-dimensional granularity to make the slicing grid more balanced than the unit maximum granularity while having the largest possible size, that is, relatively balanced.

[0071] If the result of rounding up the size-averaged granularity is equal to the single-dimensional maximum granularity, and therefore when the verification result of the balanced prediction verification of the single-dimensional maximum granularity indicates that the above-mentioned target conditions are not met, the single-dimensional maximum granularity is still determined as the single-dimensional segmentation granularity of the current multidimensional grid on the reference dimension of the current multidimensional grid, then it indicates that the unit maximum granularity that does not meet the target conditions is the relatively optimal segmentation granularity compared to other granularities. At this time, determining the single-dimensional maximum granularity as the single-dimensional segmentation granularity can achieve a relative balance that at least takes into account the maximization of the segmented grid.

[0072] Thus, based on the embodiments of the present application, even if the predicted number of slicing grids obtained by slicing the current multidimensional grid on the reference dimension using the single-dimensional maximum granularity is not an integer multiple of the number of kernel units, it is still possible to seek a relatively optimal slicing granularity by determining a single-dimensional slicing granularity different from the single-dimensional maximum granularity, so that the slicing grid obtained by slicing the multidimensional grid can be as large as possible and as evenly divided as possible by at least two kernel units 20. For example, in the embodiments of the present application, the verification result indicates that the target condition is not met in two situations, namely, the predicted number of slicing that is a non-integer multiple of the number of kernel units is less than the number of kernel units, and the predicted number of slicing that is a non-integer multiple of the number of kernel units is greater than the number of kernel units.

[0073] For example, in an embodiment of the present application, if the predicted number of splits, which is a non-integer multiple of the number of kernel units, is smaller than the number of kernel units, this indicates that the multiple split grids obtained by splitting the current multidimensional grid in the base dimension using the maximum single-dimensional granularity are insufficient to be assigned to all kernel units 20. In this case, the command processor 10 may determine the balanced split number (i.e., the number of kernel units that is greater than the minimum integer multiple of the predicted split number) to be one times the number of kernel units. Furthermore, using the base grid size of the current multidimensional grid and the number of kernel units (i.e., one times the number of kernel units serving as the balanced split number), the command processor 10 may determine a size-average granularity obtained by dividing the base grid size of the current multidimensional grid in the base dimension by the number of kernel units. Furthermore, based on this size-average granularity, a single-dimensional split granularity for the current multidimensional grid in the base dimension of the current multidimensional grid is determined. For example, the result of rounding up this size-average granularity is determined as the unit split granularity, so that the actual number of split grids obtained by splitting the current multidimensional grid in the base dimension using the single-dimensional split granularity is equal to or close to the number of kernel units.

[0074] For example, if m, n, and k of the current multidimensional grid are 40, 60, and 20 respectively (that is, the reference grid size of the current multidimensional grid is the reference grid size Grid_ref_size of 60 on the grid dimension Y), the number of kernel units is 6, and the preset single-dimensional maximum granularity Grid_cut_maxsize is 12, then the predicted number of cuts NumPreCut of the multiple cut grids obtained by cutting the current multidimensional grid on the reference dimension using the single-dimensional maximum granularity Grid_cut_maxsize is 5 and is not an integer multiple of the number of kernel units NumKer (that is, 6). At this time, the result of the balanced prediction check is that the above-mentioned target condition is not met, and the minimum integer multiple of the number of kernel units NumKer (that is, 6) that is not less than the predicted number of cuts NumPreCut (that is, 5) (that is, the balanced number of cuts NumBlcCut) is one times the number of kernel units NumKer (that is, 6). At this point, based on the current multidimensional grid's reference grid size Grid_ref_size (i.e., 60) and the minimum integer multiple representing the number of balanced cuts NumBlcCut (i.e., 6), it can be determined that the size-average granularity obtained by equally dividing the current multidimensional grid's reference grid size Grid_ref_size (i.e., 60) by the number of balanced cuts NumBlcCut (i.e., 6) is 10, which is different from the single-dimensional maximum granularity Grid_cut_maxsize (i.e., 12). Furthermore, the result of rounding up this size-average granularity (i.e., 10) (still 10) can be determined as the single-dimensional cut granularity Grid_cut_size of the current multidimensional grid in the reference dimension Y of the current multidimensional grid, i.e., Grid_cut_size = 10. Furthermore, the actual number of cuts in the cut grid obtained by dividing the current multidimensional grid in the reference dimension using the single-dimensional cut granularity Grid_cut_size (i.e., 10) is 6, which is equal to the number of kernel cells NumKer (i.e., 6).

[0075] For another example, if m, n, and k of the current multidimensional grid are 4, 6, and 2 respectively (that is, the reference grid size of the current multidimensional grid is the reference grid size Grid_ref_size of 6 on the grid dimension Y), the number of kernel units is 4, and the preset single-dimensional maximum granularity Grid_cut_maxsize is 2, then the predicted number of cuts NumPreCut of the multiple cut grids obtained by cutting the current multidimensional grid on the reference dimension using the single-dimensional maximum granularity Grid_cut_maxsize is 3 and is not an integer multiple of the number of kernel units NumKer (that is, 4). At this time, the result of the balanced prediction check is that the above-mentioned target condition is not met, and the minimum integer multiple of the number of kernel units NumKer (that is, 4) that is not less than the predicted number of cuts NumPreCut (that is, 3) (that is, the balanced number of cuts) is one times the number of kernel units NumKer (that is, 4). At this point, based on the current multidimensional grid's reference grid size Grid_ref_size (i.e., 6) and the minimum integer multiple representing the number of balanced divisions (i.e., 4), it can be determined that the average size granularity obtained by dividing the current multidimensional grid's reference grid size Grid_ref_size (i.e., 6) by the number of balanced divisions (i.e., 4) is 1.5, which is different from the single-dimensional maximum granularity Grid_cut_maxsize (i.e., 2). Furthermore, the result of rounding up this average size granularity (i.e., 1.5) (i.e., 2) can be determined as the single-dimensional division granularity Grid_cut_size of the current multidimensional grid in the reference dimension Y of the current multidimensional grid, i.e., Grid_cut_size = Grid_cut_maxsize = 2. Furthermore, the actual number of divisions of the grid obtained by dividing the current multidimensional grid in the reference dimension using the single-dimensional division granularity Grid_cut_size (i.e., 2) is 3, which is close to the number of kernel units NumKer (i.e., 4).

[0076] For example, in an embodiment of the present application, if the predicted number of splits, which is a non-integer multiple of the number of core units, is greater than the number of core units, it means that: although the multiple split grids obtained by splitting the current multidimensional grid on the reference dimension using the single-dimensional maximum granularity are sufficient to be assigned to all core units 20, the number of split grids assigned to at least two core units 20 is not exactly the same, that is, the load of at least two core units 20 is unbalanced. At this time, the command processor 10 can determine that the balanced split number (i.e., the minimum integer multiple of the number of kernel units greater than the predicted split number) is at least twice the number of kernel units, and, using the baseline grid size of the current multidimensional grid and the number of kernel units (i.e., at least twice the number of kernel units as the balanced split number), determine the size average granularity obtained by dividing the baseline grid size of the current multidimensional grid in the baseline dimension by the number of kernel units, and then determine the single-dimensional split granularity of the current multidimensional grid in the baseline dimension of the current multidimensional grid based on the size average granularity, for example, determine the result of rounding up the size average granularity as the unit split granularity, so that: the actual number of splits of the split grid obtained by splitting the current multidimensional grid in the baseline dimension using the single-dimensional split granularity is equal to or close to at least twice the number of kernel units.

[0077] For example, if m, n, and k of the current multidimensional grid are 40, 60, and 20 respectively (that is, the reference grid size of the current multidimensional grid is the reference grid size Grid_ref_size of 60 in the grid dimension Y), the number of kernel units is 6, and the preset single-dimensional maximum granularity Grid_cut_maxsize is 8, then the predicted number of cuts NumPreCut of the multiple cut grids obtained by cutting the current multidimensional grid in the reference dimension using the single-dimensional maximum granularity Grid_cut_maxsize is 8 (that is, the result of rounding up 7.5) and is not an integer multiple of the number of kernel units NumKer (that is, 6). At this time, the result of the balanced prediction check is that the above-mentioned target condition is not met, and the minimum integer multiple of the number of kernel units NumKer (that is, 6) that is not less than the predicted number of cuts NumPreCut (that is, 8) (that is, the balanced number of cuts NumBlcCut) is twice the number of kernel units NumKer (that is, 12). At this point, based on the current multidimensional grid's reference grid size Grid_ref_size (i.e., 60) and the minimum integer multiple representing the number of balanced cuts NumBlcCut (i.e., 12), it can be determined that the size-average granularity obtained by equally dividing the current multidimensional grid's reference grid size Grid_ref_size (i.e., 60) by the number of balanced cuts NumBlcCut (i.e., 12) is 5, which is different from the single-dimensional maximum granularity Grid_cut_maxsize (i.e., 8). Furthermore, the result of rounding up this size-average granularity (i.e., 5) (still 5) can be determined as the single-dimensional cut granularity Grid_cut_size for the current multidimensional grid in the reference dimension Y of the current multidimensional grid, i.e., Grid_cut_size = 5. Furthermore, the actual number of cuts in the cut grid obtained by dividing the current multidimensional 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 cells NumKer (i.e., 6).

[0078] For another example, if m, n, and k of the current multidimensional grid are 4, 12, and 2 respectively (i.e., the reference grid size of the current multidimensional grid is the reference grid size Grid_ref_size of 12 on the grid dimension Y), the number of kernel units is 4, and the preset single-dimensional maximum granularity Grid_cut_maxsize is 2, then, the predicted number of cuts NumPreCut of the multiple cut grids obtained by cutting the current multidimensional grid on the reference dimension using the single-dimensional maximum granularity Grid_cut_maxsize is 6, and 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 is that the above-mentioned target condition is not met, and the minimum integer multiple of the number of kernel units NumKer (i.e., 4) that is not less than the predicted number of cuts NumPreCut (i.e., 3) is twice the number of kernel units NumKer (i.e., 8). At this point, based on the current multidimensional grid's reference grid size Grid_ref_size (i.e., 12) and the minimum integer multiple representing the number of balanced divisions (i.e., 8), it can be determined that the average size granularity obtained by evenly dividing the current multidimensional grid's reference grid size Grid_ref_size (i.e., 12) by the number of balanced divisions (i.e., 8) is 1.5 times the maximum single-dimensional granularity Grid_cut_maxsize (i.e., 2). Furthermore, the result of rounding up this average size granularity (i.e., 1.5) (i.e., 2) can be used to determine the single-dimensional division granularity Grid_cut_size of the current multidimensional grid in the reference dimension Y of the current multidimensional grid. That is, Grid_cut_size = Grid_cut_maxsize = 2. Furthermore, the actual number of divisions of the grid obtained by dividing the current multidimensional grid in the reference dimension using the single-dimensional division granularity Grid_cut_size (i.e., 2) is 6, which is 1.5 times the number of kernel cells NumKer (i.e., 4).

[0079] Exemplarily, in an embodiment of the present application, in order to simplify the calculation process for determining the single-dimensional segmentation granularity, the command processor 10 can be specifically configured to: perform a balanced prediction check on the single-dimensional maximum granularity based on the segmented prediction results of the reference grid size using the single-dimensional maximum granularity.

[0080] Exemplarily, in an embodiment of the present application, the command processor 10 can be configured to implement balanced prediction verification based on segmented prediction results in the following manner: predict the number of segmented estimated segments of the benchmark grid size of the current multidimensional grid on the benchmark dimension using the single-dimensional maximum granularity (the segmented estimated segment number can be used to characterize the predicted number of cuts mentioned above); and, based on the segmented estimated segment number and the number of kernel units, determine the verification result of the balanced prediction verification of the single-dimensional maximum granularity; wherein, if the segmented estimated segment number is equal to an integer multiple of the number of kernel units, the verification result indicates that the aforementioned target condition is met; if the segmented estimated segment number is a non-integer multiple of the number of kernel units, the verification result indicates that the aforementioned target condition is not met.

[0081] Exemplarily, in an embodiment of the present application, the command processor 10 can be configured to determine the balanced number of split grids obtained by splitting the current multidimensional grid on the reference dimension based on the estimated number of segments of the reference grid size of the current multidimensional grid on the reference dimension and the number of kernel units.

[0082] Exemplarily, in an embodiment of the present application, if the number of segmented estimated segments, which is a non-integer multiple of the number of kernel units, is smaller than the number of kernel units, the command processor 10 may determine the balanced split number (i.e., the minimum integer multiple of the number of kernel units greater than the number of segmented estimated segments) as one times the number of kernel units, and, using the base grid size of the current multidimensional grid and the number of kernel units (i.e., one times the number of kernel units as the balanced split number), determine the size-averaged granularity obtained by dividing the base grid size of the current multidimensional grid on the base dimension by the number of kernel units, and then determine the size-averaged granularity as the single-dimensional split granularity of the current multidimensional grid on the base dimension of the current multidimensional grid.

[0083] For example, if the reference grid size of the current multidimensional grid in the reference dimension is represented as Grid_ref_size, NumPreCut used to represent the predicted number of cuts can also be used to represent the number of segmented estimated segments, the number of kernel units is represented as NumKer, and the number of segmented estimated segments NumPreCut is less than the number of kernel units NumKer, then the balanced cut number NumBlcCut can be determined as one times the number of kernel units NumKer (that is, NumBlcCut is equal to NumKer), and the single-dimensional cut granularity Grid_cut_size determined according to the size-averaged granularity can be expressed as: , here " ” means rounding up.

[0084] Exemplarily, in an embodiment of the present application, if the number of segmented estimated segments, which is a non-integer multiple of the number of kernel units, is greater than the number of kernel units, then the command processor 10 may determine that the balanced split number (i.e., the minimum integer multiple of the number of kernel units greater than the segmented estimated segment number) is at least twice the number of kernel units, and, using the baseline grid size of the current multidimensional grid and the number of kernel units (i.e., at least twice the number of kernel units as the balanced split number), determine the size-averaged granularity obtained by dividing the baseline grid size of the current multidimensional grid on the baseline dimension by the number of kernel units, and then apply the size-averaged granularity to the single-dimensional split granularity of the current multidimensional grid on the baseline dimension of the current multidimensional grid.

[0085] Exemplarily, in an embodiment of the present application, if the number of segmented estimated segments, which is a non-integer multiple of the number of core units, is greater than the number of core units, the command processor 10 can determine the modulo result of the segmented estimated segment number to the number of core units, and the modulo result represents the remainder of the segmented estimated segment number divided by the number of core units. In addition, the command processor 10 can also calculate the difference between the sum of the segmented estimated segment number and the number of core units and the modulo result to determine the number of balanced splits, that is, determine the minimum integer multiple of the number of core units that is greater than the segmented estimated segment number (in this case, at least twice).

[0086] For example, if the reference grid size of the current multidimensional grid in the reference dimension is represented as Grid_ref_size, NumPreCut used to represent the predicted number of cuts can also be used to represent the number of segmented estimated segments, the number of kernel units is represented as NumKer, and the number of segmented estimated segments NumPreCut is greater than the number of kernel units NumKer, then the balanced cut number NumBlcCut can be determined to be at least twice the number of kernel units NumKer, that is: NumBlcCut=NumPreCut+NumKer-(NumPreCut% NumKer), where % here represents a modulo operation. In this case, the single-dimensional cut granularity Grid_cut_size determined based on the size-averaged granularity can be expressed as: , here " ” means rounding up.

[0087] Figure 3 This is an example diagram of the logic for determining the single-dimensional segmentation granularity of the processor in the embodiment of this application. Figure 3 In an embodiment of the present application, the command processor of the processor may determine the single-dimensional segmentation granularity based on the balanced prediction check of the single-dimensional maximum granularity according to the following logic:

[0088] S300: predicting the estimated number of segments NumPreCut of the reference grid size Grid_ref_size of the current multidimensional grid in the reference dimension using the single-dimensional maximum granularity Grid_cut_maxsize (i.e., the predicted number of cut grids obtained by cutting the current multidimensional grid in the reference dimension with the single-dimensional maximum granularity Grid_cut_maxsize).

[0089] S310: Determine whether the estimated number of segments (ie, the predicted number of cuts NumPreCut) is less than the number of kernel units NumKer, that is, determine whether NumPreCut<NumKer holds.

[0090] If S310 determines that the estimated number of segments NumPreCut (i.e., the predicted number of cuts) is less than the number of kernel units NumKer, then the process jumps to S330 .

[0091] If S310 determines that the estimated number of segments NumPreCut (ie, the predicted number of cuts) is less than the number of kernel units NumKer, then the process jumps to S350 .

[0092] S330: Determine whether the estimated number of segments NumPreCut (ie, the predicted number of cuts) is an integer multiple of the number of kernel units NumKer.

[0093] If S330 determines that the estimated number of segments NumPreCut (i.e., the predicted number of cuts) is an integer multiple of the number of kernel units NumKer, then jump to S370;

[0094] If S330 determines that the estimated number of segments NumPreCut (ie, the predicted number of cuts) is a non-integer multiple of the number of kernel units NumKer, then the process jumps to S390 .

[0095] S350: Determine the single-dimensional cutting granularity Grid_cut_size of the current multidimensional grid on the reference dimension of the current multidimensional grid based on the size average granularity obtained by dividing the reference grid size Grid_ref_size of the current multidimensional grid on the reference dimension by the number of kernel units NumKer (i.e. Grid_ref_size / NumKer), i.e., the single-dimensional cutting granularity , here " ” means rounding up.

[0096] S370: Determine the single-dimensional maximum granularity Grid_cut_maxsize as the single-dimensional cutting granularity Grid_cut_size of the current multidimensional grid on the reference dimension of the current multidimensional grid, that is, Grid_cut_size=Grid_cut_maxsize.

[0097] S390: Determine the single-dimensional cutting granularity Grid_cut_size of the current multidimensional grid on the reference dimension of the current multidimensional grid based on the size averaged granularity obtained by dividing the reference grid size Grid_ref_size of the current multidimensional grid on the reference dimension by at least twice the number of kernel units NumKer (i.e., NumBlcCut) (i.e., Grid_ref_size / NumBlcCut). For example, the single-dimensional cutting granularity , here " ” means rounding up.

[0098] like Figure 3 In the logical example shown, S310 and S330 can be considered as the process of balanced prediction verification of the maximum granularity of a single dimension, and S350, S370 and S390 can be considered as the process of determining the single-dimensional segmentation granularity based on the verification results of the balanced prediction verification.

[0099] Exemplarily, in an embodiment of the present application, the command processor 10 may also be used to:

[0100] The current multidimensional grid is segmented along the base dimension of the current multidimensional grid using the single-dimensional segmentation granularity determined for the current multidimensional grid to obtain a plurality of segmented grids corresponding to at least two core units 20, respectively. The actual number of segmented grids can be an integer multiple (including one and at least two) of the number of core units, or an integer multiple (including one and at least two) of the number of core units. The single-dimensional grid size of the segmented grid along the base dimension of the current multidimensional grid can be equal to the single-dimensional segmentation granularity. Furthermore, the single-dimensional grid sizes of the segmented grid along other dimensions of the current multidimensional grid can maintain the single-dimensional grid sizes along other dimensions of the current multidimensional grid.

[0101] The plurality of segmented grids are respectively assigned as kernel tasks to corresponding kernel units 20 .

[0102] Thus, the embodiments of the present application can ensure that the grids obtained by dividing the multi-dimensional grid are as large as possible, so that the grids can be evenly divided by the core units 20. This can improve the computing efficiency of the processor by suppressing the increase in the interaction time between the command processor 10 and the multiple core units 20, and by suppressing the decrease in the utilization of the multiple core units 20. For example, using an existing processor of a certain specification as a reference benchmark, 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.

[0103] In an embodiment of the present application, a grid partitioning method for a processor is also provided.

[0104] Figure 4 This is an exemplary flow chart of a grid partitioning method for a processor in an embodiment of the present application. Figure 4 In an embodiment of the present application, a grid partitioning method for a processor may include:

[0105] S410: Determine a base dimension of the current multi-dimensional grid among multiple grid dimensions;

[0106] S430: Using a reference grid size of the current multidimensional grid on a reference dimension, performing a balanced prediction check on a preset single-dimensional maximum granularity; wherein a target condition for the balanced prediction check includes: a predicted number of multiple grids obtained by dividing the current multidimensional grid on the reference dimension using the single-dimensional maximum granularity is an integer multiple of the number of core units of at least two core units in the processor;

[0107] S450: Determine a single-dimensional segmentation granularity for the current multidimensional grid on the reference dimension of the current multidimensional grid based on a verification result of the single-dimensional maximum granularity balanced prediction verification; if the verification result of the single-dimensional maximum granularity balanced prediction verification indicates that a target condition is satisfied, then the single-dimensional maximum granularity is determined as the single-dimensional segmentation granularity for the current multidimensional grid on the reference dimension of the current multidimensional grid; otherwise, determine a single-dimensional segmentation granularity for the current multidimensional grid on the reference dimension of the current multidimensional grid based on a reference grid size of the current multidimensional grid on the reference dimension and a minimum integer multiple of the number of kernel units that is not less than the predicted segmentation number;

[0108] S470: Use the single-dimensional segmentation granularity determined for the current multidimensional grid to segment the current multidimensional grid on the base dimension of the current multidimensional grid to obtain multiple segmented grids corresponding to at least two kernel units respectively; wherein, the single-dimensional grid size of the segmented grid on the base dimension of the current multidimensional grid can be equal to the single-dimensional segmentation granularity; the single-dimensional grid size of the segmented grid on other dimensions of the current multidimensional grid can maintain the single-dimensional grid size on other dimensions of the current multidimensional grid; and the multiple segmented grids can be respectively assigned to the corresponding kernel units as kernel tasks.

[0109] Based on the above process, the granularity of the multidimensional grid's partitioning across multiple grid dimensions can be reduced to a single baseline dimension, and the reduced single-dimensional partitioning granularity can be adapted to the multidimensional grid based on a pre-set single-dimensional maximum granularity. This allows the resulting partitioned grid to be as large as possible and evenly divided among the core units. This improves the processor's computational efficiency by both reducing the time spent on interaction between the command processor and multiple core units and reducing the utilization of multiple core units.

[0110] For example, in the embodiment of the present application, in order to select the reference dimension according to the size characteristics of different multi-dimensional grids in multiple grid dimensions, so as to improve the adaptability to the diverse multi-dimensional grids, such as Figure 4 S410 in the illustrated process may include: determining a reference dimension of the current multidimensional grid in the multiple grid dimensions based on the single-dimensional grid sizes of the current multidimensional grid in the multiple grid dimensions.

[0111] Exemplarily, in an embodiment of the present application, in order to ensure that the single-dimensional segmentation granularity reduced to the reference dimension has the highest possible accuracy, when S410 determines the reference dimension based on the single-dimensional grid size of the current multidimensional grid, it may preferably select the grid dimension with the largest single-dimensional grid size as the reference dimension, that is, S410 may specifically include: determining the maximum single-dimensional size among the single-dimensional grid sizes of the current multidimensional grid on multiple grid dimensions; and determining the grid dimension where the maximum single-dimensional size is located as the reference dimension of the current multidimensional grid among the multiple grid dimensions.

[0112] For example, in the embodiments of the present application, Figure 4 S430 in the illustrated process may specifically include: determining, based on the result of rounding up the quotient of the reference grid size of the current multidimensional grid in the reference dimension and the single-dimensional maximum granularity, a predicted number of split grids obtained by splitting the multidimensional grid in the reference dimension using the single-dimensional maximum granularity.

[0113] For example, in the embodiments of the present application, in order to simplify the calculation process for determining the single-dimensional segmentation granularity, as shown in FIG. Figure 4 S430 in the illustrated process may specifically include: performing a balanced 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.

[0114] For example, in the embodiments of the present application, Figure 4 S430 in the process shown can implement the balanced prediction verification based on the segmented prediction results in the following manner: predict the segmented estimated number of segments of the benchmark grid size of the current multidimensional grid on the benchmark dimension using the single-dimensional maximum granularity (the segmented estimated number of segments can be used to represent the predicted number of cuts mentioned above); and, based on the segmented estimated number of segments and the number of kernel units, determine the verification result of the balanced prediction verification of the single-dimensional maximum granularity; wherein, if the segmented estimated number of segments is equal to an integer multiple of the number of kernel units, the verification result indicates that the aforementioned target condition is met; if the segmented estimated number of segments is a non-integer multiple of the number of kernel units, the verification result indicates that the aforementioned target condition is not met.

[0115] For example, in an embodiment of the present application, if the verification result indicates that the aforementioned target condition is not met, then, Figure 4S450 in the illustrated process determines the single-dimensional segmentation granularity based on the current reference grid size of the multi-dimensional grid and the minimum integer multiple of the number of kernel units that is not less than the predicted segmentation number, which may specifically include:

[0116] Determining, based on the predicted number of divisions (e.g., the estimated number of segments) and the number of kernel units, a balanced number of divisions for a plurality of division grids obtained by dividing the current multidimensional grid on the reference dimension; wherein the balanced number of divisions is a minimum integer multiple of the number of kernel units that is not less than the predicted number of divisions (e.g., the estimated number of segments); if the predicted number of divisions (e.g., the estimated number of segments) is less than the number of kernel units, then the balanced number of divisions is one times the number of kernel units; if the predicted number of divisions (e.g., the estimated number of segments) is greater than the number of kernel units, then the balanced number of divisions is at least twice the number of kernel units;

[0117] Based on the baseline grid size of the current multidimensional grid and the determined balanced split number, the single-dimensional split granularity of the current multidimensional grid on the baseline dimension of the current multidimensional grid is determined. For example, the single-dimensional split granularity of the current multidimensional grid on the baseline dimension of the current multidimensional grid is determined based on the size average granularity obtained by dividing the baseline grid size by the balanced split number.

[0118] It is understandable that if Figure 4 The process shown is only a framework description of the grid partitioning method for the processor, wherein S430 and S450 can be as follows Figure 3 The logic shown is intertwined and executed in an integrated manner.

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

[0120] It can be understood that, in the embodiments of the present application, the various parts of the content exemplified can be in an "and / or" relationship. In this article, the meaning of "and / or" refers to the context in which it is connected, which can be a common limiting relationship of "and", or can also be an alternative limiting relationship of "or". Therefore, the various parts of the content with an "and / or" relationship can be understood as including different combinations of situations in which "and / or" between each two parts of the content respectively represents a common limiting relationship of "and" or an alternative limiting relationship of "or", and this combination of different situations can be considered to be basically equivalent to the limiting scope of "at least one of the parts".

[0121] The above description is only a preferred embodiment of the present application and is 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 in the scope of protection of the present application.

Claims

1. A processor, characterized in that: include: At least two core units; as well as Command processor for: determining a base dimension of the current multidimensional grid among multiple grid dimensions; Using a reference grid size of the current multidimensional grid on the reference dimension, a balanced prediction check is performed on a preset single-dimensional maximum granularity; wherein a target condition for the balanced prediction check includes: a predicted number of multiple grids obtained by dividing the current multidimensional grid on the reference dimension using the single-dimensional maximum granularity is an integer multiple of the number of core units of the at least two core units; Determining a single-dimensional segmentation granularity for the current multidimensional grid on the reference dimension based on a verification result of the balanced prediction verification; wherein, if the verification result indicates that the target condition is satisfied, determining the single-dimensional maximum granularity as the single-dimensional segmentation granularity; otherwise, determining the single-dimensional segmentation granularity based on the reference grid size and a minimum integer multiple of the number of kernel units that is not less than the predicted segmentation number; The current multi-dimensional grid is segmented on the reference dimension using the single-dimensional segmentation granularity to obtain the multiple segmented grids corresponding to the at least two kernel units respectively.

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

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

4. The processor according to claim 1, wherein: The command processor is specifically configured to: Based on the segmented prediction result of the reference grid size using the single-dimensional maximum granularity, the balanced prediction check is performed on the single-dimensional maximum granularity.

5. The processor according to claim 4, wherein: The command processor is specifically configured to: Predicting the number of estimated segments of the reference grid size using the single-dimensional maximum granularity; wherein the estimated number of segments is used to represent the predicted number of segments; The verification result is determined based on the estimated number of segments and the number of core units; wherein, if the estimated number of segments is an integer multiple of the number of core units, the verification result indicates that the target condition is met; if the estimated number of segments is a non-integer multiple of the number of core units, the verification result indicates that the target condition is not met. The processor according to claim 1 , wherein: The command processor is specifically configured to: Determining, based on the predicted number of splits and the number of kernel units, a balanced number of splits of a plurality of split grids obtained by splitting the current multidimensional grid on the reference dimension; wherein the balanced number of splits is a minimum integer multiple of the number of kernel units that is not less than the predicted number of splits; if the predicted number of splits is less than the number of kernel units, then the balanced number of splits is one times the number of kernel units; if the predicted number of splits is greater than the number of kernel units, then the balanced number of splits is at least two times the number of kernel units; The single-dimensional segmentation granularity is determined 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: The single-dimensional segmentation granularity is determined according to the size average granularity obtained by equally dividing the reference grid size by the balanced segmentation number.

8. A grid partitioning method for a processor, characterized in that: include: determining a base dimension of the current multidimensional grid among multiple grid dimensions; A balanced prediction check is performed on a preset single-dimensional maximum granularity using a reference grid size of the current multidimensional grid on the reference dimension; wherein a target condition for the balanced prediction check includes: a predicted number of multiple grids obtained by dividing the current multidimensional grid on the reference dimension using the single-dimensional maximum granularity is an integer multiple of the number of core units of at least two core units in the processor; Determining a single-dimensional segmentation granularity for the current multidimensional grid on the reference dimension based on a verification result of the balanced prediction verification; wherein, if the verification result indicates that the target condition is satisfied, determining the single-dimensional maximum granularity as the single-dimensional segmentation granularity; otherwise, determining the single-dimensional segmentation granularity based on the reference grid size and a minimum integer multiple of the number of kernel units that is not less than the predicted segmentation number; The current multi-dimensional grid is segmented on the reference dimension using the single-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, characterized in that: Determining a reference dimension of the current multidimensional grid among multiple grid dimensions includes: The reference dimension is determined based on single-dimensional grid sizes of the current multi-dimensional grid in the multiple grid dimensions.

10. The grid cutting method according to claim 8, characterized in that: The method of performing balanced prediction verification on a preset single-dimensional maximum granularity using a reference grid size of the current multi-dimensional grid in the reference dimension includes: Based on the segmented prediction result of the reference grid size using the single-dimensional maximum granularity, the balanced prediction check is performed on the single-dimensional maximum granularity.

11. The grid cutting method according to claim 8, characterized in that: The determining of the single-dimensional segmentation granularity based on the reference grid size and the minimum integer multiple of the number of kernel units that is not less than the predicted segmentation number includes: Determining, based on the predicted number of splits and the number of kernel units, a balanced number of splits of a plurality of split grids obtained by splitting the current multidimensional grid on the reference dimension; wherein the balanced number of splits is a minimum integer multiple of the number of kernel units that is not less than the predicted number of splits; if the predicted number of splits is less than the number of kernel units, then the balanced number of splits is one times the number of kernel units; if the predicted number of splits is greater than the number of kernel units, then the balanced number of splits is at least two times the number of kernel units; The single-dimensional segmentation granularity is determined according to the reference grid size and the balanced segmentation quantity.

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

Citation Information

Patent Citations

  • 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