Method and system for processing polynomial data

The hardware-accelerated single-instruction multi-threaded multi-core processor chip solution solves the problem of matching the number of processor cores under different polynomial lengths, achieving high-efficiency polynomial operation performance and simplified software programming, while avoiding complex parallel computing and synchronization overhead.

CN117827436BActive Publication Date: 2026-11-27ZHEJIANG ANT MISUAN TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311739533.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-15
Publication Date
2026-11-27
Estimated Expiration
2043-12-15

AI Technical Summary

Technical Problem

Existing accelerator chips cannot flexibly and efficiently match the number of processor cores to accommodate different polynomial lengths when processing polynomial operations, resulting in an imbalance between computing performance and portability performance, and large overhead in complex parallel computing programming and software synchronization.

Method used

The hardware-accelerated single-instruction multi-threaded multi-core processor chip solution generates the processing program and configures the acceleration chip through the main processor, selects an appropriate number of processor cores to perform the operation, and automatically completes data segmentation and synchronization through hardware to ensure high performance under different polynomial lengths.

Benefits of technology

It achieves high-performance computing acceleration for chips with different polynomial lengths, simplifies software programming, avoids complex parallel computing programming and software synchronization overhead, and improves the utilization efficiency of processor cores.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117827436B_ABST
    Figure CN117827436B_ABST
Patent Text Reader

Abstract

The embodiment of the present specification provides a processing method and system for polynomial data, the method comprising: a main processor generates a processing program for a target polynomial, and performs a configuration operation on an acceleration chip, wherein the acceleration chip comprises a first number of processor cores dedicated to performing polynomial operations; the configuration operation comprises: selecting a second number of processor cores from the first number of processor cores, and setting the second number of processor cores to execute the processing program; each target processor core in the second number of processor cores performs the following processing: moving target subset data corresponding to the target processor core from off-chip memory storing polynomial data of the target polynomial to on-chip memory; the target subset data is a part of the polynomial data; performing operation operation on the target subset data according to the processing program. Different polynomial lengths can be matched with the number of PEs flexibly and efficiently.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to one or more embodiments in the field of computers, and more particularly to methods and systems for processing polynomial data. Background Technology

[0002] In mathematics, the sum of several monomials is called a polynomial. Polynomial operations are among the most fundamental operations in mathematics. For example, in the field of privacy computing, fully homomorphic encryption (FHE) is often used to protect private data, which involves a large number of polynomial operations.

[0003] Currently, accelerator chips are often used to perform polynomial operations to improve efficiency. Inside the accelerator chip, processing elements (PEs) perform polynomial calculations, while load and store units (LSs) handle polynomial transfer. The object of polynomial operations is the target polynomial, and its polynomial length N varies depending on the scenario and security requirements. To achieve a balance between computational and transfer performance, the number of PEs used needs to be flexibly matched to the polynomial length N, thus ensuring the efficient use of PEs within the accelerator chip. Current accelerator chips primarily employ single-core and multi-core architectures, neither of which can flexibly and efficiently match the number of PEs to different polynomial lengths. Summary of the Invention

[0004] This specification describes one or more embodiments of a method and system for processing polynomial data, which can flexibly and efficiently match the number of PEs for different polynomial lengths.

[0005] Firstly, a method for processing polynomial data is provided, the method including:

[0006] The main processor performs a target polynomial generation processing program and configures an acceleration chip, which includes a first number of processor cores dedicated to performing polynomial operations; the configuration operation includes selecting a second number of processor cores from the first number of processor cores and setting them to execute the processing program.

[0007] Each of the second number of target processor cores performs the following processing:

[0008] From the off-chip memory storing the polynomial data of the target polynomial, the target subset data corresponding to the target processor core is moved to the on-chip memory; the target subset data is a part of the polynomial data.

[0009] For the target subset of data, perform data operations according to the processing program.

[0010] In one possible implementation, the method further includes: the main processor loading the compiled program instructions of the processing program into a first address in the target memory; the configuration operation includes setting the program counter of each of the second number of processor cores to point to the first address.

