Reconfigurable mac array embedded programmable logic chip and ai acceleration method

By using embedded programmable logic chips to dynamically reconfigure the MAC array, the problems of arithmetic density and topology matching in existing technologies are solved. This enables efficient dynamic topology matching and precision switching at the operator granularity, supports hardware-level sparse processing, and improves computational efficiency and hardware utilization.

CN123178335APending Publication Date: 2026-11-27WUXI CORE FIELD MICROELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611387944.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-08
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing technologies cannot simultaneously meet the requirements of high arithmetic density, dynamic topology matching at the operator granularity, dynamic precision switching, hardware-level sparsity support, and pipeline reconfiguration without interruption, resulting in low hardware utilization and low computational efficiency.

Method used

It employs an embedded programmable logic chip with a dynamically reconfigurable MAC array, combined with a PLB array, MAC array, programmable interconnect and configuration memory, to achieve operator-level dynamic topology matching, precision switching and hardware-level sparsity support through a dynamic reconfiguration controller, and to achieve sub-microsecond reconfiguration by using a segmented switch box and dual-phase scheduling.

Benefits of technology

It achieves high arithmetic density, dynamic topology matching, precision switching, and hardware-level sparsity support, avoiding pipeline interruptions, improving computational efficiency and hardware utilization, and adapting to various operator forms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123178335A_ABST
    Figure CN123178335A_ABST
Patent Text Reader

Abstract

The application discloses an embedded programmable logic chip capable of dynamically reconfiguring a MAC array and an AI acceleration method, and belongs to the technical field of integrated circuits and AI hardware acceleration. The embedded programmable logic chip comprises a programmable logic array, a MAC multiplication and accumulation array, programmable interconnection, a configuration memory and a dynamic reconfiguration controller. Array dynamic segmentation is realized through a segmented switch box, and sub-microsecond operator switching is completed through double-phase scheduling; precision-topology collaborative reconfiguration is adopted, INT4 subunits are spliced into INT8 logic units in a 2*2 manner, and precision and topology atoms are synchronized to take effect; and hardware sparse routing is realized by relying on block-level Tag indexing. The application takes into account high arithmetic density of the MAC array and flexibility of programmable logic, eliminates matrix padding waste, improves hardware utilization, and reduces memory energy consumption; upper-layer software only issues operator instructions, can adapt to various operators of LLM and existing inference software stacks, and solves the problems of poor adaptability and low utilization rate of traditional accelerators when facing dynamic changes in operator shape, precision and sparsity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of integrated circuit and artificial intelligence hardware acceleration technology, specifically involving an embedded programmable logic chip with dynamically reconfigurable MAC array and an AI acceleration method. Background Technology

[0002] The Transformer architecture for Large Language Models (LLMs) inference involves a large number of operators with different structures and shapes, mainly including embedding layers, multi-head attention, feedforward networks (FFN), expert hybrid MoE, and various sparse operators. These operators present three core requirements for hardware accelerators: highly diverse operator matrix shapes, ranging from 1×K to M×K in dimension; diverse computational precision, with activation values ​​and weights quantized and compressed from FP32 / INT8 to INT4 or even lower; and dynamically changing sparsity, with the proportion of zero values ​​in the weights and activation matrices changing dynamically with network layers and input tokens. A single, fixed-topology, fixed-precision acceleration array struggles to efficiently adapt to all operator shapes simultaneously.

[0003] Current mainstream acceleration solutions are mainly divided into four categories: GPU / NPU fixed MAC arrays, general-purpose FPGA / eFPGA, coarse-grained reconfigurable arrays (CGRA), and reconfigurable systolic arrays in academic patents. However, all of them have inherent drawbacks. 1. Using a fixed-shape, fixed-precision MAC array has the advantages of high energy efficiency and predictable timing; however, it has the disadvantages of wasting space when the operator matrix dimension does not match the array shape, resulting in reduced hardware utilization; precision switching requires cross-layer weight overloading or software format conversion, and the operator granularity cannot be dynamically switched; dynamic sparse matrices rely on software preprocessing, which impairs hardware utilization and memory access efficiency.

