Sparse triangular linear system solving accelerator based on FPGA

Through the combined combination of register stack and FIFO cache with tight VLIW multi-instruction scheduling, the synchronization cost and communication pressure of sparse triangle linear system solutions are optimized, and the flexible architecture advantages of FPGA are utilized to achieve efficient parallel computing and storage space optimization.

CN120562357APending Publication Date: 2025-08-29SOUTHEAST UNIV

Patent Information

Application Number
CN202510438779.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-09
Publication Date
2025-08-29

AI Technical Summary

Technical Problem

The prior art has problems such as high synchronization cost, high communication pressure and low computing efficiency in solving sparse triangle linear systems, especially in the FPGA platform, which has failed to effectively utilize its flexible architecture advantages.

Method used

Register stack and FIFO cache processing are adopted, combined with tight VLIW multi-instruction scheduling, and the non-related parallel multiplexing calculation is realized, the synchronization cost and software and hardware coordination are optimized in the inter-layer scheduling process, internal PE communication is carried out through a full interconnect structure, and the overlapping calculation and write back process is superimposed.

Benefits of technology

The calculation efficiency and storage space utilization of sparse triangle linear system solutions are significantly improved, and high-efficiency parallel computing is realized, reducing the demand and communication pressure of synchronization units.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120562357A_ABST
    Figure CN120562357A_ABST
Patent Text Reader

Abstract

The invention discloses a sparse triangular linear system solving accelerator based on an FPGA (Field Programmable Gate Array), and belongs to the technical field of calculation, reckoning or counting. The accelerator comprises an HBM, an instruction prefetching and decoding module, an input cache module, an FIFO module, a processing unit array, a partial sum register file module and a data decoding register file module. A super-long instruction word architecture instruction calculation scheduling and data information generation are adopted, FIFO and a register file are used as cache modules for node conversion and node multiplexing, periodic automatic alignment is realized without synchronization cost, a full interconnection structure realizes temporary storage of multiplexing data and intermediate results in the register file, and non-reused calculation results are directly written back. According to the method, a double-floating-point calculation operation granularity capable of fully reusing nodes and parallelism is adopted, a multi-PE parallel high-reusability operation mode is fully exerted, calculation control is simplified through scheduling of software and hardware, and an implementation scheme for efficient parallelism of SpTRSV on an FPGA is provided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to integrated circuit design automation technology, and specifically discloses an accelerator for solving sparse triangular linear systems based on FPGA, belonging to the technical field of calculation, inference or counting. Background Art

[0002] Integrated circuits (ICs) have permeated every aspect of human society. However, with the continuous advancement of IC technology, chip-scale systems are becoming increasingly large, and device fabrication processes are becoming more complex, posing a greater challenge to fully automated IC simulation. In IC simulation, common commercial software uses a modified nodal analysis (MNA) method to construct electrical system equations. One of its computational performance bottlenecks is the repetitive solution of numerous sparse triangular linear systems with internal dependencies. This has led to extensive research efforts focused on accelerating the use of sparse triangular solvers (SpTRSV).

[0003] In 1989, Saad et al. proposed a level scheduling algorithm based on the CPU platform to accelerate SpTRSV. By converting sparse triangular matrices into computing nodes and dependency edges, they searched for independent nodes in the same level in the adjacency graph of the sparse triangular matrix and assigned these nodes to multiple threads for parallel solving. Thread synchronization was required between levels to prevent data damage caused by dependencies, and level sets were used to achieve the parallelism of SpTRSV.

[0004] Inter-layer scheduling is the foundation of many SpTRSV acceleration studies, serving as a model for optimization and improvement in subsequent research. In 2011, NVIDIA pioneered parallel inter-layer scheduling for SpTRSV on the powerful GPU platform, a platform renowned for its numerical computing capabilities. This pioneered subsequent optimization efforts based on GPU platforms. Many researchers have proposed acceleration methods such as graph coloring, synchronization-free algorithms, and graph transformations based on the computational structure of GPUs.

[0005] The invention with publication number CN118069315A discloses a method and device for solving sparse triangular matrices based on a distributed platform. By uniformly dividing the input matrix into blocks, it focuses on the overall load and the spatial structure of the matrix, thereby performing distributed calculations. However, this brings about a long preprocessing time and cost.

[0006] The invention with publication number CN118519787A discloses a method for optimizing memory access and parallel efficiency based on the synchronization-free SpTRSV algorithm. By dividing the rows of non-zero elements into long and short rows and assigning them to different warp levels and thread levels for processing, it attempts to better achieve load balancing. The synchronization-free algorithm solves the serious synchronization cost and the preprocessing is relatively simple. However, this division method ignores the two-dimensional spatial structure of the input matrix, making it difficult to solve the load balancing problem of the matrix itself.