[0011] Furthermore, the target memory is an off-chip memory, or the memory of the acceleration chip.

[0012] In one possible implementation, the configuration operation further includes assigning a number to each of the second number of processor cores; the step of moving the target subset data corresponding to the target processor core to on-chip memory includes:

[0013] The storage location of the target subset data is located through a hardware module based on the target processor core's own serial number.

[0014] In one possible implementation, the polynomial length of the target polynomial is N, and the second number is determined based on N.

[0015] In one possible implementation, the target processor core includes a third number of processing units, each of which is responsible for performing the computational operation on a portion of the target subset of data.

[0016] In one possible implementation, the polynomial data is divided into a second number of subsets of data, and the target subset of data is one subset of the second number of subsets of data.

[0017] Furthermore, the polynomial data is divided into several rows and columns, and the data in the preset rows constitute a subset of data.

[0018] In one possible implementation, the arithmetic operation includes at least one of the following operations:

[0019] Modular addition and subtraction, modular multiplication, number-theoretic transform (NTT), and automorphism.

[0020] In one possible implementation, the target polynomial is a combination of a first polynomial and a second polynomial, the polynomial data includes a first data set of the first polynomial and a second data set of the second polynomial, the operation includes modulo addition and subtraction of the first and second polynomials, and the target subset data is a portion of the first data set and a portion of the second data set.

[0021] In one possible implementation, each target processor core further performs the following processing:

[0022] Write the sub-operation results obtained from the arithmetic operation to the on-chip memory;

[0023] The results of suboperations are moved from on-chip memory to off-chip memory, and these suboperation results are used to combine them into an operation result for the polynomial data.

[0024] Secondly, a system for processing polynomial data is provided, the system comprising:

[0025] The generation unit, located on the main processor, is used to generate a processing program for the target polynomial.

[0026] A configuration unit, located in the main processor, is used to perform configuration operations on the acceleration chip, which includes a first number of processor cores dedicated to performing polynomial operations; the configuration operation includes selecting a second number of processor cores from the first number of processor cores and setting them to execute the processing program generated by the generation unit.

[0027] A transfer unit, disposed in each of the second number of processor cores, is configured to perform the following process: transfer target subset data corresponding to the target processor core from off-chip memory storing polynomial data of the target polynomial to on-chip memory; the target subset data is a part of the polynomial data.

[0028] The processing unit, located in each of the second number of processor cores, is used to perform the following processing: for the target subset of data moved by the transfer unit, performing data processing operations according to the processing program.

[0029] Thirdly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of the first aspect.

[0030] Fourthly, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and the processor executes the executable code to implement the method of the first aspect.

[0031] The method and system provided in the embodiments of this specification first involve the main processor generating a processing program for the target polynomial and configuring the acceleration chip, which includes a first number of processor cores dedicated to performing polynomial operations. The configuration operation includes selecting a second number of processor cores from the first number of processor cores and setting them to execute the processing program. Then, each target processor core in the second number of processor cores performs the following processing: moving target subset data corresponding to the target processor core from off-chip memory storing the polynomial data of the target polynomial to on-chip memory; the target subset data is a part of the polynomial data; and performing data operations on the target subset data according to the processing program. As can be seen from the above, in the embodiments of this specification, the software can be configured to use several processor cores to process the target polynomial, setting these processor cores to point to the same processing program. The hardware automatically completes the data segmentation of a single polynomial according to the configuration and then executes the same program on different data. This scheme can configure different numbers of PEs to complete calculations according to different polynomial lengths N, ensuring that the acceleration chip has high performance under different polynomial lengths. Moreover, since data splitting and usage are automatically handled by hardware, the software is still programmed only for a single polynomial, thus avoiding complex parallel computing programming and the synchronization overhead between different processor cores. This allows for flexible and efficient matching of the number of polynomials (PEs) for different polynomial lengths. Attached Figure Description

[0032] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0033] Figure 1 This is a schematic diagram illustrating an implementation scenario of one embodiment disclosed in this specification;

[0034] Figure 2 This is a schematic diagram illustrating an implementation scenario of another embodiment disclosed in this specification;