[0004] 2. It relies on lookup tables (LUTs) and programmable interconnects to implement arbitrary digital logic, which is highly flexible; however, it has low arithmetic density. Using LUTs to implement multiplication consumes a lot of logic resources, and the multiplier density and energy efficiency are far lower than those of dedicated MAC arrays. The reconfiguration overhead is large, with full-chip reconfiguration taking milliseconds. Even partial reconfiguration requires external coordination to transmit configuration data, and the calculation of the target area is interrupted during the reconfiguration process. It lacks on-chip look-ahead scheduling and seamless pipeline switching hardware mechanisms for operator switching, and configuration management depends on an external CPU controller.

[0005] 3. It consists of coarse-grained processing units (PEs) plus reconfigurable interconnects, with an operational granularity between that of FPGAs and dedicated accelerators. However, the PE arithmetic units are mostly general-purpose ALUs and multiply-accumulators, with fixed data path widths, making it difficult to adapt to the low-precision, high-throughput requirements of large-scale INT4 / INT8 models. The interconnects mostly adopt a mesh structure, resulting in high latency and power consumption for long-distance data transport, and lacking asymmetric designs oriented towards data flow locality. Reconfiguration is mostly done by the entire array or by PE rows, lacking block isolation and runtime local write masking mechanisms.

[0006] 4. It relies on a switch matrix to switch the direction of the data flow, which is limited to switching between pulse modes. It does not support parallel subarrays or arbitrary shape division of unaligned sub-blocks. Precision adjustment and topology adjustment are decoupled from each other. Most of them only support single-precision mode. Switching precision requires reconfiguration of the entire board. Sparse processing only performs simple zero-value bypass skipping and there is no hardware indexing mechanism that coordinates with interconnection routes.

[0007] In summary, existing technologies cannot simultaneously meet multiple requirements such as high arithmetic density, dynamic topology matching at the operator granularity, dynamic precision switching, hardware-level sparsity support, uninterrupted pipeline reconfiguration, and local isolation of configuration storage. Summary of the Invention

[0008] The purpose of this invention is to provide an embedded programmable logic chip and AI acceleration method for dynamically reconfigurable MAC arrays, so as to solve the problems mentioned in the background art, such as the inability of the prior art to simultaneously achieve high arithmetic density, dynamic topology matching at the operator granularity, dynamic switching of precision, hardware-level sparsity support, pipeline reconfiguration without interruption, and local isolation of configuration storage.

[0009] To achieve the above objectives, the present invention provides the following technical solution: an embedded programmable logic chip for dynamically reconfigurable MAC arrays, including a PLB array: composed of multiple programmable logic blocks, for implementing edge logic, such as address indexing, sparse tag parsing, MoE control, block boundary calculation, etc., as well as bit-level / control logic that is inconvenient to implement in MAC arrays; MAC array: It consists of MAC units arranged in columns. Each MAC unit contains at least one multiply-accumulate unit and local registers, and supports INT4 / INT8 operation mode. Programmable interconnect: connects PLB arrays and MAC arrays, including segmented switch boxes and computing-aware symmetrical cabling resources; Configuration memory: associated with programmable interconnect, organized in blocks by column, and supports block mask writes; Dynamic reconfiguration controller: Receives computational sequences and configuration instructions from the host, and performs look-ahead prefetching, topology formation, and two-phase scheduling.

[0010] Furthermore, the configuration memory includes multiple configuration sub-blocks, each configuration sub-block corresponding to at least one write mask; the dynamic reconfiguration controller sends a write instruction containing the sub-block address, write mask and local configuration bit stream to the configuration memory, and only performs writing on the configuration sub-block indicated by the write mask, while the multiply-accumulate unit corresponding to the unselected configuration sub-block continues to perform calculation during the writing process.