[0007] The invention with publication number CN118312299A discloses an accelerator for solving sparse triangular linear systems. By proposing a data flow processing and corresponding hardware architecture and instruction system for parallel computing between nodes, a single-structure ultra-long instruction is used to reuse the column-wise dependency through access between computing units, and node jumps are performed through register units, which can better utilize spatial structure parallelism. However, the accelerator structure proposed by this method has two fully interconnected structures, which brings serious wiring pressure to FPGA implementation. Using a single instruction to schedule all functional units causes some functional units to still perform instructions that occupy detailed control information when not enabled, resulting in serious bandwidth waste. The step of writing back to the host side in the implementation process is after writing back the output storage, which is equivalent to a serial process for PS-side data transmission and PL calculation writeback in software and hardware collaboration, affecting the overall communication transmission efficiency.

[0008] CPU and GPU platforms also share implementation issues. The granularity of their cache structures doesn't scale well with the irregular memory accesses during SpTRSV computations. Therefore, even the peak throughput of advanced processes can't achieve an average throughput that meets cost expectations. ASIC implementations can better adapt to matrices of a certain size and handle specific problems more customized, but lack the advantages of distributed computing. In comparison, FPGA implementations offer a more flexible architecture and data flow than ASICs. The number of processing units (PEs) can be flexibly configured based on memory bandwidth. Compared to CPUs and GPUs, FPGAs address cache granularity mismatches, enabling better resource utilization and cost control, resulting in a superior energy efficiency comparison.

[0009] In 2023, Linghao et al. leveraged the inherent advantages of FPGAs by coupling them with high-bandwidth memory (HBM) to implement a robust solution template for sparse linear systems. Their design primarily involved designing vector-granular data flows and data reuse methods, dividing the computational process into stages and executing it on the FPGA. Furthermore, they implemented a mixed-precision design for the computational units. This design provides valuable guidance for sparse linear systems, but the overall design still revolves around the computation of sparse matrix-vector multiplication (SpMV). While SpMV and SpTRSV share similarities in computational characteristics, they also differ significantly. Linghao's design cannot address the computational challenges of SpTRSV. Other attempts to accelerate SpTRSV on FPGAs have mostly focused on optimizing inter-layer scheduling, tending to improve the overall data flow design and communication mechanisms, without addressing the node dependency inherent in SpTRSV. Therefore, how to address and optimize the sparse dependency inherent in SpTRSV and leverage the architectural advantages of FPGAs for accelerator design remains a worthy research question. Summary of the Invention

[0010] The purpose of the present invention is to address the deficiencies of the above-mentioned background technology and provide an FPGA-based sparse triangular linear system solution accelerator. Through register stack and FIFO cache processing, it utilizes unrelated parallel multiplexing computing to improve the overall throughput, adopts tight VLIW multi-instructions to fully utilize the storage bandwidth to control the functional units, solves the synchronization cost caused by the traditional processing process of inter-layer scheduling and the technical problems of software and hardware collaboration and internal PE communication in the accelerator implementation process, and realizes the invention purpose of high-efficiency parallel computing based on FPGA that can alleviate SpTRSV computing congestion and communication pressure.

[0011] The present invention adopts the following technical solutions to achieve the above-mentioned purpose:

[0012] An FPGA-based sparse triangular linear system solving accelerator hardware architecture performs column-dependent multiplexing on the host side, transmits instructions and initial data to the PS side through HBM, and loads them according to feedback processing signals. It adopts tight VLIW multi-instructions to implement the scheduling of various functional modules on the PL side. Memory access calculations can be independently or uniformly scheduled in parallel between each PE. The interconnection mode is full communication within the PE and corresponding interconnection of the register stack, realizing fine-grained multiplexing after allocation. During the calculation process, nodes without vertical dependencies are written back to achieve overlapping communication and calculation processes between the PS and PL sides.

[0013] An FPGA-based sparse triangular linear system solution accelerator includes: an HBM, an instruction prefetch and decoding module, an input cache module, a FIFO module, a processing unit array, a partial register file module, and a solution data register file module;

[0014] The HBM is used to receive instructions and initial data of a very long instruction word architecture from the host side. After the processing unit array completes the calculation of a node, it responds to the control instruction written to the HBM by the fully interconnected structure and sends the calculation results of each node back to the host side. The initial data includes right-hand side vector data and coefficient matrix data;

[0015] An instruction prefetch and decode module is used to read and decode instructions of the very long instruction word architecture received by the HBM to obtain an instruction set, which includes but is not limited to: initial data preprocessing instructions, PE data preparation instructions, PE array execution instructions, FIFO pre-storage pre-fetch read and write control instructions, input cache module read control instructions, decompression data register file read and write control instructions, partial register file read and write control instructions, and full interconnection structure write HBM and read processing unit calculation result control instructions;