[0035] Figure 3 This is a schematic diagram illustrating an implementation scenario of another embodiment disclosed in this specification;

[0036] Figure 4 A flowchart of a method for processing polynomial data according to one embodiment is shown;

[0037] Figure 5 A schematic diagram illustrating the relationship between a process and a processor core according to one embodiment is shown.

[0038] Figure 6 This diagram illustrates a polynomial data partitioning scheme according to one embodiment.

[0039] Figure 7 This diagram illustrates a subset data partitioning scheme according to one embodiment.

[0040] Figure 8 A schematic block diagram of a system for processing polynomial data according to one embodiment is shown. Detailed Implementation

[0041] The solution provided in this specification will now be described with reference to the accompanying drawings.

[0042] Figure 1 This is a schematic diagram illustrating an implementation scenario of one embodiment disclosed in this specification. This implementation scenario relates to the processing of polynomial data, and illustrates the pipelined operation method employed by the acceleration chip. (Refer to...) Figure 1 Accelerator chip tasks can be divided into two categories: computation tasks and data transfer tasks. The typical workflow involves first moving polynomial data from off-chip memory to on-chip memory (a process called polynomial read), then using PEs (Programmers and Processors) to perform various computational operations (a process called polynomial operation), and finally moving the polynomial data back from on-chip memory to off-chip memory (a process called polynomial write). Off-chip memory can be understood as memory outside the chip, such as high-bandwidth memory (HBM) or off-chip double-rate (DDR) synchronous dynamic random access memory. On-chip memory can be understood as memory on top of the chip, such as on-chip static random-access memory (SRAM). During operation, to ensure chip performance, a pipelining approach is typically used for data read-data operation-data write. The data access time and PE operation time should be kept as consistent as possible, requiring the hardware to allocate different numbers of PEs for different polynomial lengths N. At the same time, we hope to implement this function in a simpler software programming way.

[0043] Typical accelerator chips primarily employ single-core and multi-core architectures, neither of which can flexibly and efficiently match the number of computational units (PEs) to different polynomial lengths. In a single-core architecture, the accelerator chip has one processor core with multiple PEs (e.g., 2048 PEs). All PEs are simultaneously scheduled for a specific polynomial computation task, resulting in good performance when N is large. However, when N is small, limitations in memory transfer lead to longer idle times for PEs, thus reducing performance. In a multi-core architecture, the accelerator chip has multiple processor cores, each with multiple PEs (e.g., 16 processor cores with 128 PEs each, or 14 processor cores with 512 PEs each). Theoretically, when N is large, software could be written to perform parallel computations, distributing the polynomial computation task across different cores simultaneously. However, this increases software programming complexity and synchronization overhead, leading to performance degradation. Therefore, the common practice is to process one polynomial per core. Larger N requires larger on-chip memory and higher transfer bandwidth between on-chip and off-chip memory, which also limits the performance of the accelerator chip.

[0044] This specification presents an embodiment of a single-instruction multi-threaded (SIMT) multi-core processor chip solution for hardware acceleration. This chip, also known as an acceleration chip, employs a multi-core architecture. The chip can have 2... x (For example, 16) processor cores, each processor core can have 2 y (For example, 128) PEs. The software can be pre-configured to use a certain number of cores to process the current polynomial (e.g., supporting 2...). z The hardware automatically partitions the data for a single polynomial based on its configuration, then executes the same program on each piece of data. This approach allows for different numbers of program counters (PEs) to be configured to perform calculations based on different polynomial lengths N, thus ensuring high chip performance across different polynomial lengths. Furthermore, since data partitioning and usage are handled automatically by the hardware, the software is still programmed only for a single polynomial, avoiding complex parallel computing programming and the synchronization overhead between different cores.