[0011] Furthermore, the programmable interconnect is a computation-aware asymmetric interconnect: based on the data flow locality statistics of the target operator set, the interconnect wiring resources are allocated to local short segments and long-distance segments according to a preset ratio, wherein the resource proportion of local short segments is higher than that of long-distance segments.

[0012] Furthermore, the programmable interconnect includes segmented switch boxes arranged at a predetermined granularity along the row and column directions of the multiply-accumulate array. Each segmented switch box contains a programmable switch node that turns on or off the interconnection of adjacent sub-blocks to divide the multiply-accumulate array into at least one of a full-array pulsating topology, a parallel topology of multiple independent sub-arrays, or a non-aligned sub-block topology.

[0013] Furthermore, the dynamic reconfiguration controller includes: a look-ahead prefetch queue for caching configuration instructions for multiple operators; a topology generator for generating switch node states and data flow direction configurations based on operator shape and precision; a two-phase scheduler for generating freeze signals, switching point signals, and unfreeze signals to overlap configuration writing and computation; and a mask write engine for performing mask writing of the local configuration bitstream.

[0014] Furthermore, the dual-phase scheduler generates the freeze signal to drain the pipeline within the last predetermined number of cycles of the current operator's execution, completes the atomic switch from the shadow register to the effective configuration within one cycle, and then generates the unfreeze signal to start the next operator. The total number of cycles for a single switch is less than 100 clock cycles.

[0015] Furthermore, the MAC array includes multiple multiply-accumulate sub-units, each of which supports first-precision operations; in second-precision mode, at least two multiply-accumulate sub-units are concatenated into a logical multiply-accumulate unit via a shifted addition tree, and the logical multiply-accumulate unit supports second-precision operations that are higher than the first precision.

[0016] Furthermore, the first precision is INT4, and the second precision is INT8; four INT4 multiply-accumulate sub-units are spliced ​​together in a 2×2 manner to form an INT8 logic multiply-accumulate unit, and the output of each sub-unit is shifted by 1, 16, 16, and 256 times respectively and then summed by the shift-add tree; the multiply-accumulate array is an N×N logic array in INT4 mode and a (N / 2)×(N / 2) logic array in INT8 mode.

[0017] Furthermore, the MAC array supports mixed precision mode: within the same array, the multiply-accumulate sub-units corresponding to the first set of configuration sub-blocks selected by the write mask are in splicing mode, while the multiply-accumulate sub-units corresponding to the second set of configuration sub-blocks that are not selected are in independent mode.

[0018] Furthermore, it also includes a sparse routing module, which performs zero-value filtering based on the block-level tag index of the input data, marks zero data blocks as empty packets and prevents them from entering the data path of the multiply-accumulate array, and performs dynamic routing for non-zero data blocks.

[0019] Furthermore, the sparse routing module divides the array corresponding to operators with sparsity higher than the threshold into smaller topologies based on the Tag index, and restores operators with sparsity lower than the threshold to larger topologies.

[0020] Furthermore, the programmable logic array is used to implement at least one of the following: address index generation, sparse tag parsing, expert hybrid gating comparison, and unaligned sub-block boundary calculation.

[0021] Furthermore, the programmable interconnect structure supports at least two of the following data flow modes: weighted resident pulsation mode, input broadcast reduction mode, and subarray parallel mode; the dynamic reconfiguration controller switches between the data flow modes according to the operator type.

[0022] An AI acceleration method for dynamically reconfigurable MAC arrays using embedded programmable logic includes the following steps: S1. Receive the configuration instructions for the current operator and the next operator in the operator sequence; S2. During the execution of the current operator, a local configuration bit stream for the configuration memory is generated according to the shape, precision and sparsity of the next operator. The local configuration bit stream contains only the configuration sub-blocks selected by the write mask. S3. Freeze the phase before the current operator finishes execution, and write the local configuration bit stream into the shadow register of the configuration sub-block; S4. At the switching point, the configuration atom in the shadow register is activated, and the activation of the configuration atom simultaneously updates the precision mode of the multiply-accumulate unit and the array partitioning topology of the programmable interconnect structure. S5. Start the calculation of the next operator in the unfreezing phase, so that the switching between the current operator and the next operator is completed within a predetermined number of cycles and the calculation pipeline is not interrupted.

