A homomorphic encryption GPU acceleration system and method based on machine learning

Through machine learning, dynamically adjusting parallel parameters and optimizing GPU computing, the problem of insufficient homomorphic encryption computing performance is solved, and efficient homomorphic encryption computing performance is achieved, adapting to a variety of application scenarios.

CN120110644BActive Publication Date: 2025-08-22NANJING UNIV OF POSTS & TELECOMM
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510590019.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-08
Publication Date
2025-08-22
Estimated Expiration
2045-05-08

AI Technical Summary

Technical Problem

The existing homomorphic encryption computing performance cannot meet the high concurrency requirements of actual industrial applications, especially on GPU platforms, which significantly differ in computing parallel dimensions, resulting in limited efficiency and scalability.

Method used

The parallel parameter recommendation module based on machine learning and the homomorphic encryption calculation optimization module based on GPU are adopted to dynamically adapt to computing needs by adjusting parallel parameters and optimizing memory access and instructions, and improve the performance of homomorphic encryption calculation.

Benefits of technology

Under multiple computing parameters, the homomorphic encryption computing performance is improved by 30.60 to 389.71 times, and the throughput performance is improved by 2.73 to 26.41 times, meeting the needs of differentiated application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120110644B_ABST
    Figure CN120110644B_ABST
Patent Text Reader

Abstract

This invention proposes a machine learning-based homomorphic encryption GPU acceleration system and method. Based on the computing requirements of application services, it recommends parallel parameters for GPU-based homomorphic encryption calculations with the goal of high throughput performance. High-performance homomorphic encryption calculations are then performed on the GPU based on the recommended parallel parameters. The performance test results after each homomorphic encryption calculation are fed back to the machine learning-based parallel parameter recommendation model, further improving the accuracy of the recommendation system and, in turn, the computational performance of homomorphic encryption. This method can dynamically adapt to changes in computing requirements, improve the computational performance of homomorphic encryption, and promote the industrial application of homomorphic encryption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of information security and specifically discloses a homomorphic encryption GPU acceleration system and method based on machine learning. Background Art

[0002] In the era of big data, how to perform efficient computation while ensuring data security and privacy is a core issue in the current field of privacy-preserving computing. Homomorphic encryption, an emerging encryption technology, allows operations to be performed directly on encrypted data, with the results remaining correct even after decryption. This property has attracted widespread attention in privacy-preserving computing, effectively addressing computational needs while data is encrypted. However, the computational performance of homomorphic encryption cannot meet the high concurrency requirements of real-world industrial applications.

[0003] Leveraging the data parallelism of GPU platforms to perform homomorphic encryption calculations can improve overall computing performance, but varying the parallelism dimension can significantly impact performance. Therefore, the most pressing task is to quickly find the optimal parallelism dimension for homomorphic encryption based on actual application requirements, ensuring optimal performance and meeting the concurrency requirements of real-world applications.

[0004] The present application differs from the prior art in the following ways:

[0005] Technical comparison with application document CN119740252A "A GPU acceleration method and system for homomorphic encryption technology";

[0006] Application CN119740252A proposes a GPU acceleration method and system for homomorphic encryption technology. This approach aims to address the problem that homomorphic encryption requires complex polynomial calculations with long coefficients, which GPUs lack the ability to process. Furthermore, current fully homomorphic encryption only supports addition and multiplication, cannot perform complex operations such as convolution and pooling, and cross-slot operations introduce additional overhead, limiting its efficiency and scalability. The GPU acceleration method proposed in CN119740252A aims to reduce computational latency.

[0007] This application proposes a machine learning-based homomorphic encryption GPU acceleration system and method. This system recommends computing parameters for GPU-based homomorphic encryption calculations with the goal of achieving high throughput performance based on the computing requirements of application services. This system then performs high-performance homomorphic encryption calculations on the GPU based on the recommended parameters to meet the dynamically changing concurrency requirements of actual applications. This application proposes a GPU acceleration system and method that aims to achieve the highest throughput performance under different application requirements.

[0008] Compared with this application, there are essential differences between the two in terms of application scenarios and research purposes.

[0009] The application CN119740252A adopts an optimization technology based on thread bundle shuffling to eliminate synchronization overhead, and uses kernel fusion to solve the imbalance problem between memory access and calculation. For neural network inference applications, different encoding methods are designed for different scenarios. Small batch data adopts a fully connected layer calculation method based on a big-step-small-step algorithm, and large batch data uses a stream-based calculation method.