[0045] Figure 2 This is a schematic diagram illustrating an implementation scenario of another embodiment disclosed in this specification. This implementation scenario relates to processing polynomial data, and an accelerated chip with a multi-core architecture is shown. (Refer to...) Figure 2The acceleration chip includes 16 processor cores, each containing 128 Processor Entities (PEs). Each processor core corresponds to a PE Group (PEG), which is the organization of the PEs. One PEG is a processing unit of one processor core; for example, PEG 0 corresponds to one processor core, PEG 1 to another, and so on, with PEG 15 corresponding to yet another processor core. Each PEG also corresponds to a PE scheduler and a PE direct memory access (DMA) controller.

[0046] Figure 3 This is a schematic diagram illustrating an implementation scenario of another embodiment disclosed in this specification. This implementation scenario relates to the processing of polynomial data, where an internal organization within a PEG is shown. (Refer to...) Figure 3 ,by Figure 2Taking PEG 15 as an example, 16 PE blocks (PE Blocks, PEBs) make up one PEG, and 8 PEs make up one PEB. It can be understood that each PEG in the accelerator chip can have the same organizational structure. The accelerator chip has 16 PEGs, each PEG includes 16 PEBs, and each PEB includes 8 PEs, resulting in a total of 256 PEBs and 2048 PEs in the accelerator chip. The PEBs in different PEGs can be numbered consecutively starting from 0. For example, the PEBs in PEG 0 are numbered PEB 0, ..., PEB 15, and the PEBs in PEG 15 are numbered PEB 240, ..., PEB 255. Alternatively, the PEBs in different PEGs can be numbered consecutively starting from 0 individually. For example, the PEBs in PEG 0 are numbered #PEB 0, ..., #PEB 15, and the PEBs in PEG 15 are also numbered #PEB 0, ..., #PEB 15. PEs in different PEGs and different PEBs can be numbered consecutively starting from 0. For example, PEs in #PEB 0 of PEG 0 are numbered PE 0, ..., PE 7, and PEs in #PEB 0 of PEG 15 are numbered PE 1920, ..., PE 1927. PEs in different PEGs and different PEBs can also be numbered consecutively starting from 0. For example, PEs in #PEB 0 of PEG 0 are numbered #PE 0, ..., #PE 7, and PEs in #PEB 0 of PEG 15 are also numbered #PE 0, ..., #PE 7. In the embodiments of this specification, each PE includes a vector register file (VRF) for storing data and an accelerator (ACC) for performing operations. The ACC in each PE performs operations on the data in its VRF, and different VRFs can store different data.

[0047] It should be noted that the specific values ​​mentioned above are only illustrative examples. In practice, other values ​​can be adopted as needed. For example, the number of processor cores in the acceleration chip and the number of PEs contained in a single processor core can be flexibly selected.

[0048] Figure 4 This diagram illustrates a method for processing polynomial data according to one embodiment, which can be based on... Figures 1 to 3 The implementation scenario is shown. For example... Figure 4As shown, the method for processing polynomial data in this embodiment includes the following steps: Step 41, the main processor generates a processing program for the target polynomial and configures the acceleration chip, the acceleration chip including a first number of processor cores dedicated to performing polynomial operations; the configuration operation includes selecting a second number of processor cores from the first number of processor cores and setting them to execute the processing program; Step 42, each target processor core in the second number of processor cores performs the following processing: moving the target subset data corresponding to the target processor core from the off-chip memory storing the polynomial data of the target polynomial to the on-chip memory; the target subset data is a part of the polynomial data; for the target subset data, performing data operation according to the processing program. The specific execution method of each of the above steps is described below.

[0049] First, in step 41, the main processor generates a processing program for the target polynomial and configures the acceleration chip, which includes a first number of processor cores dedicated to performing polynomial operations. The configuration operation includes selecting a second number of processor cores from the first number of processor cores and setting them to execute the processing program. It is understood that the second number is less than or equal to the first number; that is, the number of processor cores in the acceleration chip that execute the processing program can be flexibly selected, for example, selecting one processor core, two processor cores, or all processor cores in the acceleration chip.

[0050] In the embodiments described in this specification, the main processor can be implemented using a general-purpose processing unit, such as a central processing unit (CPU). The acceleration chip can be used to perform polynomial operations in fully homomorphic encryption (FHE), so the acceleration chip can be called a homomorphic processing unit (HPU) chip.