[0016] An input cache module, configured to respond to a read control instruction of the input cache module and cache right-end vector data and coefficient matrix data read from the HBM;

[0017] The FIFO module is used to respond to the FIFO pre-storage pre-fetch read and write control instructions, write the data read by the input cache module, and read the data cached in the input cache module according to the PE array execution instruction;

[0018] The processing unit array is used to respond to the PE array execution instruction, perform calculations on each node based on the data read from the FIFO module, respond to the control instruction of the fully interconnected structure to read the processing unit calculation results, read the partial sum calculation results of the nodes on which the current calculation node depends, and the solution data calculation results of the nodes on which the current calculation node depends, respond to the control instruction of the fully interconnected structure to write to the HBM, and write the non-reused solution data back to the HBM;

[0019] A partial sum register file module, configured to respond to a write control instruction of the partial sum register file and write partial sum calculation results of nodes that the node that cannot complete the current calculation depends on;

[0020] The solution data register stack module is used to respond to the write control instruction of the solution data register stack and write the solution data calculation results of the nodes that the node that cannot complete the current calculation depends on.

[0021] As a further optimization solution for the FPGA-based sparse triangular linear system solution accelerator, the instruction prefetch and decoding module reads and decodes the instructions of the very long instruction word architecture received by the HBM to obtain an instruction set. Specifically, the module automatically determines the number of instructions executed in each calculation cycle based on the hardware, decodes the instruction addresses in descending order until an execution instruction or a null instruction is obtained, and uses the execution instruction or null instruction and other instructions that have not been executed before as the instruction set for the current calculation cycle.

[0022] As a further optimization solution for the FPGA-based sparse triangular linear system solution accelerator, the FIFO module is not enabled when the PE array execution instruction is in PASS mode. It reads the coefficient matrix data when the PE array executes the instruction execution part and calculation, and reads the right-hand side vector data and coefficient matrix data when the PE array executes the instruction to perform solution data calculation.

[0023] As a further optimization solution for the FPGA-based sparse triangular linear system solving accelerator, the processing unit array is used to respond to the PE array execution instructions and perform calculations on each node based on the data read from the FIFO module. Specifically:

[0024] When the PE array executes the instruction to perform the partial sum calculation, the solution data calculation result of the node on which the currently calculated node depends is read from the solution data register stack module through the fully interconnected structure, the product of the solution data calculation result of the node on which the currently calculated node depends and the coefficient matrix data is calculated, the partial sum calculation result of the node on which the currently calculated node depends is read from the partial sum register stack module through the fully interconnected structure, the partial sum calculation result of the node on which the currently calculated node depends and the product are accumulated to obtain the partial sum of the node on which the currently calculated node depends, and when the partial sum calculation result of the node on which the currently calculated node depends is zero, the product address is assigned to the partial sum of the node on which the currently calculated node depends;

[0025] When the PE array executes instructions to perform solution data calculation, the partial sum calculation results of the nodes on which the currently calculated node depends are read from the partial sum register stack module through the fully interconnected structure, the difference between the right-hand term vector data and the partial sum calculation results of the nodes on which the currently calculated node depends is calculated, the product of the difference and the inverse of the coefficient matrix data is calculated, and the solution data of the currently calculated node is obtained.

[0026] As a further optimization solution for the FPGA-based sparse triangular linear system solving accelerator, the partial sum register stack module writes the partial sum calculation results of the nodes that the node that cannot complete the current calculation depends on according to the status bit.

[0027] As a further optimization scheme for an FPGA-based sparse triangular linear system solving accelerator, the processing unit array obtains the enable signal and address of the partial and register stack according to the PE data preparation instruction, reads the partial and calculation results of the nodes on which the currently calculated node depends, and then resets the status bit to an invalid state.

[0028] As a further optimization solution for the FPGA-based sparse triangular linear system solution accelerator, the solution data register stack module writes the solution data calculation results of the nodes that the node that cannot complete the current calculation depends on according to the status bit and reset state control signal.

[0029] As a further optimization solution for an FPGA-based sparse triangular linear system solution accelerator, the processing unit array obtains the enable signal and address of the solution data register stack according to the PE data preparation instruction, reads the solution data calculation results of the nodes on which the currently calculated node depends, and then sets the reset state control signal according to the reusability of the read solution data.

[0030] As a further optimization scheme for the FPGA-based sparse triangular linear system solving accelerator, before starting the calculation, nodes are allocated to each processing unit in the processing unit array according to the node partitioning and reuse principles of double floating-point operation granularity. The specific principle is: independent nodes jump in parallel vertically, and the intermediate calculation values ​​of dependent nodes horizontally are temporarily stored for reuse.

[0031] As a further optimization solution for the FPGA-based sparse triangular linear system solution accelerator, HBM sends the cached calculation results of each node back to the host in the form of a solution vector after all calculation cycles are completed.