[0010] The present application provides an acceleration system that can homomorphically adapt to changes in computing requirements to improve the performance of homomorphic encryption computing, including a parallel parameter recommendation module based on machine learning and a homomorphic encryption computing optimization module based on GPU. The parallel parameter recommendation module based on machine learning includes a parameter adjustment module and a parallel parameter recommendation module. It first adjusts the model parameters of the parallel parameter recommendation module and then predicts the computing performance under different parallel parameters. The GPU-based homomorphic encryption computing optimization module performs high-performance homomorphic encryption computing according to the recommended GPU parallel parameters. The computing optimization methods include parallel optimization, memory access optimization and instruction optimization.

[0011] Compared with this application, there are essential differences between the two in system design and technical means.

[0012] The homomorphic encryption GPU computing method proposed in application CN119740252A is relatively simple, using an optimization method based on thread bundle shuffling, kernel fusion and batch processing. The optimization focuses on improving memory access efficiency in order to reduce computing latency.

[0013] The GPU-based homomorphic encryption performance optimization method proposed in this application focuses more on improving throughput performance and fully utilizing the data parallel capabilities of the GPU. In addition to optimizing memory access, it also proposes parallel optimization and instruction optimization solutions. First, a machine learning-based parameter recommendation model is used to recommend appropriate GPU parallel parameters; then, the GPU's layered memory architecture is used to store data with different characteristics in global memory, texture memory, constant memory, shared memory, and registers; the data size for batch calculations is designed through the parameter recommendation module, and the GPU data parallel capabilities are used to perform high-performance parallel calculations; the PTX instructions of the CUDA platform are used to implement the underlying homomorphic encryption operator, further improving the computing performance of homomorphic encryption calculations on the GPU.

[0014] Compared with this application, there are essential differences between the two in terms of technical solutions and technical effects.

[0015] Technical comparison with application document CN115622684B “Heterogeneous acceleration method and device for privacy computing based on fully homomorphic encryption”;

[0016] The application CN115622684B proposes a privacy computing heterogeneous acceleration method and device based on fully homomorphic encryption. It optimizes the fully homomorphic encryption algorithm from the memory and instruction levels, dynamically allocates the blocks in the GPU according to the computational load, splits tasks with excessive computational complexity into smaller ones, merges tasks with small computational complexity into larger ones, and controls the memory access contention during the result merging process. The purpose is to overcome the shortcomings and deficiencies of the existing technology, reduce the computational complexity and conform to the parallel computation flow from the design of the fully homomorphic encryption algorithm, balance the workload and reduce the memory access contention from the hardware structure design to achieve the best parallel optimization solution.

[0017] This application proposes a machine learning-based homomorphic encryption GPU acceleration system and method. This system recommends computing parameters for GPU-based homomorphic encryption calculations with the goal of high throughput performance based on the computing requirements of application services. This system then performs high-performance homomorphic encryption calculations on the GPU based on the recommended parameters to meet the dynamically changing concurrency requirements of actual applications. This application proposes a GPU acceleration system and method that aims for the highest throughput performance under different application requirements, providing a GPU acceleration solution that dynamically adjusts parallel parameters based on application requirements to achieve optimal throughput.

[0018] Compared with this application, there are essential differences between the two in terms of application scenarios and research purposes.

[0019] The application CN115622684B focuses on a privacy computing heterogeneous acceleration program based on fully homomorphic encryption, with the optimization focus on NTT calculations and kernel optimization involved in the calculation process.

[0020] This application proposes a homomorphic encryption GPU acceleration system and method based on machine learning. The focus is on proposing a dynamic recommendation module for computing parameters based on machine learning, which dynamically recommends the optimal computing parameters for homomorphic encryption computing kernels on the GPU according to application requirements, and performs high-performance homomorphic encryption calculations based on the recommended parallel parameters. This includes not only NTT calculations, but also upper-level calculations of fully homomorphic encryption, such as encryption and decryption, encoding and decoding, addition, multiplication, etc.

[0021] Compared with this application, there are essential differences between the two in terms of system design and technical effects.

[0022] The optimization technology solution proposed in application CN115622684B, which dynamically calls the kernel based on the flounder transformation at each iteration of the NTT algorithm, is a fixed optimization technology solution that only follows the polynomial size N transformation and has limitations in kernel optimization.

