Reconfigurable nonlinear computing apparatus and method for state space models
By using a reconstruction method based on fixed-point exponential and fixed-point logarithmic operations, the high complexity and resource waste of the Mamba model's nonlinear functions on hardware accelerators are solved, enabling flexible nonlinear function computation and reducing hardware costs and latency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-11
- Publication Date
- 2026-04-07
AI Technical Summary
Existing hardware accelerators for state-space models suffer from high hardware complexity, huge resource overhead, poor flexibility, and difficulty in reuse when implementing nonlinear functions of the Mamba model. In particular, due to the large dynamic range of the exponential function exp, the activation function softplus, and the activation function silu, INT8 quantization leads to severe accuracy loss.
By employing fixed-point exponential and fixed-point logarithmic operations and converting key constant multiplication into pure displacement and addition/subtraction, a reconfigurable nonlinear computing device is designed. The device includes an input selection unit, a fixed-point exponential operation unit, an arithmetic connection unit, and a fixed-point logarithmic operation unit, enabling the reuse and reconstruction of the exponential function exp, the activation function softplus, and the activation function silu.
It reduces hardware complexity, decreases the demand for storage resources, improves the flexibility and reusability of nonlinear functions, avoids the precision loss of INT data streams and the hardware resource consumption of floating-point data stream schemes, and reduces hardware costs and latency.
Smart Images