[0032] The present invention adopts the above technical solution and has the following beneficial effects:

[0033] (1) The present invention proposes the node division and reuse principle for calculating the granularity of SpTRSV double floating-point operations, which can achieve high parallelism of the overall calculation. Compared with the previous traditional sparse triangular system solution accelerator, the present invention does not require a synchronization unit to implement an inter-layer scheduling algorithm. Each calculation does not need to wait for the completion of the calculation of all dependent nodes. It utilizes the characteristics of matrix locality in a more fine-grained manner and can significantly improve the computing efficiency.

[0034] (2) The present invention proposes a SpTRSV software and hardware scheduling collaboration method, which allocates matrix scheduling nodes to the host side and implements the intensive computing part on the FPGA side. The process of writing back to the host side overlaps with the computing process, and the overall scheduling is performed through non-fixed-length VLIW instructions. Compared with the fixed-length instructions proposed in CN118312299A and the serial write-back to the host after the calculation is completed, it has better storage space advantages and achieves better collaborative acceleration effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 This is an example diagram of the dependency relationship of the SpTRSV transformation DAG.

[0036] Figure 2 It is an unrelated parallel computing flow graph.

[0037] Figure 3 This is the architecture diagram of the FPGA-based SpTRSV accelerator of the present invention.

[0038] Figure 4 This is a diagram of the variable-length instruction group processing structure of the FPGA-based SpTRSV accelerator of the present invention.

[0039] Figure 5 This is the instruction format diagram that needs to be constructed by the FPGA-based SpTRSV accelerator of the present invention.

[0040] Figure 6 It is a calculation flow chart of the PE array in the present invention.

[0041] Figure 7 It is a schematic diagram of the basic computing unit PE module of the present invention.

[0042] Figure 8 This is a design flow chart of the FPGA-based SpTRSV accelerator of the present invention. DETAILED DESCRIPTION

[0043] The following examples may enable those skilled in the art to more fully understand the present invention, but are not intended to limit the present invention in any way.

[0044] The FPGA-based sparse triangular linear system solving accelerator hardware architecture disclosed in the present invention has an overall design including the following six steps.

[0045] Step 1: Obtain the sparse triangular matrix L, the coefficient matrix of the sparse lower triangular linear system Lx = b. This matrix can be extended to the transposed upper triangular matrix. For the lower triangular matrix, all superdiagonal elements are 0, which means that each unknown has dependencies only on the unknowns that follow it. Based on these dependencies, a directed acyclic graph (DAG) is constructed. The in-degree of a node represents the degree of dependence of other nodes on it. Based on the idea of ​​layer-by-layer traversal using the breadth-first search (BFS) algorithm, the graph hierarchy is gradually obtained at a low cost, sorted by the in-degree of the nodes, and a more compact initial order is provided for the subsequent node allocation PE.

[0046] Step 2: Double floating-point operation granularity is used as the basic computing unit for node computing, and computing operations without related parallelism are interconnected and reused. When solving an unknown node in SpTRSV that depends on multiple nodes, it can be solved after a part of the dependent nodes are solved without waiting for all the dependent nodes to be solved. That is, the partial sum psum of the existing dependent nodes can be calculated first, and the coefficient matrix is ​​preprocessed in blocks. The number of blocks is the same as the number of PEs of the accelerator in the design space. The previous inter-layer scheduling based on the random number of node operations is abandoned, and the calculation is carried out at the double floating-point operation granularity. Without creating new nodes, the vertical independent nodes are jumped and parallelized, and the horizontal dependent nodes are stored. The inter-node computing part and the required other node computing data are transmitted through the fully interconnected structure in the hardware. The optimization is carried out with the goal of maximizing node reuse to minimize the computing cycle waiting of the computing array.

[0047] Step 3: Map the nodes to multiple PE units of the FPGA, use Very Long Instruction Word (VLIW) instructions for computational scheduling and data information generation, and transmit VLIW instructions as well as bi and Lij to the High Bandwidth Memory (HBM) channel. bi and Lij represent the right-hand term vector b and the elements of the coefficient matrix L of the sparse lower triangular linear system Lx=b. VLIW instructions include: initial data preprocessing instructions, PE data preparation instructions, PE array execution instructions, FIFO pre-storage and pre-fetch read and write control instructions, input cache module and xi register stack, psum register stack read and write behavior information, and NoC structure write HBM and read PE calculation result control instructions. When using VLIW instructions to process large-scale matrices, HBM can better solve the communication cost and meet sufficient data storage space and data transmission bandwidth.

[0048] Step 4: When reading data from HBM, in order to ensure synchronization, the Lij and bi data provided by the first round of calculation cycle need to be cached in advance. By controlling the read control signal of the FIFO and the read control signal of the HBM, it is ensured that the calculation required data of the VLIW instruction data read from the HBM can be calculated in the same cycle.