[0023] This application proposes a dynamically changing parallel parameter tuning strategy that uses machine learning techniques to predict and adjust kernel startup parameters based on changing application requirements, achieving optimal throughput performance on the GPU. Furthermore, this application proposes a three-tiered optimization scheme for GPU-based fully homomorphic encryption: parallel optimization, memory access optimization, and instruction optimization. This scheme deeply exploits the platform hardware characteristics of the GPU to achieve optimal throughput performance for fully homomorphic computing.

[0024] Compared with this application, there are essential differences in the technical solutions of the two. Summary of the Invention

[0025] To solve the above technical problems, the present invention proposes a homomorphic encryption GPU acceleration system and method based on machine learning, which can dynamically adapt to changes in computing requirements and improve the computing performance of homomorphic encryption.

[0026] To achieve the above object, the technical solution adopted by the present invention is:

[0027] A machine learning-based homomorphic encryption GPU acceleration system, including a machine learning-based parallel parameter recommendation module and a GPU-based homomorphic encryption calculation optimization module;

[0028] The parallel parameter recommendation module based on machine learning includes a model parameter adjustment module and a parallel parameter recommendation module;

[0029] The model parameter adjustment module adjusts the model parameters of the parallel parameter recommendation module to improve the recommendation accuracy of the parallel parameter recommendation module. The model parameters include the maximum depth, i.e. the maximum depth of each decision tree; the learning rate, i.e. the contribution of each decision tree to the final prediction; and the total number of decision trees, i.e. the total number of decision trees generated.

[0030] The model parameter adjustment module includes a random search adjustment unit, a grid search adjustment unit and a Bayesian search adjustment unit;

[0031] The random search adjustment unit uses random search to adjust the model parameters of the parallel parameter recommendation module; the grid search adjustment unit uses grid search to adjust the model parameters of the parallel parameter recommendation module; the Bayesian search adjustment unit uses Bayesian search to adjust the model parameters of the parallel parameter recommendation module;

[0032] The parallel parameter recommendation module predicts the performance of homomorphic encryption calculations under different parallel parameters and recommends the optimal GPU parallel parameters based on the prediction results;

[0033] The parallel parameter recommendation module includes a performance prediction unit and an optimization recommendation unit;

[0034] The performance prediction unit uses the XGBoost algorithm to predict the computing performance of homomorphic encryption calculations under multiple combinations of parallel parameters;

[0035] The optimization recommendation unit uses optimization analysis to obtain the best computing throughput performance and the best parallel computing parameters based on the performance prediction results obtained by the performance prediction unit;

[0036] The GPU-based homomorphic encryption calculation optimization module performs homomorphic encryption calculations based on the GPU computing parallel parameters recommended by the machine learning-based parallel parameter recommendation module. This module also optimizes parallelism, memory access, and instructions based on the GPU hardware platform characteristics.

[0037] Parallel optimization uses the recommended parameters obtained by the machine learning-based parallel parameter recommendation module to perform batch calculations within a single thread and parallel calculations on multiple threads. Memory access optimization uses the hierarchical memory structure of the GPU hardware to store data in global memory, constant memory, texture memory, shared memory, and registers. Instruction optimization uses the PTX ISA instruction set of the CUDA platform to implement basic arithmetic calculations.

[0038] As a further improvement of the acceleration system of the present invention, the parallel parameters include grid size GridSize, block size BlockSize and parallel dimension GroupSize, wherein the grid size GridSize represents the number of blocks contained in a grid Grid, the block size BlockSize represents the number of threads contained in a block, and the parallel dimension GroupSize represents the number of homomorphic encryption operations calculated simultaneously.

[0039] As a further improvement to the acceleration system of the present invention, the specific steps of the XGBoost algorithm are as follows:

[0040] The model first initializes the prediction value and calculates the residual of the current prediction in each iteration; then uses these residuals to build a new decision tree, correcting the errors of the previous tree; the weights of the trees are selected using a greedy algorithm, and the final model consists of multiple weighted trees to achieve more accurate predictions. The prediction value of the XGBoost model is expressed as:

[0041] ;

[0042] in For the The final predicted value of samples, For the sample The prediction function, K represents the total number of decision trees, Representative k decision tree, belonging to the set of all possible trees , For the k Tree pairs sample The prediction results for each tree , the tree structure is represented as:

[0043] ;

[0044] in, s is the mapping from input feature space to leaf node index, is the weight corresponding to each leaf node, is the set of real numbers, Each leaf node x The corresponding weight, T Indicates the total number of leaf nodes in each tree;

[0045] The goal of training XGBoost is to minimize the objective function, which is defined as:

[0046] ;

[0047] in, is the objective function, Refers to model parameters, including tree structure and leaf weights, is the loss function, is a regularization term used to control the complexity of the model. The definition of the regularization term is:

[0048] ;

[0049] in, To control the penalty coefficient of the number of leaf nodes, Is the penalty coefficient that controls the leaf weight, also known as the learning rate, w is the leaf node weight vector, k decision trees Gradually added to the model in a greedy manner, after n After iterations, the calculated predicted value is compared with the actual label to train the model and control the penalty coefficient of the leaf weight Helps reduce the risk of overfitting and controls the penalty coefficient for the number of leaf nodes Adjust the complexity of the tree by penalizing the number of leaf nodes.

[0050] The present invention provides a method for a homomorphic encryption GPU acceleration system based on machine learning, and the specific steps are as follows:

[0051] Step S1: The application service sends a homomorphic encryption calculation request, and the request data includes the polynomial data required for the calculation, the polynomial size N, and the calculation type;

[0052] Step S2: The parallel parameter recommendation module based on machine learning performs parallel parameter recommendation calculations based on the calculation parameters. After receiving the calculation parameters, the calculation parameters include the polynomial size N and the calculation type. The model parameters are adjusted according to the model parameter adjustment module. The adjusted model executes the parallel parameter recommendation module to recommend the optimal parallel parameters, which include GridSize, BlockSize, and GroupSize. Finally, the results are transmitted to the GPU-based homomorphic encryption calculation optimization module.

[0053] Step S3: The GPU-based homomorphic encryption calculation optimization module performs calculations. After receiving the calculation data, the calculation data includes the polynomial data required for the calculation, the polynomial size, the calculation type, and the recommended parallel parameters. The calculation is performed on the GPU platform according to the parallelization, memory access, and instruction optimization methods.

[0054] Step S4: Transmit the calculation results back to the application service.

[0055] As a further improvement to the method of the present invention, the calculation types in step S1 include encoding, decoding, encryption, decryption, ciphertext addition, plaintext and ciphertext addition, ciphertext multiplication, plaintext and ciphertext multiplication and square.

[0056] As a further improvement to the method of the present invention, step S2, in which the parallel parameter recommendation module based on machine learning performs parallel parameter recommendation calculation according to the calculation parameters, includes:

[0057] Step S2-1: The machine learning-based parallel parameter recommendation module receives calculation parameters, which specifically include the polynomial size N and the homomorphic encryption calculation type;

[0058] Step S2-2: The model parameter adjustment module activates three parameter adjustment units to adjust the recommendation model of the parallel parameter recommendation module. The three parameter adjustment units are a random search adjustment unit, a grid search adjustment unit, and a Bayesian search adjustment unit. The parameter adjustment units respectively provide optimal model parameters based on the training data set and provide them to the parallel parameter recommendation model. The parallel parameter recommendation model performs model performance tests on the optimal model parameters provided by the three parameter adjustment units based on the test data and ultimately selects the optimal model parameters.

[0059] Step S2-3: The parallel parameter recommendation module performs parallel parameter recommendation calculations for a given polynomial size and homomorphic encryption calculation type based on model parameters and calculation parameters;

[0060] First, the performance prediction unit performs a performance prediction on the homomorphic encryption calculation and arranges and combines the three parallel parameters, namely GridSize, BlockSize, and GroupSize. The value range of GridSize is 1-256, the value range of BlockSize is 1-1024, and the value of GroupSize is , all three parallel parameters are powers of 2. For given combinations of computing parameters and parallel parameters, the latency of homomorphic encryption computing is predicted on the training data set. The optimization recommendation unit calculates the throughput performance of confidential computing on the same platform based on the predicted data. The throughput calculation formula is , select the best performance;

[0061] Step S2-4: The machine learning-based parallel parameter recommendation module transmits the parallel parameters corresponding to the optimal throughput performance to the GPU-based homomorphic encryption calculation optimization module.

