A storage partitioning method and device based on access pattern pattern morphing

By constructing novel partitioning functions and scheduling operators in CGRA, simplifying the address generation process, and designing a specific LSU device, the problems of memory partitioning complexity and low performance in CGRA are solved, achieving pipeline performance improvement and energy consumption reduction.

CN117609106BActive Publication Date: 2026-11-24CHONGQING UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311152543.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-06
Publication Date
2026-11-24
Estimated Expiration
2043-09-06

AI Technical Summary

Technical Problem

Existing technologies in CGRA suffer from problems such as complex memory partitioning methods leading to high address calculation overhead, low performance, and wasted bank space, making it difficult to achieve globally optimal memory partitioning with a limited number of banks.

Method used

A memory partitioning method based on access pattern deformation is proposed. By constructing a novel partitioning function and scheduling operator, the address generation process is simplified, and a specific LSU device is designed to balance address generation overhead and computational performance.

Benefits of technology

It improves pipeline performance, reduces chip power consumption, and optimizes bank usage through integer linear programming, reducing access conflicts and space waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117609106B_ABST
    Figure CN117609106B_ABST
Patent Text Reader

Abstract

This invention proposes a memory partitioning method based on access pattern deformation, comprising: constructing a novel partitioning function for memory partitioning based on traditional memory partitioning methods; simplifying the novel partitioning function by adjusting the array access patterns during pipelined execution through the execution time of scheduling operators; and designing an address generation unit based on the simplified novel partitioning function to accelerate address calculation. The method proposed in this invention reduces hardware overhead by simplifying address calculation and designing a dedicated address calculation unit, thereby reducing energy consumption without sacrificing performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of storage optimization. Background Technology

[0002] Coarse-grained reconfigurable arrays (CGRAs), with runtime configurable data paths, are promising accelerators that offer a good balance between flexibility, performance, and power. Equipped with coarse-grained processing elements (PEs) and sparse connections between them, CGRAs have significantly lower configuration overhead compared to fine-grained FPGAs. Therefore, the device designed in this invention will be implemented based on a CGRA.

[0003] A CGRA typically consists of a Processing Element Array (PEA), a flexible on-chip network, and multiple on-chip banks. Typically, a data flow graph (DFG) extracted from computationally intensive applications is mapped onto the PEA for acceleration. External memory can exchange data with on-chip data memory via Direct Memory Access (DMA) operations. On-chip data memory is usually organized in banks, allowing PEs to access data in parallel via Load-Store Units (LSUs). Each PE contains a Function Unit (FU), a Local Register File (LRF), and an output register. Based on the way multiple data memory access addresses are configured, CGRAs can be divided into two main categories: coupled memory-computation CGRAs and decoupled memory-computation CGRAs. In coupled memory-computation CGRAs, the address of the accessed memory unit is calculated by PEs within the PEA. This approach keeps the chip's area and power consumption low, but its computational performance is also reduced because the additional address generation operations require more PEs. In the decoupled memory access-computation CGRA, a dedicated LSU is used to determine the access address. Because PEA does not have an address computation part, it can achieve better performance, but it requires the design of a dedicated LSU, resulting in higher hardware power consumption.

[0004] To accelerate loop kernels on CGRA, modulo scheduling is a common technique used to pipeline the execution of the loop body's DFG. This is achieved by minimizing the initial interval (II) between adjacent iterations due to resource and dependency constraints. However, a smaller II can also lead to more concurrent memory accesses. When a loop includes an array with multiple references, the number of concurrent memory accesses to that array can easily exceed the number of banks, or even the number of banks themselves, resulting in access conflicts and performance penalties.

[0005] To overcome the port limitations of banks, memory partitioning is typically used to split the original data array into multiple memory banks. Conventional memory partitioning methods can be categorized into three types: block partitioning, circular partitioning, and block-circular partitioning. Memory partitioning has been well-studied in high-level synthesis of FPGAs. The work of J. Cong et al. attempted to partition and schedule multiple memory accesses of the data array in the same iteration across multiple banks using circular partitioning. Then, the work of P. Li et al. scheduled memory accesses in different circular iterations to find a near-optimal partition. While these works were first steps towards efficient memory partitioning for circular pipelines, they were limited to one-dimensional data arrays, while many practical applications typically involve nested loops with multi-dimensional arrays. The research of Y. Wang et al. proposed a linear transformation (LTB)-based method for multi-dimensional memory partitioning. However, this method is limited to circular partitioning and may lead to suboptimal solutions in some cases. To address the shortcomings of LTB, Y. Wang et al. later proposed a memory partitioning method based on linear transformations (GMP) to support block-circular partitioning on multi-dimensional arrays, so that optimal values ​​can be found in most cases. However, the address calculation formula in the method proposed by GMP is relatively complex and contains a lot of multiplication and division operations, which increases the overhead of address calculation.

