Task scheduling method and device based on multi-core system and related products

By splitting matrix multiplication tasks according to row and column grids on multi-core systems and optimizing parameters, the problem of matrix multiplication task scheduling on multi-core systems is solved, data exchange and I/O bottlenecks are reduced, and computing performance is improved.

CN118733206APending Publication Date: 2024-10-01CAMBRICON TECH CO LTD
View PDF 0 Cites 7 Cited by

Patent Information

Application Number
CN202310332479.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-30
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

On multi-core systems, task scheduling for matrix multiplication tasks is difficult to optimize, resulting in frequent data exchange and input/output (I/O) bottlenecks, affecting computing performance.

Method used

A task scheduling method based on multi-core systems is adopted, by splitting matrix multiplication tasks according to a row-column grid, and scheduling tasks according to optimized parameters to minimize the amount of data interaction and make full use of the parallel operation characteristics of the multi-core architecture.

Benefits of technology

It effectively reduces data exchange and I/O bottlenecks, improves the processing efficiency of matrix multiplication tasks, and makes full use of the parallel operation characteristics of multi-core architecture.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733206A_ABST
    Figure CN118733206A_ABST
Patent Text Reader

Abstract

The invention discloses a task scheduling method and device based on a multi-core system and related products. The task scheduling device may be included as a processing device in a combined processing device, which may further include an interface device and a computing device. The computing device interacts with the processing device to jointly complete computing operation specified by a user. The combined processing device can further comprise a storage device, and the storage device is connected with the computing device and the processing device and used for storing data of the computing device and the processing device. According to the scheme, the method for scheduling the matrix multiplication operation tasks on the multi-core system is provided, data IO can be effectively reduced, and the processing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure generally relates to the field of task scheduling. More specifically, the present disclosure relates to a task scheduling method based on a multi-core system, a task scheduling device, a computer-readable storage medium, a computer program product, a processing device, a chip and a board. Background Art

[0002] General Matrix Multiplication (GEMM) is the most basic component in the field of high-performance computing (HPC). From traditional scientific computing to emerging deep learning, GEMM plays a very important role. For example, computational fluid dynamics CFD, dynamic molecular simulation software CP2K, kNN and kMeans problems in large-scale physical simulations, and fully connected layers in deep learning, recurrent neural networks RNN, long short-term memory networks LSTM, gated recurrent units GRU, etc.

[0003] However, optimizing GEMM is a difficult task, especially on multi-core systems, and the current hardware for accelerating GEMM basically relies on multi-core architectures. Different multi-core architectures have different numbers of cores, different core organizations and divisions, and possibly different storage unit configurations. The division of tasks between multiple cores has a great impact on GEMM performance. Good task division can enable multiple cores to work together and greatly improve GEMM performance.

[0004] In view of this, there is an urgent need for a solution that can perform task scheduling based on a multi-core system to support multi-core efficient parallel processing of computing tasks such as matrix multiplication. Summary of the invention

[0005] In order to at least solve one or more of the technical problems mentioned above, the present disclosure proposes a task scheduling solution based on a multi-core system in multiple aspects.

[0006] In a first aspect, the present disclosure provides a task scheduling method based on a multi-core system, wherein the task includes a matrix multiplication type operation task, the multi-core system includes multiple operation units, each operation unit includes one or more processing cores, and each processing core has a local memory, the method includes: determining the number T of operation units that can be scheduled; based on the operation units that can be scheduled, splitting the matrix multiplication type operation tasks in a row and column grid manner; according to the splitting scheme, determining the amount of data that the operation unit needs to interact with the external circuit; determining the optimization parameters of the splitting scheme to minimize the amount of data interacted; and according to the optimization parameters, scheduling the matrix multiplication type operation tasks to be executed in parallel on the operation units.

[0007] In a second aspect, the present disclosure provides a task scheduling device configured to execute the task scheduling method described in the first aspect.

[0008] In a third aspect, the present disclosure provides a computer-readable storage medium having program instructions stored therein, which, when loaded and executed by a processor, causes the processor to execute the task scheduling method described in the first aspect of the present disclosure. In a fourth aspect, the present disclosure provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the task scheduling method described in the first aspect of the present disclosure. In a fifth aspect, the present disclosure provides a processing device, including the task scheduling device of the aforementioned second aspect. In a sixth aspect, the present disclosure provides a chip, including the processing device of the aforementioned fifth aspect. In a seventh aspect, the present disclosure provides a board, including the chip of the aforementioned fourth aspect.

[0009] Through the task scheduling method, task scheduling device, computer-readable storage medium, processing device, chip and board provided above, the disclosed embodiments provide an optimized task scheduling scheme for the implementation of matrix multiplication-type computing tasks on a multi-core system, which can effectively reduce frequent data exchange and loading, avoid input / output (I / O) bottleneck problems, and fully utilize the parallel operation characteristics of the multi-core architecture to improve processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0011] Figure 1 A schematic diagram showing a storage (memory) architecture of a multi-core system to which the disclosed embodiments can be applied;

[0012] Figure 2 A schematic diagram showing a first implementation form of a chessboard algorithm according to some embodiments of the present disclosure;

[0013] Figure 3 A schematic diagram showing a second implementation form of a chessboard algorithm according to other embodiments of the present disclosure;

[0014] Figure 4 An exemplary flow chart showing a task scheduling method based on a multi-core system according to an embodiment of the present disclosure;

[0015] Figure 5 An exemplary implementation of the Cannon algorithm according to an embodiment of the present disclosure is shown;

[0016] Figure 6 A schematic diagram showing the storage of data on different storage levels;

[0017] Figure 7 An example of group splitting according to an embodiment of the present disclosure is shown;

[0018] Figure 8 An example of the reduction calculation process is shown;

[0019] Fig. 9 A schematic diagram showing the splitting of matrix multiplication operations for the GEPP mode is shown. DETAILED DESCRIPTION

[0020] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0021] It should be understood that the terms "first", "second", "third", and "fourth" etc. that may appear in the claims, specifications, and drawings of the present disclosure are used to distinguish different objects rather than to describe a specific order. The terms "include" and "comprise" used in the specifications and claims of the present disclosure indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their collections.

[0022] It should also be understood that the terms used in this disclosure are only for the purpose of describing specific embodiments and are not intended to limit the disclosure. As used in this disclosure and claims, the singular forms of "a", "an", and "the" are intended to include the plural forms unless the context clearly indicates otherwise. It should also be further understood that the term "and / or" used in this disclosure and claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations.

[0023] As used in this specification and claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0024] The specific implementation of the present disclosure is described in detail below with reference to the accompanying drawings. Exemplary Storage Architecture

[0025] As mentioned above, existing multi-core systems are different in specific structure. For example, some multi-core systems, such as NVIDIA's multi-core architecture, including but not limited to Turing architecture, Volt architecture, Ampere architecture, etc., are composed of multiple independent streaming multi-core processors (SM, Streaming Multiprocessor), each SM contains a thread warp scheduler (Warp Scheduler), instruction dispatch unit (Dispatch Unit), register page (Register File) and local cache (L1 cache and shared memory). Specifically, for NVIDIA A100, it contains 108 SMs, each SM contains four Warp schedulers, four instruction dispatch units, four 16384*32-bit register pages, and 192K shared memory. Other multi-core systems, such as Cambrian's multi-core architecture, are composed of multiple computing clusters, each computing cluster has multiple computing cores ipc, these computing cores share a cache (shared memory), and each computing core has a local cache. In addition, some multi-core architectures also include L2 cache, which is shared by all streaming processors (or computing clusters), with a capacity ranging from a few megabytes to tens of megabytes. For example, NVIDIA A100 has a 40-megabyte last-level cache (LLC). LLC can have multiple operation modes, including data latching, streaming access, clearing and writing back to system memory, etc. In order to fully utilize the characteristics of LLC latching access to data and maximize the utilization of data resident in LLC, multi-core systems can increase the cache hit rate by increasing the probability of accessing the same piece of global memory in a short period of time, thereby achieving the purpose of bandwidth acceleration.

[0026] In view of the fact that matrix multiplication-like computing tasks may be implemented on various multi-core architectures, the task scheduling scheme needs to consider the compatibility and universality of different multi-core architectures. The inventors note that the key issue of task splitting optimization on a multi-core architecture is to optimize data input / output (I / O). Since the processing core is subject to the capacity limitations of internal storage resources, the huge amount of data computing may cause a large amount of data interaction between the processing core and the external storage device. The bandwidth of the I / O bus between the processing core and the external memory is limited, which is likely to cause a serious I / O bottleneck problem, and then cause a delay in data transfer and greatly reduce the computing efficiency during parallel computing. Furthermore, not only will the bandwidth limitation of the I / O bus become a bottleneck for system performance, but the large amount of I / O memory access between the processing core and the external storage device will also have an adverse effect on computing and power consumption.

[0027] In view of this, the present disclosure provides a task scheduling solution based on the storage architecture of a multi-core system, from the perspective of optimizing the amount of data interaction between the processing core and the external circuit (such as an external storage device), which is used to efficiently schedule matrix multiplication-type computing tasks to the multi-core system for parallel execution, thereby improving the computing efficiency of parallel computing of the multi-core system.

[0028] Figure 1 A schematic diagram of a storage (memory) architecture of a multi-core system to which the disclosed embodiment can be applied is shown. The storage architecture comprehensively considers a variety of multi-core systems and is compatible with different existing multi-core architectures.