[0062] As a further improvement to the method of the present invention, step S3 performs high-performance computing based on a GPU-based homomorphic encryption computing optimization module, including:

[0063] Step S3-1: The GPU-based homomorphic encryption calculation optimization module receives calculation data, which includes the polynomial data to be calculated, the polynomial size N, the homomorphic encryption calculation type, the recommended parallel parameters, and the pre-calculated data;

[0064] Step S3-2: Memory access optimization involves placing data in layers within the GPU's hierarchical memory architecture based on the computational characteristics of the data. The polynomial data to be calculated is placed in global memory, the NTT calculation table is stored in texture memory, the pre-calculated data and modulus are stored in constant memory, and the intermediate variables of the calculation are stored in shared memory and registers.

[0065] Step S3-3: Parallel optimization will configure the threads required for a single calculation based on the parallel parameters , the calculation formula is , the GPU computing thread startup parameters are , the data size required for batch calculation by each thread during parallel computing , on the GPU platform, uint4 is used to continuously copy the calculation data;

[0066] Step S3-4: Instruction optimization: Implement the underlying operators of homomorphic encryption calculations using the PTX ISA instruction set of the CUDA platform. The underlying operators include 64-bit addition, 64-bit multiplication, 128-bit reduction, and 64-bit conditional subtraction.

[0067] Step S3-5: The GPU-based homomorphic encryption calculation optimization module performs optimized high-performance calculations to obtain homomorphic encryption calculation results.

[0068] Compared with the prior art, the present invention has the following beneficial effects:

[0069] 1. The present invention proposes a machine learning-based homomorphic encryption GPU acceleration system that utilizes a machine learning-based parallel parameter recommendation module to support differentiated homomorphic encryption computing requirements proposed by various application scenarios, support diverse homomorphic encryption computing parameters under different devices, and perform adaptive changes and adjustments.

[0070] 2. This invention fully utilizes the platform hardware characteristics of the GPU to design a GPU-based homomorphic encryption optimization calculation method that combines parallel optimization, memory access optimization, and instruction optimization to support high-performance calculation of homomorphic encryption;

[0071] 3. The machine learning-based homomorphic encryption GPU acceleration method proposed in the present invention has good performance. Under multiple computing parameters, the performance of various homomorphic encryption calculation types is improved by 30.60 to 389.71 times compared to the CPU, and the throughput performance is improved by 2.73 to 26.41 times compared to the latest GPU implementation. The machine learning-based homomorphic encryption GPU acceleration method implemented by the present invention can not only improve the performance of homomorphic confidential computing, but also meet the usage requirements in differentiated application scenarios, and can effectively promote the application and promotion of homomorphic encryption computing. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] Figure 1 Homomorphic encryption GPU acceleration system framework based on machine learning;

[0073] Figure 2 Homomorphic encryption GPU acceleration method based on machine learning;

[0074] Figure 3 Schematic diagram of the parallel parameter recommendation module calculation based on machine learning;

[0075] Figure 4 Schematic diagram of GPU-based homomorphic encryption parallel optimization calculation. DETAILED DESCRIPTION

[0076] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:

[0077] Embodiment: An embodiment of the present invention provides a homomorphic encryption plus computing GPU acceleration method based on machine learning. The method constructs a parallel parameter recommendation module based on machine learning and a homomorphic encryption computing acceleration module based on GPU, which can adaptively adjust the computing parameter configuration on computing devices with different computing requirements, and provide high-performance homomorphic encryption computing.

[0078] The system framework provided in this embodiment is as follows Figure 1 As shown, the calculation process is as follows Figure 2 As shown, the specific work consists of 4 parts, and the process is as follows:

[0079] 1) The application service sends a homomorphic encryption computing request:

[0080] The application service generates a homomorphic encryption multiplication request based on actual application needs and sends it to the homomorphic encryption GPU acceleration system based on machine learning. The request data includes the polynomial data to be calculated. , polynomial size The computation type is homomorphically encrypted ciphertext multiplication. Homomorphic multiplication is planned to be performed on an NVIDIA RTX 4090. The computation security parameter is 128 bits.

[0081] 2) Parallel parameter recommendation module based on machine learning recommends parallel parameters: The calculation process of the parallel parameter recommendation module based on machine learning is as follows: Figure 3 As shown, after receiving the calculation parameters;