[0006] Memory partitioning becomes more challenging when the memory partitioning problem is approached with CGRA (Global Memory Access Replication) for two reasons: 1) the number of banks in CGRA is very limited (e.g., 4 to 8 banks); 2) CGRA has low tolerance for complex address generation. For a small number of banks, a partitioning strategy that achieves global optimum (i.e., minimizes the number of banks) is urgently needed. However, simplified address generation will miss the opportunity to find a globally optimal solution. To address these challenges, several memory partitioning schemes for CGRA have been proposed previously. In the work of S. Yin et al., a conflict-free circular mapping algorithm was proposed by considering LTB memory partitioning and modular scheduling. However, this work is affected by local minima because it only considers memory references within iterations and ignores block partitioning. Furthermore, if LTB address generation is implemented using a dedicated LSU, it will incur significant overhead in terms of chip area and power. To simplify the complexity of address generation, the work of D. Wijerathne et al. provides a decoupled access execution CGRA (FMP) that supports one-dimensional array partitioning of multiple memory banks. For multidimensional arrays, FMP first flattens them into one-dimensional arrays using hardware, and then performs block cyclic partitioning on the flattened array. However, the partitioning after array flattening depends on the array size. Different array sizes generate different partitioning schemes, many of which are suboptimal. Furthermore, FMP's use of flattened data for storage partitioning leads to low partitioning quality; most of the time, its algorithm requires a far greater number of banks than actually needed. Additionally, to facilitate address calculation within FMP banks, it requires significant padding data within the banks, resulting in wasted storage space.

[0007] In summary, balancing the overhead of address generation with the quality of partitioning results is key to solving the memory partitioning problem. Some existing studies have proposed various partitioning strategies to improve the quality of partitioning results (GMP), making the partitioning function more complex. However, complex partitioning functions lead to more complex address calculations, resulting in lower-than-expected performance. Other studies focus on the overhead of address generation (FMP), reducing it by simplifying the partitioning function and using specific LSUs, but neglecting the impact of other key factors in the accelerator mapping process, thus leading to wasted bank space. Summary of the Invention

[0008] The present invention aims to at least partially solve one of the technical problems in the related art.

[0009] Therefore, the purpose of this invention is to propose a memory partitioning method based on access mode pattern deformation to improve pipeline performance and reduce chip power consumption.

[0010] To achieve the above objectives, a first aspect of the present invention proposes a storage partitioning method based on access pattern deformation, comprising: A novel partitioning function for storage partitioning is constructed based on traditional memory partitioning methods; The novel partitioning function is simplified by adjusting the array access pattern during pipelined execution by scheduling the execution time of the operator; An address generation unit is designed based on a simplified new partitioning function, which accelerates address calculation.

[0011] In addition, a storage partitioning method based on access mode pattern deformation according to the above embodiments of the present invention may also have the following additional technical features: Furthermore, in one embodiment of the present invention, the construction of the novel partitioning function for storage partitioning based on traditional memory partitioning methods includes: For a two-dimensional array, the definition is as follows: , , in, This is one of the memory partitioning functions, representing the mapping of data to the storage bank to obtain the bankID; As one of the memory partitioning functions, it represents the offset address of the generated data within the bank; The number of banks to be used is indicated in the partitioning function. and middle, Represents the array's first... The width of the dimension.

[0012] Furthermore, in one embodiment of the present invention, adjusting the array access mode during pipelined execution by scheduling the execution time of the operator includes: Initialize the maximum movement distance maxDis, the minimum value of the last row lastMin, the list of actual movement distances for each element listDistance, the list of bank information listBankInfo, and the list of control steps CS; Calculate the minimum initial interval under resource constraints; Perform row-by-row splitting on the input data flow graph and generate a total list of access pattern rows, then perform element movement in a row-by-row manner based on the list of access pattern rows; After all elements in the current row have been determined, the minimum coordinate is recorded as lasMin in the next row; For each bank, initialize the relative control step with zero; for each element in listBankInfo[bank], determine the corresponding control step size in reverse order based on its movement distance, maximum distance, and II. After scheduling all memory access operations, other computational operations are further scheduled using integer linear programming, under the constraints of the initial interval and other resources.