[0029] As shown in the figure, the bottom layer DRAM 110 is an off-chip memory used to store input and output data, such as input data to be processed by the processing core and processing results obtained by the multi-core system. DRAM 110 can be DDR memory, and the DDR memory types are: LPDDR, GDDR, HBM, etc. The processing core can access the off-chip storage based on the bus protocol through the on-chip storage control unit (such as DDR controller). DRAM 110 can be regarded as the global storage at this level of the chip.

[0030] The next layer up in the figure is the L2 cache 120. The L2 cache 120 may include LLC. As mentioned above, LLC may have multiple operation modes, including data latching, streaming access, clearing and writing back to system memory, etc. When the data latching mode of LLC is enabled, the characteristic of LLC latching access data can be fully utilized to maximize the utilization of data resident in LLC, thereby achieving the effect of bandwidth expansion.

[0031] The next layer in the figure is the shared memory 130. The shared memory 130 can share on-chip storage between multiple processing cores. It is understood that there can be multiple shared memories, each of which serves multiple processing cores respectively, and the figure only shows one shared memory by way of example.

[0032] The top layer in the figure is the local memory 140 of each processing core 150, and the shared memory 130 is the on-chip storage of the corresponding processing core 150. Depending on the specific hardware architecture, the local memory 140 can be implemented in different ways, such as a data buffer or a register page, and the disclosed embodiment has no limitation in this regard.

[0033] although Figure 1 The memory architecture abstracted based on various multi-core architectures is shown, but those skilled in the art should understand that in different hardware implementations, Figure 1 Some storage levels in the system may be omitted. For example, in one implementation, there may be no shared memory 130; in another implementation, there may be no L2 cache 120, or even if LLC is configured on the hardware, its data latching mode is not enabled, which is equivalent to no L2 cache; in another implementation, there may be neither shared memory 130 nor L2 cache 120, or the data latching mode of LLC is not enabled. In the task scheduling scheme of the disclosed embodiment, based on Figure 1 The storage architecture takes into account the above possible implementations and provides an optimized task splitting solution to support efficient parallel execution of matrix multiplication tasks in a multi-core architecture.

[0034] In different multi-core systems or different working modes of the same multi-core system, multiple processing cores may be scheduled to perform parallel operations in different units or granularities. For example, in NVIDIA's multi-core system, one SM is generally used as the basic unit, while in some Cambrian multi-core systems, one computing cluster is generally used as the basic unit. In the disclosed embodiment, the scheduling granularity of the processing core is referred to as an "operation unit", and each operation unit includes one or more processing cores. Depending on the different multi-core systems, the number of processing cores contained in an operation unit is also different. For example, in some implementations, a computing cluster can be used as an operation unit, which contains 4 processing cores; in other implementations, four computing clusters can be used as an operation unit, which contains 16 processing cores; in some other implementations, one processing core can be used as an operation unit.

[0035] It should be noted that the "matrix multiplication type operation tasks" mentioned in this article include not only direct matrix multiplication operation tasks, but also other operation tasks that can be converted into matrix multiplication operations, such as convolution operations, Einstein summation, etc. Matrix multiplication operations can generally be expressed as: C = A*B, where the left multiplication matrix A is a matrix of size M*K, the right multiplication matrix B is a matrix of size K*N, and the output matrix C is a matrix of size M*N. The input and output data of the convolution operation generally involve dimensions such as batch (Batch), height (H), width (W), input channel (Ci), output channel (Co), convolution kernel height (Kh) and width (Kw), which can be converted into matrix multiplication operations by merging dimensions. For example: for convolution operations, the M, N and K dimensions can be, respectively, M = Batch*H*W, N = Co, K = Ci*Kh*Kw. Therefore, the scheme described in the embodiment of the disclosure based on the matrix multiplication operation task can also be similarly applied to these operation tasks that can be converted into matrix multiplication operations. Matrix multiplication task splitting scheme

[0036] In the disclosed embodiment, a splitting scheme for matrix multiplication type operations is provided to distribute matrix multiplication type operation tasks to multiple processing cores of a multi-core system for execution. In this splitting scheme, splitting is performed based on the operation units of the multi-core system, and the number of processing cores contained in the operation units can vary based on different implementations, so that the splitting scheme can adapt to different multi-core architectures. Specifically, assuming that the number of operation units that can be scheduled is T, the splitting scheme splits the matrix multiplication operation tasks in a row and column grid manner between these operation units that can be scheduled, so that in each matrix multiplication type operation task, each operation unit calculates an output matrix of a grid size. Since the divided grid is shaped like a chessboard, the above-mentioned row and column grid splitting method may also be referred to as "chessboard splitting" or "chessboard algorithm" in this article.

[0037] General matrix multiplication can be expressed as follows: C=op(A)*op(B) (1) Where op indicates whether to transpose the matrix. The left multiplication matrix op(A) and the right multiplication matrix op(B) are M*K and K*N matrices respectively, and the output matrix C is an M*K matrix. In most cases, matrices A and B do not need to be transposed, so op(A) = A, op(B) = B. For simplicity, the following will directly mention matrices A and B, omitting op.

[0038] In the chessboard algorithm of the disclosed embodiment, the output matrix C is divided into r*c (row*column) grids according to the number of schedulable operation units T, where r is the number of rows and c is the number of columns. In each round of operation, each operation unit calculates one of the grids. The above-mentioned row and column grid splitting can be implemented in different forms.

[0039] Figure 2 A schematic diagram of a first implementation of a chessboard algorithm according to some embodiments of the present disclosure is shown. In the first implementation, all schedulable T operation units (denoted by Cu in the figure) are treated as a whole for processing, and a sub-matrix Block_C of the output matrix C is calculated in each round of operation. The sub-matrix Block_C is divided into r*c small grids, and each operation unit calculates one of the small grids.

[0040] Specifically, as shown in the figure, the size of the output matrix C is M*N, and all operation units calculate a sub-matrix (Block_C) of the output matrix C in each round, and its size is assumed to be Block_M*Block_N. Further, the sub-matrix Block_C is divided into r*c (row*column) grids, each grid size is ΔM*ΔN, r*c=T, that is, each operation unit in each round of calculation needs to calculate a C matrix of size ΔM*ΔN. The light gray in the figure represents the first round of calculation, and the dark gray represents the second round of calculation. The figure assumes that the number of schedulable operation units T=12.

[0041] Figure 3 A schematic diagram of a second implementation of the chessboard algorithm according to other embodiments of the present disclosure is shown. In the second implementation, the output matrix C is directly divided into large grids of r*c, r*c=T, and each operation unit is responsible for calculating one of the large grids. Further, each large grid is divided into small grids of ΔM*ΔN, and each operation unit calculates a small grid in the corresponding large grid in each round of operation.

[0042] Specifically, as shown in the figure, the size of the output matrix C is M*N, which is first divided into a large grid of r*c, r*c = T. In this example, T = 12. Each operation unit is responsible for calculating the C matrix in a large grid, that is, each operation unit processes a complete GEMM problem, namely: GEMM i (op(A i ),op(B i ),M i ,N i ,K,A i ,lda,B i ,ldb,C i ,ldc), where the subscript i represents the i-th computing unit, C i =op(A i)*op(B i ), M i represents the number of rows of the matrix Ci, Ni represents the number of columns of the matrix Ci, lda, ldb and ldc represent the principal dimensions of the sub-matrices Ai, Bi, Ci respectively, which are equal to the principal dimensions of the original matrices, i.e. A, B, C. The principal dimension refers to the row width or column width of a matrix when it is stored in a memory in a row-major or column-major format. For example, when a matrix is ​​stored in a memory row by row, the matrix is ​​row-major, and its principal dimension is the row width of the matrix (i.e. the number of column elements). Similarly, when a matrix is ​​stored in a memory column by column, the matrix is ​​column-major, and its principal dimension is the column width of the matrix (i.e. the number of row elements).

[0043] Each operation unit completes the calculation of the large grid it is responsible for through multiple rounds of calculations. Specifically, each operation unit calculates a small grid within the large grid it is responsible for in each round of calculations, and the size of the small grid is ΔM*ΔN. The first round of calculations is shown in light gray in the figure, and the second round of calculations is shown in dark gray. The figure also shows that the processing results of all operation units in the first round of calculations can be pieced together into an r*c block.

[0044] Although the above two implementation forms seem to be quite different in form, in terms of effect, the output matrix of each processing is a matrix of rΔM*cΔN, that is, in each round of calculation, each computing unit calculates and obtains an output matrix of the size of a grid, and T computing units calculate a total of r*c grid-sized outputs. These grids can be arranged continuously (the first implementation form), that is, all computing units in each round of calculation calculate a continuously arranged output matrix; or they can be arranged at intervals (the second implementation form), that is, each computing unit calculates a continuously arranged output matrix.

[0045] In some embodiments, the second implementation form of the chessboard algorithm is preferably used. The second implementation form is conducive to clearly dividing the tasks of all computing units in the early stage, which is convenient for modular programming. Task scheduling optimization

[0046] In the disclosed embodiment, a task scheduling scheme suitable for a multi-core system is provided, which is based on the above-mentioned storage architecture and chessboard algorithm to determine the optimal splitting scheme for matrix multiplication type operation tasks, thereby minimizing the amount of data that the operation unit needs to interact with the external circuit, shortening the I / O time as much as possible, and maximizing the performance of the matrix multiplication.

[0047] Figure 4An exemplary flow chart of a task scheduling method 400 based on a multi-core system according to an embodiment of the present disclosure is shown. The tasks to be scheduled include matrix multiplication type operation tasks. The multi-core system includes multiple operation units, each operation unit includes one or more processing cores, and each processing core has a local memory (e.g., a reference Figure 1 storage architecture).