[0023] Furthermore, the generation of the local configuration bitstream includes: determining the independent / joined role of the multiply-accumulate subunit and the on / off state of the shift-add tree based on the operator precision selection; determining the on / off state of the switch nodes in the segmented switch box based on the operator shape; the configuration of precision and topology takes effect atomically at the same switching point.

[0024] Furthermore, the operator sequence includes at least two of the following: embedding layer operators, attention operators, feedforward network operators, expert hybrid operators, and sparse operators. The topology and precision switching between the operators are achieved through dynamic reconfiguration.

[0025] Furthermore, the gating selection of the expert hybrid operator is performed by a programmable logic array, and only the subarrays corresponding to the activated experts participate in the calculation, while the subarray configurations of the inactive experts are not written.

[0026] An artificial intelligence acceleration system includes a host processor, a memory, and the aforementioned dynamically reconfigurable multiply-accumulate array device; the host processor issues operator sequence configuration instructions to the dynamic reconfiguration controller, and the memory stores the operator sequence and weight data.

[0027] An electronic device includes the aforementioned dynamically reconfigurable multiply-accumulate array device, or includes the aforementioned artificial intelligence acceleration system; the electronic device is a server, an edge computing device, or a terminal device.

[0028] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described dynamic reconfiguration control method.

[0029] Compared with the prior art, the beneficial effects of the present invention are: (1) This invention heterogeneously integrates a programmable logic array and a MAC multiply-accumulate array. The programmable logic is responsible for edge control logic such as indexing and gating, while the MAC array is responsible for high-density matrix operations. This avoids the low energy efficiency of using LUTs for multiplication in FPGAs and makes up for the shortcomings of traditional NPUs, such as being fixed and having poor adaptability. At the same time, it achieves the computing energy efficiency of ASICs and the flexible adaptability of programmable devices.

[0030] (2) By adopting block mask writing, segmented switching boxes and dual-phase scheduling, the configuration is updated only for the sub-blocks that need to be changed, which greatly reduces the amount of configuration data; the on-chip controller pre-generates the configuration, and the total switching cycle is less than 100 clock cycles, achieving sub-microsecond reconfiguration. The unreconfigured area can continue to be calculated, the operator switching does not interrupt the pipeline, and the reconfiguration overhead is much smaller than the operator execution interval.

[0031] (3) This invention uses a segmented switch box to dynamically divide the physical MAC array into various topologies such as full array, multi-subarray, and unaligned sub-blocks, adapting to various operators such as Embedding, Attention, FFN, and MoE, and eliminating the filling waste of matrix operations.

[0032] (4) INT4 sub-units are combined into INT8 logic units by splicing them together in 2×2. Precision mode switching and array topology changes take effect atomically at the same switching point. It supports mixed precision operation within a single array, eliminating the need to set up two independent precision arrays, avoiding hardware resource waste, adapting to large mixed precision models, and ensuring no performance drop-off during precision switching.

[0033] (5) The interconnect layer uses block-level Tag index to filter zero values. Zero data blocks do not enter the MAC calculation path, skipping invalid reads, writes and operations; it can also adjust the array topology according to sparsity to reduce memory access bandwidth consumption and improve the actual processing efficiency of sparse operators.

[0034] (6) Fully supports Embedding, Attention, FFN, MoE, and sparse operators; in the MoE scenario, only the subarray corresponding to the activation expert is reconfigured, further reducing the reconfiguration overhead. The core mechanism is not bound to the array size, accuracy, or switching granularity, and can be flexibly extended to edge chips or server multi-cluster large arrays. Attached Figure Description