[0051] The data processed by the acceleration chip can be a polynomial decomposed using the remainder number system (RNS). The length N of the polynomial varies depending on the scenario and security requirements. Typically, a common value for N is N=2. x The value of x can be 10, 11, 12, 13, 14, 15, or 16. In the embodiments described in this specification, the number of processor cores executing the processing program in the acceleration chip can be flexibly configured according to the specific value of N, while the processing program itself does not need to consider the number of processor cores.

[0052] In one example, the method further includes: the main processor loading the compiled program instructions of the processor into a first address in the target memory; the configuration operation includes setting the program counter (PC) of each of the second number of processor cores to point to the first address.

[0053] In this example, SIMT is achieved by configuring the program counter so that a second number of processor cores execute the same program.

[0054] Furthermore, the target memory is an off-chip memory, or the memory of the acceleration chip.

[0055] Figure 5 A schematic diagram illustrating the relationship between a processor program and a processor core according to one embodiment is shown. (Refer to...) Figure 5 The program instructions compiled by the processor are loaded at the first address in the off-chip memory. If the PC of PEG 0 and PEG 15 is set to point to the first address, then each PE included in PEG 0 and PEG 15 will execute the above program instructions.

[0056] In one example, the configuration operation further includes assigning a number to each of the second number of processor cores.

[0057] In this example, the number mentioned above can be an ID inherent to the hardware itself, or a number reassigned by the software.

[0058] In one example, the polynomial length of the target polynomial is N, and the second number is determined based on N.

[0059] This example involves software scheduling; the hardware does not restrict how the software specifies it. Generally, the larger the polynomial length N, the more secondary processor cores are specified.

[0060] In the embodiments described in this specification, the software performs programming operations on the target polynomial and generates a processing program. The software specifies which processor cores will perform the calculation of this target polynomial, and the software will direct the program counter of the specified processor cores to the generated processing program. The software implementation is relatively simple.

[0061] Then, in step 42, each of the second number of processor cores performs the following processing: moving the target subset data corresponding to the target processor core from the off-chip memory storing the polynomial data of the target polynomial to the on-chip memory; the target subset data is a part of the polynomial data; and performing data operations on the target subset data according to the processing program. It can be understood that each target processor core obtains a sub-operation result for the target polynomial, and combining the sub-operation results yields the operation result for the target polynomial.

[0062] In one example, moving the target subset data corresponding to the target processor core to on-chip memory includes:

[0063] Based on the target processor core's own serial number, the storage location of the target subset data is located through a hardware module.

[0064] For example, each target processor core, based on its ID, is determined by the hardware to process which part of the polynomial. Taking a polynomial computation with 16 processor cores as an example, the processor core with ID=0 processes the first 1 / 16 of the polynomial data, the processor core with ID=15 processes the sixteenth 1 / 16 of the polynomial data. The data segmentation of the polynomial is pre-designed within the hardware. The hardware automatically calculates which segment of data it needs to process based on the polynomial length, the number of processor cores to process the polynomial, and its own processor core number.

[0065] In one example, the target processor core includes a third number of processing units, each of which is responsible for performing the computational operation on a portion of the target subset of data.

[0066] In one example, the polynomial data is divided into a second number of subsets of data, and the target subset of data is one subset of the second number of subsets of data.

[0067] Furthermore, the polynomial data is divided into several rows and columns, and the data in the preset rows constitutes a subset of data.

[0068] Figure 6 A schematic diagram of polynomial data partitioning according to one embodiment is shown. (Refer to...) Figure 6Polynomial data is split into several rows and columns. For example, using the square root method, when the polynomial length is 65536, the polynomial data can be split into 256 rows * 256 columns. Each data point can be identified by its row and column numbers, with row and column numbers ranging from 0 to 255. Specifically, "0,0" identifies data with row and column number 0, and "0,255" identifies data with row and column number 255. When all 16 processor cores of the accelerator chip are selected to execute the program, each set of 16 rows can be assigned to one processor core. Data with row numbers 0 to 15 is assigned to PEG 0, and so on, with data with row numbers 240 to 255 assigned to PEG 15.