[0013] Furthermore, in one embodiment of the invention, the step-by-step movement of the element includes: Let dis be the distance the element moves to the right. Then, according to... The calculation formula for the memory partitioning function calculates the corresponding bankID; If the new position overlaps with other elements and the corresponding bank has been assigned an initial interval of elements, or the corresponding coordinates are less than the difference between the minimum coordinates of the last row and 1, then the movement distance is increased by 1, and an attempt is made to move to the next position. Otherwise, add the element to listBankInfo[bank], record the movement distance in listDistance, update the maximum movement distance, break the while loop, and assign the element to the obtained bankID; if the element cannot be assigned to a group after traversing all positions, the initial interval will be increased by 1, and the reassignment will start from the beginning.

[0014] Furthermore, in one embodiment of the present invention, the address generation unit includes a host controller, a DMA unit, a data memory with eight memory banks, and a 4×4 PEA including a clock divider and eight LSUs, wherein each PE consists of a functional unit supporting fixed-point arithmetic, a local register file, an output register, and a configuration buffer, and selects data from adjacent PEs or LSUs for the FU through two multiplexers.

[0015] To achieve the above objectives, a second aspect of the present invention provides a memory partitioning apparatus based on access pattern deformation, comprising the following modules: The partitioning module is used to construct novel partitioning functions for storage partitioning based on traditional memory partitioning methods; A simplification module is used to simplify the novel partitioning function by adjusting the array access pattern during pipelined execution through the execution time of scheduling operators; An acceleration module is used to design an address generation unit based on a simplified new partitioning function, and to accelerate address calculation through the address generation unit.

[0016] Furthermore, in one embodiment of the present invention, the simplification module is also used for: Initialize the maximum movement distance maxDis, the minimum value of the last row lastMin, the list of actual movement distances for each element listDistance, the list of bank information listBankInfo, and the list of control steps CS; Calculate the minimum initial interval under resource constraints; Perform row-by-row splitting on the input data flow graph and generate a total list of access pattern rows, then perform element movement in a row-by-row manner based on the list of access pattern rows; After all elements in the current row have been determined, the minimum coordinate is recorded as lasMin in the next row; For each bank, initialize the relative control step with zero; for each element in listBankInfo[bank], determine the corresponding control step size in reverse order based on its movement distance, maximum distance, and II. After scheduling all memory access operations, other computational operations are further scheduled using integer linear programming, under the constraints of the initial interval and other resources.

[0017] Furthermore, in one embodiment of the present invention, the simplification module is also used for: Let dis be the distance the element moves to the right. Then, according to... The calculation formula for the memory partitioning function calculates the corresponding bankID; If the new position overlaps with other elements and the corresponding bank has been assigned an initial interval of elements, or the corresponding coordinates are less than the difference between the minimum coordinates of the last row and 1, then the movement distance is increased by 1, and an attempt is made to move to the next position. Otherwise, add the element to listBankInfo[bank], record the movement distance in listDistance, update the maximum movement distance, break the while loop, and assign the element to the obtained bankID; if the element cannot be assigned to a group after traversing all positions, the initial interval will be increased by 1, and the reassignment will start from the beginning.

[0018] To achieve the above objectives, a third aspect of the present invention provides a computer device, characterized in that it includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements a storage partitioning method based on access pattern deformation as described above.

[0019] To achieve the above objectives, a fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that, when the computer program is executed by a processor, it implements a storage partitioning method based on access pattern deformation as described above.

[0020] The memory partitioning method based on access pattern pattern deformation proposed in this invention adjusts the array access pattern during pipelined execution by scheduling the execution time of the operator, and then achieves a balance between address generation overhead and computing performance through a specially designed LSU device, thereby improving pipelined performance and reducing chip power consumption. Attached Figure Description

[0021] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 This is a flowchart illustrating a storage partitioning method based on access pattern deformation provided in an embodiment of the present invention. Figure 2 This is a pseudocode diagram of the scheduling algorithm of this invention; Figure 3 This is a hardware structure diagram of the present invention; Figure 4 These are examples of embodiments of the present invention; Figure 5 This is a schematic diagram of a storage partitioning device based on access mode pattern deformation provided in an embodiment of the present invention. Detailed Implementation