Figure CN121301276B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence models, and particularly to a reconfigurable nonlinear computing device and method for state space model. BACKGROUND
[0002] In recent years, state space models (SSM) represented by Mamba have shown the potential and efficiency of surpassing attention models (Transformer) in long sequence modeling tasks. The core of the architecture of Mamba is its selective state space model layer, which introduces multiple nonlinear functions in the calculation, including exponential function exp, activation function softplus and activation function silu, the development of the algorithm poses new challenges to the design of the corresponding hardware accelerator.
[0003] When deploying Mamba to hardware accelerators such as application-specific integrated circuits (ASIC) or field-programmable gate arrays (FPGA) on the edge or cloud, mixed-precision quantization is a key technology to improve performance and reduce power consumption. The industry generally uses INT8 to quantize linear operations in neural networks, which are not sensitive to numerical perturbations. However, the activation function silu in Mamba and the exponential function exp and the activation function softplus involved in the state update of the selective state space model layer have a very large dynamic range. If forced to use INT8 quantization, overflow or underflow will easily occur, resulting in serious precision loss. Therefore, the hardware accelerator of Mamba must use a mixed-precision strategy, and the nonlinear part needs to use a higher-precision representation. However, implementing nonlinear functions of 16-bit floating-point numbers FP16 or 16-bit brain-friendly floating-point numbers BF16 on hardware requires the use of floating-point operation units, which requires a huge amount of hardware resources.
[0004] The mainstream scheme for implementing nonlinear units on hardware is generally the lookup table method and the piecewise linear approximation method. The lookup table method uses the function input value as the address and queries the pre-computed function output value, and its cost and accuracy increase exponentially with the input range. To ensure the accuracy of the nonlinear unit, a large amount of on-chip storage resources will be consumed; the piecewise linear approximation method divides the function curve into multiple linear approximations. To achieve high accuracy, a large number of segments are required, resulting in complex control logic and large parameter storage overhead. The reusability of these two methods is poor, and each nonlinear function needs to be customized separately. It is not possible to implement the calculation of multiple nonlinear functions on the same hardware device by reconfiguring the data path. SUMMARY
[0005] This application aims to provide a reconfigurable nonlinear computing device and method for state-space models. Based on the idea of using fixed-point exponential and fixed-point logarithmic operations to reconstruct various nonlinear functions in the state-space model, the key constant multiplication is converted into pure shift and addition / subtraction operations, which greatly reduces hardware complexity. Finally, through a unified and configurable hardware unit, the reuse and reconstruction of three nonlinear functions, namely the exponential function exp, the activation function softplus, and the activation function silu, are realized. This solves the problems of high hardware complexity, huge hardware resource consumption, poor flexibility, and difficulty in reuse in existing methods for processing these nonlinear functions.
[0006] To achieve the above objectives, the technical solution of this application is as follows:
[0007] A reconfigurable nonlinear computing device for a state-space model includes: at least one computing cluster, each computing cluster including: an input selection unit, a fixed-point exponential operation unit, an arithmetic connection unit, a fixed-point logarithmic operation unit, and an output selection unit;
[0008] The input selection unit has its first end connected to the first end of the fixed-point exponentiation unit, its second end connected to the first end of the arithmetic connection unit, and its third end serving as the input end of the computation cluster.
[0009] A fixed-point exponentiation unit, the second end of which is connected to the second end of the arithmetic connection unit and the first end of the output selection unit, respectively;
[0010] An arithmetic linking unit, the third end of which is connected to the first end of a fixed-point logarithm unit;
[0011] A fixed-point logarithmic operation unit, the second end of which is connected to the second end of the output selection unit;
[0012] The output selection unit has a third terminal that is the output terminal of the computation cluster.
[0013] Optionally, depending on the number of configured computing clusters, the reconfigurable nonlinear computing device of the state-space model is configured for multi-path parallelism. When there are multiple computing clusters, the multiple computing clusters perform nonlinear function calculations in parallel.
[0014] Optionally, the reconfigurable nonlinear computing devices of the state-space model can be combined and configured according to the number of computing clusters. When there are multiple computing clusters, the multiple computing clusters can be combined to compute one activation function silu.
[0015] Optionally, the fixed-point exponent arithmetic unit includes: at least one fixed-point exponent arithmetic module, the input terminal of each fixed-point exponent arithmetic module being connected to the first terminal of the fixed-point exponent arithmetic unit, and the output terminal of each fixed-point exponent arithmetic module being connected to the second terminal of the fixed-point exponent arithmetic unit.
[0016] Each fixed-point exponentiation module includes:
[0017] The fixed-point exponent arithmetic unit includes: at least one fixed-point exponent arithmetic module, the input terminal of each fixed-point exponent arithmetic module being connected to the first terminal of the fixed-point exponent arithmetic unit, and the output terminal of each fixed-point exponent arithmetic module being connected to the second terminal of the fixed-point exponent arithmetic unit;
[0018] Each fixed-point exponentiation module includes:
[0019] The first shift adder has its first end connected to the input of the fixed-point exponentiation module, and its second end connected to the first end of the splitter.
[0020] A splitter, the second end of which is connected to the first end of the first barrel-shaped shifter, and the third end of which is connected to the first end of the first adder;
[0021] First adder;
[0022] The first barrel shifter has its second end connected to the second end of the first adder, and its third end is the output of the fixed-point exponential operation module.
[0023] Optionally, the first end of the arithmetic connection unit is connected to the third end of the arithmetic connection unit through a multiplexer, and the second end of the arithmetic connection unit is connected to the third end of the arithmetic connection unit through an adder and a multiplexer, which is used to configure the data path between the fixed-point exponential operation unit and the fixed-point logarithmic operation unit according to external instructions, and to perform arithmetic processing on the operation results of the fixed-point exponential operation unit and the fixed-point logarithmic operation unit.
[0024] Optionally, the fixed-point logarithm operation unit includes: at least one fixed-point logarithm operation module, the input terminal of each fixed-point logarithm operation module is connected to the first terminal of the fixed-point logarithm operation unit, and the output terminal of each fixed-point logarithm operation module is connected to the second terminal of the fixed-point logarithm operation unit;
[0025] Each fixed-point logarithm module includes:
[0026] The first end of the leading 1 detector is the input end of the fixed-point logarithmic operation module, and the second end of the leading 1 detector is connected to the first input end of the second adder and the first end of the second barrel shifter, respectively.
[0027] The second barrel-shaped shifter, the second end of which is connected to the second end of the second adder;
[0028] The second adder has its third terminal connected to the first terminal of the second shift adder;
[0029] The second shift adder has its second terminal as the output terminal of the fixed-point logarithmic operation module.
[0030] A reconfigurable nonlinear computation method for a state-space model, applied to a reconfigurable nonlinear computation device for a state-space model as described above, comprising,
[0031] Configure at least one computing cluster to receive raw input data. Each computing cluster is used to perform fixed-point exponential and fixed-point logarithmic operations on the raw input data. The raw input data is represented in fixed-point number format.
[0032] The nonlinear function of the state-space model is determined, and each computational cluster selects the corresponding operation based on the determined nonlinear function;
[0033] When the nonlinear function is an exponential function exp, fixed-point exponential operation is selected, and the calculation result of the exponential function exp is output.
[0034] When the nonlinear function is the activation function softplus, select fixed-point exponential operation, output the first fixed-point exponential operation result, add 1, then select fixed-point logarithmic operation, and output the softplus calculation result of the activation function.
[0035] When the nonlinear function is the activation function silu, based on the symmetry of the activation function silu, fixed-point logarithmic operation is selected based on the absolute value of the original input data, and the first fixed-point logarithmic operation result is output. Based on the negative absolute value of the original input data, fixed-point exponential operation is selected, and the second fixed-point exponential operation result is output. After adding 1 to the second fixed-point exponential operation result, fixed-point logarithmic operation is selected, and the second fixed-point logarithmic operation result is output. The first fixed-point logarithmic operation result and the second fixed-point logarithmic operation result are subtracted. Based on the subtraction result, fixed-point exponential operation is selected, and the third fixed-point exponential operation result is output. The activation function silu calculation result is output according to the positive or negative sign of the original input data.
[0036] Optional, fixed-point exponentiation includes:
[0037] Input data in fixed-point format ;
[0038] Using mathematical transformations Define fixed-point numbers ;
[0039] Fixed point number m Split into integer partsu and decimal part v Add, integer part , F For decimal places, the decimal part , ;
[0040] Based on the number of fixed points after splitting m ,get ,right Perform displacement calculations on Perform linear fitting calculations;
[0041] By combining displacement calculations and linear fitting calculations, the final displacement reconstruction is performed to obtain the fixed-point exponential calculation result in the hardware. Where b represents the intercept parameter of the linear fitting operation; >> indicates the right displacement sign; << indicates the left displacement sign.
[0042] Optional fixed-point logarithmic operations include:
[0043] Input data in fixed-point format ;
[0044] Input data is obtained based on the preceding 1 detection. Most significant bit w Input data Left displacement most significant bit w Obtain the most significant bit w Normalized decimals aligned to position 1.0 k , ;
[0045] Based on input data Fixed-point representation Using identities ,right Perform linear fitting operation to obtain , ,definition ;
[0046] right Perform displacement and addition operations to obtain the results of fixed-point logarithmic operations in the hardware. .
[0047] Optionally, when the nonlinear function is the activation function silu, the calculation method specifically includes:
[0048] Input raw input data in fixed-point format. x ;
[0049] Based on the original input data x absolute value Perform fixed-point logarithmic operations and output the result of the first fixed-point logarithmic operation. ;
[0050] Based on the original input data x negative absolute value Perform fixed-point exponentiation and output the result of the second fixed-point exponentiation. ;
[0051] Add 1 to the result of the second fixed-point exponent calculation to obtain the result after adding 1 to the second fixed-point exponent calculation. ;
[0052] Perform a fixed-point logarithmic operation on the result of adding 1 to the result of the second fixed-point exponentiation, and output the result of the second fixed-point logarithmic operation. ;
[0053] Subtract the results of the first and second fixed-point logarithm operations to obtain the result of the subtraction. ;
[0054] Based on the subtraction result s Select fixed-point exponentiation and output the result of the third fixed-point exponentiation. ;
[0055] Determine the original input data x The relationship with 0: if it is greater than 0, then the result of the activation function silu calculation is obtained. If it is less than 0, then the activation function silu is calculated. If it equals 0, then the activation function silu is obtained. .
[0056] This application provides a reconfigurable nonlinear computing device and method for state-space models. It proposes a hardware-friendly implementation device and nonlinear function calculation method based on fundamental fixed-point exponential and logarithmic operations for decomposition and reconstruction, oriented towards state-space models. This includes basic operation unit design and reconfigurable path design. This application offers high flexibility in nonlinear function design, achieving a highly reusable nonlinear function operation unit design that is fully compatible with all nonlinear functions involved in the Mamba model. No custom hardware design is required for each function; during use, only the data path of the relevant function scenario needs to be configured to switch to different function implementation scenarios, achieving reconfigurable path design. The reconfigurable nonlinear computing device for state-space models provided in this application has low requirements for computing power and storage resources for the nonlinear units. Simultaneously, the use of fixed-point numerical format avoids the significant accuracy loss in nonlinear function hardware implementation caused by integer (INT) data streams, and also avoids the excessive hardware resource consumption of floating-point data stream schemes. During computation, a shift adder is used to complete the multiplication operation, avoiding the use of traditional multipliers and lookup tables, thus solving the problems of high hardware cost and high latency.
[0057] To make the above-mentioned features and advantages of the application more apparent and understandable, specific embodiments are provided below, and detailed descriptions are given in conjunction with the accompanying drawings. Attached Figure Description
[0058] Figure 1 A block diagram of the reconfigurable nonlinear computing device for the state-space model provided in this application.
[0059] Figure 2 This is a block diagram of the fixed-point exponentiation module 1121.
[0060] Figure 3 This is a block diagram of the fixed-point logarithm operation module 1141.
[0061] Figure 4 This is a data flow diagram of a reconfigurable nonlinear computing device for a state-space model according to a specific embodiment of this application.
[0062] Figure 5 A flowchart of the reconfigurable nonlinear computation method for the state-space model provided in this application.
[0063] Figure 6 This is a flowchart of the fixed-point index calculation for this application.
[0064] Figure 7 This is a flowchart of the fixed-point logarithmic operation in this application.
[0065] Figure 8 This is a flowchart of step S5 of this application. Detailed Implementation
[0066] To make the objectives and technical solutions of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the described embodiments of this application without creative effort are within the scope of protection of this application.
[0067] In one embodiment of this application, a reconfigurable nonlinear computing device for a state-space model is also provided, for implementing a selective state-space model layer of the Mamba model on a hardware accelerator. See also... Figure 1 , Figure 1 A block diagram of a reconfigurable nonlinear computing device for a state-space model provided in this application. The reconfigurable nonlinear computing device for a state-space model includes at least one computing cluster 11, each computing cluster 11 including: an input selection unit 111, a fixed-point exponential operation unit 112, an arithmetic connection unit 113, a fixed-point logarithmic operation unit 114, and an output selection unit 115.
[0068] The input selection unit 111 has its first end connected to the first end of the fixed-point exponentiation unit 112, its second end connected to the first end of the arithmetic connection unit 113, and its third end serving as the input terminal of the computation cluster 11 for receiving raw input data. x Determine the nonlinear function of the state-space model, and select the corresponding computation unit based on the determined nonlinear function;
[0069] The fixed-point exponentiation unit 112 is connected to the second end of the arithmetic connection unit 113 and the first end of the output selection unit 115 respectively, and is used to perform fixed-point exponentiation.
[0070] Arithmetic connection unit 113, the third end of which is connected to the first end of fixed-point logarithm operation unit 114, is used to configure the data path between fixed-point exponential operation unit 112 and fixed-point logarithm operation unit 114 according to external instructions, and to perform arithmetic processing on the operation results of fixed-point exponential operation unit 112 and fixed-point logarithm operation unit 114.
[0071] Fixed-point logarithmic operation unit 114, the second end of fixed-point logarithmic operation unit 114 is connected to the second end of output selection unit 115, and is used to perform fixed-point logarithmic operations;
[0072] The output selection unit 115 has its third terminal as the output terminal of the calculation cluster 11, which is used to select the corresponding nonlinear function calculation result according to the determined nonlinear function.
[0073] This application provides a reconfigurable nonlinear computing device for state-space models. It proposes a hardware-friendly nonlinear function computing device based on fundamental fixed-point exponential and fixed-point logarithmic operations for decomposition and reconstruction, oriented towards state-space models. This includes basic operation unit design and reconfigurable path design. This application offers high flexibility in nonlinear function design, achieving a highly reusable nonlinear function operation unit design that is fully compatible with all nonlinear functions involved in the Mamba model. No custom hardware design is required for each function; during use, only the data path of the relevant function scenario needs to be configured to switch to different function implementation scenarios, realizing the reconfigurable path design. The reconfigurable nonlinear computing device for state-space models provided in this application has low requirements for computing power and storage resources for the nonlinear units. Simultaneously, it adopts a fixed-point numerical format (FXP), avoiding the significant accuracy loss in nonlinear function hardware implementation caused by integer (INT) data streams, and avoiding the excessive hardware resource consumption of floating-point data stream schemes. During computation, a shift adder is used to complete the multiplication operation, avoiding the use of traditional multipliers and lookup tables, thus solving the problems of high hardware cost and high latency.
[0074] As an example, the original input data x Using fixed-point number format To represent, where, W Represents the original input data x The total bit width of the fixed-point number, F Represents the original input data x The number of decimal places for a fixed-point number.
[0075] In one embodiment of this application, the decimal places of a fixed-point number are... F It is 8.
[0076] As an example, depending on the number of configured computing clusters 11, the reconfigurable nonlinear computing device of the state-space model supports multi-path parallel configuration. When there are multiple computing clusters 11, multiple computing clusters 11 perform nonlinear function calculations in parallel.
[0077] As another example, depending on the number of configured computing clusters 11, the reconfigurable nonlinear computing device of the state-space model supports combined configurations. When there are multiple computing clusters 11, multiple computing clusters 11 can be combined to compute one activation function silu.
[0078] As an example, all data paths of a reconfigurable nonlinear computing device based on a state-space model support the insertion of pipelined registers to improve hardware performance.
[0079] As an example, the input selection unit 111 is implemented using a multiplexer (MUX). The input terminals of the multiplexer are connected to the second and third terminals of the input selection unit 111, respectively, and the output terminal of the multiplexer is connected to the first terminal of the input selection unit 111.
[0080] As an example, the fixed-point exponentiation unit 112 includes: at least one fixed-point exponentiation module 1121, the input terminal of each fixed-point exponentiation module 1121 is connected to the first terminal of the fixed-point exponentiation unit 112, and the output terminal of each fixed-point exponentiation module 1121 is connected to the second terminal of the fixed-point exponentiation unit 112.
[0081] As an example, the fixed-point exponentiation module 1121 is reusable. For example, in a computing cluster 11, the fixed-point exponentiation unit 112 includes a fixed-point exponentiation module 1121. When the nonlinear function is the activation function silu, the fixed-point exponentiation module 1121 is reused twice.
[0082] Specifically, please refer to Figure 2 , Figure 2 The diagram shows the structure of the fixed-point exponentiation module 1121. Each fixed-point exponentiation module 1121 has the same structure and is used to perform fixed-point exponentiation operations. It includes: a first shift adder 11211, a splitter 11212, a first barrel shifter 11213, and a first adder 11214.
[0083] The first shift adder 11211 has its first terminal serving as the input terminal of the fixed-point exponentiation module 1121, and its second terminal connected to the first terminal of the splitter 11212 for inputting data in fixed-point number format. ,based on Using mathematical transformations Define fixed-point numbers In hardware ;in, The subscript (2) indicates binary;
[0084] The splitter 11212 has its second end connected to the first end of the first barrel shifter 11213, and its third end connected to the first end of the first adder 11214, for converting fixed-point numbers... m Split into integer parts u and decimal part v Add, integer part decimal part , Based on the number of fixed points after splitting m ,get ; where >> indicates the right displacement sign, which will change the fixed-point numberm Right displacement F Discard the decimal part of the fixed-point number, keeping only the integer part. u << indicates the left shift sign, which shifts the integer part... u Left displacement F After the position, use a fixed-point number. m Subtract this value to get the decimal part. v ;
[0085] The first barrel shifter 11213 has its second end connected to the second end of the first adder 11214, and its third end is the output of the fixed-point exponentiation module 1121, used for... In the hardware, shift operations are performed. By left displacement u Bitwise implementation; displacement reconstruction is performed by combining displacement operations and linear fitting operations to obtain the fixed-point exponential operation result in the hardware. ;
[0086] The first adder 11214 is used for the intercept parameter in the linear fitting operation based on the input. b ,Depend on right Perform linear fitting operation to obtain .
[0087] In one embodiment of this application, the intercept parameter of the linear fitting operation b =1.
[0088] As an example, the arithmetic connection unit 113 uses an adder to perform arithmetic processing on the results of the fixed-point exponentiation unit 112 and the fixed-point logarithm unit 114; a multiplexer is used to configure the data path between the fixed-point exponentiation unit 112 and the fixed-point logarithm unit 114; the first end of the arithmetic connection unit 113 is connected to the third end of the arithmetic connection unit 113 through the multiplexer; and the second end of the arithmetic connection unit 113 is connected to the third end of the arithmetic connection unit 113 through an adder and a multiplexer.
[0089] Specifically, the arithmetic connection unit 113 may employ multiple multiplexers to configure reconfigurable data paths according to actual configuration conditions.
[0090] Specifically, the arithmetic connection unit 113 in each computing cluster 11 supports configuring multiple parallel data paths and configuring combined data paths based on the number of computing clusters 11.
[0091] As an example, the fixed-point logarithm operation unit 114 includes: at least one fixed-point logarithm operation module 1141, the input terminal of each fixed-point logarithm operation module 1141 is connected to the first terminal of the fixed-point logarithm operation unit 114, and the output terminal of each fixed-point logarithm operation module 1141 is connected to the second terminal of the fixed-point logarithm operation unit 114.
[0092] As an example, the fixed-point logarithm operation module 1141 is reusable. For instance, in a computing cluster 11, the fixed-point logarithm operation unit 114 includes a fixed-point logarithm operation module 1141, which is reused twice when the nonlinear function is the activation function silu.
[0093] Specifically, please refer to Figure 3 , Figure 3 The diagram shows the structure of the fixed-point logarithmic operation module 1141. Each fixed-point logarithmic operation module 1141 has the same structure and is used to perform fixed-point logarithmic operations. It includes: a leading 1 detector 11411, a second barrel shifter 11412, a second adder 11413, and a second shift adder 11414.
[0094] The leading 1 detector 11411 has its first terminal serving as the input terminal of the fixed-point logarithm operation module 1141. Its second terminal is connected to the first terminals of the second adder 11413 and the second barrel shifter 11412, respectively, for inputting fixed-point number formatted input data. Input data is obtained based on the preamble 1 detection. Most significant bit (MSB) w ;
[0095] The second barrel shifter 11412 has its second end connected to the second end of the second adder 11413, and is used to transfer input data. Left displacement most significant bit w Obtain the most significant bit w Normalized decimals aligned to position 1.0 k ;
[0096] The second adder 11413, the third terminal of which is connected to the first terminal of the second shift adder 11414, is used to perform operations based on input data. Fixed-point representation Using identities ,right Perform linear fitting operation to obtain , ,definition ;
[0097] The second shift adder 11414 has its second terminal being the output terminal of the fixed-point logarithm operation module 1141, used for... Obtain the fixed-point logarithm calculation results in the hardware. ;in, .
[0098] As an example, the output selection unit 115 is implemented using a multiplexer. The input terminals of the multiplexer are connected to the first and second terminals of the output selection unit 115, respectively, and the output terminal of the multiplexer is connected to the third terminal of the output selection unit 115.
[0099] Specifically, the operation process of each nonlinear function only runs under the nonlinear function condition of the corresponding state space model. The calculation result entering the output selection unit 115 is only effectively output under the nonlinear function condition of the corresponding state space model. Finally, the output selection unit 115 selects the calculation result of the corresponding nonlinear function for output, instead of all nonlinear function operation processes working simultaneously.
[0100] In a specific embodiment of this application, please refer to Figure 4 , Figure 4 This is a data flow diagram of a reconfigurable nonlinear computing device for a state-space model according to a specific embodiment of this application, such as... Figure 4 The diagram illustrates the data flow of a reconfigurable nonlinear computing device for calculating various nonlinear functions in a state-space model according to a specific embodiment of this application. It should be particularly noted that... Figure 4 The data flow is only shown and does not include connection relationships. The reconfigurable nonlinear computing device for configuring the state-space model includes two computing clusters: a first computing cluster 12 and a second computing cluster 13. The first computing cluster 12 includes: a first input selection unit 121, a first fixed-point exponentiation unit 122, a first arithmetic connection unit 123, a first fixed-point logarithm operation unit 124, and a first output selection unit 125. The second computing cluster 13 includes: a second input selection unit 131, a second fixed-point exponentiation unit 132, a second arithmetic connection unit 133, and a second fixed-point logarithm operation unit. The first fixed-point exponentiation unit 122 of the first computation cluster 12 includes a first fixed-point exponentiation module 1221, and the first fixed-point logarithm unit 124 of the first computation cluster 12 includes a first fixed-point logarithm module 1241; the second fixed-point exponentiation unit 132 of the second computation cluster 13 includes a second fixed-point exponentiation module 1321, and the second fixed-point logarithm unit 134 of the second computation cluster 13 includes a second fixed-point logarithm module 1341. The first computation cluster 12 receives raw input data. The second computing cluster 13 receives the raw input data. At this point, a dual-path parallel configuration is used to calculate the exponential function exp and the activation function softplus, while a combined configuration is used to calculate the activation function silu.
[0101] The following is based on Figure 4 The data flow diagram illustrates the data flow for calculating each nonlinear function.
[0102] When the nonlinear function is an exponential function exp, the original input data in the first computation cluster 12 The result enters the first fixed-point exponentiation module 1221 after passing through a multiplexer. The result then passes through a multiplexer again, finally outputting the calculated result of the exponential function exp. In the second computation cluster 13, the original input data The result enters the second fixed-point exponentiation module 1321 after passing through a multiplexer. The result then passes through a multiplexer again, finally outputting the calculated result of the exponential function exp. When only the exponential function exp is configured for calculation, the first fixed-point logarithm unit 124 and the second fixed-point logarithm unit 134 are idle in this mode.
[0103] When the nonlinear function is the activation function softplus, the original input data in the first computation cluster 12 The result enters the first fixed-point exponential operation module 1221 after passing through a multiplexer. After being incremented by 1 by an adder, the result enters the first fixed-point logarithmic operation module 1241 after passing through a multiplexer again. Finally, the result of the softplus activation function is output. In the second computation cluster 13, the original input data The result enters the second fixed-point exponential operation module 1321 after passing through a multiplexer. After being incremented by 1 by an adder, the result enters the second fixed-point logarithmic operation module 1341 after passing through a multiplexer again. Finally, the result of the softplus activation function is output. When configured with the activation function softplus, the first fixed-point exponentiation module 1221 and the first fixed-point logarithm module 1241 operate in series, and the second fixed-point exponentiation module 1321 and the second fixed-point logarithm module 1341 operate in series.
[0104] When the nonlinear function is the activation function silu, the original input data Compared with the original input data The same data. In the first computation cluster 12, the original input data... The negative absolute value is passed through a multiplexer to the first fixed-point exponentiation module 1221 to obtain the second fixed-point exponentiation result. After adding 1 using an adder, the result of adding 1 to the second fixed-point exponentiation operation is obtained. The result then passes through a multiplexer to the first fixed-point logarithm operation module 1241, yielding the second fixed-point logarithm operation result. Meanwhile, in the second computation cluster 13, the original input data The absolute value is passed through a multiplexer to the second fixed-point logarithm operation module 1341 to obtain the result of the first fixed-point logarithm operation. ; The result of the first fixed-point logarithm operation and the result of the second fixed-point logarithm operation Each input passes through a multiplexer and is then subtracted from the input to obtain the subtracted result. The result is then returned to the second fixed-point exponentiation module 1321 via a multiplexer to obtain the third fixed-point exponentiation result. At this point, the original input data is judged. or raw input data If the value is greater than 0, then the final output of the activation function silu is calculated after passing through the multiplexer. If not, then the original input data is processed by an adder. The result of the calculation with the third fixed-point exponent The results are added together, then passed through a multiplexer to finally output the activation function silu calculation result. The computation can be completed efficiently through parallel pipelines. The above activation function silu operation process occupies the first fixed-point exponential operation module 1221, the second fixed-point exponential operation module 1321, the first fixed-point logarithmic operation module 1241, and the second fixed-point logarithmic operation module 1341.
[0105] As another example, when the nonlinear function is the activation function silu, the first computation cluster 12 can also be configured to obtain the result of the first fixed-point logarithmic operation. The second computation cluster 13 obtains the result of the second fixed-point logarithm operation. At this time, the activation function silu operation process occupies the first fixed-point logarithm operation module 1241, the second fixed-point logarithm operation module 1341, and the second fixed-point exponentiation operation module 1321, and the second fixed-point exponentiation operation module 1321 is used twice.
[0106] As an example, a specific embodiment of this application illustrates a configuration of two fixed-point exponential operation modules and two fixed-point logarithmic operation modules for a reconfigurable nonlinear computing device for a state-space model. In another specific embodiment, a configuration of one fixed-point exponential operation module, one fixed-point logarithmic operation module, one multiplier, and one divider can also be used. In this case, the calculation of the exponential function exp and the activation function softplus is implemented using one fixed-point exponential operation module and one fixed-point logarithmic operation module; when calculating the activation function silu, the original formula of the activation function silu is as follows:
[0107]
[0108] If the activation function silu is used in the original formula without any transformation, a fixed-point exponential operation module is required for calculation first. Then use a divider to calculate. Finally, a multiplier is used for calculation. The configuration of a fixed-point exponential operation module, a fixed-point logarithmic operation module, a multiplier, and a divider can also achieve the purpose of this application to realize a reconfigurable nonlinear computing device for the state space model through a configurable data path, thereby completing the calculation of the activation function silu.
[0109] As another example, this application can also use any number of fixed-point exponential operation modules and any number of fixed-point logarithmic operation modules. As long as the fixed-point exponential operation module or the fixed-point logarithmic operation module is used to realize the reconfigurable nonlinear computing device of the state space model through the configurable data path to complete the purpose of calculating all nonlinear functions, it falls within the protection scope of this invention.
[0110] In one embodiment of this application, a reconfigurable nonlinear computation method for a state-space model is also provided, applied to the aforementioned reconfigurable nonlinear computation apparatus for a state-space model. Please refer to [link to relevant documentation]. Figure 5 , Figure 5 A flowchart of the reconfigurable nonlinear calculation method for the state-space model provided in this application. The reconfigurable nonlinear calculation method for the state-space model includes steps S1 to S5.
[0111] Step S1: Configure at least one computing cluster to receive raw input data. x Each computation cluster is used to process the original input data. x Perform fixed-point exponential and fixed-point logarithmic operations;
[0112] Step S2: Determine the nonlinear function of the state-space model, and each computational cluster selects the corresponding operation based on the determined nonlinear function;
[0113] Step S3: When the nonlinear function is an exponential function exp, select fixed-point exponential operation and output the calculation result of the exponential function exp;
[0114] Step S4: When the nonlinear function is the activation function softplus, select fixed-point exponential operation, output the first fixed-point exponential operation result, add 1, then select fixed-point logarithmic operation, and output the softplus calculation result of the activation function.
[0115] Step S5: When the nonlinear function is the activation function silu, based on the symmetry of the activation function silu, and using the original input data... x The absolute value of the input data is used to perform a fixed-point logarithm operation, and the result of the first fixed-point logarithm operation is output. x For the negative absolute value, select fixed-point exponentiation, output the second fixed-point exponentiation result, add 1, then select fixed-point logarithm arithmetic, output the second fixed-point logarithm result, subtract the first and second fixed-point logarithm results, and calculate based on the subtraction result. s Select fixed-point exponentiation, output the result of the third fixed-point exponentiation, based on the original input data. x The positive or negative sign of the output activation function is calculated by silu.
[0116] As an example, when the reconfigurable nonlinear calculation method for state-space models is applied to the aforementioned reconfigurable nonlinear calculation device for state-space models, the arithmetic connection unit 113 performs arithmetic processing on the calculation results of the fixed-point exponentiation unit 112 and the fixed-point logarithm unit 114, including: adding 1 to the first fixed-point exponentiation result, adding 1 to the second fixed-point exponentiation result, subtracting the first fixed-point logarithm result from the second fixed-point logarithm result, and processing according to the original input data. x The sign of the signal is used to obtain the activation function silu calculation result.
[0117] In step S1, please refer to Figure 5 In step S1, at least one computing cluster is configured to receive raw input data. x Each computation cluster is used to process the original input data. x Perform fixed-point exponential and fixed-point logarithmic operations.
[0118] For example, please refer to Figure 6 , Figure 6 This is a flowchart of the fixed-point exponentiation process in this application. Since exponentiation of 2 in hardware can be implemented through bit shifting, such as... This is equivalent to shifting a binary number three bits to the left. The fixed-point exponentiation in this application utilizes mathematical transformations. The exponentiation of e is converted into the exponentiation of 2, and finally completed through shifting and addition operations, specifically including steps S111 to S115.
[0119] Step S111: Input data in fixed-point number format ;
[0120] Step S112: Using mathematical transformations Define fixed-point numbers ;
[0121] Step S113: Convert the fixed-point numberm Split into integer parts u and decimal part v Add, integer part decimal part , , F Decimal place width;
[0122] Step S114: Based on the number of fixed points after splitting m ,get ,right Perform displacement calculations on Perform linear fitting calculations;
[0123] Step S115: Combine displacement calculation and linear fitting calculation to perform final displacement reconstruction and obtain the fixed-point exponential calculation result in the hardware. .
[0124] Specifically, in step S111, The data representing the fixed-point number format for fixed-point exponentiation includes: raw input data. x Raw input data x negative absolute value and the result of subtraction s .
[0125] In step S112, The subscript (2) indicates binary.
[0126] In step S114, for Performing shift operations includes: in hardware By left displacement u Bit implementation; for Perform linear fitting operations, including: fitting within the range [0,1). Performing approximate linear fitting operations yields .
[0127] For example, please refer to Figure 7 , Figure 7 This is a flowchart of the fixed-point logarithmic operation in this application. The fixed-point logarithmic operation in this application is also ultimately completed through displacement and addition operations, specifically including steps S121 to S125.
[0128] Step S121: Input data in fixed-point number format ;
[0129] Step S122: Obtain input data based on the preamble 1. Most significant bit w Input data Left displacement most significant bit wObtain the most significant bit w Normalized decimals aligned to position 1.0 k , ;
[0130] Step S123: Based on input data Fixed-point representation Using identities ,right Perform linear fitting operation to obtain , ,definition ;
[0131] Step S124: For Perform displacement and addition operations to obtain the results of fixed-point logarithmic operations in the hardware. .
[0132] Specifically, in step S121, The data representing the fixed-point number format for performing fixed-point logarithmic operations includes: raw input data. x absolute value The result of adding 1 to the first fixed-point exponent calculation result and the result of adding 1 to the second fixed-point exponent calculation result.
[0133] In step S123, .
[0134] In step S2, please refer to Figure 5 In step S2, the nonlinear function of the state-space model is determined, and each computational cluster selects the corresponding operation based on the determined nonlinear function.
[0135] As an example, the nonlinear functions of a state-space model include: the exponential function exp, the activation function softplus, and the activation function silu.
[0136] In step S3, please refer to Figure 5 In step S3, when the nonlinear function is an exponential function exp, fixed-point exponential operation is selected, and the calculation result of the exponential function exp is output.
[0137] As an example, when the nonlinear function is the exponential function exp, fixed-point exponential operation is selected, and the result of the exponential function exp calculation is output. Specifically, this includes: inputting the original input data. x By directly performing fixed-point exponentiation, the result of the exponential function exp is obtained.
[0138] As an example, the number of computation clusters can be one or more. When there are multiple computation clusters, multi-path parallel calculation of the exponential function exp is performed, with each computation cluster receiving its own original input data. xSelect fixed-point exponential operation to output the calculation results of each exponential function exp.
[0139] In step S4, please refer to Figure 5 In step S4, when the nonlinear function is the activation function softplus, fixed-point exponential operation is selected, the first fixed-point exponential operation result is output and incremented by 1, then fixed-point logarithmic operation is selected, and the softplus calculation result of the activation function is output.
[0140] As an example, when the nonlinear function is the softplus activation function, fixed-point exponential operation is selected, the result of the first fixed-point exponential operation is incremented by 1, and then fixed-point logarithmic operation is selected to output the softplus activation function calculation result. Specifically, this includes: inputting the original input data. x First, perform fixed-point exponentiation to output the first fixed-point exponentiation result. Then, add a constant 1 to the first fixed-point exponentiation result and perform fixed-point logarithmic operation to obtain the softplus activation function calculation result.
[0141] As an example, the number of computation clusters can be one or more, with fixed-point exponentiation and fixed-point logarithm operations implemented within a single cluster. When there are multiple computation clusters, multi-path parallel softplus activation function computation is performed, with each computation cluster receiving its own original input data. x First, perform fixed-point exponential calculation to output the first fixed-point exponential calculation result. Then, add a constant 1 to the first fixed-point exponential calculation result and perform fixed-point logarithmic calculation to obtain the softplus calculation results of each activation function.
[0142] In step S5, please refer to Figure 5 In step S5, when the nonlinear function is the activation function silu, based on the symmetry of the activation function silu, the original input data is used... x The absolute value of the input data is used to perform a fixed-point logarithm operation, and the result of the first fixed-point logarithm operation is output. x For the negative absolute value, select fixed-point exponentiation, output the second fixed-point exponentiation result, add 1, then select fixed-point logarithm arithmetic, output the second fixed-point logarithm result, subtract the first and second fixed-point logarithm results, and calculate based on the subtraction result. s Select fixed-point exponentiation, output the result of the third fixed-point exponentiation, based on the original input data. x The positive or negative sign of the output activation function is calculated by silu.
[0143] As an example, in step S5, because when the original input data x Performing fixed-point logarithmic operations directly when the value is less than 0 is illegal; therefore, based on the original input data... x absolute value By utilizing the symmetry of the activation function silu, the computation of the activation function silu is, for the first time, made compatible in hardware with the reconfigurable nonlinear computing device of the state-space model proposed in this application, which greatly simplifies the hardware control logic.
[0144] Please see Figure 8 , Figure 8 This is a flowchart of step S5 of this application. Step S5 specifically includes steps S51 to S58.
[0145] Step S51: Input the raw input data in fixed-point format. x ;
[0146] Step S52: Based on the original input data x absolute value Perform fixed-point logarithmic operations and output the result of the first fixed-point logarithmic operation. ;
[0147] Step S53: Based on the original input data x negative absolute value Perform fixed-point exponentiation and output the result of the second fixed-point exponentiation. ;
[0148] Step S54: Add 1 to the result of the second fixed-point exponent calculation to obtain the result after adding 1 to the second fixed-point exponent calculation. ;
[0149] Step S55: Perform fixed-point logarithmic operation on the result of adding 1 to the result of the second fixed-point exponentiation operation, and output the result of the second fixed-point logarithmic operation. ;
[0150] Step S56: Subtract the results of the first fixed-point logarithm operation and the second fixed-point logarithm operation to obtain the subtraction result. ;
[0151] Step S57: Based on the subtraction result s Select fixed-point exponentiation and output the result of the third fixed-point exponentiation. ;
[0152] Step S58: Determine the original input data x The relationship with 0: if it is greater than 0, then the result of the activation function silu calculation is obtained. If it is less than 0, then the activation function silu is calculated. If it equals 0, then the activation function silu is obtained. .
[0153] Specifically, in step S51, the raw input data in fixed-point number format is input. xFollowing this, it also includes: judging the original input data. x Is it greater than 0? If so, then the original input data... x absolute value If not, then the original input data x absolute value .
[0154] In step S58, the activation function silu is calculated. It is expressed as follows:
[0155] .
[0156] As an example, this application utilizes the symmetry of the activation function silu. This transforms interval calculations for x < 0 into interval operations for x > 0, thus unifying the computation path of the activation function silu. It calculates silu(x) (x > 0) and silu(-x) (x > 0) based on the original input data. x Choose one of the symbols, and then perform the operation x+silu(x) on the result of silu(-x) to make it fully compatible with the current configuration conditions. Any computational core that utilizes the symmetry of the activation function silu to reuse x>0 falls within the scope of this invention.
[0157] As an example, the number of computation clusters can be one or more. Since the computation of the activation function silu involves two fixed-point exponential operations and two fixed-point logarithmic operations, the activation function silu can be computed across one or more computation clusters. Furthermore, when there are multiple computation clusters, multi-path parallel computation of the activation function silu can be performed. Any method that utilizes fixed-point exponential or fixed-point logarithmic operations to reconstruct the exponential function exp, the activation function softplus, and the activation function silu under the same configuration conditions via configurable data paths falls within the scope of protection of this invention.
[0158] This application provides a reconfigurable nonlinear computing device and method for state-space models. It proposes a hardware-friendly implementation device and nonlinear function calculation method based on fundamental fixed-point exponential and logarithmic operations for decomposition and reconstruction, oriented towards state-space models. This includes basic operation unit design and reconfigurable path design. This application offers high flexibility in nonlinear function design, achieving a highly reusable nonlinear function operation unit design that is fully compatible with all nonlinear functions involved in the Mamba model. No custom hardware design is required for each function; during use, only the data path of the relevant function scenario needs to be configured to switch to different function implementation scenarios, achieving reconfigurable path design. The reconfigurable nonlinear computing device for state-space models provided in this application has low requirements for computing power and storage resources for the nonlinear units. Simultaneously, the use of fixed-point numerical format avoids the significant accuracy loss of integer (INT) data streams in nonlinear function hardware implementation, and also avoids the excessive hardware resource consumption of floating-point data stream schemes. During computation, a shift adder is used to complete the multiplication operation, avoiding the use of traditional multipliers and lookup tables, thus solving the problems of high hardware cost and high latency.
[0159] Although this application has been disclosed above with reference to embodiments, it is not intended to limit this application. Anyone skilled in the art may make some modifications and refinements without departing from the spirit and scope of this application. Therefore, the scope of protection of this application shall be determined by the appended claims.
Claims
1. A reconfigurable nonlinear computing device for a state-space model, characterized in that, include: At least one computing cluster, each computing cluster including: an input selection unit, a fixed-point exponential operation unit, an arithmetic connection unit, a fixed-point logarithmic operation unit, and an output selection unit; The input selection unit has its first end connected to the first end of the fixed-point exponentiation unit, its second end connected to the first end of the arithmetic connection unit, and its third end serving as the input end of the computation cluster. A fixed-point exponentiation unit, the second end of which is connected to the second end of an arithmetic connection unit and the first end of an output selection unit; wherein, the fixed-point exponentiation unit includes: at least one fixed-point exponentiation module, the input end of each fixed-point exponentiation module being connected to the first end of the fixed-point exponentiation unit, and the output end of each fixed-point exponentiation module being connected to the second end of the fixed-point exponentiation unit; Each fixed-point exponentiation module includes: The first shift adder has its first end connected to the input of the fixed-point exponentiation module, and its second end connected to the first end of the splitter. A splitter, the second end of which is connected to the first end of the first barrel-shaped shifter, and the third end of which is connected to the first end of the first adder; First adder; The first barrel shifter has its second end connected to the second end of the first adder, and its third end is the output of the fixed-point exponential operation module. An arithmetic linking unit, the third end of which is connected to the first end of a fixed-point logarithm unit; A fixed-point logarithmic operation unit, the second end of which is connected to the second end of the output selection unit; The output selection unit has a third terminal that is the output terminal of the computation cluster.
2. The reconfigurable nonlinear computing device for the state-space model as described in claim 1, characterized in that, Depending on the number of computing clusters configured, the reconfigurable nonlinear computing device of the state-space model is configured in multiple parallel paths. When there are multiple computing clusters, the multiple computing clusters perform nonlinear function calculations in parallel.
3. The reconfigurable nonlinear computing device for the state-space model as described in claim 1, characterized in that, Depending on the number of configured computing clusters, the reconfigurable nonlinear computing devices of the state-space model are combined and configured. When there are multiple computing clusters, multiple computing clusters are combined to compute one activation function silu.
4. The reconfigurable nonlinear computing device for the state-space model as described in claim 1, characterized in that, The first end of the arithmetic connection unit is connected to the third end of the arithmetic connection unit through a multiplexer, and the second end of the arithmetic connection unit is connected to the third end of the arithmetic connection unit through an adder and a multiplexer. It is used to configure the data path between the fixed-point exponential operation unit and the fixed-point logarithmic operation unit according to external instructions, and to perform arithmetic processing on the operation results of the fixed-point exponential operation unit and the fixed-point logarithmic operation unit.
5. The reconfigurable nonlinear computing device for the state-space model as described in claim 1, characterized in that, The fixed-point logarithm arithmetic unit includes: at least one fixed-point logarithm arithmetic module, the input terminal of each fixed-point logarithm arithmetic module is connected to the first terminal of the fixed-point logarithm arithmetic unit, and the output terminal of each fixed-point logarithm arithmetic module is connected to the second terminal of the fixed-point logarithm arithmetic unit; Each fixed-point logarithm module includes: The first end of the preamble 1 detector is the input end of the fixed-point logarithmic operation module, and the second end of the preamble 1 detector is connected to the first input end of the second adder and the first end of the second barrel shifter, respectively. The second barrel-shaped shifter, the second end of which is connected to the second end of the second adder; The second adder has its third terminal connected to the first terminal of the second shift adder; The second shift adder has its second terminal as the output terminal of the fixed-point logarithmic operation module.
6. A reconfigurable nonlinear computation method for a state-space model, applied to a reconfigurable nonlinear computation device for a state-space model as described in any one of claims 1 to 5, characterized in that, include, Configure at least one computing cluster to receive raw input data. Each computing cluster is used to perform fixed-point exponential and fixed-point logarithmic operations on the raw input data. The raw input data is represented in fixed-point number format. The nonlinear function of the state-space model is determined, and each computational cluster selects the corresponding operation based on the determined nonlinear function; When the nonlinear function is an exponential function exp, fixed-point exponential operation is selected, and the calculation result of the exponential function exp is output. When the nonlinear function is the activation function softplus, select fixed-point exponential operation, output the first fixed-point exponential operation result, add 1, then select fixed-point logarithmic operation, and output the softplus calculation result of the activation function. When the nonlinear function is the activation function silu, based on the symmetry of the activation function silu, fixed-point logarithmic operation is selected based on the absolute value of the original input data, and the first fixed-point logarithmic operation result is output. Based on the negative absolute value of the original input data, fixed-point exponential operation is selected, and the second fixed-point exponential operation result is output. After adding 1 to the second fixed-point exponential operation result, fixed-point logarithmic operation is selected, and the second fixed-point logarithmic operation result is output. The first fixed-point logarithmic operation result and the second fixed-point logarithmic operation result are subtracted. Based on the subtraction result, fixed-point exponential operation is selected, and the third fixed-point exponential operation result is output. The activation function silu calculation result is output according to the positive or negative sign of the original input data.
7. The reconfigurable nonlinear calculation method for the state-space model as described in claim 6, characterized in that, Fixed-point exponentiation includes: Input data in fixed-point format ; Using mathematical transformations Define fixed-point numbers ; Fixed point number m Split into integer parts u and decimal part v Add, integer part , F For decimal places, the decimal part , ; Based on the number of fixed points after splitting m ,get ,right Perform displacement calculations on Perform linear fitting calculations; By combining displacement calculations and linear fitting calculations, the final displacement reconstruction is performed to obtain the fixed-point exponential calculation result in the hardware. Where b represents the intercept parameter of the linear fitting operation; >> indicates the right displacement sign; << indicates the left displacement sign.
8. The reconfigurable nonlinear calculation method for the state-space model as described in claim 6, characterized in that, Fixed-point logarithmic operations include: Input data in fixed-point format ; Input data is obtained based on the preceding 1 detection. Most significant bit w Input data Left displacement most significant bit w Obtain the most significant bit w Normalized decimals aligned to position 1.0 k , ; Based on input data Fixed-point number representation Using identities ,right Perform linear fitting operation to obtain , ,definition ; right Perform displacement and addition operations to obtain the results of fixed-point logarithmic operations in the hardware. .
9. The reconfigurable nonlinear calculation method for the state-space model as described in claim 6, characterized in that, When the nonlinear function is the activation function silu, the specific calculation method includes: Input raw input data in fixed-point format. x ; Based on the original input data x absolute value Perform fixed-point logarithmic operations and output the result of the first fixed-point logarithmic operation. ; Based on the original input data x negative absolute value Perform fixed-point exponentiation and output the result of the second fixed-point exponentiation. ; Add 1 to the result of the second fixed-point exponent calculation to obtain the result after adding 1 to the second fixed-point exponent calculation. ; Perform a fixed-point logarithmic operation on the result of adding 1 to the result of the second fixed-point exponentiation, and output the result of the second fixed-point logarithmic operation. ; Subtract the results of the first and second fixed-point logarithm operations to obtain the result of the subtraction. ; Based on the subtraction results s Select fixed-point exponentiation and output the result of the third fixed-point exponentiation. ; Determine the original input data x The relationship with 0: if it is greater than 0, then the result of the activation function silu calculation is obtained. If it is less than 0, then the activation function silu is calculated. If it equals 0, then the activation function silu is obtained. .
Citation Information
Patent Citations
A local approximation method for quantitative analysis of combat effectiveness index
CN119783724A
KAN adaptive function combination method and device based on multi-scale sparse branches
CN121009934A