[0082] (1) First, start the parameter adjustment module to adjust the model parameters. Determine 80% of the data set as the training set and 20% as the test set. Start the three parameter adjustment units to adjust the parameters;

[0083] 1. Random search adjustment unit: First determine the parameter space, the total number of decision trees ranges from 50 to 300, the learning rate ranges from 0.01 to 0.9, and the maximum depth ranges from 3 to 10. Then perform random search iterations and update the optimal model parameters;

[0084] 2. Grid search adjustment unit: First, create a parameter grid with the total number of decision trees ranging from 50 to 300 in intervals of 5, the learning rate ranging from 0.05 to 0.95 in intervals of 0.05, and the maximum depth set to 3 to 10. Then traverse the parameter space and update the optimal model parameters;

[0085] 3. Bayesian search adjustment unit: The initial parameters of Bayesian search are a learning rate between 0.01 and 0.9, a maximum depth between 3 and 10, and a total number of decision trees between 50 and 300. The Bayesian search is iterated to update the optimal model parameters.

[0086] 4. Select the optimal model parameters: Train the model on the training set and select the best model parameters from the optimal model parameters given by the three model parameter adjustment units;

[0087] (2) Use the parallel parameter recommendation module to recommend parallel parameters for calculation. Based on the obtained optimal model parameters, build the XGBoost model and generate a decision tree;

[0088] 1. Performance prediction unit: This unit permutes and combines the possible values ​​of the parallel parameters GridSize, BlockSize, and GroupSize, and uses the XGBoost model to predict the performance of homomorphic multiplication.

[0089] 2. Optimization recommendation unit: Calculates throughput based on the predicted latency performance. It selects the best throughput and returns the corresponding parallel parameter combination. The parallel parameter combination obtained here is GridSize=256, BlockSize=512, and GroupSize=32.

[0090] (3) Return the recommended parallel parameters. The calculated parallel parameters are passed to the GPU-based homomorphic encryption high-performance computing module;

[0091] 3) GPU-based homomorphic encryption calculation optimization module performs high-performance computing: The GPU-based homomorphic encryption calculation optimization module first receives the calculation data, including the polynomial to be calculated Polynomial size The calculation type is ciphertext multiplication calculation, and the recommended parallel parameters are GridSize=256, BlockSize=512, and GroupSize=32;

[0092] (1) Memory access optimization unit. Stored in global memory, 128-bit security parameters When the number of moduli is 3, the moduli are stored in constant memory, and the Barrett reduction parameters of the 128-bit multiplication are calculated in advance and stored in constant memory;

[0093] (2) Parallel optimization unit. The parallel optimization process is as follows: Figure 4 As shown. According to the recommended parallel parameters, the number of threads for a single calculation is known ,but Each thread processes two operations in batches and uses uint4 for continuous memory copying. The GPU thread startup parameters are 8,512;

[0094] (3) Instruction optimization unit. The underlying operators required for homomorphic multiplication operations are 64-bit addition, 64-bit multiplication, 128-bit reduction, and 64-bit conditional subtraction. These algorithms are implemented in the PTX instruction set.

[0095] (4) Perform high-performance computing. After memory access optimization, parallel optimization, and instruction optimization, complete the homomorphic multiplication calculation and obtain the homomorphic multiplication calculation result. Returns the application service.

[0096] In addition to being applicable to the CUDA platform architecture, the present invention can also be applied to other multi-core computing architectures with parallel computing characteristics, including but not limited to OpenCL.

[0097] The machine learning algorithm used in the present invention may use other algorithms for fitting and predictive calculations, including but not limited to RandomForest. Deep learning algorithms with the same functionality may also be used, including but not limited to CNN.

[0098] The above description is merely a preferred embodiment of the present invention and does not constitute any other form of limitation to the present invention. Any modification or equivalent variation based on the technical essence of the present invention shall still fall within the scope of protection claimed by the present invention.

Claims