[0022] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.

[0023] The storage partitioning method based on access mode pattern deformation according to an embodiment of the present invention is described below with reference to the accompanying drawings.

[0024] Example 1 Figure 1 This is a schematic flowchart of a storage partitioning method based on access mode pattern deformation provided in an embodiment of the present invention.

[0025] like Figure 1 As shown, the storage partitioning method based on access pattern deformation includes the following steps: S101: Construct a new partitioning function for storage partitioning based on traditional memory partitioning methods; S102: The new partitioning function is simplified by adjusting the array access pattern during pipelined execution by scheduling the execution time of the operator; S103: An address generation unit is designed based on the simplified new partitioning function to accelerate address calculation.

[0026] Before providing a detailed description of this invention, some definitions, parameters, and related functions are clearly explained to ensure that the overall structure of the problem is clear and easy to understand. The definitions are as follows: : The data field represents the collection of all memory elements. : Represents the coordinates of an element in an n-dimensional data field; : Represents the array's first... Width of the dimension; : This means that in one iteration, m neighboring elements in the array need to be accessed; : As one of the memory partitioning functions, it maps data to the bank to obtain the bankID; : As one of the memory partitioning functions, it generates the offset address of the data within the bank; : The number of banks to be used is indicated in the partitioning function. and middle; : Represents the transformation coefficients of the dividing hyperplane in the dividing function; All-one Hyperplane: All-one Hyperplane represents a method of partitioning the data domain, when... When this is the case, it is called a hyperplane with a uniform shape; : Let represent a pattern that can be covered by a hyperplane of all ones, and for each hyperplane, the number of elements it traverses does not exceed 12 data elements.

[0027] Furthermore, in one embodiment of the present invention, a novel partitioning function for storage partitioning is constructed based on traditional memory partitioning methods, including: For a two-dimensional array, the definition is as follows: , , in, This is one of the memory partitioning functions, representing the mapping of data to the storage bank to obtain the bankID; As one of the memory partitioning functions, it represents the offset address of the generated data within the bank; The number of banks to be used is indicated in the partitioning function. and middle, Represents the array's first... The width of the dimension.

[0028] As can be seen from the above formula, when When it is a power of 2, and This can be converted into a simpler shift and AND operation, thus greatly reducing the overhead of address calculation. Therefore, in When the value is a power of 2, the address calculation involves only one multiplication, two additions, one shift, and one AND operation. This significantly reduces computational complexity and reduces the requirements for hardware resources and energy.

[0029] Based on the difference between the initial pattern and the tiered pattern, a scheduling algorithm is used to transform the pattern during pipelined execution into a tiered pattern. Therefore, this invention first schedules operators that access memory, and then schedules the remaining operators. The overall process of the scheduling algorithm is as follows: Figure 2 As shown below, the variables in the scheduling algorithm will be explained in detail: maxDis: Maximum movement distance; lastMin: the minimum value in the last row. value; listDistance: A list of the actual distances each element has moved; listBankInfo: A list of bank information; CS: Control Step List; M: The maximum number of elements in P that are allocated to a bank; patternRows: A list of all access pattern rows; minPos: The minimum position of the current row.

[0030] Figure 2 The pseudocode of the scheduling algorithm proposed in this invention is given. The algorithm takes DFG(D), access mode (P) and maximum number of banks N as inputs, and outputs the partitioning result, the number of banks used, and the scheduling result.