[0048] like Figure 4 As shown, in step 410, the number T of computing units that can be scheduled is determined. In some implementations, the number T of computing units that can be scheduled can be directly determined based on the hardware configuration, such as the number of computing units configured for the multi-core system. If these computing units are idle, the computing task can be executed directly; otherwise, it is necessary to wait until the required number of computing units are idle before the computing task can be executed. Since multi-core systems usually need to perform a variety of computing tasks, and the computing power required for these computing tasks varies, some computing units will be occupied and some computing units will be idle. In other implementations, when performing task scheduling, the number T of computing units that can currently be scheduled can be determined based on, for example, the number of computing units that are expected to be idle within a period of time.

[0049] In step 420, the operation tasks are split in a row-column grid manner based on the operation units that can be scheduled. Different types of matrix multiplication operation tasks have slightly different row-column grid splitting methods. Specifically, in some implementations, when the matrix multiplication operation task is a first-class task, the operation units that can be scheduled are split in a row-column grid manner according to the operation units, so that in each round of operation, each operation unit calculates an output matrix of the size of a grid. The first type of task is the case where the M and N dimensions are large enough, such as GEMM or GEPP type matrix multiplication. In other implementations, when the matrix multiplication operation task is a second-class task, the operation units that can be scheduled are divided into several operation unit groups, and the row-column grid splitting is performed according to the operation unit groups, so that in each round of operation, each operation unit group calculates an output matrix of the size of a grid. The second type of task is the case where the K dimension is large enough, but the M and N dimensions are relatively small, such as GEPDOT type matrix multiplication. It should be clear that although the output data splitting of GEMM or GEPP type matrix multiplication is in the form of the first type of task, GEMM and GEPDOT are both in Figure 1 The on-chip storage resident C matrix shown, that is, splitting the K dimension, constantly updating the matrices A and B, is different from GEPP, which is described in detail later. In the following description, the GEMM type matrix multiplication operation task is temporarily used as an example for explanation, and the GEPDOT and GEPP type matrix multiplication tasks will be described in detail later. When splitting the matrix multiplication task between multiple operation units or operation unit groups, the previous chessboard algorithm is applied for splitting.

[0050] Next, in step 430, the amount of data that the operation unit needs to interact with the external circuit is determined according to the splitting scheme. As mentioned above, the key issue of task splitting optimization on a multi-core architecture lies in data input / output (I / O). Therefore, when determining the optimized splitting scheme, the operation cost is mainly considered from the perspective of data input / output. Depending on the specific implementation of the storage architecture, the way the operation unit interacts with the external circuit (such as external memory) is slightly different, and the corresponding data volume calculation method is also slightly different. The following mainly considers two storage architectures: 1. LLC does not exist or the latch mode of LLC is not enabled; 2. LLC exists and the latch mode is enabled.