[0035] Figure 1 This is a schematic diagram of the overall architecture of this chip; Figure 2 This is a schematic diagram of the computation-sensing symmetric interconnect structure in this invention; Figure 3 A schematic diagram of writing configuration memory for block masking; Figure 4 This is a schematic diagram of the segmentation process for a segmented switch box array; Figure 5 This is a flowchart illustrating the two-phase timing scheduling process. Figure 6 A flowchart illustrating the process of precision-topology collaborative reconstruction; Figure 7 This is a schematic diagram of the sparse routing and tag indexing process; Figure 8 Create a flowchart for the model computation level; Figure 9 A schematic diagram illustrating the derivation of reconfiguration delay (specific flow → number of cycles) or data flow mode pair; In the diagram: 100, PLB array; 200, MAC array; 300, programmable interconnect; 400, dynamic reconfiguration controller. Detailed Implementation

[0036] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0037] Example 1: Overall Chip Architecture like Figure 1 As shown, the embedded programmable logic chip of the present invention mainly comprises four parts: PLB array 100, MAC array 200, programmable interconnect 300, and dynamic reconfiguration controller 400.

[0038] PLB array 100: Composed of several programmable logic blocks, it undertakes operator edge logic, such as address index generation, sparse tag parsing, MoE expert gating comparison, and unaligned sub-block boundary calculation, and completes bit-level control logic that is inconvenient to implement in MAC array 200.

[0039] MAC Array 200: A large number of MAC units arranged in rows and columns. Each MAC unit contains a multiply-accumulate unit and a local register file, supporting INT4 and INT8 multiprecision operations.

[0040] Programmable Interconnect 300: Completes signal interconnection between PLB array 100 and MAC array 200; includes segmented switch box and computational sensing asymmetric wiring resources; equipped with configuration memory, which is divided into rows and columns and supports block mask write operation.

[0041] Dynamic reconfiguration controller 400: Receives operator sequences and configuration instructions from the host, and performs look-ahead prefetching, topology generation, two-phase scheduling, and mask write engine control.

[0042] The chip can be integrated into the AI-accelerated SoC or used as a standalone coprocessor to interact with the host via AXI and PCIe standard interfaces.

[0043] Example 2: Computation-Sensitive Asymmetric Interconnect like Figure 2As shown, considering the locality of data flow in large model matrix operations, the frequency of data interaction between adjacent MAC units within an operator is much higher than that of long-distance transmission across arrays. First, data flow statistics are performed on the target operator set (Llama series models QKV, FFN, and Attention operators) to obtain a hotspot matrix of data transfer frequency between various logical locations. Based on this hotspot matrix, wiring resources are allocated: 70% of wiring resources are allocated to local short segments, and 30% are allocated to a few high-traffic, long-distance hotspot paths. Physically, this manifests as a higher density of short segments within the switch box, while long segments only cover a few cross-area aggregation and weighted broadcast paths. This design tilts interconnect resources towards high-frequency access paths, reducing latency and power consumption caused by long lines.

[0044] Example 3: Block Mask Write to Configuration Memory like Figure 3 As shown, the configuration memory is divided into multiple configuration sub-blocks according to the array rows and columns. For example, a group of configuration sub-blocks corresponds to 4 rows × 4 columns of MAC units. Each configuration sub-block is equipped with an independent write mask. The write command issued by the dynamic reconfiguration controller 400 carries the sub-block address, write mask, and local configuration bit stream. The hardware only performs write updates on the sub-blocks selected by the write mask. Sub-blocks not selected by the mask retain their original configuration, and the corresponding MAC units can continue to perform calculations. Optionally, a shadow register can be added. The new configuration is first written to the shadow register and takes effect uniformly at the global switching point, ensuring the atomicity of configuration switching within the same sub-array. Reconfiguration only updates the changed sub-blocks, reducing the configuration bit stream from the entire array size to the KB level. Reconfiguration and calculation are physically isolated, supporting seamless pipeline switching.