[0031] First, this invention initializes maxDis, lastMin, listDistance, listBankInfo, and CS. Then, it calculates the minimum II under resource constraints. Next, it performs row-by-row splitting on the input DFG and generates patternRows. Then, it performs element movement row-by-row from the smallest x_0 row to the largest x_0 column. After that, for each element in each patternRows, it first initializes the element's movement distance (dis) with zero, then enters a while loop to perform unidirectional (rightward) element movement until it reaches the boundary of the data field (...). Besides, assuming the element has shifted to the right by dis, it is based on The formula is used to calculate the corresponding bankID. If the new position overlaps with other elements, and the corresponding bank has already been assigned II elements, or the corresponding... The smallest coordinate is less than the last row. If the difference between the coordinate (lastMin) and 1 is 1, it increments the movement distance by 1 and attempts to move to the next position. Otherwise, it adds the element to listBankInfo[bank], records the movement distance in listDistance, updates maxDis, and breaks the while loop to assign the element to the obtained bankID. If an element cannot be assigned to a group after traversing all positions, then II is incremented by 1, and the reassignment starts from the beginning. During each element's movement attempt, the minPos of the current row is also updated. After determining all elements in the current row, the minimum... The coordinates are recorded as lasMin in the next row. After all elements have been successfully assigned to the bank, it further determines the control step based on the recorded movement distance. For each bank, the relative control step (step) is first initialized with zero. Then, for each element in listBankInfo[bank], in reverse order, it determines the corresponding control step size based on its movement distance, maximum distance, and II (line 30), and then increments the step size by 1. After scheduling all memory access operations, other computational operations are further scheduled using integer linear programming (ILP) under the constraints of II and other resources.

[0032] Furthermore, in one embodiment of the present invention, adjusting the array access mode during pipelined execution by scheduling the execution time of operators includes: Initialize the maximum movement distance maxDis, the minimum value of the last row lastMin, the list of actual movement distances for each element listDistance, the list of bank information listBankInfo, and the list of control steps CS; Calculate the minimum initial interval under resource constraints; Perform row-by-row splitting on the input data flow graph and generate a total list of access pattern rows. Perform element movement in a row-by-row manner based on the list of access pattern rows. After all elements in the current row have been determined, the minimum coordinate is recorded as lasMin in the next row; For each bank, initialize the relative control step with zero; for each element in listBankInfo[bank], determine the corresponding control step size in reverse order based on its movement distance, maximum distance, and II. After scheduling all memory access operations, other computational operations are further scheduled using integer linear programming, under the constraints of the initial interval and other resources.

[0033] Furthermore, in one embodiment of the invention, performing element movement in a row-by-row manner includes: Let dis be the distance the element moves to the right. Then, according to... The calculation formula for the memory partitioning function calculates the corresponding bankID; If the new position overlaps with other elements and the corresponding bank has been assigned an initial interval of elements, or the corresponding coordinates are less than the difference between the minimum coordinates of the last row and 1, then the movement distance is increased by 1, and an attempt is made to move to the next position. Otherwise, add the element to listBankInfo[bank], record the movement distance in listDistance, update the maximum movement distance, break the while loop, and assign the element to the obtained bankID; if the element cannot be assigned to a group after traversing all positions, the initial interval will be increased by 1, and the reassignment will start from the beginning.

[0034] Based on the formula for the memory partitioning function in S101, this invention designs... Figure 3 Compared to using PEA for address generation, this method reduces the complexity of address calculation, increases the speed of address calculation, and also improves the utilization rate of PEA.

[0035] Furthermore, in one embodiment of the present invention, the address generation unit includes a host controller, a DMA unit, a data memory with eight memory banks, and a 4×4 PEA including a clock divider and eight LSUs, wherein each PE consists of a functional unit supporting fixed-point arithmetic, a local register file, an output register, and a configuration buffer, and selects data from adjacent PEs or LSUs for the FU through two multiplexers.

[0036] Because a specific memory access operation is performed only once every two cycles in modular scheduling, the clockdivider (DIV) generates an enable signal every two cycles and sends it to the LSUs. For example... Figure 3 As shown in section d, DIV consists of an accumulator (Acc) and a maxII comparator, where maxII represents the maximum II allowed by the hardware for pipelined operations. Since memory access operations placed on the LSU can be scheduled in any time slot within a pipeline window of height II, the comparator can be used to generate II enable signals for LSUs operating in different time slots.