[0049] Step 5: The PE array reads data based on different types of computational flows controlled by VLIW instructions, reading the calculated psum and xi data from the fully interconnected PE structure. Different types of computations are automatically cycle-aligned.

[0050] Step 6: After each calculation of the PE array is completed, the xi and psum data to be reused are temporarily stored in the register stack through the fully interconnected structure, and the non-reused xi results are written back to the host side through HBM.

[0051] Step 7: After all matrix calculation cycles are completed, HBM transmits the remaining untransmitted xi results back to the host.

[0052] Figure 1 is an example of the SpTRSV transformation DAG dependency relationship involved in the present invention, Figure 2 It is a scheduling method for dual computing operation granularity. Taking the calculation of node 3 as an example, the relationship between its dependent nodes is marked, indicating that the calculation of the preceding nodes that need to be completed to complete the calculation of node 3 is the basic principle relationship that needs to be followed in the calculation scheduling process. Figure 1 Nodes 4 and 5 in the example both require the calculation result of node 3. To reduce the repeated reading and writing of the xi register and prioritize multiplexing, the crossbar structure of the NoC is used in the FPGA to transmit the multiplexed psum and xi data. Figure 2 This demonstrates node partitioning and reuse at the granularity of double floating-point operations. Each node has a fixed PE allocation, and the intermediate results of the corresponding partial sums do not require interconnection with additional nodes. The computational operations in each computation cycle are all combinations of multiplications and additions. Unlike previous node traversal sorting methods for inter-layer scheduling, which use the same level of node numbering for nodes with the same in-degree, the present invention uses the previous level to update the in-degree of the node at the next level, and updates the sorting vector order of adjacent nodes.

[0053] Figure 3 This is the architecture diagram of the FPGA-based SpTRSV accelerator involved in the present invention. It shows the two major parts of control flow and data flow. The overall components are controlled by instructions, and the connection between PE arrays is realized through the NoC structure. The functions and behaviors of each module of its control scheduling are described as follows.

[0054] HBM: This module is used for data transmission between the host and FPGA, using the AXI3 protocol, with a data bit width of 256 bits and a clock frequency of up to 450MHz. It provides 32 pseudo channels for data transmission and can be interconnected with the top-level IP core of the accelerator using the AXI interface. In this design, under the control signal of the overall calculation start, the instructions and initial data sent by the host side are sent to the accelerator. After the accelerator completes the data calculation of a node, it responds to the write-back instruction and sends the calculation result back to the host side. This data transmission process overlaps with the accelerator calculation process.

[0055] Instruction prefetch and decode module: This module is used for prefetching and decoding instructions. Considering the storage space, the whole instruction is integrated at the vector level with effective data. The corresponding variable-length instructions need to be prefetched and decoded according to the instruction form standard. The whole prefetch and decode process will be carried out after the instruction is received and the computing system starts the signal. The instruction address sequence is read and decoded. The prefetch and decode process will be combined below. Figure 4 and Figure 5 Detailed introduction.

[0056] Bi / LijBRAM is the input cache module: This module is used to cache the right-hand-end vector data bi and coefficient matrix data Lij read from the HBM. The input cache contains the number of banks corresponding to the size of the PE array. The bit width of each input data is fixed at 32 bits, and the write enable is determined by the system start signal. When the accelerator starts running, the original data of the right-hand-end vector b and coefficient matrix L need to be loaded from the host side and written sequentially to the corresponding banks. The data written to the bank is cycle-aligned through the FIFO module.

[0057] FIFO module: As a temporary storage unit for the matrix data alignment cycle, it controls the reading of the corresponding bank of the input cache module and the writing of the FIFO through the system start signal. The full signal of the FIFO is used as a feedback signal for writing to prevent data overflow. When the FIFO is not full, the data of the input cache module will continue to be written to the FIFO. Writing to the FIFO will be performed during the calculation and is only subject to the overall control of the accelerator. Reading the FIFO is to read bi / Lij according to the calculation mode after the preprocessing instruction is decoded. Among them, FIFO reading Lij will be determined by the PE mode control instruction contained in the VLIW instruction and will not be enabled only in the blocking case. The other calculation modes such as the xi calculation mode and the psum calculation mode will enable FIFO reading Lij. FIFO reading bi is enabled in the xi calculation mode of the PE array execution instruction.

[0058] Processing unit array, namely PE array module: This module is the calculation module of the accelerator. It will perform corresponding mode calculations based on the read data and will run after the accelerator receives the system start signal. The mode switching of the calculation process is controlled by the PE array execution instruction, which is divided into blocking and non-blocking calculations. Blocking actually means that the dependent data of the overall calculation has been calculated. It is subject to the blocking of the matrix structure, which will allow the PE overall calculation to perform a simple PASS mode. Non-blocking calculations are divided into two cases, namely psum calculations and xi calculations. The PE array module will read different input data according to the calculation mode and perform calculations after reconstructing the internal array. The overall calculation method is a parallel calculation with interconnected communication. The detailed PE array module design and calculation mode are as follows. Figure 6 and Figure 7 shown.