[0069] Figure 7 This diagram illustrates a subset data partitioning scheme according to one embodiment. (Refer to...) Figure 7 Taking PEG 15 as an example, the subset of data corresponding to each processor core can be further split into multiple PEs by column. For example, the VRF of PE 1920 stores data with row numbers 240 to 255 and column numbers 0 to 1, ... the VRF of PE 1927 stores data with row numbers 240 to 255 and column numbers 14 to 15, ... the VRF of PE 2040 stores data with row numbers 240 to 255 and column numbers 240 to 241, ... the VRF of PE 2047 stores data with row numbers 240 to 255 and column numbers 254 to 255.

[0070] In one example, the operation includes at least one of the following operations:

[0071] Modular addition and subtraction, modular multiplication, number theory transformations (NTT), and automorphism.

[0072] It is understandable that modulo addition and subtraction include either modulo addition or modulo subtraction.

[0073] In one example, the target polynomial is a combination of a first polynomial and a second polynomial, the polynomial data includes a first data set of the first polynomial and a second data set of the second polynomial, the operation includes modulo addition and subtraction of the first and second polynomials, and the target subset data is a portion of the first data set and a portion of the second data set.

[0074] In one example, each target processor core also performs the following processing:

[0075] Write the sub-operation results obtained from the arithmetic operation to the on-chip memory;

[0076] The results of suboperations are moved from on-chip memory to off-chip memory, and these suboperation results are used to combine them into an operation result for the polynomial data.

[0077] In this example, each processor core automatically identifies and reads the data it should process, performs the relevant data operations according to the instructions inside the processor core, and then each processor core automatically identifies and writes the data it has processed to off-chip memory.

[0078] In the embodiments described in this specification, if multiple processor cores execute the same program, the processor cores are asynchronous and do not need to know the status of each other. The software can add a piece of synchronous code at the end of the program segment after the normal program execution is complete for status summarization and task completion notification.

[0079] This embodiment implements a hardware SIMT multi-core architecture on the acceleration chip. The software flexibly selects the number of cores to run the program based on the polynomial length N. The hardware automatically selects a portion of the polynomial data and executes the same program based on the number of cores configured by the software and its own ID. By flexibly selecting the number of cores according to the polynomial length, a relative balance between polynomial transport time and processing time is ensured. This guarantees the efficiency of the acceleration chip and achieves good performance even with both small and large polynomial lengths. The hardware SIMT architecture ensures that the software programming object remains a complete polynomial, with the hardware automatically handling data partitioning, operation synchronization, and many other actions. This transforms complex multi-core parallel computing programs into ordinary single programs, while avoiding the performance overhead of software communication and synchronization.

[0080] The method provided in the embodiments of this specification first involves the main processor generating a processing program for the target polynomial and configuring the acceleration chip, which includes a first number of processor cores dedicated to performing polynomial operations. The configuration operation includes selecting a second number of processor cores from the first number of processor cores and setting them to execute the processing program. Then, each target processor core in the second number of processor cores performs the following processing: moving target subset data corresponding to the target processor core from off-chip memory storing the polynomial data of the target polynomial to on-chip memory; the target subset data is a part of the polynomial data; and performing data operations on the target subset data according to the processing program. As can be seen from the above, in the embodiments of this specification, the software can be configured to use several processor cores to process the target polynomial, setting these processor cores to point to the same processing program. The hardware automatically completes the data segmentation of a single polynomial according to the configuration and then executes the same program on different data. This scheme can configure different numbers of PEs to complete calculations according to different polynomial lengths N, ensuring that the acceleration chip has high performance under different polynomial lengths. Moreover, since data splitting and usage are automatically handled by hardware, the software is still programmed only for a single polynomial, thus avoiding complex parallel computing programming and the synchronization overhead between different processor cores. This allows for flexible and efficient matching of the number of polynomials (PEs) for different polynomial lengths.