[0037] Figure 3 Part b illustrates the structure of the configurable LSU. It primarily consists of a load register (LDR), a storage register (STR), an address generator (AG), and a configuration buffer. (See diagram for details.) Figure 3 As shown in part e, AG first uses an accumulator enabled by the signal from the divider ( ), at a given step size ( ) and initial value ( The low-dimensional component of the memory reference generated on ) ).if If the maximum value is reached, then Reset to Meanwhile, another accumulator ( It can use independent stride length ( ) and initial value ( To generate high-dimensional components of memory references ( Then, according to and The calculation formula uses adders, multipliers, shifters, and AND gates to generate the bankID and the offset within the bank. To simplify the circuit, the number of banks (N) used is also limited to a power of two integer. Therefore, the division operation is simplified to have a constant parameter. The right shifter, the modulo operation is simplified to an AND operation with a constant parameter N-1.

[0038] Using an all-one hyperplane in memory partitioning based on access mode variations can significantly reduce addressing overhead in hardware while minimizing the number of memory banks.

[0039] Example 2 S201: As Figure 4 The C++ source code shown in section a contains four read operations on array B and three addition operations. Consider a CGRA with four banks.

[0040] S202: After analyzing S201, the following related variables can be defined.

[0041]

[0042] S203: After obtaining the initial pattern, the present invention can adjust the pattern shape during pipeline execution using a scheduling algorithm, as follows: The algorithm first initializes the parameters, and then obtains the value of II (II=1) according to the formula.

[0043] After initialization, it is necessary to iterate through all elements in the pattern. First, the elements are divided into rows. In this example, it is divided into 3 rows, so patternRows = ([ ],[ ],[ ]).

[0044] Then iterate through all elements in each row; first, for the elements in the first row... Perform a judgment, initialize dis to 0, and then enter the while loop statement, based on... The formula can be used to obtain the bank number corresponding to the current element point. Then, it is determined whether the obtained bank number meets the following conditions: 1) Since the element point does not coincide with other elements in the current row after shifting right by a distance dis; 2) The number of elements in the current bank is less than II; 3) After the current element is shifted right by a distance dis, its new bank number is... The position is to the right of lastMin, satisfying the above three conditions. Therefore, the allocation is valid, and the allocation result is added to the list of bank allocation information and distance information.

[0045] Update minPos. At this point, the elements in the first row have been traversed. Next, traverse all elements in the second row, starting with... When dis equals 0, meaning the point does not move, according to... The obtained bank number, and The same bank number means that the number of elements stored in that bank exceeds II. Therefore, when dis=0, the condition is not met, and dis needs to be increased. When dis equals 1, all conditions are met, so [the condition is changed]. Save the partitioning results, and then continue iterating through the second row. For each element, when dis equals 0, the partitioning condition is met, so the partitioning result is saved. Finally, the elements in the last row are traversed. When dis=0, according to The obtained bank number and the elements in the second row Similarly, we need to increment dis by 1 and then re-determine the partitioning result. At this point, all the conditions are met, and the partitioning result is saved.

[0046] After dividing the above four element points, this invention obtains the bankID corresponding to each element and the distance dis to move to the right. Then, each load operation can be scheduled according to dis.

[0047] When scheduling each operator, this invention schedules them in descending order of size according to dis. First, this invention schedules operators whose dis is equal to maxDis(0). and The scheduling process involves moving operators with a dis value of 1 to time step 0, and then moving operators with a dis value of 0 to time step 1. At this point, the invention has completed the scheduling of all operators for bank access operations. The remaining operators are then scheduled using ILP, but this is not the focus of the invention, and its specific details are omitted here.

[0048] S204: After scheduling is completed, the present invention can obtain a result such as Figure 4 As shown in section c of the DFG, after the pipeline execution, its simultaneous access to the bank is as follows: Figure 4 The solid-line box in section c is shown. Secondly, this invention uses this DFG image as input, in... Figure 3 The hardware executes in a pipelined manner.

[0049] After scheduling, II has been determined, so DIV can calculate the address once by sending an enable signal to LSU every II cycle based on the value of II. For example... Figure 3 As shown in the left half of part e, after the enable signal is transmitted to the AG in the LSU, the AG starts to work. First... Accumulator generation The corresponding subscript index is used to determine whether the value exceeds the limit. If the maximum value is exceeded, then it needs to be... Add one, then Resetting to 0 means that the current data row has been completely traversed. When generated... and after, Figure 3 The right half of part e is based on and The formula calculates the current data's bankID and offset within the bank. It's worth noting that this invention stipulates that N is a power of 2, therefore... and The division and modulo operations in the algorithm are replaced with shift and AND operations, which greatly reduces the complexity of the operation.

[0050] After the LSU calculates the address of the data that needs to be accessed, it passes the data to the PE for calculation through the LDR. After the PE completes a calculation, it passes the calculated data to the corresponding data location through the STR in the LSU, thus completing one iteration calculation.