[0059] Psum register stack module: This module serves as a temporary storage module for intermediate results, namely partial sums and psums. It will temporarily store intermediate results of dependent nodes that cannot be calculated by the current node. The behavior of writing to the psum register stack will be controlled by the write enable field in the psum calculation mode control instruction executed by the PE array. Since the writing method of this design is based on the status bit, there is no need to provide a write address. Reading the psum register stack will obtain the enable and address according to the PE data preparation instruction. Due to the one-time characteristics of horizontal data dependency, it will automatically reset to an invalid state after each data read.

[0060] xi register stack module: This module serves as a temporary storage module for node results xi. It is primarily used to reuse already calculated node results for psum calculations on other nodes. Writing to the xi register stack is controlled by the write enable field in the xi calculation mode control instruction executed by the PE array. Similarly, because the write method is based on the status bit, there is no need to provide a write address. Since the reuse of xi is not one-time, reading the temporarily stored solution data in the xi register requires an additional reset status control signal to determine whether the current read resets the current address state, providing a basis for updating the write address state. By using the FIFO and register stack as a cache module for node conversion and node reuse, automatic cycle alignment is achieved without synchronization costs.

[0061] The fully interconnected module is the NoC structure: The fully interconnected module mainly undertakes the communication multiplexing requirements between different nodes. During the psum or xi calculation process, the currently required data will be selected according to the interconnection selection field in the PE array execution instruction, thereby reading the psum or xi data calculated by the corresponding PE. In the process of writing back to HBM, the interconnection selection end in the control instruction of the fully interconnected module is required to select the xi register stack, and the non-reused solution data Xi is written back through the HBM-related AXI control signal. The write-back process will overlap with the overall calculation process, and there is no need to wait for the completion of the entire calculation process. Figure 4 This is a diagram of the processing structure of the variable-length instruction group of the SpTRSV accelerator based on FPGA involved in the present invention. Due to the optional non-fixed-length instruction scheduling of this design, the number of instructions executed in each calculation cycle is automatically determined by the hardware, and decoding is performed from high to low until an execution instruction or a null instruction is encountered. The execution instruction or null instruction and other instructions that have not been executed before are used as the instruction set to be executed in the cycle. This process will be pre-fetched by a shifter with twice the longest instruction bit width. The instructions are tightly arranged and can be pre-fetched and aligned, and the instruction control information has parallelism. The specific instruction control information is as follows: Figure 5 The form of the instruction displayed.

[0062] Figure 5 It is the instruction form required to construct the FPGA-based SpTRSV accelerator involved in the present invention, which mainly shows five operations, among which NOP is a solution to the read and write conflict processing of the register stack. Since the preferred implementation of the present invention realizes reuse as much as possible, the occurrence of block conflicts has been greatly avoided; since the loading of Lij and bi in the initial data preprocessing instruction only follows the execution instruction or the empty instruction, and the calculation order is fixed, it is only necessary to provide the preprocessing FIFO write enable, bi / Lij preprocessing is the part of pre-data reading, and the corresponding FIFO reading bi_FIFO_ren and Lij_FIFO_ren will be performed, wherein the writing FIFO will be performed during the calculation to realize the overlap of reading data and calculation, so there is no need to use instruction processing; the PE data preparation instruction is to prepare PE data in advance, and then perform specific calculations according to the calculation mode of PE. The psum data preparation instruction includes the read enable signal psum_rf_ren of the psum register stack and the address information ps um_rf_raddr, xi data preparation instructions include the read enable signal xi_rf_ren, reset state control signal xi_rf_r_rst and address information xi_rf_raddr of the xi register stack. The required xi and psum will be obtained by scheduling the corresponding register stack on demand. Due to the existence of a multiplexing mechanism, xi will need to determine whether the current readout resets the current address state to provide a basis for updating the write address state. However, due to the one-time characteristics of horizontal data dependence, psum only needs the last psum. Each write address update can reset the address valid state by default, so one reset control signal is reduced; the PE array execution instruction is the control instruction corresponding to the PE calculation mode, including providing the calculation mode selection execution PE_mode_sel, the interconnection selection field NoC_sel, the enable signal xi_rf_wen for writing to the xi register stack, and the enable signal psum_rf_wen for writing to the psum register stack. For the specific calculation mode process and PE module, see Figure 6 and Figure 7 , mode selection and input data source selection are required, and due to the automatic write address generation in this design, only write enable needs to be provided; on the one hand, the interconnection module control controls the communication with the PE array within the PL side, and on the other hand, it is necessary to implement the write-back operation control information. Since the write-back and node data calculation processing processes do not conflict, the write-back operation of the interconnection module and the calculation of the node data can be performed synchronously, so that the feedback signal is used to perform the instruction signal and the initial data loading, realizing the overall parallelism of the PL side and the PS side. The interconnection module control instructions include: the xi register stack write-back HBM instruction xi_rf_NoC_sel in response to NoC_sel and the AXI interface control signal HBM_AXI_control_signal.

