FPGA-based overlay processor acceleration system and method based on state space duality

The FPGA-based overlay processor acceleration system addresses memory and computational inefficiencies in the Mamba2 model by employing a specialized hardware architecture and control method, enhancing computational efficiency and reducing redundant operations.

US20260377323A1Pending Publication Date: 2026-11-26EASTERN INSTITUTE OF TECHNOLOGY NINGBO
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
US19/641582
Authority / Receiving Office
US · United States
Patent Type
Applications(United States)
Current Assignee / Owner
Priority Date
2025-05-23
Filing Date
2026-04-08
Publication Date
2026-11-26

AI Technical Summary

Technical Problem

Existing hardware platforms face issues of high memory overhead, low efficiency in element-wise computations, and severe redundancy in sparse computations, particularly with the Mamba2 model, due to extensive memory consumption and redundant operations.

Method used

An FPGA-based overlay processor acceleration system utilizing a sparse predefined data acquirer module, reconfigurable systolic array module, partial sum cache module, element-wise operation cache module, and on-chip memory management module, along with a control method that decomposes computations into parallelizable sequences and optimizes data access, to reduce redundant computations and memory usage.

Benefits of technology

The system significantly reduces memory occupation, improves element-wise computational efficiency, and decreases sparse computational redundancy, thereby accelerating the inference process of the Mamba2 model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure US20260377323A1-D00000_ABST
    Figure US20260377323A1-D00000_ABST
Patent Text Reader

Abstract

Disclosed herein is an FPGA-based overlay processor acceleration system and method based on state space duality in the field of machine learning, the system including modules such as a sparse predefined data acquirer module, a reconfigurable systolic array module, a partial sum cache module, an element-wise operation cache module, a function computation module, and an on-chip memory management module. By removing zero elements through the sparse predefined data acquirer module, redundant data are reduced, significantly decreasing redundant computations; the reconfigurable systolic array module flexibly supports multiple computation modes, improving the utilization rate of hardware resources; the partial sum cache module implements cross-cycle accumulation, the element-wise operation cache module integrates results, the function computation module completes nonlinear operations, and the on-chip memory management module optimizes result caching, ensuring on-chip execution of SSD computations, significantly reducing off-chip memory access, and improving inference efficiency and energy efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

CROSS-REFERENCE TO RELATED APPLICATIONS

[0001] The application claims priority to Chinese patent application No. 2025106696819, filed on May 23, 2025, the entire contents of which are incorporated herein by reference.TECHNICAL FIELD

[0002] This disclosure relates to the technical field of machine learning and, in particular, to an FPGA-based overlay processor acceleration system and method based on state space duality.BACKGROUND

[0003] In the current digital era, the field of large language models is developing rapidly. Models represented by Transformer are widely applied in numerous scenarios such as intelligent assistants, content creation, and personalized recommendations, demonstrating excellent performance in handling long-range dependencies in sequential data. With the rise of edge computing, higher requirements have been placed on the inference performance of models in resource-constrained environments. Against this background, the Mamba model, built on the state space model, emerged. By leveraging parallel scanning and recurrent computation, it achieves near-linear computational complexity, making it suitable for deployment in resource-constrained environments. The subsequent Mamba2 model introduced State Space Duality (SSD), which further improves computational efficiency on parallel hardware such as GPUs. This improvement has attracted widespread attention in the industry and offers a novel solution for processing long-sequence data.

[0004] However, the Mamba2 model has revealed a series of serious issues in practical deployment, which are specifically manifested in the following aspects: in terms of memory, under the SSD mechanism, extensive broadcast operations expand small tensors into large ones for element-wise multiplication, resulting in a sharp increase in memory occupation and bandwidth requirements during inference. Specifically, in the dual attention mode, memory consumption reaches up to 41.55 GB, and even in the recurrent mode, it reaches 10.5 GB, placing considerable strain on memory resources. In terms of hardware computing performance, mainstream GPUs and conventional FPGA-based accelerators are designed for tensor compression and dense matrix computation. As a result, they provide insufficient support for element-wise computations that follow broadcast expansion. Under the SSD mechanism, element-wise operations account for 83.88% of the computational latency in the overall inference process, severely hampering the inference speed. The issue of computational redundancy is equally prominent. SSD computations involve a large number of sparse matrix multiplications, and conventional compute units cannot effectively skip zero-value regions in sparse matrices, resulting in a substantial amount of redundant computations and significantly impacting overall computational performance. Consequently, conventional sparse optimization and memory optimization methods suffer from issues of memory occupation, computational inefficiency, and redundant computations, making it difficult to adapt to the unique structure of the Mamba model.SUMMARYTechnical Problem

[0005] Existing hardware platforms suffer from the problems of huge memory overhead, low efficiency in element-wise computations, and severe redundancy in sparse computations.Technical Solution

[0006] This disclosure provides an FPGA-based overlay processor acceleration system and method based on state space duality. The system reduces memory overhead during the state space duality computation process, and improves computational efficiency as well as inference speed and energy efficiency.

[0007] To achieve the aforementioned purpose, this disclosure employs the following technical solution:

[0008] an FPGA-based overlay processor acceleration system based on state space duality, including:

[0009] a sparse predefined data acquirer module, configured to generate a valid data access address sequence according to a predefined sparse pattern, and extract valid data according to the valid data access address sequence, where the valid data include input data and weights from which zero elements have been removed;