[0045] Example 4: Segmented Switch Box Array Segmentation like Figure 4 As shown, segmented switch boxes (SSBs) are arranged at the row / column granularity along the 200-row and column directions of the MAC array. The programmable switch nodes inside the switch boxes can connect or disconnect the interconnection paths between adjacent sub-blocks. Based on the on / off combinations of the switch nodes, the physical array can dynamically switch between three topologies: Full array pulsation mode: All switch nodes are turned on, and the entire 32×32 array is treated as a single pulsation array, which is suitable for FFN large GEMM operations.

[0046] Subarray parallel mode: Disconnect the switch at the specified row and column position to divide into multiple 16×16 independent subarrays for parallel computation, which is suitable for multi-head attention and MoE multi-expert parallel scenarios.

[0047] Unaligned sub-block mode: Local switch combinations generate irregular sub-blocks, adapting to irregular operators such as the MoE dynamic activation expert. The topology is automatically generated by the dynamic reconfiguration controller 400 based on the operator shape. Each split only modifies a small number of switch configuration bits, resulting in extremely low switching latency.

[0048] Example 5: Dynamic Reconfiguration Controller 400 and Dual-Phase Scheduling like Figure 5 The Dynamic Reconfiguration Controller 400 includes a look-ahead prefetch queue, a topology generator, a two-phase scheduler, a mask write engine, and a status register.

[0049] Workflow: The host sends out operator sequences and stores them in a look-ahead prefetch queue. The queue depth can cache multiple operators. While operator N is running, the controller prepares the configuration information for operators N+1 and N+2 in advance.

[0050] The topology generator parses the operator shape, precision, and sparsity, calculates the on / off state of switch boxes, data flow direction, and precision mode, and only generates the local configuration bit stream corresponding to the affected sub-blocks.

[0051] Two-phase scheduling: Phase freezing occurs when operator N reaches the end of a few cycles, triggering a freeze signal to empty the pipeline and write the new configuration to the shadow register. Switching occurs within one clock cycle, atomically switching the shadow register to the working configuration. Phase unfreezing immediately starts the next operator pipeline filling. The freeze, switch, and unfreeze processes overlap with the original operator calculations, ensuring the pipeline remains uninterrupted macroscopically.

[0052] The masked write engine performs block masked writes; after reconfiguration is complete, it reports the status to the host. Under a 1GHz clock frequency, the total switching cycle of the operator is less than 100 cycles, achieving sub-microsecond reconfiguration.

[0053] Example 6: Precision Topology Cooperative Reconstruction like Figure 6 The basic operation unit of the array is the INT4 multiply-accumulate sub-unit. The sub-unit has two working modes: independent mode, which directly serves as an INT4 MAC; and splicing mode, 2×2 INT4 sub-units are combined with a shift-add tree to form an INT8 logic MAC unit.

[0054] Mathematical Implementation Logic: Let A = a116 + a0, B = b116 + b0; A × B = a0b0 + (a0b1 + a1b0) × 16 + a1b1 × 256; Four INT4 sub-units (2×2) calculate the four-term product respectively, and the output results are shifted by ×1, ×16, ×16, and ×256 respectively, and fed into the shift-addition tree for summation to obtain the complete INT8 multiplication result. Array logic size changes synchronously: The physical array is a 32×32 INT4 sub-unit array; in independent mode, the logic array is 32×32; after splicing to INT8 mode, the logic array becomes 16×16. The controller simultaneously generates two sets of configurations: precision mode configuration (sub-unit independence / sponging, shift-addition tree on / off) and topology configuration (switch box splitting, data flow direction). Both configurations take effect atomically at the same switching point, avoiding intermediate states. It also supports mixed precision mode: relying on block mask writing, different sub-blocks of the array can be configured with INT4 independent mode and INT8 splicing mode respectively, to adapt to mixed precision operators.

