A GPU dynamic task efficient scheduling method for anti-quantum cryptographic operation
By constructing an execution length correction factor and a batch scheduling adaptive factor in quantum-resistant cryptography, the task length is dynamically corrected and the deficit counter quota is adjusted, thus solving the problem of task execution length estimation bias in general-purpose graphics processor scheduling and achieving more efficient task scheduling and resource utilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-12
- Publication Date
- 2026-04-10
AI Technical Summary
Existing general-purpose dynamic task scheduling methods for graphics processors suffer from inaccurate scheduling due to errors in task execution length estimation in quantum cryptography scenarios, which affects the system's real-time performance and throughput.
By constructing an execution length correction factor and a batch scheduling adaptive factor based on real-time monitoring information when the scheduler receives a new task request, the baseline predicted length of the task is dynamically corrected and the deficit counter quota is adjusted, thereby optimizing the weighted fair queuing and deficit round-robin scheduling framework.
It effectively eliminates task length prediction bias, improves the scheduling accuracy and overall performance of quantum cryptography tasks, and achieves two-level optimization across queues and within queues to meet the requirements of real-time performance and high throughput.
Smart Images

Figure CN121277652B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of GPU task scheduling, in particular to a GPU dynamic task efficient scheduling method for quantum-resistant cryptographic operation. BACKGROUND
[0002] With the rapid development of quantum computing technology, the public key cryptography system based on traditional mathematical problems such as integer factorization and elliptic curve discrete logarithm is facing a serious threat. Once a large-scale quantum computer is put into use, the existing encryption algorithm will not be able to guarantee information security. In order to solve this problem, domestic and foreign research institutions and standardization organizations have successively put forward a new generation of quantum-resistant cryptographic algorithms. Such algorithms are mainly based on lattice problems, multivariate polynomial problems, hash problems and coding theory problems, and can theoretically resist quantum computing attacks. However, compared with traditional cryptographic algorithms, quantum-resistant cryptographic algorithms have greatly increased in terms of operation complexity and resource consumption. For example, lattice-based encryption and signature methods require large-scale polynomial operations, fast Fourier transform, sparse matrix multiplication and frequent hash calculations, and the amount of operation is often several or even dozens of times that of traditional algorithms. Therefore, how to efficiently complete quantum-resistant cryptographic operation in engineering practice has become an important problem to be solved.
[0003] In order to improve the efficiency of quantum-resistant cryptographic operation, general-purpose graphics processors gradually become the main platform for accelerating such operations due to their large-scale parallel computing capabilities and multi-task concurrency characteristics. In typical application scenarios, such as large-scale key exchange, batch signature verification and blockchain node authentication, general-purpose graphics processors need to handle a large number of computing tasks at the same time. These tasks have significant heterogeneity: one type is small-grained tasks such as hash sampling and parameter consistency detection, which have very high real-time requirements and usually need to be completed within milliseconds; the other type is large-grained tasks such as large-scale matrix multiplication-based key generation and decryption, which take a long time to execute a single task but have high overall throughput requirements. How to reasonably schedule tasks of different priorities and different sizes on general-purpose graphics processors directly determines whether the system can meet the real-time and high-throughput requirements at the same time.
[0004] The dynamic task scheduling method of the existing general-purpose graphics processor is usually based on a multi-queue priority mechanism, and the allocation between the multi-queue tasks and the batch processing within the queue are realized through a weighted fair queuing algorithm and a deficit round-robin algorithm. This kind of method can theoretically guarantee the rapid response of high-priority tasks, avoid the long-term execution of low-priority tasks, and take into account the fairness of large and small tasks within the queue. However, in the actual scene of quantum-resistant cryptographic operations, this kind of method still has obvious deficiencies. The core premise of the weighted fair queuing and the deficit round-robin is to accurately estimate the execution length of each task, and to calculate the virtual completion time label and the round transmission basis accordingly, but in the scene of quantum-resistant cryptographic operations, the execution time and resource consumption of the task have great uncertainty: the sparsity difference of the input data may cause the computational complexity of the same algorithm to fluctuate significantly; the memory access mode of different batches may cause memory conflict and cache jitter; and the concurrent running of multiple kernels may also cause bandwidth contention and resource interference. These factors cause the task execution length estimation to generally have obvious deviation, which causes the scheduler to be unable to truly reflect the task overhead in the actual running process, and the direct result is that the high-priority but actually time-consuming task may occupy the graphics processor resources for a long time, thereby delaying the execution of other critical tasks; and the actually time-consuming task is repeatedly delayed due to the estimation value being too large, which reduces the overall throughput. At the same time, in the queue, the process of rotating and accumulating deficit based on the biased length may also cause uneven batch transmission and even queue starvation.
[0005] Therefore, how to effectively solve the scheduling inaccuracy caused by the estimation deviation of the task execution length while maintaining the advantages of the weighted fair queuing and the deficit round-robin scheduling framework has become a problem to be solved. SUMMARY
[0006] Therefore, the embodiment of the present application provides a GPU dynamic task efficient scheduling method for quantum-resistant cryptographic operations, to solve the problem of how to effectively solve the scheduling inaccuracy caused by the estimation deviation of the task execution length while maintaining the advantages of the weighted fair queuing and the deficit round-robin scheduling framework.
[0007] The embodiment of the present application provides a GPU dynamic task efficient scheduling method for quantum-resistant cryptographic operations, which comprises the following steps:
[0008] In the dynamic task scheduling process of the graphics processor for quantum-resistant cryptographic operations, when the scheduler receives a new task request, real-time monitoring information is obtained based on the running data buffer area of the scheduler;
[0009] extracting feature information related to execution deviation from the real-time monitoring information, corresponding to obtain structural sparse imbalance degree, memory access merging damage rate, concurrent congestion intensity, batch isomorphism degree, and prediction relative residual, to construct an execution length correction factor, obtain a baseline prediction length of the new task request, dynamically correct the baseline prediction length of the new task request by using the execution length correction factor, obtain a target execution length, and apply the target execution length to the weighted fair queuing across queues;
[0010] extracting task size difference features and system instantaneous resource state features from the real-time monitoring information, corresponding to obtain task length difference degree and resource congestion degree, and combining batch isomorphism degree to construct a batch scheduling adaptive factor, if any queue in the weighted fair queuing is selected to enter task emission, adjusting the target deficit counter quota of the any queue by using the batch scheduling adaptive factor, to obtain a target deficit counter quota;
[0011] comparing the target execution length of each task in the any queue with the target deficit counter quota to obtain a corresponding comparison result, and scheduling tasks according to the comparison result.
[0012] Preferably, the extracting feature information related to execution deviation from the real-time monitoring information, corresponding to obtain structural sparse imbalance degree, memory access merging damage rate, concurrent congestion intensity, batch isomorphism degree, and prediction relative residual, comprises:
[0013] obtaining a current task batch and a current running window to which the new task request belongs;
[0014] obtaining the proportion of non-zero elements in each polynomial or matrix in the current task batch, to form a non-zero element proportion sequence, calculating the mean and variance of the non-zero element proportion sequence, taking the variance as the numerator, and the sum of the mean and a constant 1 as the denominator, to obtain the structural sparse imbalance degree;
[0015] in the current running window, counting the number of accesses that are not merged into aligned transactions and the number of accesses that are merged into aligned transactions to obtain a total number of accesses, and taking the proportion of accesses that are not merged into aligned transactions in the total number of accesses as the memory access merging damage rate;
[0016] obtaining bandwidth occupation proportion, cache miss proportion, and concurrent kernel number proportion, respectively normalizing the bandwidth occupation proportion, cache miss proportion, and concurrent kernel number proportion to obtain corresponding normalized values, and taking the mean of all normalized values as the concurrent congestion intensity;
[0017] According to the operator type and the scale parameter, all tasks in the current task batch are classified to obtain the number of tasks in each class, and according to the number of tasks in each class, the proportion of the maximum task quantity in the total number of tasks in the current task batch is obtained as the batch isomorphism degree;
[0018] At least two historical task requests belonging to the same class of tasks as the new task request are obtained, the time difference value between the actual execution time and the baseline prediction length of each historical task request is calculated respectively to obtain the median of the time difference value, and the median of the baseline prediction length is obtained from the baseline prediction lengths of all historical task requests, so that the median of the baseline prediction length is used as the denominator, and the median of the time difference value is used as the numerator to obtain the prediction relative residual.
[0019] Preferably, the method for constructing the execution length correction factor is:
[0020] The sum of the square of the structural sparse imbalance degree, the square of the memory access merging destruction rate and the square of the concurrent congestion intensity is calculated, the sum of the constant 1 and the sum is used as the denominator, and the sum is used as the numerator to obtain the corresponding ratio; the maximum value of the prediction relative residual and the constant 0 is obtained as the prediction characteristic value; the maximum value of the opposite of the prediction relative residual and the constant 0 is obtained as the adjustment coefficient of the batch isomorphism degree, and the product of the adjustment coefficient and the batch isomorphism degree is obtained; the sum of the constant 1, the prediction characteristic value and the ratio is subtracted from the product to obtain the execution length correction factor.
[0021] Preferably, the method for constructing the execution length correction factor is:
[0022] At least two historical task requests belonging to the same class of tasks as the new task request are obtained, the median of the start time and the median of the data transmission time are obtained according to the start time and the data transmission time of each historical task request, and the sum of the medians is obtained; the product of the execution length correction factor and the baseline prediction length of the new task request is obtained, and the sum of the product and the sum of the medians is recorded as the target execution length of the new task request.
[0023] Preferably, the method for constructing the execution length correction factor is:
[0024] In the current running window, the memory bandwidth utilization rate and the cache miss rate are obtained, the addition result between the memory bandwidth utilization rate and the cache miss rate is calculated, the addition result is normalized to obtain the resource congestion degree;
[0025] According to the target execution length of each task in the current task batch, a length standard deviation and a length average value of all target execution lengths are calculated, the length standard deviation is divided by the length average value, and a task length difference degree is obtained.
[0026] Preferably, the method for constructing the batch scheduling adaptive factor comprises the following steps:
[0027] A difference value between a constant 1 and a batch isomorphism degree is calculated, a multiplication value of the task length difference degree and the difference value is obtained, a batch scheduling adaptive factor is obtained by taking a sum of the constant 1 and the multiplication value as a numerator and taking a sum of the constant 1 and a resource congestion degree as a denominator.
[0028] Preferably, the adjusting of the deficit counter quota of any queue by using the batch scheduling adaptive factor to obtain a target deficit counter quota comprises the following steps:
[0029] A product of the batch scheduling adaptive factor and the deficit counter quota of any queue is taken as the target deficit counter quota.
[0030] Preferably, the task scheduling according to the comparison result comprises the following steps:
[0031] If the target execution length of any task in the any queue is less than or equal to the target deficit counter quota, the any task is executed and transmitted; if the target execution length of any task in the any queue is greater than the target deficit counter quota, the any task is delayed and transmitted.
[0032] Compared with the prior art, the embodiment of the present application has the following beneficial effects:
[0033] The present application is directed to the dynamic task scheduling process of the graphic processing unit resisting quantum cryptography operation. Before the task is scheduled, the feature information (structure sparse imbalance degree, memory merging destruction rate, concurrent congestion intensity, batch isomorphism degree and prediction relative residual) related to execution deviation is extracted, the execution length correction factor is constructed, the baseline prediction length of the task is dynamically corrected, and the correction length (target execution length) closer to the real cost is obtained. Then, in the batch transmission link in the queue, the task length difference degree, batch isomorphism degree and resource congestion degree and other features are extracted, the batch scheduling adaptive factor is constructed, the transmission condition of the deficit round robin and the batch size are dynamically adjusted. In the fusion stage, the target execution length and the batch scheduling adaptive factor are introduced into the weighted fair queuing and the deficit round robin composite framework, which are respectively used for updating the virtual completion time and determining the task transmission condition, so that the task length prediction deviation is effectively eliminated in a feature-driven manner without changing the original scheduling framework structure, the batch task transmission strategy is dynamically adjusted, the scheduling result is more consistent with the actual characteristics of the anti-quantum cryptography operation task, and the double-layer optimization of cross-queue and intra-queue is realized. Attached Figure Description
[0034] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. 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.
[0035] Figure 1 This is a flowchart of a method for efficient scheduling of dynamic tasks in GPUs for quantum cryptography resistance, provided in Embodiment 1 of the present invention. Detailed Implementation
[0036] Embodiments of this disclosure are described in detail below, with examples of these embodiments illustrated in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this disclosure, and should not be construed as limiting it.
[0037] It should be noted that the terms "first," "second," etc., used in this disclosure and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure.
[0038] To illustrate the technical solution of the present invention, specific embodiments are described below.
[0039] See Figure 1 This is a flowchart of a method for efficient scheduling of dynamic tasks in GPUs for quantum cryptography resistance, provided in Embodiment 1 of the present invention. Figure 1 As shown, the method may include:
[0040] Step S101: During the dynamic task scheduling of the GPU against quantum cryptography, when the scheduler receives a new task request, it obtains real-time monitoring information based on the scheduler's running data buffer.
[0041] In the dynamic task scheduling process of the anti-quantum cryptography operation graphics processing unit (GPU), the embodiment of the present application establishes a multi-source data collection mechanism for task execution and system operation, collects and records the key information of the task level and the system level in real time, and archives them to the running data buffer of the scheduler, so that when the scheduler receives a new task request, it can obtain real-time monitoring information based on the running data buffer of the scheduler, wherein the collection and recording method of the real-time monitoring information is as follows:
[0042] At the task level, the scheduler records the baseline prediction length of the task at each task submission, which is determined by the task type and input parameters, such as matrix dimension, polynomial order, hash batch size, etc. During the task execution process, the scheduler obtains the actual execution time of the task through the built-in timing module and compares it with the baseline prediction length for subsequent calculation of the prediction relative residual. During the task batch scheduling process, the scheduler records the execution length of all tasks within the task batch, so as to analyze the task length difference within the queue and count the number of similar tasks and the total number of tasks within the task batch, so as to calculate the batch isomorphism degree.
[0043] At the system level, the scheduler obtains the running state data of the graphics processing unit through the hardware performance counter and the running log interface, including: memory bandwidth utilization, obtained by monitoring the proportion of read / write byte number of memory in unit time to bandwidth peak; cache miss rate, obtained by counting the ratio of cache access times to miss times; and concurrent kernel number ratio, obtained by querying the proportion of the number of currently active stream processors to the maximum available core number. The above running state data is used to calculate the resource congestion intensity. In addition, at the memory access link, the scheduler marks whether each access is merged into an aligned transaction by the hardware through the log interface, so as to count the number of accesses that are not merged into an aligned transaction, the number of accesses that are merged into an aligned transaction, and the total number of accesses, which are used to calculate the memory access merge destruction rate.
[0044] At the data level, all raw data collected at the task level and the system level are uniformly archived to the running data buffer of the scheduler to form real-time monitoring information, wherein the real-time monitoring information includes but is not limited to: baseline prediction length and actual execution time of the task, non-zero element proportion sequence of the polynomial or matrix, memory access record (number of accesses that are not merged into an aligned transaction and number of accesses that are merged into an aligned transaction), memory bandwidth utilization, cache miss rate and concurrent kernel number ratio, number of similar tasks, memory bandwidth utilization and cache miss rate.
[0045] Step S102, extracting the feature information related to the execution deviation in the real-time monitoring information, corresponding to obtain the structural sparse imbalance degree, the memory merging destruction rate, the concurrent congestion intensity, the batch isomorphism degree, the prediction relative residual, to construct the execution length correction factor, obtain the baseline prediction length of the new task request, utilize the execution length correction factor, dynamically correct the baseline prediction length of the new task request, obtain the target execution length, and apply the target execution length to the weighted fair queuing across the queue.
[0046] When the scheduler receives a new task request, the traditional multi-queue priority mechanism is used for dynamic task scheduling of the graphics processor, that is, the combination mechanism of weighted fair queuing and deficit round robin is used to realize the allocation between multi-queue tasks and batch processing within the queue. Although this method can maintain a certain fairness between queues and realize batch transmission within the queue, it still faces two outstanding problems in actual execution: one is the prediction deviation of task execution length, which causes serious distortion of priority marking and polling amount; the other is the mismatch of batch tasks in difference, similarity and resource state, which causes long-term starvation of large tasks, excessive accumulation of small tasks, and repeated occurrence of instantaneous congestion. Therefore, in the embodiment of the present application, when the scheduler receives a new task request, the real-time monitoring information is obtained based on the running data buffer area of the scheduler, which is used to dynamically correct the execution length (i.e. baseline prediction length) of the task before scheduling the task according to the real-time monitoring information, and at the same time, the batch transmission scale in the deficit round robin process is dynamically adjusted in the batch transmission link within the queue, so that the scheduler is optimized at two levels of cross-queue selection and queue internal rotation, so that the dynamic task scheduling of quantum-resistant cryptography operation can meet the real-time requirement and maintain high throughput, thereby realizing efficient utilization of graphics processor resources.
[0047] For the dynamic correction of the task execution length, in the dynamic task scheduling of the quantum-resistant cryptographic operation graphics processor, the estimation deviation of the execution length of the task is the main problem affecting the scheduling accuracy. When making scheduling decisions, the weighted fair queuing algorithm and the deficit round robin algorithm both rely on the execution length of the task as the basis for calculation. If the execution length of the task is greatly different from the real cost, it will lead to distortion of the priority judgment and the task transmission order, and then cause the double decline of real-time performance and throughput. Therefore, the embodiment of the present application proposes a joint analysis method based on task baseline prediction and runtime resource indicators, which dynamically corrects the predicted length of the task before it enters the scheduling, so that the scheduling calculation is more in line with the actual execution. Specifically: the feature information related to the execution deviation is extracted from the real-time monitoring information, including the structural sparse imbalance degree, the memory access merging destruction rate, the concurrent congestion intensity, the batch isomorphism degree, the prediction relative residual, the execution length correction factor is obtained by converting the deviation information into a correction factor, which is used for dynamically correcting the baseline predicted length of the new task request, the corrected length which is closer to the real execution can be obtained, and the corrected length is directly applied to the virtual completion time of the weighted fair queuing and the quota judgment of the deficit round robin, so that the scheduling logic is no longer dependent on a single prediction, but has the ability to adapt to the fluctuations of the running environment.
[0048] The dynamic task scheduling of the quantum-resistant cryptographic operation graphics processor is a dynamic process. Whenever a new task request is received, the new task request is placed in the current runtime task batch and the running window. Therefore, when a new task request is received, the current task batch and the current running window to which the new task request belongs can be determined, and then the real-time monitoring information and the feature information related to the execution deviation in the current task batch and the current running window to which the new task request belongs are used to construct an execution length correction factor.
[0049] The structural sparse imbalance degree is used to represent the difference in structure of the tasks to be executed in the same batch. The proportion of non-zero elements in each polynomial or matrix in the current task batch is obtained to form a non-zero element proportion sequence, and the mean and variance of the non-zero element proportion sequence are calculated. The variance is the numerator, and the sum of the mean and a constant 1 is the denominator to obtain the structural sparse imbalance degree. The value range of the structural sparse imbalance degree is [0, 1]. When the difference in the proportion of non-zero elements in the current task batch is large, it means that the difference in the input structure (i.e. the structure of the new task request) in the current task batch is more obvious, which means that it is more likely to occur thread branch divergence and cache utilization imbalance, and the value of the structural sparse imbalance degree is larger. Conversely, when the proportion of non-zero elements in the current task batch is similar, the structure is more homogeneous, and the value of the structural sparse imbalance degree is smaller.
[0050] The memory access merging destruction rate is used to depict the strength of the merging degree of global memory access being destroyed. In the current running window, all read and write operations in the current running window are counted, the number of accesses not merged into aligned transactions and the number of accesses merged into aligned transactions are counted, the total number of accesses is obtained, and the proportion of the number of accesses not merged into aligned transactions in the total number of accesses is recorded as the memory access merging destruction rate. The memory access merging destruction rate has a value range of [0, 1], and the greater the value, the more inefficient the memory access, the more discrete accesses and alignment failures, and the longer the memory access waiting time. The smaller the value, the higher the access merging degree, and the more sufficient the bandwidth utilization.
[0051] The concurrent congestion intensity is used to reflect the channel congestion degree caused by concurrent running. Based on the three observable quantities of “bandwidth occupation proportion”, “cache miss proportion” and “concurrent core number proportion”, the bandwidth occupation proportion, the cache miss proportion and the concurrent core number proportion are obtained, the maximum and minimum value normalization method is used to normalize the bandwidth occupation proportion, the cache miss proportion and the concurrent core number proportion respectively, the corresponding normalized values are obtained, and the mean value of all normalized values is taken as the concurrent congestion intensity. The concurrent congestion intensity has a value range of [0, 1], and the closer the value to 1, the more the bandwidth is occupied, the more obvious the cache jitter, and the more the number of concurrent cores, and the stronger the influence of mutual resource contention. The closer the value to 0, the more idle the system.
[0052] The batch isomorphism degree is used to represent the consistency of the tasks in the current task batch in shape and scale. According to the operator type (such as matrix multiplication, fast Fourier transform, polynomial multiplication) and the scale parameter (such as matrix dimension, polynomial order, data block size), all tasks in the current task batch are classified to obtain the number of tasks in each class. The class with the most number of tasks is taken as the mainstream configuration, and the proportion thereof can be used for the calculation of the batch isomorphism degree, that is, according to the number of tasks in each class, the proportion of the maximum number of tasks in the total number of tasks in the current task batch is obtained as the batch isomorphism degree. For example, if a task batch contains one hundred tasks, seventy of which have the same type and parameter, the seventy tasks are the mainstream configuration, and the batch isomorphism degree of the task batch is seventy percent, that is, 0.7. The batch isomorphism degree has a value range of [0, 1], and the higher the batch isomorphism degree, the more consistent the matrix dimension, polynomial order and data layout of the current task batch, the smaller the execution time variance, and the more reusable the prediction value. The lower the batch isomorphism degree, the greater the structural difference of the current task batch, and the stronger the execution time fluctuation.
[0053] The prediction relative residual is used to measure the systematic deviation between the predicted execution time and the actual execution time. For a plurality of execution records of the same type of task in a current running window, at least two historical task requests belonging to the same type of task as the new task request are obtained, the time difference between the actual execution time of each historical task request and the baseline prediction length is calculated respectively, the median of the time difference is obtained, the median of the baseline prediction length is obtained among the baseline prediction lengths of all historical task requests, and the median of the time difference is obtained as the numerator and the median of the baseline prediction length as the denominator to obtain a dimensionless prediction relative residual. The prediction relative residual is positive, indicating that the prediction is generally low (actual faster), the prediction relative residual is negative, indicating that the prediction is generally high (actual faster), and the prediction relative residual is close to zero, indicating that the prediction is close to the truth. It should be noted that the median is selected to suppress the interference of extreme values on the result, so that the correction direction is more stable.
[0054] Further, after extracting the structure sparse imbalance degree, the memory merge destruction rate, the concurrent congestion intensity, the batch isomorphism degree and the prediction relative residual, the execution length correction factor is constructed by using the structure sparse imbalance degree, the memory merge destruction rate, the concurrent congestion intensity, the batch isomorphism degree and the prediction relative residual. The specific construction method is: calculate the sum of the squares of the structure sparse imbalance degree, the squares of the memory merge destruction rate and the squares of the concurrent congestion intensity, take the sum of the constant 1 and the sum as the denominator, and take the sum as the numerator to obtain the corresponding ratio; obtain the maximum value in the prediction relative residual and the constant 0, denoted as the prediction characteristic value; obtain the maximum value in the opposite number of the prediction relative residual and the constant 0 as the adjustment coefficient of the batch isomorphism degree, obtain the product of the adjustment coefficient and the batch isomorphism degree; the sum of the constant 1, the prediction characteristic value and the ratio is subtracted from the product to obtain the execution length correction factor.
[0055] The calculation formula of the execution length correction factor is:
[0056]
[0057] The execution length correction factor is represented by 1, and the constant is represented by 0. The maximum value function is represented by max. The structure sparse imbalance degree is represented by The memory merge destruction rate is represented by The concurrent congestion intensity is represented by The batch isomorphism degree is represented by The prediction relative residual is represented by 0.
[0058] It should be noted that when the prediction is generally low, the sparse mode difference increases, the memory access merging is destroyed, or the concurrent congestion is intensified, the execution length correction factor is correspondingly increased, so as to immediately convert the stress of these scenarios into the task length; when the recent (current running window) prediction is high and the current task batch is highly homogeneous, the execution length correction factor is moderately adjusted downward, so as to avoid delaying the task that can be completed quickly due to excessive conservatism. The square and fractional form is adopted, so that when any bottleneck is significantly increased, the overall correction can be significantly amplified, and when multiple bottlenecks exist at the same time, the distortion will not be infinitely accumulated.
[0059] Finally, after obtaining the execution length correction factor, the execution length correction factor is applied to the baseline prediction length to dynamically correct the baseline prediction length and explicitly compensate for the baseline overhead of starting and transmission, to obtain a corrected length for scheduling calculation. The specific dynamic correction method is: obtaining the baseline prediction length of a new task request, obtaining at least two historical task requests belonging to the same type of task as the new task request according to the multiple execution records of the same type of task in the current running window, obtaining the median of the startup time and the median of the data transmission time of each historical task request according to the startup time and the data transmission time of each historical task request, and obtaining the sum of the medians; obtaining the product between the execution length correction factor and the baseline prediction length of the new task request, adding the product to the sum of the medians, and taking the addition value as the target execution length of the new task request, and applying the target execution length to the weighted fair queuing across queues.
[0060] The calculation formula of the target execution length is:
[0061]
[0062] Wherein, L represents the target execution length, represents the execution length correction factor, represents the baseline prediction length of the new task request, represents the sum of the median of the startup time and the median of the data transmission time of the same type of task, that is, the sum of the medians, which is used to ensure that the basic overhead is not underestimated in the small-granularity task scenario.
[0063] It should be noted that the modified execution length (target execution length) will be used for the virtual completion time label of the weighted fair queuing and the deduction determination of the deficit round robin, so that the priority order across queues and the batch transmission within the queue are based on the same "scene-aware" length measurement. Through the modification process of the execution length modification factor, when the structural sparsity imbalance degree, memory merge destruction rate or concurrent congestion intensity increases, the execution length modification factor naturally becomes larger, timely increasing the "perceived length" of the new task in the system, and avoiding the high priority channel being occupied by a short task for a long time; when the predicted relative residual is negative and the batch isomorphism degree is high, the execution length modification factor is automatically reduced, so that the same type of task with actual faster execution obtains a scheduling opportunity earlier. Thus, without changing the original scheduling framework structure, the estimation deviation of the execution length of the task is self-corrected by using the real-time characteristics in the scene, and the consistent goal of improving the real-time performance and the throughput is achieved.
[0064] In step S103, the task size difference feature and the system instantaneous resource state feature are extracted from the real-time monitoring information, and the task length difference degree and the resource congestion degree are obtained correspondingly. The batch scheduling adaptive factor is constructed in combination with the batch isomorphism degree. If any queue in the weighted fair queuing is selected to enter the task transmission, the deficit counter quota of any queue is adjusted by using the batch scheduling adaptive factor to obtain the target deficit counter quota.
[0065] In the dynamic scheduling of the graphics processing unit of the anti-quantum cryptography operation, the deficit round robin mechanism is used for batch task transmission within the queue. However, in the actual application scene, the anti-quantum cryptography task has the characteristics of strong batch, large granularity difference and complex resource dependence, which causes obvious deficiencies in the execution process of the existing deficit round robin mechanism: on the one hand, when there are tasks with significant length difference in the queue, the deficit quota is often insufficient to cover the large task, and the scheduler will repeatedly delay it and preferentially transmit a batch of small tasks, thereby causing long-term starvation of the large task and reducing the fairness and system throughput of the overall scheduling. On the other hand, when the deficit round robin concentrates on transmitting a large number of tasks at a certain moment, since the anti-quantum cryptography operation generally requires frequent video memory access and large-scale data movement, the instantaneous congestion of the video memory bandwidth and the cache system is prone to occur, which causes the task to be transmitted but the actual execution delay to increase significantly, and the overall performance to decrease instead. In addition, the task similarity feature within the batch is not utilized, and the existing deficit round robin mechanism only uses the deficit quota as the transmission basis, which cannot distinguish between small tasks with high homogeneity and large tasks with strong difference, resulting in uneven execution efficiency of the tasks within the same batch, and further amplifying the delay and throughput fluctuation.
[0066] Therefore, in the actual operation process of the existing deficit polling mechanism in the anti-quantum cryptographic operation scene, there are generally problems such as unreasonable batch merging granularity selection leading to large task starvation, batch transmission causing bandwidth and cache congestion, and low efficiency of mixed execution of isomorphic and heterogeneous tasks in batches. These problems cause the internal queue scheduling to be unable to match the task characteristics and system resource state, and become the key technical problem restricting the overall scheduling performance. In the embodiment of the present application, the batch transmission scale in the deficit polling process is dynamically adjusted, that is, by constructing a batch scheduling adaptive factor, the batch transmission in the queue is differentially adjusted, so that the transmission decision not only considers the deficit amount, but also combines the size difference, similarity characteristics of tasks in the batch, and the instantaneous resource state of the system, thereby dynamically adjusting the granularity and order of transmission, avoiding long-term postponement of large tasks, reducing the impact of batch bursts on bandwidth, and improving the efficiency of batch execution of similar tasks.
[0067] To achieve this goal, the embodiment of the present application extracts the task size difference characteristics and the system instantaneous resource state characteristics in the current task batch from the real-time monitoring information, obtains the task length difference degree and the resource congestion degree, and relies on the task length difference degree, batch isomorphic degree and resource congestion degree of the current task batch to construct a batch scheduling adaptive factor. In addition to the deficit amount, dynamic adjustment of large task protection, similar task merging and instantaneous resource pressure is added. The method of constructing the batch scheduling adaptive factor based on the task length difference degree, batch isomorphic degree and resource congestion degree of the current task batch is as follows:
[0068] (1) Obtain the task length difference degree, which is used to measure the discrete degree of the execution length of different tasks in the batch, that is, the size difference of tasks in the batch. When the difference is large, it means that large tasks are more likely to be delayed, and the priority of the large tasks in batch transmission should be improved.
[0069] Specifically, according to the target execution length of each task in the current task batch, the length standard deviation and the length average value of all target execution lengths are calculated, and the length standard deviation is divided by the length average value to obtain the task length difference degree.
[0070] (2) Obtain the resource congestion degree, which is used to reflect the pressure of the system in terms of video memory bandwidth and cache usage. When the congestion degree is high, the batch transmission scale should be reduced to avoid instantaneous resource impact.
[0071] Specifically, in the current running window, the video memory bandwidth utilization rate and the cache miss rate are obtained, the addition result between the video memory bandwidth utilization rate and the cache miss rate is calculated, and the maximum and minimum value normalization method is used to normalize the addition result to obtain the resource congestion degree.
[0072] (3) A batch scheduling adaptive factor is constructed in combination with the task length difference degree, the resource congestion degree and the batch homogeneity degree. Through this factor, large tasks are no longer delayed for a long time due to insufficient quota, small tasks with high homogeneity can be combined for execution to reduce the overhead, and when the bandwidth and cache pressure intensify, the launch size is actively compressed, thereby achieving the balance of difference-driven, similarity-utilized and congestion-inhibited.
[0073] Specifically, a difference between a constant 1 and the batch homogeneity degree is calculated, a multiplication value of the task length difference degree and the difference is obtained, a sum of the constant 1 and the multiplication value is taken as a numerator, and a sum of the constant 1 and the resource congestion degree is taken as a denominator, to obtain the batch scheduling adaptive factor. The calculation formula of the batch scheduling adaptive factor is as follows:
[0074]
[0075] wherein, denotes the batch scheduling adaptive factor, 1 denotes a constant, denotes the task length difference degree, denotes the resource congestion degree, denotes the batch homogeneity degree.
[0076] It should be noted that the formula of the batch scheduling adaptive factor reflects the comprehensive effect of different characteristics on the scheduling logic in batch launch. When the task length difference degree is large and the batch homogeneity degree is low, the value of the numerator part increases, and the batch scheduling adaptive factor increases, thereby relaxing the deficit quota, so that large tasks can be scheduled earlier to avoid long starvation; when the batch homogeneity degree is high, the product term in the numerator part decreases, so that the batch scheduling adaptive factor relatively decreases, indicating that similar tasks can be launched in batches to reduce the start and memory overhead. When the resource congestion degree rises, the denominator increases, resulting in the batch scheduling adaptive factor being tightened, which limits the size of the instantaneous batch, thereby relieving the pressure on the bandwidth and cache. The batch scheduling adaptive factor is based on the internal structural characteristics of the batch task and the running characteristics of the external system, and dynamically adjusts the launch behavior of the deficit round robin. Through the batch scheduling adaptive factor, the deficit round robin is changed from a simple quota determination to a multi-dimensional decision-making process of “difference-driven, similarity-utilized and congestion-inhibited”. When the difference is prominent, the value of the numerator part is enlarged to ensure that large tasks are scheduled; when the batch homogeneity is high, the numerator part is contracted to promote batch combined execution; when the resource congestion intensifies, the numerator part is actively compressed to avoid instantaneous performance degradation. Finally, the scheduling process inside the queue is more closely coupled with the task characteristics and the system state, and the balance between real-time performance and throughput is achieved.
[0077] At this time, the embodiment of the application obtains two types of key optimization quantities: one is the execution length correction factor and the corrected task length (target execution length), which is used to eliminate the interference of baseline prediction deviation on scheduling decision; the other is the batch scheduling adaptive factor, which is used to dynamically adjust the batch transmission scale in the deficit round robin process, so that the scheduling behavior matches the difference of batch tasks and the system resource state. Then, the two are uniformly introduced into the scheduling framework to realize the fusion optimization of weighted fair queuing and deficit round robin. The fusion process takes the target execution length as the basis for cross-queue priority judgment and takes the batch scheduling adaptive factor as the adjustment weight of batch transmission in the queue, so that the two coordinate under the same logic. Through this mechanism, the embodiment of the application realizes the transition from "prediction-driven" to "feature-driven", so that the scheduling process can avoid the order mismatch caused by prediction distortion and prevent resource congestion caused by improper batch processing, thereby achieving consistent optimization between real-time performance and throughput.
[0078] Specifically, at the cross-queue level, the target execution length is taken as the weight basis to update the virtual completion time label of the weighted fair queuing, so that the scheduler can perform queuing based on an index closer to the real cost when selecting a queue, avoiding priority distortion caused by prediction deviation. At the queue internal level, the scheduler no longer relies on the deficit counter amount, but takes the batch scheduling adaptive factor as the adjustment coefficient to redefine the task transmission judgment condition. Therefore, when any queue in the weighted fair queuing is selected to enter task transmission, the batch scheduling adaptive factor is used to adjust the deficit counter amount of any queue to obtain a target deficit counter amount, and the adjustment method is: taking the product of the batch scheduling adaptive factor and the deficit counter amount of any queue as the target deficit counter amount. Further, the judgment condition of task transmission is modified as:
[0079]
[0080] Wherein, L represents the target execution length, represents the deficit counter amount of any queue, represents the batch scheduling adaptive factor, represents the target deficit counter amount of any queue.
[0081] Through the judgment condition, the system can dynamically balance the task length deviation and the batch transmission scale, so that the scheduling behavior has dual optimization capabilities of length correction and batch adaptation. If the target execution length of a task meets the judgment condition, the task is transmitted for execution; if the condition is not met, the task is delayed to the next round and continues to accumulate the deficit amount until the condition is met.
[0082] Step S104, comparing the target execution length of each task in any queue with the target deficit counter allowance, obtaining a corresponding comparison result, and scheduling the task according to the comparison result.
[0083] After determining the determination condition, if the target execution length of any task in the any queue is less than or equal to the target deficit counter allowance, the any task is preferentially transmitted, that is, the any task is executed and transmitted, so as to ensure real-time performance and improve overall throughput; if the target execution length of any task in the any queue is greater than the target deficit counter allowance, the any task is delayed to the next round of scheduling, that is, the any task is delayed and transmitted, and the deficit counter of the any task continues to accumulate, so as to ensure that the any task will not be permanently skipped.
[0084] It should be noted that the graphic processor task scheduling method provided by the embodiments of the present application cooperates the execution length correction factor and the batch scheduling adaptive factor in the whole running process, the former ensures the accurate perception of the real cost of the task by the scheduler, and avoids the false short task occupying the high priority channel; the latter ensures the adaptive matching of the batch transmission in the queue and the system resource state, and avoids the congestion risk caused by the long-term delay of the large task and the batch transmission. The scheduler is optimized at two levels of cross-queue selection and queue internal rotation, so that the dynamic task scheduling of the quantum-resistant password operation can meet the real-time requirement and maintain a high throughput, so as to realize the efficient use of the graphic processor resources.
[0085] The above embodiments are only used to illustrate the technical solutions of the present application, but not limit the present application; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalent ones; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A GPU dynamic task efficient scheduling method for quantum-resistant cryptographic operation, characterized in that, The method comprises: In the process of dynamic task scheduling of a graphics processing unit resisting quantum cryptography operation, when a new task request is received by a scheduler, real-time monitoring information is obtained based on a running data buffer area of the scheduler; In the real-time monitoring information, feature information related to execution deviation is extracted, and a structure sparsity imbalance degree, a memory access merging damage rate, a concurrent congestion intensity, a batch isomorphism degree, and a prediction relative residual are obtained correspondingly to construct an execution length correction factor, obtain a baseline prediction length of the new task request, dynamically correct the baseline prediction length of the new task request by using the execution length correction factor, obtain a target execution length, and apply the target execution length to a weighted fair queuing across queues; In the real-time monitoring information, task size difference features and system instantaneous resource state features are extracted, and a task length difference degree and a resource congestion degree are obtained correspondingly, and a batch scheduling adaptive factor is constructed in combination with the batch isomorphism degree, and if any queue in the weighted fair queuing is selected to enter task emission, the target deficit counter quota of the any queue is adjusted by using the batch scheduling adaptive factor to obtain a target deficit counter quota. The target execution length of each task in the any queue is compared with the target deficit counter quota to obtain a corresponding comparison result, and task scheduling is performed according to the comparison result.
2. The GPU dynamic task efficient scheduling method for anti-quantum cryptographic operation according to claim 1, characterized in that, The extracting, in the real-time monitoring information, of feature information related to execution deviation to obtain a structure sparsity imbalance degree, a memory access merging damage rate, a concurrent congestion intensity, a batch isomorphism degree, and a prediction relative residual comprises: A current task batch and a current running window to which the new task request belongs are obtained; A proportion of non-zero elements in each polynomial or matrix in the current task batch is obtained to form a non-zero element proportion sequence, a mean and a variance of the non-zero element proportion sequence are calculated, the variance is taken as a numerator, and a sum of the mean and a constant 1 is taken as a denominator to obtain the structure sparsity imbalance degree; In the current running window, a number of accesses that are not merged into aligned transactions and a number of accesses that are merged into aligned transactions are counted to obtain a total number of accesses, and a proportion of the accesses that are not merged into aligned transactions in the total number of accesses is taken as the memory access merging damage rate; A bandwidth occupation proportion, a cache miss proportion, and a concurrent core number proportion are obtained, the bandwidth occupation proportion, the cache miss proportion, and the concurrent core number proportion are normalized respectively to obtain corresponding normalized values, and a mean of all the normalized values is taken as the concurrent congestion intensity; All tasks in the current task batch are classified according to operator types and scale parameters to obtain a number of tasks in each class, and a proportion of a maximum task number in a total number of tasks in the current task batch is taken as the batch isomorphism degree according to the number of tasks in each class. Obtaining at least two historical task requests belonging to the same type of task as the new task request, calculating the time difference value between the actual execution time and the baseline prediction length of each historical task request respectively, obtaining the median of the time difference value, obtaining the median of the baseline prediction length among all historical task requests, taking the median of the baseline prediction length as the denominator and the median of the time difference value as the numerator to obtain the prediction relative residual.
3. The GPU dynamic task efficient scheduling method for anti-quantum cryptographic operation according to claim 1, characterized in that, The method for constructing the execution length correction factor is: Calculate the addition value of the square of the structure sparse imbalance degree, the square of the memory merge destruction rate, and the square of the concurrent congestion intensity, take the sum of the constant 1 and the addition value as the denominator, and take the addition value as the numerator to obtain the corresponding ratio; obtain the maximum value in the prediction relative residual and the constant 0 as the prediction characteristic value; obtain the maximum value in the opposite number of the prediction relative residual and the constant 0 as the adjustment coefficient of the batch isomorphism degree, and obtain the product of the adjustment coefficient and the batch isomorphism degree; difference between the sum of the constant 1, the prediction characteristic value and the ratio and the product to obtain the execution length correction factor.
4. The GPU dynamic task efficient scheduling method for anti-quantum cryptographic operation of claim 1, wherein, The method for constructing the execution length correction factor is: Obtain at least two historical task requests belonging to the same type of task as the new task request, obtain the median of the start time and the median of the data transmission time according to the start time and the data transmission time of each historical task request, and obtain the sum of the medians; obtain the product between the execution length correction factor and the baseline prediction length of the new task request, and take the addition value of the product and the sum of the medians as the target execution length of the new task request.
5. The GPU dynamic task efficient scheduling method for anti-quantum cryptographic operation according to claim 2, characterized in that, The method for constructing the execution length correction factor is: In the current running window, obtain the memory bandwidth utilization rate and the cache miss rate, calculate the addition result between the memory bandwidth utilization rate and the cache miss rate, normalize the addition result to obtain the resource congestion degree; According to the target execution length of each task in the current task batch, calculate the length standard deviation and the length average value of all target execution lengths, and divide the length standard deviation by the length average value to obtain the task length difference degree.
6. The GPU dynamic task efficient scheduling method for anti-quantum cryptographic operation according to claim 1, wherein, The method for constructing the batch scheduling adaptive factor is: Calculate the difference between the constant 1 and the batch isomorphism degree to obtain the multiplication value of the task length difference degree and the difference, take the sum of the constant 1 and the multiplication value as the numerator, and take the sum of the constant 1 and the resource congestion degree as the denominator to obtain the batch scheduling adaptive factor.
7. The GPU dynamic task efficient scheduling method for anti-quantum cryptographic operation according to claim 1, wherein, The method for constructing the execution length correction factor is: Take the product of the batch scheduling adaptive factor and the deficit counter quota of any queue as the target deficit counter quota.
8. The GPU dynamic task efficient scheduling method for anti-quantum cryptographic operation according to claim 1, wherein, The method for constructing the execution length correction factor is: If a target execution length of any task in the any queue is less than or equal to the target deficit counter allowance, the any task is executed for launch; if a target execution length of any task in the any queue is greater than the target deficit counter allowance, the any task is launched late.
Citation Information
Patent Citations
Mixed-platform, multi-task and multi-printer batch printing algorithm
CN119473182A
A method for task scheduling with a simulated annealing-based approach in the cloud computing
US20220019463A1