[0051] The memory partitioning method based on access pattern pattern deformation proposed in this invention adjusts the array access pattern during pipelined execution by scheduling the execution time of operators. Furthermore, a specially designed LSU device achieves a balance between address generation overhead and computational performance, thereby improving pipelined performance and reducing chip power consumption. Compared to existing technologies, this invention has the following advantages: The memory allocation problem of multi-subgraph mapping on a space accelerator is precisely described as a bi-objective optimization problem using integer linear programming, and a solution that minimizes conflicts while moderately consuming the bank is finally found. Introducing lifecycle analysis into the memory allocation of multi-subgraph mapping enables the timely reclamation of storage space for expired data, thereby reducing access conflicts and bank consumption.

[0052] To achieve the above embodiments, the present invention also proposes a storage partitioning device based on access mode pattern deformation.

[0053] Figure 5 This is a schematic diagram of a storage partitioning device based on access mode pattern deformation, provided in an embodiment of the present invention.

[0054] like Figure 5 As shown, the storage partitioning device based on access pattern deformation includes: a partitioning module 100, a simplification module 200, and an acceleration module 300, wherein, The partitioning module is used to construct novel partitioning functions for storage partitioning based on traditional memory partitioning methods; The simplification module is used to simplify the new partitioning function by adjusting the array access pattern during pipelined execution by scheduling the execution time of the operator; The acceleration module is used to design an address generation unit based on the simplified new partitioning function, thereby accelerating address calculation.

[0055] Furthermore, in one embodiment of the present invention, the simplification module is also used for: Initialize the maximum movement distance maxDis, the minimum value of the last row lastMin, the list of actual movement distances for each element listDistance, the list of bank information listBankInfo, and the list of control steps CS; Calculate the minimum initial interval under resource constraints; Perform row-by-row splitting on the input data flow graph and generate a total list of access pattern rows. Perform element movement in a row-by-row manner based on the list of access pattern rows. After all elements in the current row have been determined, the minimum coordinate is recorded as lasMin in the next row; For each bank, initialize the relative control step with zero; for each element in listBankInfo[bank], determine the corresponding control step size in reverse order based on its movement distance, maximum distance, and II. After scheduling all memory access operations, other computational operations are further scheduled using integer linear programming, under the constraints of the initial interval and other resources.

[0056] Furthermore, in one embodiment of the present invention, the simplification module is also used for: Let dis be the distance the element moves to the right. Then, according to... The calculation formula for the memory partitioning function calculates the corresponding bankID; If the new position overlaps with other elements and the corresponding bank has been assigned an initial interval of elements, or the corresponding coordinates are less than the difference between the minimum coordinates of the last row and 1, then the movement distance is increased by 1, and an attempt is made to move to the next position. Otherwise, add the element to listBankInfo[bank], record the movement distance in listDistance, update the maximum movement distance, break the while loop, and assign the element to the obtained bankID; if the element cannot be assigned to a group after traversing all positions, the initial interval will be increased by 1, and the reassignment will start from the beginning.

[0057] To achieve the above objectives, a third aspect of the present invention provides a computer device, characterized in that it includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements the memory partitioning method based on access pattern deformation as described above.

[0058] To achieve the above objectives, a fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that the computer program, when executed by a processor, implements the storage partitioning method based on access pattern deformation as described above.