[0055] Example 7: Hardware-level Tag Sparse Routing like Figure 7 As shown, the sparse matrix is ​​appended with non-zero tag bitmaps in 4×4 block granularity; the tag bitmaps are parsed by PLB array 100 to generate address indexes. Tag information is read at the interconnect entry point; zero-block data packets are marked as empty packets and are no longer sent to the MAC array 200 data path; non-zero data packets undergo dynamic routing. The interconnect bandwidth released by zero packets is used for effective data transmission. The controller can also adjust the array topology synchronously based on operator sparsity; when sparsity is high, it is divided into smaller subarrays; when sparsity is low, it restores a large-pulsation array. Zero values ​​do not occupy MAC calculation cycles or interconnect bandwidth, reducing memory access overhead and improving the actual throughput of sparse operators.

[0056] Example 8: Complete Workflow of Large Language Model Operators like Figure 8 As shown, the complete inference process for a single token in a Llama-type model is as follows: Embedding layer: table lookup and memory access intensive, PLB array 100 completes the index lookup logic, and MAC array 200 completes the post-lookup processing with the smallest subarray.

[0057] Attention QKV projection: Large-size GEMM, using full array systolic mode, weights reside in MAC local registers, activating streaming input.

[0058] Attention score calculation: Batch GEMV and small matrix operations are performed, and the calculation is divided into multiple 16×16 sub-arrays for parallel processing to achieve multi-head parallel computing.

[0059] FFN feedforward network projection: large GEMM, full array pulsation mode; nonlinear and quantization operations are handled by PLB array 100.

[0060] MoE Expert Hybrid Layer: PLB array 100 performs gating comparison to select Topk to activate experts; only the subarrays corresponding to the activated experts are opened, and the subarrays of unactivated experts are left idle.

[0061] Sparse network layer: Tag sparse routing mode is enabled to filter zero blocks. All topology and precision switching between operators is completed in sub-microseconds by the dynamic reconfiguration controller 400.

[0062] Example 9: Multi-level data flow mode and hardware / software collaboration like Figure 9 As shown, the hardware supports three types of data flow modes: Pulsating mode (fixed weight): The weight is stored in the MAC local register, and the input is activated column by column, with partial and row by row accumulation. It is suitable for large GEMMs and has the lowest memory access overhead. Broadcast reduction mode (fixed input): The same input is broadcast to the entire row of MAC, and each row is multiplied and added independently before reduction, which is suitable for GEMV and batch small matrices; Subarray parallel mode: Multiple subarrays run different operators independently, adapting to multi-head attention and multi-expert MoE.

[0063] Two-level mapping and coordination between software and hardware: Compilation phase: Operator graph is converted into data flow mode selection, initial topology / precision / sparse configuration, and local configuration instruction sequence is generated and sent to the hardware look-ahead queue; During runtime: The dynamic reconfiguration controller executes scheduling at the granularity of 400 operators; when encountering runtime changes such as dynamic sparsity and dynamic expert selection, it triggers local mask write reconfiguration. The software layer only issues operator-level instructions and does not need to be aware of the underlying bitstream reconfiguration details, allowing seamless integration with existing NN compiler runtimes.

[0064] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. An embedded programmable logic chip capable of dynamically reconfigurable MAC arrays, characterized in that: Includes PLB array (100): composed of multiple programmable logic blocks, used to implement edge logic, and bit-level or control logic that is inconvenient to implement in MAC array (200); MAC array (200): Consists of MAC units arranged in columns. Each MAC unit contains at least one multiply-accumulate unit and local registers, supporting INT4 or INT8 operation modes. Programmable interconnect (300): connects the PLB array (100) and the MAC array (200), including segmented switch boxes and computing-aware symmetrical wiring resources; Configuration memory: associated with a programmable interconnect (300), organized in blocks by or column, with block mask write capability; Dynamic reconfiguration controller (400): Receives calculation sequences and configuration instructions from the host, and performs look-ahead prefetching, topology formation, and two-phase scheduling.

2. The embedded programmable logic chip for dynamically reconfigurable MAC array according to claim 1, characterized in that, The configuration memory includes multiple configuration sub-blocks, each configuration sub-block corresponding to at least one write mask; the dynamic reconfiguration controller (400) sends a write instruction containing the sub-block address, write mask and local configuration bit stream to the configuration memory, and only performs writing on the configuration sub-block indicated by the write mask. The multiply-accumulate unit corresponding to the unselected configuration sub-block continues to perform calculation during the writing process.