[0063] The fully interconnected structure implements fine-grained reuse of intermediate computation values ​​after node allocation. This involves reading initial data Lij and bi from the FIFO, fixing them, and then reading intermediate results psum or node result xi registers from the NoC, based on the address specified by the interconnect select field NoC_sel in the PE array execution instruction. This allows for the required reuse and initial data. The NoC effectively alleviates the pressure on FPGA routing resources, and small arrays can be interconnected using traditional multiplexers. The reset state control signal xi_rf_r_rst determines the reuse of the result xi. Reuseable xi are written back to the xi register stack via the interconnect structure in response to xi_rf_NoC_sel, participating in subsequent computations. Non-reuseable xi are written back to the HBM as the final result in response to the HBM_AXI_control_signal. Figure 6 This is the calculation flow chart of the PE array in the present invention, which is divided into two calculation modes: psum calculation mode and x i Calculation mode, both calculations require reading L ij , including the case of i=j, i represents the matrix row, j represents the matrix column, and the psum calculation also needs to read the dependent calculated node x j , and need to read the previous psum result psum as appropriate before , x i The calculation also requires reading the original right-hand side data b from the FIFO i , and needs to read the previous psum result psumb as appropriate e f ore .

[0064] Figure 7 It is a schematic diagram of the calculation basic unit PE module of the present invention, showing three control modes, namely multiplication, division and zero jumping. The zero jumping situation is not specifically drawn, and the actual circuit is directly connected through a bypass control.

[0065] In the psum calculation, there are initial psum accumulation and intermediate psum accumulation: For the intermediate psum accumulation, the required dependent calculated node x is obtained from the NoC interconnection structure. j , also reads the previous psum result psum from the psum register before It is worth noting that psum will not be interconnected through the NoC structure, and the psum node is only calculated in the PE. For the initial psum accumulation, only the multiplication calculation of the calculated nodes is required through the designed zero-skipping structure. The formulas for the two are:

[0066] psum=psum before+Lij*x j

[0067] psum=0+Lij*x j

[0068] In the xi calculation, there are two cases: the case where there are non-zero values ​​in the diagonal row and the case where there are no non-zero values. For the xi calculation where there are non-zero values ​​in the diagonal row, it is necessary to read the previous psum result psum from the psum register. before , proceed with psum before Addition operation of negative value, and then read coefficient data L from FIFO ii Perform multiplication calculation. It is worth noting that in order to unify our PE calculations into the same mode, the diagonal elements L of the coefficient matrix will be ii Perform reciprocal processing; for xi calculations that do not have non-zero values, only the designed zero-skipping structure is needed to perform multiplication calculations on the calculated nodes. The formulas for the two are:

[0069]

[0070]

[0071] The above are merely preferred embodiments of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions based on the principles of the present invention are within the scope of protection of the present invention. It should be noted that for those skilled in the art, various improvements and modifications that do not depart from the principles of the present invention should be considered within the scope of protection of the present invention.

Claims

1. A sparse triangular linear system solution accelerator based on FPGA, characterized in that: include: The HBM is used to receive instructions and initial data of a very long instruction word architecture from the host side. After the processing unit array completes the calculation of a node, it responds to the control instruction written to the HBM by the fully interconnected structure and sends the calculation results of each node back to the host side. The initial data includes right-hand side vector data and coefficient matrix data; An instruction prefetch and decode module is used to read and decode instructions of the very long instruction word architecture received by the HBM to obtain an instruction set, wherein the instruction set includes but is not limited to: initial data preprocessing instructions, PE data preparation instructions, PE array execution instructions, FIFO pre-storage pre-fetch read and write control instructions, input cache module read control instructions, decompression data register file read and write control instructions, partial register file read and write control instructions, and full interconnection structure write HBM and read processing unit calculation result control instructions; An input cache module, configured to respond to a read control instruction of the input cache module and cache right-end term vector data and coefficient matrix data read from the HBM; a FIFO module, configured to respond to pre-storage pre-fetch read / write control instructions of the FIFO, write data read by the input buffer module, and read data cached in the input buffer module according to PE array execution instructions; a processing unit array, configured to respond to an execution instruction from the PE array, perform calculations on each node based on data read from the FIFO module, respond to a control instruction from the fully interconnected structure to read a calculation result of a processing unit, read partial sum calculation results of nodes on which the currently calculated node depends, and calculation results of solution data of nodes on which the currently calculated node depends, and respond to a control instruction from the fully interconnected structure to write to the HBM, write solution data that is not reused back to the HBM; a partial sum register file module, configured to respond to a write control instruction of the partial sum register file and write partial sum calculation results of nodes that the node that cannot complete the current calculation depends on; and The solution data register stack module is used to respond to the write control instruction of the solution data register stack and write the solution data calculation results of the nodes that the node that cannot complete the current calculation depends on.