[0010] a reconfigurable systolic array module, configured to receive the valid data transmitted by the sparse predefined data acquirer module, and perform dense matrix operations, sparse matrix operations, element-wise operations, and segment-wise multiplication operations on the valid data;

[0011] a partial sum cache module, configured to store intermediate computation results obtained after the reconfigurable systolic array module performs the dense matrix operations, the sparse matrix operations, and the segment-wise multiplication operations, and perform cross-cycle accumulation operations on the intermediate computation results;

[0012] an element-wise operation cache module, configured to receive element-wise operation results obtained after the reconfigurable systolic array module performs the element-wise operations, and receive accumulated intermediate computation results obtained after the partial sum cache module performs the cross-cycle accumulation operations;

[0013] a function computation module, configured to perform nonlinear operations on the element-wise operation results and the accumulated intermediate computation results transmitted from the element-wise operation cache module, so as to obtain nonlinear operation results; and

[0014] an on-chip memory management module, configured to directly cache the nonlinear operation results output from the function computation module in an internal cache of an FPGA, for subsequent computations or for transmission back to a DDR memory as a final result.

[0015] Further, the system further includes an input cache and weight cache module, configured to provide access addresses corresponding to to-be-computed input data and weights;

[0016] where the sparse predefined data acquirer module extracts the valid data from the access addresses of the input cache and weight cache module according to the valid data access address sequence.

[0017] Further, the system further includes an instruction control unit module, configured to receive an instruction sequence transmitted from a host CPU, so as to control, according to the instruction sequence, the sparse predefined data acquirer module, the reconfigurable systolic array module, the partial sum cache module, the element-wise operation cache module, the function computation module, and the on-chip memory management module to work in a collaborative manner.

[0018] Further, the sparse predefined data acquirer module includes an address sequence generator, a sparse data register bank, and a distributed queue unit; and

[0019] the address sequence generator generates the valid data access address sequence according to the predefined sparse pattern, so as to remove zero element data; extracts the valid data according to the valid data access address sequence, and stores the valid data in the sparse data register bank; and transmits the valid data to the reconfigurable systolic array module via the distributed queue unit.

[0020] Further, the reconfigurable systolic array module includes several processing units connected in a cascaded manner; and each of the processing units includes an input selection multiplexer switch, a data input register, a control logic unit, a matrix multiply-accumulate unit, and an element-wise compute unit.

[0021] Further, the element-wise operation cache module is bidirectionally connected to both the reconfigurable systolic array module and the function computation module.

[0022] A control method for an FPGA-based overlay processor acceleration system based on state space duality, including, based on the FPGA-based overlay processor acceleration system based on state space duality as described above:

[0023] generating, by the sparse predefined data acquirer module, a valid data access address sequence according to a predefined sparse pattern, and extracting valid data according to the valid data access address sequence, where the valid data include input data and weights from which zero elements have been removed;

[0024] receiving, by the reconfigurable systolic array module, the valid data transmitted by the sparse predefined data acquirer module, and performing dense matrix operations, sparse matrix operations, element-wise operations, and segment-wise multiplication operations on the valid data;

[0025] storing, by the partial sum cache module, intermediate computation results obtained after the reconfigurable systolic array module performs the dense matrix operations, the sparse matrix operations, and the segment-wise multiplication operations, and performing cross-cycle accumulation operations on the intermediate computation results;

[0026] receiving, by the element-wise operation cache module, element-wise operation results obtained after the reconfigurable systolic array module performs the element-wise operations, and receiving accumulated intermediate computation results obtained after the partial sum cache module performs the cross-cycle accumulation operations;

[0027] performing, by the function computation module, nonlinear operations on the element-wise operation results and the accumulated intermediate computation results transmitted from the element-wise operation cache module, so as to obtain nonlinear operation results; and

[0028] directly caching, by the on-chip memory management module, the nonlinear operation results output from the function computation module in an internal cache of an FPGA, for subsequent computations or for transmission back to a DDR memory as a final result.

[0029] Further, before the step of generating, by the sparse predefined data acquirer module, a valid data access address sequence according to a predefined sparse pattern, and extracting valid data according to the valid data access address sequence, the control method further includes:

[0030] based on a data-flow graph composed of respective operators during a state space duality computation process, decomposing the state space duality computation process into a plurality of parallelizable and reorderable basic operator sequences.

[0031] Further, the process of receiving, by the reconfigurable systolic array module, the valid data transmitted by the sparse predefined data acquirer module and performing dense matrix operations, sparse matrix operations, element-wise operations, and segment-wise multiplication operations on the valid data further includes:

[0032] utilizing an operator fusion framework to merge broadcast matrix multiplication and summation operations into vector-matrix multiplication operations; shifting segment-wise multiplication in causal matrix generation backward to the stage of element-wise operations; and

[0033] selecting a computation mode according to an operator type and generating a corresponding instruction sequence, for the reconfigurable systolic array module to execute corresponding operator operations.

[0034] Further,

[0035] when the operator type is the dense matrix operation, general matrix multiplication is adopted, so as to optimize data block reading through an address mapping list; and

[0036] when the operator type is the sparse matrix operation, sparse matrix multiplication is adopted, so as to utilize a tensor rearrangement algorithm to remove redundant computations involving the zero elements.BENEFICIAL EFFECTS

[0037] Compared with the prior art, this disclosure has the following beneficial effects:

[0038] this disclosure provides an FPGA-based overlay processor acceleration system based on state space duality, including modules such as a sparse predefined data acquirer module, a reconfigurable systolic array module, a partial sum cache module, an element-wise operation cache module, a function computation module, and an on-chip memory management module. By removing zero elements through the sparse predefined data acquirer module, redundant data are reduced, significantly decreasing redundant computations; the reconfigurable systolic array module flexibly supports multiple computation modes, improving the utilization rate of hardware resources; the partial sum cache module implements cross-cycle accumulation, the element-wise operation cache module integrates results, the function computation module completes nonlinear operations, and the on-chip memory management module optimizes result caching, ensuring on-chip execution of SSD computations, significantly reducing off-chip memory access, and improving inference efficiency and energy efficiency. This system solves the problems of large memory occupation, low element-wise computational efficiency, and sparse computational redundancy in the Mamba2 model by reducing redundant data transmission and computation, optimizing memory access, and efficiently executing various operations utilizing the reconfigurable characteristics of FPGAs. This system effectively reduces memory occupation, improves element-wise computational efficiency, and decreases sparse computational redundancy, thereby significantly accelerating the inference process of the Mamba2 model.

[0039] Preferably, in this disclosure, by adding an input cache and weight cache module, a unified source of input data and weight access addresses is provided for the system, enabling the sparse predefined data acquirer module to extract valid data from fixed locations more efficiently, avoiding confusion in data sources and additional address lookup operations, further improving the efficiency and accuracy of data extraction, and contributing to more stable and faster operation of the entire acceleration system.

[0040] Preferably, in this disclosure, an instruction control unit module is introduced, which, by receiving an instruction sequence transmitted from a host CPU, achieves collaborative control of each module in the system. This enables the entire acceleration system to work according to a predetermined sequence and logic, avoiding conflicts and confusion between modules, improving the overall operational efficiency and stability of the system, and ensuring that complex computational tasks can be completed accurately and efficiently.

[0041] Preferably, in this disclosure, the sparse predefined data acquirer module specifically includes an address sequence generator, a sparse data register bank, and a distributed queue unit, where the address sequence generator can accurately generate a valid data access address sequence according to a predefined sparse pattern, effectively removing zero element data; the sparse data register bank provides dedicated storage space for the valid data, facilitating subsequent processing; and the distributed queue unit enables efficient transmission of the valid data. These components work in a collaborative manner, enabling the sparse predefined data acquirer module to extract the valid data more quickly and accurately, providing strong support for subsequent computations.

[0042] Preferably, in this disclosure, the reconfigurable systolic array module includes several processing units connected in a cascaded manner. The several processing units connected in a cascaded manner provide powerful computing capability, enabling simultaneous processing of multiple data; the input selection multiplexer switch achieves flexible selection and input of data; the data input register temporarily stores input data, ensuring the stability of data processing; the control logic unit precisely controls the operation of the processing units; and the matrix multiply-accumulate unit and the element-wise compute unit implement dense matrix operations and element-wise operations, respectively. These designs enable the reconfigurable systolic array module to efficiently and flexibly complete various computational tasks.

[0043] Preferably, in this disclosure, the element-wise operation cache module is bidirectionally connected to both the reconfigurable systolic array module and the function computation module. This bidirectional connection enables the element-wise operation cache module to simultaneously receive the element-wise operation results from the reconfigurable systolic array module and the accumulated intermediate computation results from the partial sum cache module, and transmit these results to the function computation module in a timely manner for performing nonlinear operations. Simultaneously, the function computation module can also feed back computation results to the element-wise operation cache module, achieving flexible interaction and sharing of data, thereby improving the overall computational efficiency and flexibility of the system.

[0044] This disclosure also provides a control method for an FPGA-based overlay processor acceleration system based on state space duality. Based on the aforementioned acceleration system, the method reduces the amount of data by removing zero elements through the sparse predefined data acquirer module, flexibly executes various matrix operations with the reconfigurable systolic array module, implements cross-cycle accumulation of intermediate results with the partial sum cache module, integrates element-wise operation and accumulation results with the element-wise operation cache module, completes nonlinear operations with the function computation module, and optimizes result caching with the on-chip memory management module. The method solves the problems of large memory occupation, low element-wise computational efficiency, and sparse computational redundancy in the Mamba2 model by reducing redundant data and computations, optimizing memory access, and improving computational efficiency utilizing the reconfigurable characteristics of FPGAs. This method significantly reduces memory occupation, improves element-wise computational efficiency, and decreases sparse computational redundancy, thereby substantially accelerating the inference process of the Mamba2 model and effectively solving the key problems faced by existing hardware platforms.

[0045] Preferably, in this disclosure, before the sparse predefined data acquirer module extracts valid data, a decomposition step based on a data-flow graph during the state space duality computation process is added. The beneficial effects lie in that the duality computation process is decomposed into a plurality of parallelizable and reorderable basic operator sequences, providing a basis for subsequent parallel computation and operator reordering, helping to improve the computational efficiency and flexibility of the system, enabling the system to utilize hardware resources more efficiently, and further enhancing overall performance.

[0046] Preferably, in this disclosure, an operator fusion framework is utilized to merge broadcast matrix multiplication and summation operations into vector-matrix multiplication operations, reducing computation steps and latency; segment-wise multiplication in causal matrix generation is shifted backward to the stage of element-wise operations, optimizing the computation flow; a computation mode is selected according to an operator type and a corresponding instruction sequence is generated, enabling the reconfigurable systolic array module to execute corresponding operator operations more accurately, improving computational accuracy and efficiency, allowing the system to better adapt to different computational tasks, and fully leveraging the hardware advantages of FPGAs.