3. The embedded programmable logic chip for dynamically reconfigurable MAC array according to claim 1, characterized in that, The programmable interconnect (300) is a computation-aware asymmetric interconnect: based on the data flow locality statistics of the target operator set, the interconnect wiring resources are allocated to local short segments and long-distance segments according to a preset ratio, wherein the resource ratio of local short segments is higher than that of long-distance segments.

4. The embedded programmable logic chip for dynamically reconfigurable MAC array according to claim 3, characterized in that, The programmable interconnect (300) includes segmented switch boxes arranged at a predetermined granularity along the row and column directions of the multiply-accumulate array. Each segmented switch box contains a programmable switch node that turns on or off the interconnection of adjacent sub-blocks to divide the multiply-accumulate array into at least one of a full-array pulsating topology, a parallel topology of multiple independent sub-arrays, or a non-aligned sub-block topology.

5. The embedded programmable logic chip for dynamically reconfigurable MAC array according to claim 1, characterized in that, The dynamic reconfiguration controller (400) includes: The lookahead prefetch queue is used to cache configuration instructions for multiple operators; A topology generator is used to generate switch node states and data flow direction configurations based on operator shape and precision. A dual-phase scheduler is used to generate freeze signals, switch point signals, and thaw signals, allowing configuration writing and calculation to overlap. And a mask write engine for performing mask writing of the local configuration bitstream.

6. The embedded programmable logic chip for dynamically reconfigurable MAC array according to claim 5, characterized in that, The dual-phase scheduler generates the freeze signal to drain the pipeline within the last predetermined number of cycles of the current operator execution, completes the atomic switch from the shadow register to the effective configuration within one cycle, and then generates the unfreeze signal to start the next operator. The total number of cycles for a single switch is less than 100 clock cycles.

7. The embedded programmable logic AI acceleration method for dynamically reconfigurable MAC arrays according to claim 1, applied to the embedded programmable logic chip according to any one of claims 1-6, characterized in that, Includes the following steps: S1. Receive the configuration instructions for the current operator and the next operator in the operator sequence; S2. During the execution of the current operator, a local configuration bit stream for the configuration memory is generated according to the shape, precision and sparsity of the next operator. The local configuration bit stream contains only the configuration sub-blocks selected by the write mask. S3. Freeze the phase before the current operator finishes execution, and write the local configuration bit stream into the shadow register of the configuration sub-block; S4. At the switching point, the configuration atom in the shadow register is activated, and the activation of the configuration atom simultaneously updates the precision mode of the multiply-accumulate unit and the array partitioning topology of the programmable interconnect (300) structure; S5. Start the calculation of the next operator in the unfreezing phase, so that the switching between the current operator and the next operator is completed within a predetermined number of cycles and the calculation pipeline is not interrupted.

8. The embedded programmable logic AI acceleration method for dynamically reconfigurable MAC arrays according to claim 7, characterized in that, The generation of the local configuration bitstream includes: determining the independent or spliced ​​role of the multiply-accumulate subunit and the on / off state of the shift-add tree based on the operator precision selection; determining the on / off state of the switch nodes in the segmented switch box based on the operator shape; the configuration of precision and topology takes effect atomically at the same switching point.

9. The embedded programmable logic AI acceleration method for dynamically reconfigurable MAC arrays according to claim 7, characterized in that, The operator sequence includes at least two of the following: embedding layer operators, attention operators, feedforward network operators, expert hybrid operators, and sparse operators. The topology and precision switching between the operators are achieved through dynamic reconfiguration.

10. The embedded programmable logic AI acceleration method for dynamically reconfigurable MAC arrays according to claim 9, characterized in that: The gating selection of the expert hybrid operator is executed by a programmable logic array. Only the subarrays corresponding to the activated experts participate in the calculation, and the subarray configurations of the inactive experts are not written.