[0081] According to another embodiment, a processing system for polynomial data is also provided, which is used to perform the methods provided in the embodiments of this specification. Figure 8 A schematic block diagram of a system for processing polynomial data according to one embodiment is shown. Figure 8 As shown, the system 800 includes:

[0082] The generation unit 81 is located in the main processor and is used to generate a processing program for the target polynomial.

[0083] The configuration unit 82, located in the main processor, is used to perform configuration operations on the acceleration chip, which includes a first number of processor cores dedicated to performing polynomial operations; the configuration operation includes selecting a second number of processor cores from the first number of processor cores and setting them to execute the processing program generated by the generation unit 81.

[0084] The transfer unit 83, disposed in each of the second number of processor cores, is used to perform the following process: transferring target subset data corresponding to the target processor core from off-chip memory storing polynomial data of the target polynomial to on-chip memory; the target subset data is a part of the polynomial data.

[0085] The arithmetic unit 84, located in each of the second number of processor cores, is used to perform the following processing: for the target subset of data moved by the transfer unit 83, perform data arithmetic operations according to the processing program.

[0086] Optionally, as an embodiment, the configuration unit 82 is further configured to load the compiled program instructions of the processor into a first address of the target memory; the configuration operation includes setting the program counter of each of the second number of processor cores to point to the first address.

[0087] Furthermore, the target memory is an off-chip memory, or the memory of the acceleration chip.

[0088] Optionally, as an embodiment, the configuration operation further includes assigning a number to each of the second number of processor cores; the transfer unit 83 is specifically used to address the storage location of the target subset data through a hardware module according to the number of the target processor core itself.

[0089] Optionally, as an embodiment, the polynomial length of the target polynomial is N, and the second number is determined based on N.

[0090] Optionally, as an embodiment, the target processor core includes a third number of processing units, each of which is responsible for performing the computational operation on a portion of the target subset data.

[0091] Optionally, as an embodiment, the polynomial data is divided into a second number of subsets of data, and the target subset of data is one subset of the second number of subsets of data.

[0092] Furthermore, the polynomial data is divided into several rows and columns, and the data in the preset rows constitutes a subset of data.

[0093] Optionally, as an embodiment, the arithmetic operation includes at least one of the following operations:

[0094] Modular addition and subtraction, modular multiplication, number theory transformations (NTT), and automorphism.

[0095] Optionally, as an embodiment, the target polynomial is a combination of a first polynomial and a second polynomial, the polynomial data includes a first data set of the first polynomial and a second data set of the second polynomial, the operation includes modulo addition and subtraction of the first polynomial and the second polynomial, and the target subset data is a part of the first data set and a part of the second data set.

[0096] Optionally, as an embodiment, the transfer unit 83 is further configured to perform the following processing:

[0097] Write the sub-operation results obtained from the arithmetic operation to the on-chip memory;

[0098] The results of suboperations are moved from on-chip memory to off-chip memory, and these suboperation results are used to combine them into an operation result for the polynomial data.

[0099] The system provided in this embodiment first generates a processing program for the target polynomial using a generation unit 81 in the main processor, and then a configuration unit 82 configures the acceleration chip, which includes a first number of processor cores dedicated to performing polynomial operations. The configuration operation includes selecting a second number of processor cores from the first number of processor cores and setting them to execute the processing program. Then, a transfer unit 83 in each of the second number of target processor cores performs the following processing: transferring target subset data corresponding to the target processor core from off-chip memory storing the polynomial data of the target polynomial to on-chip memory; the target subset data is a part of the polynomial data. An operation unit 84 performs data operation operations on the target subset data according to the processing program. As can be seen from the above, in this embodiment, the software can be configured to use several processor cores to process the target polynomial, setting these processor cores to point to the same processing program. The hardware automatically completes the data segmentation of a single polynomial according to the configuration, and then executes the same program on different data. This scheme can configure different numbers of PEs to complete calculations according to different polynomial lengths N, ensuring that the acceleration chip has high performance under different polynomial lengths. Moreover, since data splitting and usage are automatically handled by hardware, the software is still programmed only for a single polynomial, thus avoiding complex parallel computing programming and the synchronization overhead between different processor cores. This allows for flexible and efficient matching of the number of polynomials (PEs) for different polynomial lengths.