[0047] Preferably, in this disclosure, for dense matrix operations, general matrix multiplication is adopted and data block reading is optimized through an address mapping list, which can improve data reading efficiency and reduce memory access time; for sparse matrix operations, sparse matrix multiplication is adopted and a tensor rearrangement algorithm is utilized to remove redundant computations involving the zero elements, thereby reducing the amount of computations and memory occupation. These optimization methods further enhance the computational performance and resource utilization of the system, enabling the system to more efficiently process various types of computational tasks and effectively solve the problems of the Mamba2 model regarding memory and computational efficiency.BRIEF DESCRIPTION OF THE DRAWINGS

[0048] FIG. 1 is a schematic diagram of a software stack and a hardware microarchitecture of an FPGA-based overlay processor acceleration system based on state space duality provided by an embodiment of this disclosure;

[0049] FIG. 2 is a schematic structural diagram of a sparse predefined data acquirer and a processing unit provided by this disclosure;

[0050] FIG. 3 is a schematic diagram of an on-chip cache management and data interaction mechanism provided by this disclosure;

[0051] FIG. 4 is a detailed schematic diagram of a sparse matrix multiplication computation process provided by this disclosure;

[0052] FIG. 5 is a detailed schematic diagram of a segment-wise multiplication computation process provided by this disclosure; and

[0053] FIG. 6 is a schematic structural diagram of an FPGA-based overlay processor acceleration system based on state space duality provided by this disclosure.DETAILED DESCRIPTION OF THE EMBODIMENTS

[0054] To further understand the content of this disclosure, this disclosure will be described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the embodiments are merely for illustrating rather than for limiting this disclosure.

[0055] The technical terms involved in this disclosure are explained below:

[0056] Field-Programmable Gate Array (FPGA) is an integrated circuit with the hardware logic configurable through programming, and is commonly used in the fields of high-performance computing and hardware acceleration.

[0057] Double Data Rate (DDR) is a random access memory (RAM) technology widely used in computers and electronic devices to achieve high-speed data transmission.

[0058] State Space Duality (SSD) is a key technology introduced in the Mamba2 model to improve computational efficiency on parallel hardware such as GPUs.

[0059] Graphics Processing Unit (GPU), originally used for graphics rendering, is now widely applied in fields such as parallel computing and artificial intelligence, and can accelerate large-scale data processing.

[0060] Mamba is a machine learning model, specifically a sequence data processing model based on a state space model, which has near-linear computational complexity and is suitable for inference in resource-constrained environments.

[0061] Mamba2 is an improved version of the Mamba model, which introduces SSD to further enhance computational efficiency.

[0062] Central Processing Unit (CPU) is the core and control unit of a computer, constructed using very large-scale integrated circuits.

[0063] Address Sequence Generator (ASG) is configured to generate a valid data access address sequence according to a predefined sparse pattern, thereby removing zero element data, and then extracting valid data according to the sequence and storing the valid data in a sparse data register bank.

[0064] Block Random Access Memory (BRAM) exists in units of blocks, each having an independent storage structure and read / write ports.

[0065] A Peripheral Component Interconnect Express (PCIe) interface is a high-speed serial computer expansion bus standard configured to connect various hardware devices inside a computer, such as graphics cards, solid-state drives, network cards, and sound cards.

[0066] As described in the background, conventional sparse optimization strategies such as pruning and quantization, as well as memory optimization methods (model partitioning, computational graph fusion, and data flow optimization) cannot be directly and effectively applied to the unique structure of the Mamba model. Therefore, there is an urgent need to design a new acceleration optimization solution that can simultaneously solve the problems of high memory occupation, low element-wise computational performance, and sparse computational redundancy, achieving efficient acceleration of the Mamba2 model. It can be seen that the hardware platforms in the prior art suffer from problems such as huge memory overhead, low element-wise computational efficiency, and severe sparse computational redundancy.

[0067] To solve the aforementioned problems, as shown in FIG. 6, this embodiment provides an FPGA-based overlay processor acceleration system based on state space duality, which includes: a sparse predefined data acquirer module, configured to generate a valid data access address sequence according to a predefined sparse pattern, and extract valid data according to the valid data access address sequence; where the valid data includes input data and weights from which zero elements have been removed; a reconfigurable systolic array module, configured to receive the valid data transmitted by the sparse predefined data acquirer module, and perform dense matrix operations, sparse matrix operations, element-wise operations, and segment-wise multiplication operations on the valid data; a partial sum cache module, configured to store intermediate computation results obtained after the reconfigurable systolic array module performs the dense matrix operations, the sparse matrix operations, and the segment-wise multiplication operations, and perform cross-cycle accumulation operations on the intermediate computation results; an element-wise operation cache module, configured to receive element-wise operation results obtained after the reconfigurable systolic array module performs the element-wise operations, and receive accumulated intermediate computation results obtained after the partial sum cache module performs the cross-cycle accumulation operations; a function computation module, configured to perform nonlinear operations on the element-wise operation results and the accumulated intermediate computation results transmitted from the element-wise operation cache module, so as to obtain nonlinear operation results; and an on-chip memory management module, configured to directly cache the nonlinear operation results output from the function computation module in an internal cache of an FPGA, for subsequent computations or for transmission back to a DDR memory as a final result.

[0068] Exemplarily, this embodiment provides an FPGA-based overlay processor acceleration system based on state space duality, which improves both the software stack and the hardware microarchitecture. Specifically, the acceleration system is implemented as follows:

[0069] the hardware microarchitecture of the FPGA-based overlay processor acceleration system includes: an instruction control unit module, an input cache and weight cache module, a sparse predefined data acquirer module, a reconfigurable systolic array module, a partial sum cache module, an element-wise operation cache module, a function computation module, and an on-chip memory management module. The specific structures and functions are as follows:

[0070] instruction control unit module:

[0071] composition: including an instruction decoding unit, an instruction cache unit, and timing control logic.

[0072] Function: receiving an instruction sequence generated by compilation of a host CPU, and controlling each module of the entire processor system to work in a collaborative manner.

[0073] Input cache and weight cache module:

[0074] composition: the input cache and the weight cache are respectively composed of a plurality of high-speed on-chip storage units.

[0075] Connection: respectively connected to the sparse predefined data acquirer module, providing to-be-computed data and weights.

[0076] Function: providing fast access to data and weights to meet the demands of high-bandwidth and low-latency computation.

[0077] Sparse predefined data acquirer module:

[0078] composition: an address sequence generator (ASG), a sparse data register bank, and a distributed queue unit.

[0079] Connection: connected to the input cache and weight cache module and the reconfigurable systolic array module.

[0080] Function: generating an address sequence according to a predefined sparse pattern, and excluding loading of zero element data in advance, thereby precisely controlling the transmission of sparse matrix data and minimizing redundant operations.

[0081] Reconfigurable systolic array module:

[0082] this module is composed of several processing units (PEs) connected in a cascaded manner. The structure of each processing unit is as follows:

[0083] composition of the processing unit (PE): composed of an input selection multiplexer switch, a data input register, a control logic unit, and a compute unit (including a matrix multiply-accumulate (MAC) unit and an element-wise compute unit).

[0084] Connection: the PEs are connected in a cascaded manner through horizontal and vertical data paths, supporting efficient cross-PE data transmission; simultaneously, each PE unit is connected to the sparse predefined data acquirer module to achieve precise data loading; the output ends of the PEs are connected to the partial sum cache module and the element-wise operation cache module for storing intermediate results computed at various stages.

[0085] Functions and computation mode support: the processing units support general matrix multiplication (GEMM) to implement dense matrix operations, support sparse matrix multiplication (SpMM) to improve computational efficiency by dynamically skipping zero elements, support element-wise operations to achieve efficient parallel point-wise computation, and support segment-wise multiplication (Segment-Mul) to efficiently execute causal mask-related operations.

[0086] Partial sum cache module:

[0087] composition: a multi-level cache register array.

[0088] Connection: connected to the output end of the reconfigurable systolic array module and to the element-wise operation cache module.

[0089] Function: storing intermediate results during the computation process, supporting cross-cycle accumulation of multiple rounds of computation, and ensuring efficient and stable partial sum operations.

[0090] Element-wise operation cache module:

[0091] composition: two dedicated high-speed BRAM cache arrays (EleOps Buffer A and B).

[0092] Connection: this module is bidirectionally connected to the reconfigurable systolic array module and the function computation module (SFU module), thereby supporting efficient interaction for element-wise operations.

[0093] Function: providing high-bandwidth cache required for element-wise computation, and ensuring efficient element-wise data transmission.

[0094] Function computation module:

[0095] composition: a pipelined computation structure, including an exponential function (EXP), an activation function (SiLU), a normalization compute unit (RMSNorm), etc.; the above functions are all dedicated functions.

[0096] Connection: connected to the element-wise operation cache module and the on-chip memory management module respectively.

[0097] Function: efficiently completing nonlinear operations in the SSD algorithm, and significantly reducing the computational latency of non-linear functions.

[0098] On-chip memory management module:

[0099] composition: this module is composed of a width-first buffer unit, a depth-first cache unit, and data interaction control logic.

[0100] Connection: connected to the element-wise operation cache module, the SFU module, and the systolic array module.

[0101] Function: through intelligent allocation of caches, executing the SSD computation process completely within the on-chip cache; reducing the number of off-chip memory accesses and improving the utilization rate of data transmission bandwidth.

[0102] Exemplarily, based on the hardware microarchitecture of the FPGA-based overlay processor acceleration system described above, the overall data flow and signal transmission relationship of this system are as follows:

[0103] data input flow: data are read by the input cache and weight cache module, and transmitted via the sparse predefined data acquirer module to the reconfigurable systolic array module for sparse computation.

[0104] Computation flow: after the reconfigurable systolic array module respectively completes GEMM operations, SpMM operations, element-wise operations, and Segment-mul operations, it outputs partial results to the partial sum cache module or the element-wise operation cache module. The results from the element-wise operation cache module are further transmitted to the function computation module for nonlinear operations. The computation results received by the partial sum cache module are intermediate computation results obtained after the reconfigurable systolic array module performs dense matrix operations, sparse matrix operations, and segment-wise multiplication operations, and cross-cycle accumulation operations are performed on the intermediate computation results; the element-wise operation cache module receives element-wise operation results obtained after the reconfigurable systolic array module performs element-wise operations, and receives accumulated intermediate computation results obtained after the partial sum cache module performs the cross-cycle accumulation operations.

[0105] Result output flow: the final results processed by the function computation module are directly cached on-chip via the on-chip memory management module, waiting for the next stage of computation or being transmitted back to the DDR memory through a dedicated path.

[0106] Exemplarily, to further improve the performance of this system, this embodiment also optimizes and improves the software stack, i.e., providing a control method for an FPGA-based overlay processor acceleration system based on state space duality, specifically as follows:

[0107] the software stack design provided in this embodiment is dedicated to reducing memory overhead during the SSD computation process and improving the resource utilization efficiency of the hardware microarchitecture. The software stack runs entirely on the host CPU and mainly consists of the following key steps:

[0108] I: data-flow graph unrolling:

[0109] to efficiently map the Mamba model onto the FPGA hardware platform, in this embodiment, the data-flow graph (DFG) composed of respective operators in the SSD computation is first analyzed by unrolling and subdividing the complex SSD computation into several parallelizable and reorderable basic operator sequences for more efficient subsequent hardware mapping.

[0110] II: utilizing an operator fusion framework:

[0111] in SSD computation, there are a large number of broadcast element-wise multiplication operations, causing significant memory pressure. To alleviate this problem, this embodiment proposes a software-hardware collaborative operator fusion framework.

[0112] Exemplarily, the specific fusion strategy includes the following two important aspects:

[0113] (1) operator merge: broadcast matrix multiplication and the subsequent summation operation can essentially be uniformly represented as a simpler linear operator computation. This embodiment proposes merging the two into a unified descriptor, expressed uniformly through vector-matrix multiplication. In this way, through operator merge, the original two-step operation (broadcast multiplication and summation) is unified into a one-step matrix multiplication operation, thereby effectively shortening the computational path and significantly reducing the memory overhead of intermediate feature tensors.

[0114] (2) Operator backward shift: the generation of the causal matrix M involved in State Space Duality (SSD) computation is typically implemented through segment-wise multiplication (Segment-mul), which involves segment-wise summation and exponential operations. In this method, by utilizing the properties of the SSD computation, part of the operations are performed in advance, i.e., the segment-wise multiplication is embedded into the subsequent element-wise operation process, thereby shortening the overall computational path. The implementation of the operator backward shift effectively advances the segment-wise computation, reducing the memory burden and latency during complex computation stages.

[0115] III: utilizing a data allocation algorithm:

[0116] this embodiment also proposes a set of efficient data allocation algorithms to support tile-granularity multiply-accumulate (MAC) computations for matrix operations.

[0117] Specifically, it includes two computation modes:

[0118] (1) general matrix multiplication (GEMM) mode: the GEMM mode supports linear matrix multiplication and fused broadcast MAC computations. Through software precisely defining the address mapping lists before and after broadcasting, the required data blocks are efficiently read in each cycle, and after reordering, they are fed into the systolic array to perform vectorized MAC computations, thereby significantly reducing memory occupation.

[0119] (2) Sparse matrix multiplication (SpMM) mode: to solve the problem of sparse computational redundancy, this embodiment also designs a set of tensor-reorder-and-group transformation algorithms: first, a zero element mask is applied to the sparse matrix to remove invalid computations involving zero elements; then, the non-zero element data are regrouped and reordered in a compact manner, facilitating efficient loading into the systolic array compute units, greatly reducing redundant computations.

[0120] IV: computation mode selection:

[0121] the software stack of this embodiment integrates high-level instructions through a compiler, supporting flexible and diverse computation mode selections, including but not limited to:

[0122] A. Load / Store mode: responsible for data transmission between DDR and on-chip cache;

[0123] B. Fetch mode: scheduling data to adapt to systolic array computation;

[0124] C. GEMM mode: general matrix multiplication;

[0125] D. SpMM mode: sparse matrix multiplication;

[0126] E. SegMul mode: segment-wise multiplication for causal masking;

[0127] F. EleOps mode: element-wise computation; and

[0128] G. SFU mode: non-linear function computation, such as EXP, SiLU, and RMSNorm.

[0129] By reasonably selecting the different computation modes mentioned above, this control method can optimize configurations according to the requirements of different computation stages, thereby further significantly improving the utilization rate of hardware computing resources.

[0130] In summary, the FPGA-based overlay processor acceleration system based on state space duality provided in this embodiment has the following advantages: in terms of hardware microarchitecture:

[0131] I. efficient sparse computation: the sparse predefined data acquirer module effectively skips zero elements, significantly reducing redundant computations;

[0132] II. flexible multi-mode computation: the reconfigurable systolic array supports multiple computation modes through dynamic configuration, improving the utilization rate of hardware resources;

[0133] III. optimized on-chip cache: intelligent cache management strategies ensure on-chip execution of SSD computations, significantly reducing off-chip memory access and improving inference efficiency and energy efficiency; and

[0134] IV. efficient nonlinear computation: the efficient implementation of the function computation module further enhances overall computational performance.

[0135] In terms of software stack:

[0136] I. significantly reduced memory overhead: the operator fusion framework and precise data allocation greatly reduce the amount of intermediate tensor data, lowering memory bandwidth requirements;

[0137] II. improved computational efficiency: data reordering and sparse computation mode selection significantly reduce redundant computations involving zero elements, improving the effective utilization rate of hardware resources; and

[0138] III. increased inference speed and energy efficiency: the software scheduling strategy precisely controls the computation flow, ensuring efficient operation of the FPGA hardware units, effectively improving the overall inference throughput and energy efficiency.

[0139] The FPGA-based overlay processor acceleration system based on state space duality provided in this embodiment is specifically implemented and described below with reference to the accompanying drawings:

[0140] as shown in FIG. 1, it is a schematic diagram of the software stack and hardware microarchitecture of the system. The left side of FIG. 1 shows the step composition of the software stack of the FPGA-based overlay processor acceleration system (MambaOPU), including key steps such as data-flow graph unrolling, operator fusion, data allocation, array mode selection, memory scheduling, and event generation. Data and instructions are sent from a host CPU to the acceleration system via a PCIe interface. The right side shows the hardware microarchitecture composition of the FPGA-based overlay processor acceleration system, including an instruction control unit module, an input cache and weight cache module, a sparse predefined data acquirer module, a reconfigurable systolic array module, a partial sum cache module, an element-wise operation cache module, a function computation module, and an on-chip memory management module. The modules are interconnected through efficient data paths to achieve efficient execution of SSD computations.

[0141] As shown in FIG. 2, the left side of FIG. 2 illustrates the sparse predefined data acquirer module with a core consisting of an address sequence generator, a register bank, and a distributed queue. It precisely controls the data flow by generating folding indexes to support different computation modes (including sparse computations in stages Sa1, Sa3, and Sa5). The right side of FIG. 2 shows a detailed schematic structural diagram of a processing unit PE, illustrating the PE's multiplexer switch, data register, and input / output signals of the computation and control logic (including current input CUR IN, weight input W IN, element-wise multiply ELE MUL, CAS multiply CAS MUL, element-wise add ELE ADD, CAS multiply-accumulate CAS MAC, bypass signal BYPASS, and next input NEXT IN), reflecting the high flexibility and multi-computation mode support capability of the processing unit.

[0142] As shown in FIG. 3, the data interaction process during the fusion computation and element-wise computation stages is clearly described. The fusion computation results are efficiently stored in a URAM-based cache and can further achieve seamless interaction with the element-wise cache. The left part of the figure shows the data interaction strategy between fusion computation and element-wise computation, including four scenarios: fusion to fusion, fusion to element-wise, element-wise to element-wise, and element-wise to fusion, to optimize on-chip data flow and minimize off-chip memory access; the right part of FIG. 3 shows the access strategy and timeline for on-chip cache and off-chip cache during different computation stages in SSD computation (such as Sa1-Sa6, Sr1-Sr8, and So1-So4), reflecting the efficient data management solution of this system, which ensures that the SSD computation process always resides in the on-chip cache for efficient completion.

[0143] As shown in FIG. 4, the computation process of sparse matrix multiplication (SpMM) is described, illustrating the specific operation flow for tensor B∈R(1×3×3) and tensor C∈R(3×3×1). In each computation cycle, each processing unit (PE) loads two elements into register REG2 through the current input port, and loads one element into register REG1 through the weight input port. Under the control of the multiplexer, the current processing unit PE[i, j] extracts a specific element from REG2 and performs a multiply-accumulate operation with the loaded element b_ij. The resulting partial product is passed downward in a vertical direction to the next row of processing units PE[i+1,j] in subsequent cycles. Simultaneously, the input elements pre-stored in register REG2 are passed rightward in a horizontal direction to the adjacent processing unit PE[i, j+1]. Each processing unit (PE) performs the above computations alternately until all partial accumulations are completed. The final computation results are output by the PE units in the last row.

[0144] As shown in FIG. 5, each processing unit loads, through the current input port, the causal vector elements {1,ai} processed by the exponential operation into register REG2, and simultaneously loads, through the weight input port, the masked intermediate activation values {b} into register REG1, to perform element-wise multiplication. The partial product result generated inside the PE unit PE[i, j] is stored back into register REG2 or register REG3 according to specific requirements:

[0145] if stored in register REG2, this result will be multiplied by the element b_ij newly loaded into the weight input port in the next computation cycle;

[0146] If stored in register REG3, this result is passed downward via the CAS_MUL path to the next row of PE units PE[i+1,j] for a multiply-accumulate operation with the element a_(i,j+1).

[0147] After each PE completes computation at a specific position, its computation result is output to an external register via a BYPASS channel controlled by control signals CTRL3 and CTRL4.

[0148] The embodiment described above is merely one of the embodiments capable of achieving the technical solution of this disclosure. The scope of protection claimed by this disclosure is not limited to this embodiment, but also includes any changes, substitutions, and other implementations that are easily conceivable by those skilled in the art within the technical scope disclosed herein.

[0149] Finally, it should be noted that the above embodiment is merely used to illustrate the technical solution of this disclosure, not to limit it. Although this disclosure has been described in detail with reference to the above embodiment, a person of ordinary skill in the art should understand that modifications or equivalent substitutions may still be made to the specific implementations of this disclosure, and any modification or equivalent substitution that does not depart from the spirit and scope of this disclosure shall be covered within the claimed scope of protection of this disclosure.

Claims