[0059] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0060] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0061] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A storage partitioning method based on access pattern pattern deformation, characterized in that, Includes the following steps: A novel partitioning function for storage partitioning is constructed based on traditional memory partitioning methods; The novel partitioning function is simplified by adjusting the array access pattern during pipelined execution by scheduling the execution time of the operator; An address generation unit is designed based on a simplified new partitioning function, and the address calculation is accelerated through the address generation unit; The novel partitioning function for storage partitioning, constructed based on traditional memory partitioning methods, includes: For a two-dimensional array, the definition is as follows: , , in, This is one of the memory partitioning functions, representing the mapping of data to the storage bank to obtain the bankID; As one of the memory partitioning functions, it represents the offset address of the generated data within the bank; The number of banks to be used is indicated in the partitioning function. and middle, Represents the array's first... Width of the dimension; The method of adjusting the array access pattern during pipelined execution by scheduling the execution time of operators includes: Initialize the maximum movement distance maxDis, the minimum value of the last row lastMin, the list of actual movement distances for each element listDistance, the list of bank information listBankInfo, and the list of control steps CS; Calculate the minimum initial interval under resource constraints; Perform line-by-line splitting on the input data flow graph and generate a total list of access pattern lines, then perform element movement in a line-by-line manner based on the list of access pattern lines; After all elements in the current row have been determined, the minimum coordinate is recorded as lasMin in the next row; For each bank, initialize the relative control step with zero; for each element in listBankInfo[bank], determine the corresponding control step size in reverse order based on its movement distance, maximum distance, and II. After scheduling all memory access operations, other computational operations are further scheduled using integer linear programming, under the constraints of the initial interval and other resources. The step-by-step movement of elements includes: Let dis be the distance the element moves to the right. Then, according to... The calculation formula for the memory partitioning function calculates the corresponding bankID; If the new position overlaps with other elements and the corresponding bank has been assigned an initial interval of elements, or the corresponding coordinates are less than the difference between the minimum coordinates of the last row and 1, then the movement distance is increased by 1, and an attempt is made to move to the next position. Otherwise, add the element to listBankInfo[bank], record the movement distance in listDistance, update the maximum movement distance, break the while loop, and assign the element to the obtained bankID; if the element cannot be assigned to a group after traversing all positions, the initial interval will be increased by 1, and the reassignment will start from the beginning. The address generation unit includes a host controller, a DMA unit, a data memory with 8 memory banks, and a 4×4 PEA including a clock divider and 8 LSUs. Each PE consists of a functional unit supporting fixed-point arithmetic, a local register file, an output register, and a configuration buffer. Data from adjacent PEs or LSUs is selected for the FU through two multiplexers.

2. A storage partitioning device based on access pattern pattern deformation, characterized in that, Includes the following modules: The partitioning module is used to construct novel partitioning functions for storage partitioning based on traditional memory partitioning methods; A simplification module is used to simplify the novel partitioning function by adjusting the array access pattern during pipelined execution through the execution time of scheduling operators; An acceleration module is used to design an address generation unit based on a simplified new partitioning function, and to accelerate address calculation through the address generation unit. The novel partitioning function for storage partitioning, constructed based on traditional memory partitioning methods, includes: For a two-dimensional array, the definition is as follows: , , in, This is one of the memory partitioning functions, representing the mapping of data to the storage bank to obtain the bankID; As one of the memory partitioning functions, it represents the offset address of the generated data within the bank; The number of banks to be used is indicated in the partitioning function. and middle, Represents the array's first... Width of the dimension; The method of adjusting the array access pattern during pipelined execution by scheduling the execution time of operators includes: Initialize the maximum movement distance maxDis, the minimum value of the last row lastMin, the list of actual movement distances for each element listDistance, the list of bank information listBankInfo, and the list of control steps CS; Calculate the minimum initial interval under resource constraints; Perform line-by-line splitting on the input data flow graph and generate a total list of access pattern lines, then perform element movement in a line-by-line manner based on the list of access pattern lines; After all elements in the current row have been determined, the minimum coordinate is recorded as lasMin in the next row; For each bank, initialize the relative control step with zero; for each element in listBankInfo[bank], determine the corresponding control step size in reverse order based on its movement distance, maximum distance, and II. After scheduling all memory access operations, other computational operations are further scheduled using integer linear programming, under the constraints of the initial interval and other resources. The step-by-step movement of elements includes: Let dis be the distance the element moves to the right. Then, according to... The calculation formula for the memory partitioning function calculates the corresponding bankID; If the new position overlaps with other elements and the corresponding bank has been assigned an initial interval of elements, or the corresponding coordinates are less than the difference between the minimum coordinates of the last row and 1, then the movement distance is increased by 1, and an attempt is made to move to the next position. Otherwise, add the element to listBankInfo[bank], record the movement distance in listDistance, update the maximum movement distance, break the while loop, and assign the element to the obtained bankID; if the element cannot be assigned to a group after traversing all positions, the initial interval will be increased by 1, and the reassignment will start from the beginning. The address generation unit includes a host controller, a DMA unit, a data memory with 8 memory banks, and a 4×4 PEA including a clock divider and 8 LSUs. Each PE consists of a functional unit supporting fixed-point arithmetic, a local register file, an output register, and a configuration buffer. Data from adjacent PEs or LSUs is selected for the FU through two multiplexers.

3. A computer device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the memory partitioning method based on access pattern deformation as described in claim 1.

4. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the storage partitioning method based on access mode pattern deformation as described in claim 1.