2. The FPGA-based sparse triangular linear system solution accelerator according to claim 1, characterized in that: The instruction prefetch and decoding module reads and decodes the instructions of the very long instruction word architecture received by the HBM to obtain an instruction set. Specifically, the module automatically determines the number of instructions executed in each calculation cycle based on the hardware, decodes the instruction addresses in descending order until an execution instruction or a null instruction is obtained, and uses the execution instruction or null instruction and other instructions that have not been executed before as the instruction set of the current calculation cycle.

3. The FPGA-based sparse triangular linear system solution accelerator according to claim 2, characterized in that: The FIFO module is not enabled when the PE array execution instruction is in PASS mode, reads the coefficient matrix data when the PE array execution instruction performs partial calculations, and reads the right end vector data and coefficient matrix data when the PE array execution instruction performs solution data calculations.

4. The FPGA-based sparse triangular linear system solution accelerator according to claim 3, characterized in that: The processing unit array is used to respond to the PE array execution instruction and perform calculations on each node based on the data read from the FIFO module, specifically: When the PE array executes the instruction to perform the partial sum calculation, the solution data calculation result of the node on which the currently calculated node depends is read from the solution data register file module through the fully interconnected structure, the product of the solution data calculation result of the node on which the currently calculated node depends and the coefficient matrix data is calculated, the partial sum calculation result of the node on which the currently calculated node depends is read from the partial sum register file module through the fully interconnected structure, the partial sum calculation result of the node on which the currently calculated node depends is accumulated and the product, and the partial sum of the node on which the currently calculated node depends is obtained. When the partial sum calculation result of the node on which the currently calculated node depends is zero, the product address is assigned to the partial sum of the node on which the currently calculated node depends; When the PE array executes instructions to perform solution data calculations, the partial sum calculation results of the nodes on which the currently calculated node depends are read from the partial sum register stack module through the fully interconnected structure, the difference between the right-hand term vector data and the partial sum calculation results of the nodes on which the currently calculated node depends is calculated, the product of the difference and the inverse of the coefficient matrix data is calculated, and the solution data of the currently calculated node is obtained.

5. The FPGA-based sparse triangular linear system solution accelerator according to claim 4, characterized in that: The partial sum register stack module writes partial sum calculation results of nodes that the node that cannot complete the current calculation depends on according to the status bit.

6. The FPGA-based sparse triangular linear system solution accelerator according to claim 5, characterized in that: The processing unit array obtains the enable signal and address of the partial and register stack according to the PE data preparation instruction, reads the partial and calculation results of the nodes on which the currently calculated node depends, and resets the status bit to an invalid state.

7. The FPGA-based sparse triangular linear system solution accelerator according to claim 4, characterized in that: The solution data register stack module writes the solution data calculation results of the nodes that the node that cannot complete the current calculation depends on according to the status bit and the reset status control signal.

8. The FPGA-based sparse triangular linear system solution accelerator according to claim 7, characterized in that: The processing unit array obtains the enable signal and address of the solution data register stack according to the PE data preparation instruction, reads the solution data calculation results of the nodes on which the currently calculated node depends, and sets the reset state control signal according to the reusability of the read solution data.

9. The FPGA-based sparse triangular linear system solving accelerator according to any one of claims 1 to 8, characterized in that: Before starting the calculation, nodes are allocated to each processing unit in the processing unit array based on the node division and reuse principle of double floating-point operation granularity. Specifically, the principle is: independent nodes jump in parallel vertically and intermediate calculation values ​​of dependent nodes horizontally are temporarily stored for reuse.

10. The FPGA-based sparse triangular linear system solution accelerator according to any one of claims 1 to 8, characterized in that: After all calculation cycles are completed, the HBM sends the cached calculation results of each node back to the host in the form of a solution vector.

Citation Information

Patent Citations

  • Sparse triangular matrix solving method and device based on distributed platform

    CN118069315A

  • Accelerator for solving sparse triangular linear system

    CN118312299A

  • Memory access and parallel efficiency optimization method based on non-synchronization SpTRSV algorithm

    CN118519787A

Cited By

  • Sparse LU decomposition acceleration method for FPGA (Field Programmable Gate Array) with flow-sensing high-bandwidth memory

    CN121144677A