1. An FPGA-based overlay processor acceleration system based on state space duality, comprising:a sparse predefined data acquirer module, configured to generate a valid data access address sequence according to a predefined sparse pattern, and extract valid data according to the valid data access address sequence, wherein the valid data comprise input data and weights from which zero elements have been removed;a reconfigurable systolic array module, configured to receive the valid data transmitted by the sparse predefined data acquirer module, and perform dense matrix operations, sparse matrix operations, element-wise operations, and segment-wise multiplication operations on the valid data, wherein the process of receiving the valid data transmitted by the sparse predefined data acquirer module and performing dense matrix operations, sparse matrix operations, element-wise operations, and segment-wise multiplication operations on the valid data further comprises:utilizing an operator fusion framework to merge broadcast matrix multiplication and summation operations into vector-matrix multiplication operations; shifting segment-wise multiplication in causal matrix generation backward to the stage of element-wise operations; andselecting a computation mode according to an operator type and generating a corresponding instruction sequence, for the reconfigurable systolic array module to execute corresponding operator operations;a partial sum cache module, configured to store intermediate computation results obtained after the reconfigurable systolic array module performs the dense matrix operations, the sparse matrix operations, and the segment-wise multiplication operations, and perform cross-cycle accumulation operations on the intermediate computation results;an element-wise operation cache module, configured to receive element-wise operation results obtained after the reconfigurable systolic array module performs the element-wise operations, and receive accumulated intermediate computation results obtained after the partial sum cache module performs the cross-cycle accumulation operations;a function computation module, configured to perform nonlinear operations on the element-wise operation results and the accumulated intermediate computation results transmitted from the element-wise operation cache module, so as to obtain nonlinear operation results; andan on-chip memory management module, configured to directly cache the nonlinear operation results output from the function computation module in an internal cache of an FPGA, for subsequent computations or for transmission back to a DDR memory as a final result.

2. The FPGA-based overlay processor acceleration system based on state space duality according to claim 1, further comprising an input cache and weight cache module, configured to provide access addresses corresponding to to-be-computed input data and weights;wherein the sparse predefined data acquirer module extracts the valid data from the access addresses of the input cache and weight cache module according to the valid data access address sequence.

3. The FPGA-based overlay processor acceleration system based on state space duality according to claim 1, further comprising an instruction control unit module, configured to receive an instruction sequence transmitted from a host CPU, so as to control, according to the instruction sequence, the sparse predefined data acquirer module, the reconfigurable systolic array module, the partial sum cache module, the element-wise operation cache module, the function computation module, and the on-chip memory management module to work in a collaborative manner.

4. The FPGA-based overlay processor acceleration system based on state space duality according to claim 1, wherein the sparse predefined data acquirer module comprises an address sequence generator, a sparse data register bank, and a distributed queue unit; andthe address sequence generator generates the valid data access address sequence according to the predefined sparse pattern, so as to remove zero element data; extracts the valid data according to the valid data access address sequence, and stores the valid data in the sparse data register bank; and transmits the valid data to the reconfigurable systolic array module via the distributed queue unit.

5. The FPGA-based overlay processor acceleration system based on state space duality according to claim 1, wherein the reconfigurable systolic array module comprises several processing units connected in a cascaded manner; and each of the processing units comprises an input selection multiplexer switch, a data input register, a control logic unit, a matrix multiply-accumulate unit, and an element-wise compute unit.

6. The FPGA-based overlay processor acceleration system based on state space duality according to claim 1, wherein the element-wise operation cache module is bidirectionally connected to both the reconfigurable systolic array module and the function computation module.

7. A control method for an FPGA-based overlay processor acceleration system based on state space duality, comprising, based on the FPGA-based overlay processor acceleration system based on state space duality according to claim 1:generating, by the sparse predefined data acquirer module, a valid data access address sequence according to a predefined sparse pattern, and extracting valid data according to the valid data access address sequence, wherein the valid data comprises input data and weights from which zero elements have been removed;receiving, by the reconfigurable systolic array module, the valid data transmitted by the sparse predefined data acquirer module, and performing dense matrix operations, sparse matrix operations, element-wise operations, and segment-wise multiplication operations on the valid data, wherein the process of receiving the valid data transmitted by the sparse predefined data acquirer module and performing dense matrix operations, sparse matrix operations, element-wise operations, and segment-wise multiplication operations on the valid data further comprises:utilizing an operator fusion framework to merge broadcast matrix multiplication and summation operations into vector-matrix multiplication operations; shifting segment-wise multiplication in causal matrix generation backward to the stage of element-wise operations; andselecting a computation mode according to an operator type and generating a corresponding instruction sequence, for the reconfigurable systolic array module to execute corresponding operator operations;storing, by the partial sum cache module, intermediate computation results obtained after the reconfigurable systolic array module performs the dense matrix operations, the sparse matrix operations, and the segment-wise multiplication operations, and performing cross-cycle accumulation operations on the intermediate computation results;receiving, by the element-wise operation cache module, element-wise operation results obtained after the reconfigurable systolic array module performs the element-wise operations, and receiving accumulated intermediate computation results obtained after the partial sum cache module performs the cross-cycle accumulation operations;performing, by the function computation module, nonlinear operations on the element-wise operation results and the accumulated intermediate computation results transmitted from the element-wise operation cache module, so as to obtain nonlinear operation results; anddirectly caching, by the on-chip memory management module, the nonlinear operation results output from the function computation module in an internal cache of an FPGA, for subsequent computations or for transmission back to a DDR memory as a final result.

8. The control method for an FPGA-based overlay processor acceleration system based on state space duality according to claim 7, wherein before the step of generating, by the sparse predefined data acquirer module, a valid data access address sequence according to a predefined sparse pattern, and extracting valid data according to the valid data access address sequence, the control method further comprises:based on a data-flow graph composed of respective operators during a state space duality computation process, decomposing the state space duality computation process into a plurality of parallelizable and reorderable basic operator sequences.

9. The control method for an FPGA-based overlay processor acceleration system based on state space duality according to claim 7, whereinwhen the operator type is the dense matrix operation, general matrix multiplication is adopted, so as to optimize data block reading through an address mapping list; andwhen the operator type is the sparse matrix operation, sparse matrix multiplication is adopted, so as to utilize a tensor rearrangement algorithm to remove redundant computations involving the zero elements.