[0051] The first storage architecture (LLC closed) is mainly for each computing unit that needs to directly read from the global memory (for example Figure 1 The scenario of loading data from a DRAM (with a cache memory), for example, because there is no LLC, or although there is an LLC, the data latch mode is not turned on, or even if the data latch mode is turned on, no data is hit in the cache.

[0052] In this scenario, the computing unit needs to read data from external memory for each round of computing, receiving input data through multiple readings in multiple rounds of computing. Depending on the algorithm used on the processing core within the computing unit, the calculation method of the amount of data that the computing unit needs to interact with the external circuit is slightly different.

[0053] In one implementation, when the size of the matrix involved in the matrix multiplication task satisfies the first condition, the amount of data that the operation unit needs to interact with the external circuit is determined in a first manner, and the first manner adopts the method of resident output matrix C on chip. The first condition may be, for example, a situation where the K dimension is large enough, such as GEMM, GEPDOT type matrix multiplication tasks.

[0054] In this implementation, for example, the amount of data that each operation unit needs to read from the external memory to complete the entire matrix multiplication operation, that is, the cost of data interaction, can be determined according to the following formula (2): Where A is a matrix of size M*K, B is a matrix of size K*N, and the output matrix C is a matrix of size M*N and is split into r*c row and column grids, where r is the number of rows and c is the number of columns. and Indicates that each operation unit is responsible for the matrix multiplication task The calculation task of the output matrix C is as follows: ΔM and ΔN are the splitting granularity of the M dimension and the N dimension in the operation unit, that is, the size of the C matrix calculated by each operation unit in each round. dw represents the data bit width.

[0055] As can be seen from the above formula (2), in each round of operation, each operation unit needs to calculate a grid of size ΔM * ΔN, and the data volumes of the left multiplication matrix A and the right multiplication matrix B required respectively are ΔM * K * dw(A) and ΔN * K * dw(B). To complete the entire matrix multiplication operation, a total of rounds of operations are required. Therefore, a total of such a large amount of data needs to be read. In this embodiment, the goal of task scheduling optimization is to minimize the amount of interactive data represented by formula (2).

[0056] In another implementation, when the matrix scale participating in the matrix multiplication operation task satisfies the second condition, the matrix multiplier local cache resident A matrix or B matrix, and the data volume that the operation unit needs to interact with the external circuit is determined in the second way. The second condition is: the total data volume of matrix A or B is less than the size LS of the on-chip local cache, and M * K * dw(A) + 2 * (K * n align *dw(B) + M * n align *dw(C) < LS or N * K * dw(B) + 2 * (K * m align *dw(A) + m align *N * dw(C)) < LS, where m align and n align are the minimum M and N that the on-chip processing core can handle for the matrix multiplication operation task, dw() represents the bit width; or K is less than a preset threshold and 2 * m align *n align *dw(C) + 3 * K * MAX(m align *dw(A), n align *dw(B)) < LS. The second condition is collectively referred to as the GEPP class matrix multiplication task. Those that do not meet the second condition can be classified into the first condition. The following will describe such matrix multiplication tasks in detail in the GEPP part.

[0057] In some embodiments, the impact of bandwidth can be further considered. Specifically, the impact factor of transmission bandwidth can be considered in the amount of interactive data. This impact factor is expressed as the bandwidth utilization coefficient γ(ΔL, L), which is equal to the ratio of the equivalent bandwidth of loading a sub-matrix from the external circuit every L data according to the data length ΔL to the full bandwidth.

[0058] Specifically, at this time, formula (2) can be adjusted to: Among them, γ(ΔL,L) is the bandwidth utilization coefficient, which is equal to the ratio of the equivalent bandwidth of loading a submatrix from the external memory every L data according to the data length ΔL to the full bandwidth. The data length ΔL can be understood as the amount of data to be loaded, and L can be understood as the memory access step. lda and ldb represent the size of the main dimension of matrices A and B respectively, and Δlda and Δldb represent the granularity of the splitting of matrices A and B in the main dimension, that is, the size of the splitting in the main dimension.

[0059] The second storage architecture (LLC enabled) is mainly for scenarios where an L2 cache exists and the data latch mode is enabled. That is, a multi-core system includes a global cache for caching data so that when the computing unit loads data from the external memory, it will be loaded from the global cache first, thereby achieving the effect of amplifying the external memory bandwidth.

[0060] In this scenario, each operation unit or operation unit group only needs to interact with the external memory once to retrieve all the data required for the matrix multiplication operation. Therefore, the amount of data that needs to be interacted with the external circuit can be determined in the manner that each operation unit or operation unit group interacts with the external circuit once to retrieve all the data required to perform the matrix multiplication operation task.

[0061] In one implementation, for a GEMM-type matrix multiplication operation task, the amount of data that each operation unit needs to read from the external memory to complete the entire matrix multiplication operation, that is, the cost of data interaction, can be determined according to the following formula (4): Where A is a matrix of size M*K, B is a matrix of size K*N, and the output matrix C is a matrix of size M*N and is split into r*c rows and columns, where r is the number of rows, c is the number of columns, ΔM and ΔN are the split granularity between the M and N dimensions in the operation units, respectively. size and B size are the total data size of matrix A and matrix B respectively.

[0062] From the above formula (4), it can be seen that due to the existence of the global cache, the required data can be cached in the global cache at one time. In the subsequent operations, the operation unit hits the data in the global cache and fetches the data from the global cache without generating data interaction with the DRAM. size A total of times, and the amount of data in matrix A is A size A total of In this embodiment, the goal of task scheduling optimization is to minimize the amount of interactive data represented by formula (4).

[0063] Similarly, in some embodiments, the influence of bandwidth may be further considered, and formula (4) may be adjusted to: The meaning of γ(ΔL,L) is the same as before.

[0064] Next, in step 440, the optimization parameters of the splitting scheme are determined to minimize the amount of interactive data. It can be seen from the formula for the amount of interactive data determined above that when the number of schedulable operating units T is known, the parameters that can be changed include r, c, ΔM, ΔN, that is, including: the parameters of splitting in the chessboard algorithm: the number of rows r and the number of columns c; the output matrix size calculated by each operating unit in a single round of operation: ΔM*ΔN. Optionally or additionally, when the K dimension is relatively large and needs to be split, the K-dimensional splitting granularity ΔK can also be included. Therefore, the entire search space can be established to find the optimization parameters that minimize the amount of interactive data. The search space depends on the algorithm used on the chip and mainly depends on the space allocation of the on-chip memory, which will be described in detail later.

[0065] Finally, in step 450, according to the determined optimization parameters, these operation units are scheduled to perform matrix multiplication type operation tasks. As mentioned above, the optimization parameters include the splitting parameters r and c in the chessboard algorithm; the output matrix size calculated by each operation unit in a single round of operation: ΔM*ΔN; and the splitting granularity ΔK or search granularity that optionally includes K dimensions. Therefore, according to these optimization parameters, the matrix multiplication task can be split and scheduled to each operation unit for operation accordingly, thereby minimizing the amount of data interaction between the operation unit and the external memory, achieving further reduction of I / O time to improve matrix multiplication performance. Search space construction

[0066] When determining the optimization parameters of the splitting scheme, a search space can be established based on some constraints, so as to search for the optimal parameters in the search space. These constraints mainly include the following aspects: the number of computing units, the capacity of each level of processor memory and the space allocation constraints.

[0067] The constraint on the number of operation units T is that when the chessboard algorithm is used, the number of grids obtained by row and column grid division is required to be consistent with the number of operation units / operation unit groups, which can be expressed as formula (6): r*c=T / d (6) Where r is the number of rows, c is the number of columns, d=1 when the matrix multiplication task is the first type of task, and d>1 when it is the second type of task, and d is the number of operation units in each group of operation units (which will be described in detail in the GEPDOT section later).

[0068] For each level of cache space division in the on-chip storage hierarchy of a multi-core system, a corresponding search subspace needs to be established. The constraints on the capacity size of each level of the processing core memory are related to the algorithm used to implement the matrix multiplication operation, and more specifically, to the matrix residence method used. In some embodiments of the present disclosure, for matrix multiplication tasks (such as GEMM, GEPDOT, etc.) whose matrix scale meets the first condition, consider residing the C matrix on the local high-speed memory of the matrix multiplication operator, and continuously update the sub-matrices of the A and B matrices according to the K dimension until the K dimension is calculated in a loop, and only the sub-matrices of the A matrix and the B matrix are stored in the other levels of memory. In other embodiments of the present disclosure, for matrix multiplication tasks (such as GEPP, etc.) whose matrix scale meets the second condition, consider residing the A matrix (or the B matrix) on the local high-speed cache of the matrix multiplication operator, continuously update the sub-matrices of the B matrix (or the A matrix), and store the sub-matrices of the C matrix calculated last time on the off-chip memory, which will be described in detail in the GEPP section below.

[0069] Consider a multi-core processor with a two-level storage architecture on a chip, that is, there are S processing cores in a computing unit, each processing core has its own local cache, and these S processing cores share a cache. In the computing unit, the output matrix block C block (ΔM, ΔN) is evenly split into rows and columns on each processing core. Assume that ΔM is split into S among the cores. m ΔN is split between the nuclei. n , where S = S m *S n At the same time, ΔK is split into S k Operations, where S k >=1, that is, in one big cycle (calculating an output matrix block C block (ΔM, ΔN) is called a big cycle), the processing core loads ΔK / S from the previous level of memory at a time. k The sub-matrices of corresponding size require S k It takes several times to load and calculate ΔK. k Each operation in the operations can be called a small loop. Therefore, the constraint on the size of the local memory capacity of the processing core can be determined according to the amount of data required for a small loop operation and the amount of matrix resident data, expressed as formula (7): Where P indicates whether ping-pong pipelining is applied on the chip. When ping-pong pipelining is applied, P = 2, otherwise, P = 1; Size DataCache Indicates the capacity of the local storage.

[0070] When each computing unit in the memory architecture includes a shared memory, the search space can further include constraints on the size of the shared memory. Considering that the upper level memory of the shared memory is an off-chip memory, the computing unit needs to complete the input matrix block A of the matrix multiplication task at one time block and B block The load (i.e., one round of large cycle operation) is considered. At this time, the constraint on the capacity of the shared memory can be expressed as formula (8): P[ΔM*dw(A)+ΔN*dw(B)]*ΔK<Size SHMEM (8) Similarly, P indicates whether ping-pong pipelining is applied. When ping-pong pipelining is applied, P = 2, otherwise, P = 1; Size SHEME Indicates the capacity of the shared memory.

[0071] In one implementation, on a multi-core processor with a secondary storage architecture on a chip, when the number of processors S in the computing unit satisfies Under the condition that is an integer, the Gannon algorithm is used to implement the matrix multiplication task.

[0072] The Cannon algorithm is an algorithm that optimizes matrix block multiplication and is a storage-efficient algorithm. In the Cannon algorithm, the left-hand matrix A and the right-hand matrix B involved in the matrix multiplication operation are split into S left-hand matrix blocks and S right-hand matrix blocks. Here is a positive integer greater than or equal to 2, called the splitting coefficient of the Gannon algorithm. , matrices A and B can be divided into 4 matrix blocks respectively. , matrices A and B can be divided into 9 matrix blocks respectively. When performing the multiplication, matrices A and B can be divided into 16 matrix blocks respectively, or they can be divided into 4 "2×2" left-multiplication matrix blocks and right-multiplication matrix blocks. The cannon algorithm is performed inside each "2×2" left-multiplication matrix block and right-multiplication matrix block, and then the cannon algorithm is performed outside. Through the aforementioned block processing, the large matrix multiplication operation can be split into S matrix multiplication tasks, and these S matrix multiplication tasks can be assigned to S processing cores for parallel execution.

[0073] In the Cannon algorithm, in order to make the row and column subscripts of the left-multiplied matrix block and the right-multiplied matrix block meet the multiplication requirements, circular shift transfer is purposefully performed on each row and column, so that the total storage requirements of the processing core can be reduced. Based on different memory architectures, data transfer between processing cores can be through a shared storage core shared by multiple processing cores, or through a data channel between processing cores.

[0074] Figure 5An exemplary implementation of the Cannon algorithm according to an embodiment of the present disclosure is shown. In this example, it is assumed that That is, the matrix to be calculated is divided into 2×2 matrix blocks and allocated to four processing cores for processing; these four processing cores correspond to one calculation unit and share one shared storage core to realize data transmission.

[0075] As shown in the figure, the shared storage core 510 stores the input matrix blocks of the matrix multiplication tasks assigned to the operation units including the four processing cores 520 in the current operation round: block and B block It can be understood that when the aforementioned chessboard algorithm is applied, the matrix multiplication result of the two input matrix blocks corresponds to an output matrix block C of size ΔM*ΔN block The two input matrices are divided into 4 matrix blocks and Accordingly, the output matrix block C is the result matrix block It can also be divided into four matrix blocks

[0076] Based on the above matrix partitioning, the four processing cores can respectively execute the following formula to calculate the corresponding matrix multiplication results

[0077] It can be seen from the above formula that the operation can be completed in two rounds. Figure 5 The upper middle part shows the input matrix blocks required by each processing core in the first round, and the lower middle part shows the input matrix blocks required by each processing core in the second round.

[0078] Figure 6 Schematic diagram of data storage at different storage levels is shown. As shown in the figure, the input matrices A and B that need to perform matrix multiplication operations are stored in the global memory 610. The global memory is, for example, Figure 1 The off-chip memory DRAM in the processing core is used. The loading pipeline of input matrices A and B is implemented on the shared memory 620. In some embodiments, the output matrix C is not cached in the shared memory core, but directly resides in the local memory of the processing core, and then cyclically accumulated in the K dimension as needed. The local memory 630 of the processing core also stores relatively small matrices A and B. The figure also shows the matrix data used and the calculated matrix data at the computing unit 640 of the processing core.

[0079] Alternatively or additionally, in some embodiments, in order to improve processing efficiency, a ping-pong pipeline may be used to load the input matrices A and B from the shared memory 620 to the local memory 630 of the processing core. In these embodiments, the shared memory core may be configured with at least two storage areas to support data access between one storage area and a certain memory while data access between another storage area and another memory. The two storage areas may be referred to as a ping-pong storage space and a pong storage space, that is, a ping-pong pipeline is used.

[0080] According to the description of the above algorithm, when When , the corresponding search space can be established. Specifically, S in formula (7) m =S n =S k =2, P=2 in formula (7) and formula (8), and the optimization parameters of the splitting scheme that minimizes the amount of data of the aforementioned interaction can be searched in this search space.

[0081] In some implementations, when searching, the search step size can be set according to the following parameters: ΔK=k max(ΔL,K align ), Δlda=iΔL, Δldb=jΔL (9) Where i, j, k are positive integers; ΔL represents the basic splitting step of data, which is generally equal to the cache line of DRAM; Δlda and Δldb represent the splitting granularity of the main dimension of matrix A and B, respectively, which can also be called the search step, which can be an integer multiple of ΔL; K align represents the alignment parameter; ΔK represents the split granularity of K dimension, which can be ΔL and K align An integer multiple of the maximum value in .

[0082] More generally, when searching, you can set the search step size as follows:

[0083] The search granularity of the main dimension of each matrix can be determined based on the basic split granularity of the main dimension, the minimum alignment requirement for processing and checking the main dimension, and the number of splits of the main dimension within the operation unit. In an example, the main dimension can be searched according to the following formula: Δld=i*max(ΔL,S ld *ld align ) (10) Where Δld is the split size of the main dimension of the matrix, ΔL represents the basic split granularity of the dimension, which is generally equal to the cache line length of DRAM. align Indicates the minimum alignment requirement of this dimension in the processing core, S ldIndicates the number of times the dimension is split in the operation unit, i is an arbitrary positive integer to be searched and determined. For the dimensions of the leading dimension (ld) of the matrix, see the following table: For the non-leading dimension D (D is M, K or N), the search granularity can be determined according to the minimum alignment requirement of the processing core for the non-leading dimension and the number of times the non-leading dimension is split within the operation unit. In an example, the non-leading dimension can be searched according to the following formula: ΔD=j*S d *d align (11) Where ΔD is the split size of the non-leading dimension, d align Indicates the minimum alignment requirement of this dimension in the processing core, S d Indicates the number of times the dimension is split in the operation unit, and j is an arbitrary positive integer to be searched and determined.

[0084] Therefore, by searching in the search space, we can find the optimization parameters of the splitting scheme that minimizes the corresponding amount of interactive data (that is, the cost function cost mentioned above). These optimization parameters include the splitting parameters r and c in the chessboard algorithm; the output matrix size calculated by each operation unit in a single round of operation: ΔM*ΔN; and the K-dimensional splitting granularity ΔK.

[0085] In actual operation, multiple combinations that meet the above optimization may be found. In this case, the influence of any one or more of the following parameters can be additionally considered to further select appropriate optimization parameters.

[0086] One parameter is called the compute-to-memory access ratio (CGMA). The compute-to-memory access ratio is the ratio of the number of compute operations to the number of memory operations, which can reflect the efficiency of compute operations and memory operations.

[0087] In some embodiments, when the output matrix C resides in an on-chip memory (LLC ON), the memory access ratio CGMA can be defined as: CGMA device TFLOPS is the hardware's own computing memory access ratio, 1 trillion (=10 12 ) times the number of floating point operations; Bandwidth DRAM is the bandwidth of the off-chip memory DRAM; CGMAloads is the calculated memory access ratio of the load, and β is the ratio of the total LLC bandwidth to the total DRAM bandwidth, that is: β represents the maximum bandwidth amplification factor that LLC can obtain. CGMA in formula (12) device is the hardware's own computational memory access ratio. CGMA in formula (13) loads is the calculated memory access ratio of the load, when CGMA loads >CGMA device When the load is the computing bottleneck, the load is the IO bottleneck. Otherwise, it is the IO bottleneck. To further elaborate, first use the computing access memory ratio to determine whether the obtained split combination is a computing bottleneck or an IO bottleneck. If it is an IO bottleneck, the optimization target is the IO volume, and the smaller the IO volume, the better; when the obtained split combination is the computing bottleneck, select the split combination with the largest computing utilization rate. When the computing utilization rates are the same, select the combination with the largest computing access memory ratio.

[0088] In some other embodiments, when LLC is OFF, the memory access ratio may be calculated as: in,

[0089] Another parameter is the processing core utilization. Current computer hardware, in order to accelerate large-scale matrix multiplication, all uses tensor core technology, that is, to implement a relatively large-scale matrix multiplication on one computing unit. For example, in some hardware architectures, a computing unit can calculate a 16*8*16 (M*K*N) matrix multiplication in one beat. This requires that the M and N dimensions be aligned to 16. However, in the disclosed embodiment, for different loads, after the chessboard algorithm is split, the M and N dimensions will cause a loss of computing power due to alignment. Therefore, the utilization U of the processing core (such as the tensor core) can be used core To evaluate the splitting scheme, as shown below: Where m align and n align They represent the alignment requirements of the processing core in the M and N dimensions respectively.

[0090] In some embodiments, the influence of the above two parameters can be combined. Specifically, when the splitting scheme is an IO bottleneck, the calculation memory access ratio and IO (that is, the previous cost) can be considered as the optimization target, that is, the optimal optimization parameter is further selected based on the calculation memory access ratio; and when it is a computing bottleneck, the processing core utilization rate needs to be considered, that is, the optimal optimization parameter is further selected based on the processing core utilization rate.

[0091] Therefore, through the optimization scheduling scheme of the embodiment of the present disclosure, the chessboard algorithm is used to split the tasks between the computing units, and a splitting scheme that minimizes the amount of data interaction can be found. Furthermore, a relatively good computing-to-memory ratio can be ensured. Kernel-side GENM execution

[0092] In intelligent computing systems, high-performance multi-core systems are usually used as accelerator cards for servers, which exchange data with the host CPU via the PCIe bus. The splitting process of the disclosed embodiment is usually completed at the host end host. The host end determines the optimization parameters of the splitting scheme according to the above-mentioned optimization problem, including chessboard parameters (r, c) and splitting parameters (ΔM, ΔN, ΔK). Afterwards, the host end passes these optimization parameters from the CPU to the high-performance multi-core system by starting the kernel (launch kernel). The parameters required to start kemal include but are not limited to matrix A, matrix B, matrix C, dimension M, dimension K, dimension N, matrix A main dimension lda, matrix B main dimension ldb, matrix C main dimension ldc, matrix block ΔM, ΔK, ΔN, chessboard parameters r, c, d, and additional operation operators op_A, op_B, op_C for matrices A, B, and C, etc. Each operation unit in the multi-core system can determine the GEMM tasks it needs to process according to the chessboard parameters.

[0093] According to the specific implementation form of the chessboard algorithm (such as the two implementation forms mentioned above), the operation unit determines its own GEMM task according to the corresponding rules, that is, determines the specific block addresses of the A matrix and the B matrix that it needs to process. Those skilled in the art can easily deduce the matrix multiplication task blocks processed by each operation unit based on the division principle of the previous implementation form, which will not be expanded here. GEPDOT Program

[0094] In some cases, such as neural network training, we often encounter a situation where the K dimension is particularly large. For example, there are several training scales in transformer models (M=3240, K=43640, N=1024), (M=3360, K=43640, N=1024) and (M=3312, K=43640, N=512), or in computer vision (CV) networks there are such training scales (M=256, K=25088, N=1024), (M=64, K=401408, N=256) and (M=64, K=100352, N=512), etc. There are even some cases where the M dimension and N dimension are smaller. The matrix multiplication classification for these cases is generally called GEPDOT.

[0095] For GEPDOT, if we continue to use the chessboard algorithm mentioned above, for example, splitting it according to the scenario where one computing unit includes 4 processing cores, the following situation may occur: M and N calculated on each processing core or each computing unit are very small. At this time, the access performance of the global memory (DRAM) and the on-chip memory will be relatively poor, resulting in very poor overall performance.

[0096] In view of this, in some embodiments, for such a situation where K is very large, a split K and reduction method can be used to perform the matrix multiplication task, wherein each processing core or each operation unit calculates a complete M and N. Further, in some embodiments, for the situation where M and N are relatively large and K is very large, a method of splitting the M, N and K dimensions between processing cores at the same time can be used. In this way, bandwidth and computing resources can be fully utilized, thereby achieving a relatively good performance.

[0097] Specifically, all schedulable computing units can be grouped, each group includes d computing units. The computing units in the group are divided into K dimensions, and each processing core or each computing unit calculates a complete C block Matrix. If ΔK is split between the processor cores within each computing unit (that is, ΔK is evenly divided among the processor cores within the computing unit for calculation), the sum is first reduced within the computing unit, and finally, the results calculated by each computing unit are reduced. Before the reduction, each computing unit needs to synchronize and "inform" each other that they have completed the K-dimensional loop calculation. Assume that T schedulable computing units are divided into s groups, each with d computing units. Between these s groups, the chessboard algorithm is used to split the matrix multiplication task.

[0098] Under this group splitting, the constraints of the search space described above need to be adjusted as follows.

[0099] Constraints on the number of operation units T: T mod d = 0, r*c = T / d (17) Similarly, T is the total number of operation units, d is the number of operation units in each group, r is the number of rows, and c is the number of columns.

[0100] In terms of the computing unit, the constraint on the size of the local memory capacity of the processing core is still formula (7), but the on-chip splitting coefficient (S) of (ΔM, ΔN, ΔK) needs to be modified. m , S n , S k ): In one implementation, when there is a multi-level cache structure on the chip, the Cannon algorithm is applied, and ΔK is not split between processor cores, but ΔK needs to be calculated in batches of Sk, then In one implementation, the processor cores do not split ΔM and ΔN, but only split ΔK into S parts. After each calculation is completed, the cores perform the reduction calculation again. Then S m =1, S n =1, S k =S.

[0101] When each computing unit in the memory architecture includes shared memory, the constraints on the size of the shared memory are still: P[ΔM*dw(A)+ΔN*dw(B)]*ΔK<Size SHMEM (18)

[0102] The search step size is: ΔK=k max(ΔL,K align ), Δlda=iΔL, Δldb=jΔL (19)

[0101] Different multi-core systems can have different grouping methods. In the grouping process, the processor cores or computing units that can communicate with each other are prioritized to be grouped together, and the inter-core communication function is fully utilized to achieve "handshake" synchronization, and then the protocol is performed. The whole process does not require the host to participate in the work, so the value of d needs to be consistent with the number of computing units that can communicate. For computing units that cannot communicate with each other, the host can issue a synchronization request. The host waits for each computing unit to complete its own matrix multiplication task (the computing unit stores its own calculation results on DRAM), and then issues the protocol task to each computing unit. Therefore, it only needs to consider whether d can be divided by the total number of computing units T.

[0102] In one hardware implementation, 4 (or 2, or 8, or 16) computing units are connected through a bus so that the processor cores can communicate with each other. In this case, d is 4 (or the corresponding 2, or 8, or 16). The reduction process sends the matrix multiplication calculation results to other computing units through the bus. The other computing units accumulate the results bit by bit to obtain the final output result. In another hardware implementation, multiple computing units share an on-chip cache. These computing units can communicate with each other to achieve efficient synchronization. The on-chip cache can be a distributed shared memory (DSM) or a scratch pad memory (SPM). Assuming that in this implementation, 4 computing units share a DSM or SPM, d can be given priority to be 4. The cache DSM or SPM provides a data caching function. After each operation unit completes its own matrix multiplication block calculation task, it stores the calculation result (the partial sum of the matrix multiplication) in the cache. Through the synchronization mechanism, it notifies other cores to load the partial sum from the cache, and performs a reduced sum to obtain the final output result. Figure 7 An example of group splitting according to an embodiment of the present disclosure is shown.

[0103] Figure 7 (a) and (b) illustrate the K-dimensional splitting in each group of operation units (each group has d operation units) in each round of operation. As shown in (a), for the A matrix block, its M dimension size is ΔM, and the K dimension is split into d matrix sub-blocks according to the number of operation units d; as shown in (b), for the B matrix block, its N dimension size is ΔN, and the K dimension is split into d matrix sub-blocks according to the number of operation units d. These matrix sub-blocks are correspondingly assigned to each operation unit in the group, and each operation unit calculates a ΔM*ΔN part and the result matrix. The matrix sub-block pairing is shown by different shadows in the figure. After each operation unit completes the calculation, the calculation result can be stored directly in the SPM or stored in the DRAM in a cache lock manner.

[0104] Figure 7 (c) shows that d ΔM*ΔN partial and result matrices are stored on the SPM. As shown in the figure, these d partial and result matrices need to be reduced, that is, bitwise accumulated. This requires that after each processing core or computing unit completes its own matrix multiplication calculation and stores the partial sum obtained (stored in DSM, or SPM or DRAM, or sent to the shared memory of each cluster through the bus), all computing units and processing cores in each group are forced to synchronize through the internal communication mechanism or the host, and then C blockThe matrix (ΔM*ΔN) is split into d operation units, each of which calculates The reduction of the Cblock matrix. Specifically, we can C block The matrix is ​​split into S processing cores in the operation unit to perform the reduction. At this time, each processing core needs to bear C block The reduction part is the bitwise accumulation of the sum of the matrix multiplication parts. The processing core can use the addition tree method to calculate the output of each part during the reduction process. After the calculation is completed, the calculation result can be stored in the corresponding position of DRAM. That is, each operation unit uses the IO step size (stride IO) to load the SPM with a size of The operation unit can be calculated by using the binary tree reduction (addition tree) method. After the calculation, the C matrix can be directly stored back to the corresponding location of the global memory (such as DRAM). Figure 7 (d) shows a method of splitting C into d operation units. block Schematic diagram of matrix and partial sum calculations.

[0105] Figure 8 An example of the processor core reduction calculation process is shown. In this example, it is assumed that d = 8 = 2 3 . Through multiple rounds of pairwise accumulation, three rounds of reduction calculation are required to obtain the final result. In each round of reduction calculation: the intermediate results calculated by each operation unit or the reduction results of the previous round of reduction are accumulated in pairs to obtain the reduction results of the current round of reduction calculation.

[0106] In an optional implementation, the C matrix partial sum reduction process can also be implemented using atomic operations (atomicadd), where each processor core calculates C block When the processor core issues an atomic operation, it can lock the part of C that it calculates. block The DRAM address corresponding to the matrix. Other processor cores cannot operate the data at this address at this time. The atomic operation is an addition operation. After the atomic addition is completed, the address is directly released. Other processor cores continue to perform the same atomic addition operation until the bitwise accumulation of all partial sums is completed to obtain a complete C matrix.

[0107] The above GEPDOT scheme can be enabled when the matrix multiplication operation task meets specific conditions.

[0108] Specifically, first, it can be judged based on the scale of the left-hand and right-hand matrices in matrix multiplication that the K dimension must be large enough compared to the M and N dimensions, for example, at least larger than a specified multiple of the M or N dimensions. According to experience, in some implementations, K is at least larger than 4 times M or larger than 4 times N. Secondly, when it is assumed that the row-column grid split is performed by the operation unit, the data assigned to a single operation unit for processing does not meet the memory access requirements of the minimum cache line, or does not meet the requirements of the device for calculating the memory access ratio. Specifically, after a pre-split between T operation units, the prior knowledge of ΔM and ΔN is obtained, where ΔM and ΔN are the sizes of the M and N dimensions of a C matrix block assigned to each operation unit for calculation after the C matrix is ​​split between T operation units. If ΔM and ΔN do not meet the memory access requirements of the minimum cache line (CL, cacheline) of the global memory (such as DRAM), or do not meet the requirements of the device for calculating the memory access ratio, it is necessary to enter the GEPDOT solution. In summary, entering GEPDOT requires the following two conditions to be met at the same time: (1)K≥4M or K≥4N (2)(transA and ΔM*sizeof(type)<CL)or ΔN*sizeof(type)<CL orCGMA case <CGMA device , transA means transposing the matrix A In condition (2), the device calculates the memory access ratio as: The computing power here is TFLOPS tiny core Bandwidth is the computing power of each small computing core (i.e., the processing core within the computing unit, such as the IPU in some Cambrian architectures and the tensor core in the GPU). DRAM is the memory access bandwidth of DRAM. m and S n Because ΔM is split into S in one operation unit m ΔN is split into S n There are S in this operation unit. m *S n A small computing core.

[0109] The goal of pre-splitting is to make the split ΔM (TileM in the pseudo code) and ΔN (TileN in the pseudo code) as close as possible. An exemplary pseudo code for pre-splitting is given below.

[0110] priorTilingStrategy(int&TileM,

[0111] int&TileN,

[0112] int priorTileM,

[0113] int priorTileN,

[0114] int M,

[0115] int N,

[0116] int TotalCore){

[0117] int row=1;

[0118] float opt_goal=FLT_MAX;

[0119] int row=1;

[0120] int col=TotalCore;

[0121] if(N / M>TotalCore){

[0122] row=1;

[0123] col=TotalCore;

[0124] }else if(M / N>TotalCore){

[0125] row=TotalCore;

[0126] col=1;

[0127] }else{

[0128] int r=1;

[0129] while(row<=int(sqrt(TotalCore))){

[0130] int c=TotalCore / r;

[0131] if(TotalCore%c==0){

[0132] float ratio1=ceil(float(M) / r) / ceil(float(N) / c);

[0133] float ratio2=ceil(float(M) / c) / ceil(float(N) / r);

[0134] if(abs(ratio1-1)<=opt_goal){

[0135] row = r;

[0136] col = c;

[0137] opt_goal = abs(ratio1-1);

[0138] }

[0139] if(abs(ratio2-1)<=opt_goal){

[0140] row = c;

[0141] col = r;

[0142] opt_goal = abs(ratio2-1);

[0143] }

[0144] }

[0145] r++;

[0146] }

[0147] }

[0148] TileM=min(ceil(M / row),priorTileM);

[0149] TileN=min(ceil(N / col),priorTileN);

[0150] }

[0151] From the above code, we can see that if either N or M exceeds T (the total number of operation units) times the other, the smaller number will not be split, but the larger number will be split into T parts; in other cases, we will look for a splitting method that makes TileM and TileN as close as possible. GEPP Program

[0152] In some cases, matrix multiplication tasks may encounter situations where the K dimension is relatively small, and either or both the M and N dimensions are relatively large. The matrix multiplication classification for these situations is generally called GEPP. In this case, the split is mainly in the M and N dimensions, and the K dimension is not suitable for further splitting.

[0153] Fig. 9 A schematic diagram of matrix multiplication operation splitting for the GEPP mode is shown.

[0154] As shown in the figure, the left multiplication matrix A is split in the M dimension and the K dimension is not split, where ΔM is the size of the matrix block after the split. The right multiplication matrix B is split in the N dimension and the K dimension is not split, where ΔN is the size of the matrix block after the split. The product result matrix C is obtained by the multiplication operation between the split matrix blocks.

[0155] The matrix block obtained by left-multiplying the matrix A according to the above splitting is called A block , its size in the M dimension is ΔM, and its size in the K dimension remains K; the matrix block obtained by right-multiplying the matrix B according to the above splitting is called B block , its size in N dimension is ΔN, and its size in K dimension remains K.

[0156] When the above matrix operations are implemented on a multi-core computing device, the M and N dimensions can be split according to the chessboard algorithm. For example, when splitting according to the second implementation form, each operation unit is responsible for a pair of split matrix blocks A. block and B block The operation is performed, thereby being responsible for a matrix block of size ΔM*ΔN in the result matrix C. Further, each split matrix block A block and B block The operations between them can be divided among multiple processing cores within a computing unit.

[0157] In order to reduce the frequent loading of data during the operation, a solution can be adopted in which either matrix resides. For matrix multiplication operations, the resident side can be the left multiplication matrix block A. block Or right multiply by matrix block B block .

[0158] In the disclosed embodiment, in order to find the optimal scheduling plan, it is necessary to weigh the chessboard splitting strategies for the two cases of A matrix residence and B matrix residence, evaluate the amount of interaction data with the external circuit generated by the A matrix residence and the B matrix residence, and select the residence plan with the smallest amount of interaction data.

[0159] With LLC latch enabled:

[0160] When the A matrix block is resident, the B matrix block and the C matrix block are cyclically replaced. In an operation unit, the ΔM dimension is evenly split into the S processing cores (tiny computing cores) of an operation unit. When splitting according to the chessboard algorithm, when the A matrix block is resident, ΔM needs to be evenly split into the S processing cores of an operation unit.

[0161] At this point, the cost function of data interaction needs to be adjusted as follows:

[0162] The constraints of the search space need to be adjusted as follows.

[0163] Constraints on the number of operation units T: r*c=T (23) Where r is the number of rows and c is the number of columns.

[0164] Handle the constraints on the size of the kernel local memory: Where S is the number of processing cores in a computing unit; P indicates whether ping-pong pipelining is applied. When ping-pong pipelining is applied, P = 2, otherwise, P = 1; Size DataCache Indicates the capacity of the local storage.

[0165] Constraints on shared memory capacity: P[dw(B)KΔN+dw(C)ΔMΔN]<Size SHMEM (25) The meaning of each parameter is the same as before.

[0166] The calculation of memory access ratio CGMA can be adjusted as follows: There is a min(c, β) in the above formula. This is because: although LLC avoids repeatedly loading data from DRAM, it is also necessary to load related data from LLC. The maximum bandwidth for loading data is β times that of DRAM, where β is the bandwidth amplification factor of LLC relative to DRAM.

[0167] Similarly, when the B matrix block is resident, the A matrix block and the C matrix block are cyclically replaced. In order to obtain the maximum computation-to-memory ratio and the minimum IO in one operation unit, ΔN is evenly divided into S processing cores (tiny cores).

[0168] At this point, the cost function of data interaction needs to be adjusted as follows:

[0169] The constraints of the search space are adjusted as follows.

[0170] Constraints on the number of operation units T: r*c=T (28) Where r is the number of rows and c is the number of columns.

[0171] Handle the constraints on the size of the kernel local memory: The meaning of each parameter is the same as before.

[0172] Constraints on shared memory capacity: P[dw(A)KΔM+dw(C)ΔMΔN]<Size SHMEM (30) The meaning of each parameter is the same as before.

[0173] The calculation of memory access ratio CGMA can be adjusted as follows:

[0174] The results of the above two splitting forms are compared, and the best splitting and retention method is selected for matrix multiplication.

[0175] LLC does not exist or LLC latch mode is not enabled:

[0176] In the case where the A matrix block resides, the cost function of data interaction needs to be adjusted as follows:

[0177] The memory access ratio is calculated as follows:

[0178] In the case of B matrix block residency, the cost function of data interaction needs to be adjusted as follows:

[0179] The memory access ratio is calculated as follows: Parallel computing expansion

[0180] Those skilled in the art will appreciate that, although various schemes of the embodiments of the present disclosure have been described above with reference to a multi-core system architecture for intelligent computing, the various embodiments of the present disclosure may also be applied to general parallel computing systems, especially to supercomputing systems for calculating extremely large-scale matrix multiplication operations.

[0181] A supercomputing system can be abstracted as including a main core (CPU, equivalent to the host side) and N auxiliary computing slave cores (multiple GPU cards or dense computing cards, specializing in computing-intensive Soc chips). If the slave cores cannot communicate with each other and all data is distributed by the main core, the splitting strategy in this scenario can adopt the "LLC OFF" strategy. If the slave cores can communicate with each other, then at a certain moment, the data reused between the cores can be obtained through exchange, and the splitting strategy in this scenario can adopt the "LLC ON" strategy. The RAM limit on the split model only needs to consider the DRAM capacity corresponding to each core.

[0182] The disclosed embodiment also provides a task scheduling device, including a processor and a memory, wherein the processor is configured to execute program instructions; the memory is configured to store the program instructions, and when the program instructions are loaded and executed by the processor, the processor executes the task scheduling method described in any embodiment of the disclosed embodiment. The disclosed embodiment also provides a computer-readable storage medium, in which program instructions are stored, and when the program instructions are loaded and executed by the processor, the processor executes the task scheduling method described in any embodiment of the disclosed embodiment. The disclosed embodiment also provides a computer program product, including a computer program or instruction, which implements the task scheduling method described in any embodiment of the disclosed embodiment when executed by the processor. The disclosed embodiment also provides a processing device, including the aforementioned task scheduling device. The disclosed embodiment also provides a chip, which may include the aforementioned processing device. Further, the disclosed embodiment also provides a board, which may include the aforementioned chip.

[0183] According to different application scenarios, the electronic equipment or device disclosed herein may include servers, cloud servers, server clusters, data processing devices, robots, computers, printers, scanners, tablet computers, smart terminals, PC devices, IoT terminals, mobile terminals, mobile phones, driving recorders, navigators, sensors, cameras, cameras, video cameras, projectors, watches, headphones, mobile storage, wearable devices, visual terminals, automatic driving terminals, transportation, household appliances, and / or medical equipment. The transportation includes airplanes, ships and / or vehicles; the household appliances include televisions, air conditioners, microwave ovens, refrigerators, rice cookers, humidifiers, washing machines, electric lights, gas stoves, and range hoods; the medical equipment includes magnetic resonance imaging, ultrasound machines and / or electrocardiographs. The electronic equipment or device disclosed herein may also be applied to the Internet, IoT, data centers, energy, transportation, public administration, manufacturing, education, power grids, telecommunications, finance, retail, construction sites, and medical fields. Further, the electronic equipment or device disclosed herein may also be used in cloud, edge, and terminal applications related to artificial intelligence, big data, and / or cloud computing. In one or more embodiments, electronic devices or devices with high computing power according to the disclosed solution can be applied to cloud devices (such as cloud servers), while electronic devices or devices with low power consumption can be applied to terminal devices and / or edge devices (such as smart phones or cameras). In one or more embodiments, the hardware information of the cloud device and the hardware information of the terminal device and / or edge device are compatible with each other, so that according to the hardware information of the terminal device and / or edge device, appropriate hardware resources can be matched from the hardware resources of the cloud device to simulate the hardware resources of the terminal device and / or edge device, so as to complete the unified management, scheduling and collaborative work of end-to-end or cloud-edge-to-end.

[0184] It should be noted that, for the purpose of simplicity, the present disclosure describes some methods and embodiments thereof as a series of actions and combinations thereof, but those skilled in the art will appreciate that the scheme of the present disclosure is not limited by the order of the actions described. Therefore, based on the disclosure or teaching of the present disclosure, those skilled in the art will appreciate that some of the steps therein may be performed in other orders or simultaneously. Further, those skilled in the art will appreciate that the embodiments described in the present disclosure may be regarded as optional embodiments, i.e., the actions or modules involved therein may not necessarily be necessary for the implementation of one or some of the schemes of the present disclosure. In addition, depending on the different schemes, the present disclosure also has different focuses on the description of some embodiments. In view of this, those skilled in the art may appreciate the parts that are not described in detail in a certain embodiment of the present disclosure, and may also refer to the relevant descriptions of other embodiments.

[0185] In terms of specific implementation, based on the disclosure and teaching of this disclosure, those skilled in the art can understand that several embodiments disclosed in this disclosure can also be implemented by other methods not disclosed herein. For example, with respect to the various units in the electronic device or device embodiments described above, this article splits them on the basis of considering the logical functions, and there may be other splitting methods in actual implementation. For another example, multiple units or components can be combined or integrated into another system, or some features or functions in the units or components can be selectively disabled. In terms of the connection relationship between different units or components, the connection discussed in the above text in conjunction with the accompanying drawings can be a direct or indirect coupling between units or components. In some scenarios, the aforementioned direct or indirect coupling involves a communication connection using an interface, wherein the communication interface can support electrical, optical, acoustic, magnetic or other forms of signal transmission.

[0186] In the present disclosure, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units. The aforementioned components or units may be located in the same location or distributed on multiple network units. In addition, according to actual needs, some or all of the units may be selected to achieve the purpose of the scheme described in the embodiments of the present disclosure. In addition, in some scenarios, multiple units in the embodiments of the present disclosure may be integrated into one unit or each unit may exist physically separately.

[0187] In some other implementation scenarios, the above-mentioned integrated unit can also be implemented in the form of hardware, that is, a specific hardware circuit, which may include digital circuits and / or analog circuits, etc. The physical implementation of the hardware structure of the circuit may include but is not limited to physical devices, and the physical devices may include but are not limited to devices such as transistors or memristors. In view of this, the various devices described herein (such as computing devices or other processing devices) can be implemented by appropriate hardware processors, such as central processing units, GPUs, FPGAs, DSPs, and ASICs, etc. Further, the aforementioned storage unit or storage device may be any appropriate storage medium (including magnetic storage media or magneto-optical storage media, etc.), which may be, for example, a variable resistive memory (Resistive Random Access Memory, RRAM), a dynamic random access memory (Dynamic Random Access Memory, DRAM), a static random access memory (Static Random Access Memory, SRAM), an enhanced dynamic random access memory (Enhanced Dynamic Random Access Memory, EDRAM), a high bandwidth memory (High Bandwidth Memory, HBM), a hybrid memory cube (Hybrid Memory Cube, HMC), ROM and RAM, etc.

[0188] The embodiments of the present disclosure are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present disclosure. The description of the above embodiments is only used to help understand the method of the present disclosure and its core idea. At the same time, for those skilled in the art, according to the ideas of the present disclosure, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present disclosure.

Claims

1. A task scheduling method based on a multi-core system, wherein the task includes a matrix multiplication type operation task, the multi-core system includes a plurality of operation units, each operation unit includes one or more processing cores, and each processing core has a local memory, the method comprising: Determine the number T of computing units that can be scheduled; Based on the schedulable operation units, splitting the matrix multiplication operation tasks into row and column grids; According to the splitting plan, determine the amount of data that the operation unit needs to interact with the external circuit; Determining optimization parameters of the splitting scheme to minimize the amount of data of the interaction; as well as According to the optimization parameters, the matrix multiplication type operation tasks are scheduled to be executed in parallel on the operation units.

2. The method according to claim 1, wherein: Based on the schedulable operation units, splitting the matrix multiplication operation tasks in a row-column grid manner includes: When the matrix multiplication task is a first-class task, the row-column grid splitting is performed according to the operation unit, so that in each round of operation, each operation unit calculates an output matrix of a grid size; or When the matrix multiplication type operation task is a second type of task, the operation unit is divided into a plurality of operation unit groups, and the row-column grid splitting is performed according to the operation unit groups, so that in each round of operation, each operation unit group calculates an output matrix of a grid size.

3. The method according to claim 2, wherein the matrix multiplication task is a second-class task when the following conditions are met: The K dimension is at least a specified multiple of the M dimension or the N dimension, where the left multiplication matrix A is a matrix of size M*K, and the right multiplication matrix B is a matrix of size K*N; and When it is assumed that the row-column grid splitting is performed according to the operation unit, the data allocated to a single operation unit for processing does not meet the memory access requirement of the minimum cache line, or does not meet the requirement of the device for calculating the memory access ratio.

4. The method according to any one of claims 2-3, wherein: According to the splitting scheme, the amount of data that the operation unit needs to interact with the external circuit includes: When the size of the matrix involved in the matrix multiplication task satisfies the first condition, the amount of data that the operation unit needs to interact with the external circuit is determined in a first manner, wherein the first manner adopts a method of storing the output matrix C on-chip; or When the size of the matrix involved in the matrix multiplication task meets the second condition, the amount of data that the operation unit needs to interact with the external circuit is determined in a second way, wherein the second way adopts a method of storing the left multiplication matrix A or the right multiplication matrix B on-chip.

5. The method according to claim 4, wherein the second condition is satisfied when the matrix scale satisfies the following condition, otherwise the first condition is satisfied, and the second condition comprises: The total amount of data in matrix A or matrix B is less than the size of the local cache space LS on the chip, and M*K*dw(A)+2*(K*n align *dw(B)+M*n align *dw(C)<LS or N*K*dw(B)+ 2*(K*m align *dw(A)+m align *N*dw(C))<LS, where m align and n align are the minimum M and N that the on-chip processing core can handle for matrix multiplication operation tasks, dw() represents the bit width; or K is less than the preset threshold and 2*m align *n align *dw(C)+3*K*MAX(m align *dw(A),n align *dw(B)) <LS。 6. The method according to any one of claims 4-5, wherein: The amount of data that the operation unit needs to interact with the external circuit in the first way includes: The amount of data of the left multiplication matrix A and the right multiplication matrix B that each operation unit or each group of operation units needs to read to complete the operation task is determined according to the following formula: Where A is a matrix of size M*K, B is a matrix of size K*N, and the output matrix C is a matrix of size M*N and is split into r*c row and column grids, where r is the number of rows, c is the number of columns, ΔM and ΔN are the split granularities of the M and N dimensions between operation units or operation unit groups, respectively, and dw() represents the data bit width.

7. The method according to any one of claims 4 to 6, wherein: The amount of data that the operation unit needs to interact with the external circuit in the second way includes: The amount of interactive data with the external circuit generated by the resident left multiplication matrix A and right multiplication matrix B is evaluated respectively, and the resident scheme with the smallest exchange data amount is selected, wherein the amount of data of the left multiplication matrix A and the right multiplication matrix B that each operation unit needs to read to complete the operation task is determined according to the following formula: When the A matrix residency scheme is adopted: When using the B matrix residency scheme: Where A is a matrix of size M*K, B is a matrix of size K*N, and the output matrix C is a matrix of size M*N and is split into r*c row and column grids, where r is the number of rows, c is the number of columns, ΔM and ΔN are the split granularity of the M and N dimensions between operation units, respectively, and dw() represents the data bit width.

8. The method according to claim 1, wherein the multi-core system further comprises a global cache for caching data so that the computing units are preferentially loaded from the global cache when loading data from an external memory, and according to the splitting scheme, determining the amount of data that each computing unit or each group of computing units needs to interact with the external circuit comprises: The amount of data that needs to be interacted with the external circuit is determined in a manner that each operation unit or operation unit group interacts with the external circuit once and retrieves all data required to perform the matrix multiplication type operation task.

9. The method according to any one of claims 4 to 8, wherein: According to the splitting scheme, determining the amount of data that each operation unit or each group of operation units needs to interact with the external circuit further includes: The influence factor of transmission bandwidth is considered in the interactive data volume, and the influence factor is expressed as a bandwidth utilization coefficient γ(ΔL,L), which is equal to the ratio of the equivalent bandwidth of loading a submatrix from the external circuit every L data according to the data length ΔL to the full bandwidth.

10. The method according to any one of claims 2 to 9, wherein determining the optimization parameters of the splitting scheme to minimize the amount of data of the interaction comprises: Establishing a search space for optimization parameters of the splitting scheme; as well as The optimization parameters of the splitting scheme that minimize the data amount of the interaction are searched in the search space.

11. The method according to claim 10, wherein the search space is established according to the following constraints: Constraint on the number of operation units: r*c=T / d. When the matrix multiplication operation task is a first-type task, d=1; when it is a second-type task, d>1. d is the number of operation units in each group of operation units.

12. The method according to any one of claims 10-11, wherein the search space is further established according to the following constraints: For each level of cache space partition in the on-chip storage hierarchy of the multi-core system, a corresponding search subspace is established based on the adopted matrix residency method.

13. The method of claim 12, wherein the on-chip storage hierarchy comprises two levels: a local cache and a shared cache, and the establishing a corresponding search subspace comprises: According to the constraint of the shared cache capacity by the amount of data required for a round of large cycle operation, a shared cache search subspace is established; as well as According to the constraints of the local cache capacity imposed by the amount of data required for a round of small loop operations and the amount of matrix resident data, a local cache search subspace is established.

14. The method according to any one of claims 10 to 13, wherein: When searching within the search space, the search granularity is set according to the following parameters: The search granularity of the main dimension of the matrix is ​​determined according to the basic split granularity of the main dimension, the minimum alignment requirement of the main dimension for processing and checking, and the number of splits of the main dimension within the operation unit; The search granularity of the non-primary dimension of the matrix is ​​determined according to the minimum alignment requirement of the processing core for the non-primary dimension and the number of times the non-primary dimension is split within the operation unit.

15. The method according to any one of claims 9 to 13, wherein the optimization parameters of the splitting scheme include: Parameters for splitting the row and column grid: r and c; The size of the output matrix calculated by each operation unit or each operation unit group in a single round of operation: ΔM*ΔN; and When the K dimension needs to be split, the K dimension is split into a granularity ΔK within the operation unit.

16. The method according to any one of claims 2 to 14, wherein the row-column grid splitting comprises any one of the following: All the schedulable operation units or operation unit groups calculate a sub-matrix Block_C of the output matrix C in each round of operation, wherein the sub-matrix Block_C is divided into r*c small grids, and each operation unit or operation unit group calculates one of the small grids; or The output matrix C is divided into r*c large grids, each large grid is further divided into ΔM*ΔN small grids, and each operation unit or operation unit group calculates a small grid in the corresponding large grid in each round of operation.

17. According to any one of the methods of claims 1 to 15, when there are multiple sets of optimization parameters that satisfy minimizing the amount of data for the interaction, the method further comprises: Determine a computational memory access ratio (CGMA) of the splitting scheme under each set of optimization parameters and / or a utilization rate of a processing core in an operation unit, wherein the computational memory access ratio is a ratio of the number of computational operations to the number of memory access operations, and the utilization rate of the processing core is a ratio of an effective computation of the processing core to an actual computation under alignment constraints; as well as Based on the computation to memory access ratio (CGMA) and / or the utilization of the processing core, an optimal optimization parameter is selected from the multiple groups of optimization parameters.

18. The method according to claim 16, wherein based on the computation to memory access ratio (CGMA) and / or the utilization of the processing core, selecting the optimal optimization parameter from the plurality of groups of optimization parameters comprises: When the splitting scheme belongs to the IO bottleneck situation, the optimal optimization parameters are further selected based on the calculated memory access ratio; or When the splitting scheme belongs to a computing bottleneck situation, the optimal optimization parameters are further selected based on the utilization of the processing cores.

19. A task scheduling device, comprising a processor and a memory, wherein: The processor is configured to execute program instructions; The memory is configured to store the program instructions; When the program instructions are loaded and executed by the processor, the processor executes the task scheduling method according to any one of claims 1-17.

20. A computer-readable storage medium storing program instructions, which, when loaded and executed by a processor, enables the processor to execute the task scheduling method according to any one of claims 1 to 17.

21. A computer program product, comprising a computer program or instructions, wherein when the computer program or instructions are executed by a processor, the task scheduling method according to any one of claims 1 to 17 is implemented.

22. A processing device, comprising the task scheduling device according to claim 18.

23. A chip comprising the processing device according to claim 21.

24. A board comprising the chip according to claim 22.

Citation Information

Cited By

  • Method and device for executing operation task on multi-core system and related product

    CN119806807A

  • Method and device for realizing task splitting based on multi-core processor and related product

    CN119847730A

  • Task scheduling method and task scheduling device based on multi-core system and related products

    CN122173217A

  • Method and device for executing operation task on multi-core system and related product

    CN122173260A

  • Multi-core system-based task scheduling method and apparatus, and related product

    EP4693041A1