1. A homomorphic encryption GPU acceleration system based on machine learning, characterized by: Including a parallel parameter recommendation module based on machine learning and a homomorphic encryption calculation optimization module based on GPU; The parallel parameter recommendation module based on machine learning includes a model parameter adjustment module and a parallel parameter recommendation module; The model parameter adjustment module adjusts the model parameters of the parallel parameter recommendation module to improve the recommendation accuracy of the parallel parameter recommendation module. The model parameters include the maximum depth, i.e. the maximum depth of each decision tree; the learning rate, i.e. the contribution of each decision tree to the final prediction; and the total number of decision trees, i.e. the total number of decision trees generated. The model parameter adjustment module includes a random search adjustment unit, a grid search adjustment unit and a Bayesian search adjustment unit; The random search adjustment unit uses random search to adjust the model parameters of the parallel parameter recommendation module; the grid search adjustment unit uses grid search to adjust the model parameters of the parallel parameter recommendation module; the Bayesian search adjustment unit uses Bayesian search to adjust the model parameters of the parallel parameter recommendation module; The parallel parameter recommendation module predicts the performance of homomorphic encryption calculations under different parallel parameters and recommends the optimal GPU parallel parameters based on the prediction results; The parallel parameter recommendation module includes a performance prediction unit and an optimization recommendation unit; The performance prediction unit uses the XGBoost algorithm to predict the computing performance of homomorphic encryption calculations under multiple combinations of parallel parameters; The optimization recommendation unit uses optimization analysis to obtain the best computing throughput performance and the best parallel computing parameters based on the performance prediction results obtained by the performance prediction unit; The GPU-based homomorphic encryption calculation optimization module performs homomorphic encryption calculations based on the GPU computing parallel parameters recommended by the machine learning-based parallel parameter recommendation module. This module also optimizes parallelism, memory access, and instructions based on the GPU hardware platform characteristics. Parallel optimization uses the recommended parameters from the machine learning-based parallel parameter recommendation module to perform batch calculations within a single thread and parallel calculations across multiple threads. Memory access optimization uses the GPU hardware's hierarchical memory structure to store data in global memory, constant memory, texture memory, shared memory, and registers. Instruction optimization utilizes the CUDA platform's PTXISA instruction set to implement basic arithmetic calculations. The machine learning-based parallel parameter recommendation module performs parallel parameter recommendation calculations based on the calculation parameters, including: Step S2-1: The machine learning-based parallel parameter recommendation module receives calculation parameters, which specifically include the polynomial size N and the homomorphic encryption calculation type; Step S2-2: The model parameter adjustment module activates three parameter adjustment units to adjust the recommendation model of the parallel parameter recommendation module. The three parameter adjustment units are a random search adjustment unit, a grid search adjustment unit, and a Bayesian search adjustment unit. The parameter adjustment units respectively provide optimal model parameters based on the training data set and provide them to the parallel parameter recommendation model. The parallel parameter recommendation model performs model performance tests on the optimal model parameters provided by the three parameter adjustment units based on the test data and ultimately selects the optimal model parameters. Step S2-3: The parallel parameter recommendation module performs parallel parameter recommendation calculations for a given polynomial size and homomorphic encryption calculation type based on model parameters and calculation parameters; First, the performance prediction unit performs a performance prediction on the homomorphic encryption calculation and arranges and combines the three parallel parameters, namely GridSize, BlockSize, and GroupSize. The value range of GridSize is 1-256, the value range of BlockSize is 1-1024, and the value of GroupSize is , all three parallel parameters are powers of 2. For given combinations of computing parameters and parallel parameters, the latency of homomorphic encryption computing is predicted on the training data set. The optimization recommendation unit calculates the throughput performance of confidential computing on the same platform based on the predicted data. The throughput calculation formula is , select the best performance; Step S2-4: The machine learning-based parallel parameter recommendation module transmits the parallel parameters corresponding to the optimal throughput performance to the GPU-based homomorphic encryption calculation optimization module; The GPU-based homomorphic encryption computing optimization module performs high-performance computing, including: Step S3-1: The GPU-based homomorphic encryption calculation optimization module receives calculation data, which includes the polynomial data to be calculated, the polynomial size N, the homomorphic encryption calculation type, the recommended parallel parameters, and the pre-calculated data; Step S3-2: Memory access optimization involves placing data in layers within the GPU's hierarchical memory architecture based on the computational characteristics of the data. The polynomial data to be calculated is placed in global memory, the NTT calculation table is stored in texture memory, the pre-calculated data and modulus are stored in constant memory, and the intermediate variables of the calculation are stored in shared memory and registers. Step S3-3: Parallel optimization will configure the threads required for a single calculation based on the parallel parameters , the calculation formula is , the GPU computing thread startup parameters are , the data size required for batch calculation by each thread during parallel computing , on the GPU platform, uint4 is used to continuously copy the calculation data; Step S3-4: Instruction optimization: Implement the underlying operators of homomorphic encryption calculations using the PTX ISA instruction set of the CUDA platform. The underlying operators include 64-bit addition, 64-bit multiplication, 128-bit reduction, and 64-bit conditional subtraction. Step S3-5: The GPU-based homomorphic encryption calculation optimization module performs optimized high-performance calculations to obtain homomorphic encryption calculation results.