[0100] According to another embodiment, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed in a computer, causes the computer to perform a combination Figure 4 The method described.

[0101] According to another embodiment, a computing device is also provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements a combination... Figure 4 The method described.

[0102] Those skilled in the art will recognize that, in one or more of the examples above, the functions described in this invention can be implemented using hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium.

[0103] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for processing polynomial data, the method comprising: The main processor loads the compiled program instructions of the target polynomial generation processing program into the first address of the target memory, and performs configuration operations on the acceleration chip, which includes a first number of processor cores dedicated to performing polynomial operations. The configuration operation includes selecting a second number of processor cores from the first number of processor cores, setting the program counter of each processor core in the second number of processor cores to point to the first address; and assigning a number to each processor core in the second number of processor cores; wherein the polynomial length of the target polynomial is N, and the second number is determined based on N; Each of the second number of target processor cores performs the following processing: From the off-chip memory storing the polynomial data of the target polynomial, the target subset data corresponding to the target processor core is moved to the on-chip memory; the target subset data is a part of the polynomial data; wherein, the storage location of the target subset data is addressed by a hardware module according to the number of the target processor core itself. For the target subset of data, perform data operations according to the processing program.

2. The method as described in claim 1, wherein, The target memory is an off-chip memory, or the memory of the acceleration chip.

3. The method as described in claim 1, wherein, The target processor core includes a third number of processing units, each of which is responsible for performing the computational operation on a portion of the target subset of data.

4. The method of claim 1, wherein, The polynomial data is divided into a second number of subsets of data, and the target subset of data is one subset of the second number of subsets of data.

5. The method of claim 4, wherein, The polynomial data is divided into several rows and columns, and the data in the preset rows constitutes a subset of the data.

6. The method of claim 1, wherein, The computational operation includes at least one of the following operations: Modular addition and subtraction, modular multiplication, number theory transformations (NTT), and automorphism.

7. The method of claim 1, wherein, The target polynomial is a combination of a first polynomial and a second polynomial. The polynomial data includes a first data set of the first polynomial and a second data set of the second polynomial. The operation includes modulo addition and subtraction of the first and second polynomials. The target subset data is a part of the first data set and a part of the second data set.

8. The method of claim 1, wherein, Each target processor core also performs the following processing: Write the sub-operation results obtained from the arithmetic operation to the on-chip memory; The results of suboperations are moved from on-chip memory to off-chip memory, and these suboperation results are used to combine them into an operation result for the polynomial data.

9. A system for processing polynomial data, the system comprising: A generation unit, located on the main processor, is used to generate a processing program for the target polynomial and load the compiled program instructions of the processing program into the first address of the target memory. A configuration unit, located in the main processor, is used to perform configuration operations on the acceleration chip, which includes a first number of processor cores dedicated to performing polynomial operations; The configuration operation includes selecting a second number of processor cores from the first number of processor cores, setting the program counter of each processor core in the second number of processor cores to point to the first address; and assigning a number to each processor core in the second number of processor cores; wherein the polynomial length of the target polynomial is N, and the second number is determined based on N; A transfer unit, disposed in each of the second number of processor cores, is configured to perform the following processing: transferring target subset data corresponding to the target processor core from off-chip memory storing polynomial data of the target polynomial to on-chip memory; the target subset data is a part of the polynomial data; wherein, the transfer unit is further configured to address the storage location of the target subset data through a hardware module according to the number of the target processor core itself; The processing unit, located in each of the second number of processor cores, is used to perform the following processing: for the target subset of data moved by the transfer unit, performing data processing operations according to the processing program.

10. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of any one of claims 1-8.

11. A computing device comprising a memory and a processor, wherein the memory stores executable code, and the processor, when executing the executable code, implements the method of any one of claims 1-8.

Citation Information

Patent Citations

  • Data processing method and device, computer equipment and storage medium

    CN114580606A

  • Method and apparatus for approximation using polynomials

    EP3716052A1