2. The homomorphic encryption GPU acceleration system based on machine learning according to claim 1, characterized in that: The parallel parameters include grid size GridSize, block size BlockSize and parallel dimension GroupSize, where the grid size GridSize represents the number of blocks contained in a grid, the block size BlockSize represents the number of threads contained in a block, and the parallel dimension GroupSize represents the number of homomorphic encryption operations calculated simultaneously.

3. The homomorphic encryption GPU acceleration system based on machine learning according to claim 1, characterized in that: The specific steps of the XGBoost algorithm are as follows: The model first initializes the prediction value and calculates the residual of the current prediction in each iteration; then uses these residuals to build a new decision tree, correcting the errors of the previous tree; the weights of the trees are selected using a greedy algorithm, and the final model consists of multiple weighted trees to achieve more accurate predictions. The prediction value of the XGBoost model is expressed as: ; in For the The final predicted value of samples, For the sample The prediction function, K represents the total number of decision trees, Representative k decision tree, belonging to the set of all possible trees , For the k Tree pairs sample The prediction results for each tree , the tree structure is represented as: ; in, s is the mapping from input feature space to leaf node index, is the weight corresponding to each leaf node, is the set of real numbers, Each leaf node x The corresponding weight, T Indicates the total number of leaf nodes in each tree; The goal of training XGBoost is to minimize the objective function, which is defined as: ; in, is the objective function, Refers to model parameters, including tree structure and leaf weights, is the loss function, is a regularization term used to control the complexity of the model. The definition of the regularization term is: ; in, To control the penalty coefficient of the number of leaf nodes, Is the penalty coefficient that controls the leaf weight, also known as the learning rate, w is the leaf node weight vector, k decision trees Gradually added to the model in a greedy manner, after n After iterations, the calculated predicted value is compared with the actual label to train the model and control the penalty coefficient of the leaf weight Helps reduce the risk of overfitting and controls the penalty coefficient for the number of leaf nodes Adjust the complexity of the tree by penalizing the number of leaf nodes.

4. A method for a homomorphic encryption GPU acceleration system based on machine learning according to any one of claims 1 to 3, characterized in that: The specific steps are as follows: Step S1: The application service sends a homomorphic encryption calculation request, and the request data includes the polynomial data required for the calculation, the polynomial size N, and the calculation type; Step S2: The parallel parameter recommendation module based on machine learning performs parallel parameter recommendation calculations based on the calculation parameters. After receiving the calculation parameters, the calculation parameters include the polynomial size N and the calculation type. The model parameters are adjusted according to the model parameter adjustment module. The adjusted model executes the parallel parameter recommendation module to recommend the optimal parallel parameters, which include GridSize, BlockSize, and GroupSize. Finally, the results are transmitted to the GPU-based homomorphic encryption calculation optimization module. Step S3: The GPU-based homomorphic encryption calculation optimization module performs calculations. After receiving the calculation data, the calculation data includes the polynomial data required for the calculation, the polynomial size, the calculation type, and the recommended parallel parameters. The calculation is performed on the GPU platform according to the parallelization, memory access, and instruction optimization methods. Step S4: Transmit the calculation results back to the application service.

5. The method of a homomorphic encryption GPU acceleration system based on machine learning according to claim 4, characterized in that: The calculation types in step S1 include encoding, decoding, encryption, decryption, ciphertext addition, plaintext and ciphertext addition, ciphertext multiplication, plaintext and ciphertext multiplication and square.

Citation Information

Patent Citations

  • A heterogeneous acceleration method and device for privacy computing based on fully homomorphic encryption

    CN115622684B

  • GPU acceleration method and system for homomorphic encryption technology

    CN119740252A

  • Fully homomorphic encryption method for federated learning of Internet of Vehicles

    CN115935383A

  • GPU acceleration method for fully homomorphic multiplication

    CN118466898A