Algorithm module scheduling method

By introducing the principle of aligning drafting depth and page granularity as integer multiples in the multi-module algorithm framework, the management of cache page resources is optimized, which solves the problems of low cache page utilization and fluctuation in task batch loading, and achieves stability and performance improvement in system scheduling.

CN121742999AActive Publication Date: 2026-03-27BEIJING DARONGXIN TECHNOLOGY GROUP CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-12
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

In the existing system, due to improper management of cache page resources within a multi-module algorithm framework, the utilization rate of cache pages is low, the batch loading of tasks fluctuates, affecting the system scheduling balance and causing latency and resource contention issues.

Method used

By introducing the principle of aligning drafting depth with page granularity as an integer multiple, unified scheduling parameters for the drafting and verification modules are determined, ensuring that the length of the generated result matches the page allocation granularity, optimizing the utilization of cached pages, establishing a mathematical correspondence between concurrent micro-batch capacity and cycle time, and achieving precise allocation and stable scheduling of resources.

Benefits of technology

It significantly improves the utilization of cached pages, reduces storage waste, stabilizes the execution rhythm between multiple modules, increases the maximum concurrent micro-batch capacity and end-to-end throughput, and solves the problems of capacity oscillation and performance degradation in traditional scheduling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121742999A_ABST
    Figure CN121742999A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of algorithm module scheduling, and discloses an algorithm module scheduling method, which comprises the following steps of: firstly, acquiring a page size, a total page budget, a draft acceptance rate, a draft module service rate and a verification module service rate of a key value cache; calculating the expected length of the accepted prefix according to the draft acceptance rate, and determining the target draft drawing depth of the accepted prefix aligned with the integral multiple of the page size; calculating single-request peak page occupation according to the target draft depth, and obtaining the maximum concurrent micro-batch capacity in combination with the total page budget; further determining a beat period based on the service rates of the draft module and the verification module; and finally, mapping the requests to a fixed time coordinate and slot position according to an arrival sequence, and outputting a scheduling result containing the target draft depth and the mapping relationship. According to the method, the high utilization rate of the cache page can be realized under the condition that the page resources are fixed, the periodic fluctuation of the concurrent capacity is eliminated, and the overall execution efficiency and stability of a multi-module algorithm system are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of algorithm module scheduling, and more particularly to an algorithm module scheduling method. BACKGROUND

[0002] In recent years, multi-module algorithm frameworks, especially inference systems, require multiple models or algorithm stages to work collaboratively in a single task. For example, in a speculative generation inference, a front-end module is responsible for generating draft results, and a back-end module is responsible for verifying and retaining acceptable parts. Although this working mechanism improves the average execution speed, due to the statistical differences in the running time and output length of the two modules, the system must save the intermediate results through cache pages to maintain the continuity of the data flow. Existing systems usually manage the cache space in fixed page sizes to quickly allocate and recycle memory. However, the length of the draft generated by the algorithm is not fixed, and the acceptance rate between different requests differs significantly. As a result, when there is a deviation between the generated content and the page granularity, some pages cannot be completely filled, and the remaining space cannot be immediately reused, causing the actual available page number to fluctuate on the time axis. This fluctuation directly affects the loading capacity of the task batch, thereby disrupting the scheduling balance of the system.

[0003] Specifically, when generating a draft, the drafting module reserves multiple pages at once to store temporary results; when the verification module confirms part of the results, only part of the pages are permanently retained, and the remaining pages are marked as recyclable, but since the page is the smallest management unit, it cannot be immediately reallocated; the acceptance rate of different tasks is uneven, resulting in uneven occupation and release rhythm of cache pages, periodic peaks and valleys; the scheduler fails to recognize this periodic resource occupation pattern and continues to schedule batch sizes based on the average value, causing delays to rise when page utilization is low and resource contention to occur when utilization is high. SUMMARY

[0004] The present application provides an algorithm module scheduling method, which solves the technical problem of how to determine the unified scheduling parameters of the drafting and verification modules under the condition of limited cache page resources, so that the length of the generated results and the page allocation granularity are periodically matched, thereby stabilizing the parallel batch processing capacity of the system and reducing the delay fluctuation.

[0005] The present application provides an algorithm module scheduling method, comprising: obtaining the page size, total page budget, and draft acceptance rate of the key-value cache; determining a target drafting depth that aligns the expected length of the accepted prefix with the page size in integer multiples according to the draft acceptance rate; calculating the maximum concurrent micro-batch capacity using the total page budget according to the single-request peak page occupation corresponding to the target drafting depth; The cycle time is determined based on the service rates of the drafting and verification modules. Based on the maximum concurrent micro-batch capacity and cycle time, requests are mapped to specific time coordinates and slots in the order of arrival, and the scheduling results containing the target drafting depth and mapping relationship are output.

[0006] The beneficial effects of this invention include: by introducing an integer multiple alignment principle between drafting depth and page granularity during the algorithm module scheduling process, a definite correspondence is established between the length of the retained draft prefix and the size of the key-value cache page, achieving precise utilization and periodic stable allocation of page resources. This method can maintain high consistency in cache page utilization under different draft acceptance rates, significantly reducing storage waste caused by intra-page fragmentation; simultaneously, by establishing a mathematical correspondence between the scheduling cycle period and the concurrent micro-batch capacity, the execution rhythm between multiple modules is synchronized in both time and space dimensions, thereby stably improving the maximum concurrent micro-batch capacity and end-to-end throughput without increasing page resources, and improving the capacity oscillation and performance degradation problems that occur in traditional scheduling when page allocation granularity is mismatched. Attached Figure Description

[0007] Figure 1 The paging resonance effect of this invention can significantly improve the maximum concurrent capacity graph; Figure 2 This is a heatmap comparing the memory page utilization rates of the paging resonance scheduling of the present invention with those of the traditional scheduling. Figure 3 This is a flowchart of an algorithm module scheduling method according to the present invention. Detailed Implementation

[0008] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the subject matter described herein, and changes may be made to the function and arrangement of the elements discussed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the examples. Furthermore, features described in some examples may be combined in other examples.

[0009] like Figure 1 As shown, Figure 1 The scheduling method of this invention and the comparison method are presented at different draft acceptance rates. Maximum concurrent micro-batch capacity Relationship curve; experimental parameters fixed at page size Maximum drafting depth Total budget The dashed lines represent a comparison method, following... The slow rise of the solid line is the method of the present application, and the curve shows a plateau and a stepped ladder trend, and there are obvious capacity peaks in several intervals. The gray area in the figure is the capacity gain compared with the comparison method; the position marked as the resonance peak corresponds to the case where the expected length of the reserved prefix is close to an integer multiple of the page size, the in-page free space is minimized, the loadable concurrent micro-batch capacity is greatly improved; the resonance gain area between adjacent peaks is the section where the capacity is better than the comparison method; the step effect is the integer alignment boundary, and if the draft depth is not selected according to the rules of the present application, the in-page fragmentation increases and the capacity falls back. Figure 1 It is shown that under the conditions of given page size, maximum draft depth and total page budget, by deterministically selecting the draft depth to match the expected reserved prefix with the page granularity, the discrete constraints of page resources can be converted into predictable capacity jumps, thereby significantly improving the maximum concurrent micro-batch capacity within a wide range of draft acceptance rates.

[0010] As shown in Figure 2 , Figure 2 , the memory page utilization distribution of the traditional alignment method and the scheduling method of the present application in the two-dimensional space of draft acceptance rate and draft depth is compared under the condition of the same page size of sixteen. The left graph is the traditional method, the horizontal axis is the draft acceptance rate, the vertical axis is the draft depth, and the gray scale represents the actual page utilization. It can be seen that there is a large area of low utilization and obvious fragmentation depression, which shows that when the length of the reserved prefix does not match the page size, the in-page free space is difficult to reuse, resulting in a long-term low-efficiency state. The right graph is the method of the present application, which appears as multiple bright high-utilization bands under the same coordinate system and color scale, and the utilization rate can approach 100%. These high-utilization bands correspond to the calculation of the expected length of the reserved prefix, and the selection of the draft depth that matches the length with an integer multiple of the page size, so that the page allocation and release form a stable match within the beat, significantly reducing the fragmentation. Figure 2 It is shown that under a wide range of draft acceptance rate and draft depth combinations, the present application can convert the originally dispersed low-utilization area into a predictable high-utilization band, so that the video memory page resources are fully and stably used.

[0011] As shown in Figure 3 , an algorithm module scheduling method comprises: Obtaining the page size, total page budget and draft acceptance rate of the key-value cache; According to the draft acceptance rate, determining the target draft depth that aligns the expected length of the accepted prefix with an integer multiple of the page size; According to the single-request peak page occupancy corresponding to the target draft depth, calculating the maximum concurrent micro-batch capacity using the total page budget; Determining the beat period based on the service rate of the draft module and the verification module; Based on the maximum concurrent micro-batch capacity and cycle time, requests are mapped to specific time coordinates and slots in the order of arrival, and the scheduling results containing the target drafting depth and mapping relationship are output.

[0012] In one embodiment of the invention, page size, total page budget, and draft acceptance rate include: The page size is the number of key-value entries that a single paginated key-value cache page can hold; The total page budget is the total number of physical pages in system memory that can be allocated and used simultaneously. The draft acceptance rate is the statistical value of the probability that a single draft entry will be retained by the validation module.

[0013] Define three physical and statistical parameters for the scheduling method of this algorithm: Page size is denoted as Unit: Items / Page; Total page budget is recorded as Unit: Page; The draft acceptance rate is recorded as ; Unit: dimensionless; It should be noted that existing large language model inference engines (such as the PagedAttention mechanism) do not allocate GPU memory per token, but rather use pagination management. Ignoring page size ( This can lead to a mismatch between the granularity of memory allocation and reclamation, resulting in severe internal fragmentation.

[0014] Total page budget ( The key-value cache (KVCache) is a hard physical limit imposed by the hardware (GPU memory) on the key-value cache, which determines the maximum capacity of the system.

[0015] Draft acceptance rate ( ) is an attribute in the speculative decoding scenario, reflecting the probability of passing the small model drafting and large model validation.

[0016] In the specific implementation of the project, and Directly read the configuration files of the self-inference engine (such as vLLM's block_size and gpu_memory_utilization). This is obtained through runtime sliding window statistics. Specifically, (initialization) a fixed-length window is maintained in memory. First-in-first-out queue (e.g.) (Record) Each reasoning step. After completion, the number of draft tokens for this step ( ) and "Number of accepted tokens" ) Enqueue; if the queue is full, remove the oldest set of data. (Compute) Compute the average acceptance rate within the real-time computation window: ; (Update) Update the computed value as the draft acceptance rate for the next scheduling period.

[0017] In one embodiment of the present application, according to the draft acceptance rate, a target draft depth is determined to align the expected length of accepted prefixes to be an integer multiple of the page size, comprising: For each candidate draft depth, subtract the candidate draft depth power of the draft acceptance rate from the value one to obtain a first value; multiply the draft acceptance rate by the first value to obtain a second value; subtract the draft acceptance rate from the value one to obtain a third value; divide the second value by the third value to obtain the expected length of continuous prefixes reserved by the checking module; Divide the expected length of continuous prefixes by the page size, perform a rounding operation on the obtained quotient, and multiply the rounding result by the page size to obtain the integer multiple alignment length; Calculate the absolute value of the difference between the expected length of continuous prefixes and the integer multiple alignment length, and determine the candidate draft depth that minimizes the absolute value of the difference as the target draft depth.

[0018] Finding a best target draft depth is denoted as .

[0019] Step 1: Calculate the expected length of continuous prefixes ; Subtract the candidate draft depth power of the draft acceptance rate from the value one... to obtain the expected length of continuous prefixes reserved by the checking module ; wherein, denotes the candidate draft depth, denotes the candidate draft depth power of the draft acceptance rate. denotes the first value, denotes the second value, denotes the third value.

[0020] Step 2: Calculate the integer multiple alignment length ; Divide the expected length of continuous prefixes by the page size, perform a rounding operation on the obtained quotient... to obtain the integer multiple alignment length ; wherein, denotes the rounding operation, denotes the page size.

[0021] Step 3: Determine the target draft depth ; Calculate the absolute value of the difference between the expected length of consecutive prefixes and the integer multiple of the alignment length... and determine it as the target drafting depth. ; in, This represents the absolute value of the difference.

[0022] It should be noted that in speculative decoding, the actual length of the accepted token sequence is a random variable, following a truncated geometric distribution, with its mean being... .when Not divisible by page size This means that, statistically, each request will generate a non-full tail page (i.e., internal fragmentation). This fragmentation is amplified in continuous batch processing, significantly reducing memory utilization.

[0023] In one embodiment of the present invention, the peak page occupancy per single request corresponding to the target drafting depth includes: Divide the target drafting depth by the page size, and round up the resulting quotient to get the number of pages occupied by the draft. Divide the expected length of the consecutive prefixes retained by the verified module corresponding to the target drafting depth by the page size, and round up the resulting quotient to obtain the number of pages to be retained. Add the number of pages used for drafting to the number of pages used for retention to get the peak page usage per request.

[0024] Through mathematical optimization, the amount of effective data generated by statistical expectation is forced to be limited. ) and the storage boundary of physical pages ( Alignment.

[0025] When the absolute value of the difference is at its minimum, the statistical level of memory fragmentation is reduced to a minimum, and the system enters a resonance state, thus enabling more concurrent requests to be packed into the limited memory.

[0026] In the worst-case scenario, the peak page occupancy of a single request under resonant conditions is calculated and denoted as... .

[0027] Step 1: Calculate the number of pages required for the draft. ; Divide the target drafting depth by the page size and round the resulting quotient up. ; Step 2: Calculate the number of pages to be reserved ; Divide the expected length corresponding to the target drafting depth by the page size, and round up the resulting quotient. ; Step 3: Calculate peak page usage per single request ; Add draft occupancy to reserved occupancy ; Draft occupancy represents the amount of GPU memory that must be pre-allocated for all generated draft tokens at the draft phase, regardless of whether they are eventually accepted or not. This is a rigid requirement for physical allocation.

[0028] Reserved occupancy represents the amount of GPU memory that needs to be reserved for the surviving valid prefixes after the end of the check phase.

[0029] It is worth noting that in the engineering implementation of pipeline parallelism or asynchronous recycling, in order to ensure the absolute safety of scheduling, we adopt a conservative strategy (Conservative Estimation). That is, there is an overlapping peak between the space required for drafting and the space reserved after the last check within this scheduling beat.

[0030] represents the maximum page-level resource budget required to process a request under this optimized target draft depth .

[0031] In an embodiment of the present application, according to the single-request peak page occupancy corresponding to the target draft depth, the maximum concurrent micro-batch capacity is calculated using the total page budget, including: Divide the total page budget by the single-request peak page occupancy to obtain a quotient, and perform a floor operation on the quotient. The result of the floor operation is taken as the maximum concurrent micro-batch capacity.

[0032] Since the has been resonantly aligned, the at this time is actually near the integer boundary of the local minimum. Therefore, the peak occupancy calculated based on this is the minimum value after fragmentation optimization, which lays the foundation for subsequent maximum batch processing capacity.

[0033] Calculate the maximum parallel processing capacity of the system constrained by GPU memory, that is, the maximum concurrent micro-batch capacity .

[0034] Wherein, represents the maximum concurrent micro-batch capacity (unit: number of requests / batch), represents the total page budget (unit: page), which corresponds to the total number of physical pages available for simultaneous allocation in the system memory, represents the single-request peak page occupancy (unit: page / request), which corresponds to the sum of the draft occupancy page number and the reserved occupancy page number, represents the floor operation (Floor Function), which corresponds to performing a floor operation on the quotient.

[0035] It's important to note that in inference systems, video memory (KVCache) is the absolute bottleneck resource. To ensure system stability, video memory overflow (OOM) is strictly prohibited. Therefore, the maximum concurrency of the system is... Must meet .

[0036] By division and rounding down Calculate the total budget under the worst-case scenario (PeakUsage). The number of integer requests that can be safely handled.

[0037] By optimizing the target drafting depth This makes the page occupancy of a single request... It reached a local minimum (i.e., eliminated intra-page fragmentation).

[0038] because It was reduced (as a denominator). (As a merchant) it will increase accordingly.

[0039] It should be noted that, due to The existence of right The changes exhibit a step-function response. Resonant alignment is precisely to ensure... Falling into the ability to make The optimal range for leaping to the next level is found, thereby maximizing the system's throughput.

[0040] In one embodiment of the present invention, determining the cycle time based on the service rates of the drafting module and the verification module includes: Divide the target drafting depth by the drafting module service rate to obtain the time required for the drafting stage; divide the expected length of the continuous prefix retained by the verification module corresponding to the target drafting depth by the verification module service rate to obtain the time required for the verification stage; select the larger value between the time required for the drafting stage and the time required for the verification stage to determine the cycle time.

[0041] A unified time base for scheduling algorithm modules is determined, namely the cycle time (denoted as ). ).

[0042] Step 1: Calculate the time required for the drafting phase. ; Step 2: Calculate the time required for the verification phase. ; Step 3: Determine the beat period ; in, Indicates the target drafting depth (unit: entries). Drafting module service rate (unit: entry / sec), meaning the number of tokens generated by the drafting model per second, Duration of the drafting phase (unit: second), Expected length of the continuous prefix retained by the verification module (unit: entry), Verification module service rate (unit: entry / sec), meaning the number of tokens verified by the verification model per second, Duration of the verification phase (unit: second), Beat cycle (unit: second), that is, the length of the time window of unified scheduling, Select the larger value.

[0043] It should be noted that the architecture of continuous batching combined with speculative decoding is adopted. In order to realize deterministic scheduling (that is, without complex dynamic queue checking), the system needs a unified heartbeat or beat. Within the same beat, the system needs to ensure that the drafting and verification actions have enough time to complete, otherwise pipeline congestion (Pipeline Bubble) or data competition will occur.

[0044] It should be noted that, is the time to generate drafts, is the time to verify valid tokens. Take the maximum value , which means that the system sets a unified rhythm according to the speed of the slowest link. Although this seems to be limited by the slow module, combined with staggered slot mapping, this deterministic waiting eliminates the additional overhead caused by resource contention (Race Condition) and frequent context switching (Context Switching) in dynamic scheduling.

[0045] In an embodiment of the present application, according to the maximum concurrent micro-batch capacity and the beat cycle, the requests are mapped to the determined time coordinates and slots in the order of arrival, and the scheduling result containing the target drafting depth and the mapping relationship is output, including: For each request numbered from zero in the order of arrival, divide the number of the request by the maximum concurrent micro-batch capacity to obtain a quotient and a remainder; the down rounding result of the quotient is determined as the batch index of the request; the remainder is determined as the slot index of the request within the beat corresponding to the batch index; and the batch index is multiplied by the unified beat cycle to obtain the drafting start time of the request; Add the drafting start time to the duration of the drafting phase to obtain the verification start time of the request; Construct and output the scheduling result, which contains the target drafting depth, the maximum concurrent micro-batch capacity, the beat cycle, and the spatiotemporal mapping relationship for any request number composed of the drafting start time, the verification start time, and the slot index.

[0046] In order to establish a unique deterministic mapping from the request arrival order to the execution spatiotemporal coordinates.

[0047] Let be the request index numbered from zero starting from the arrival order ( ).

[0048] Step 1: Calculate the batch index and the slot index ; Divide the number of this request by the maximum concurrent micro-batch capacity to get the quotient and the remainder; the down-round result of the quotient is determined as the batch index of this request; the remainder is determined as the slot index of this request in the , ; is equivalent to , that is, the remainder operation; Step 2: Calculate the drafting start time ; Multiply the batch index by the beat cycle to get the drafting start time of this request ; Step 3: Calculate the verification start time ; Add the drafting start time to the required duration of the drafting phase to get the verification start time of this request ; Step 4: Construct the scheduling result ; Construct and output the scheduling result... contains the target drafting depth, the maximum concurrent micro-batch capacity, the beat cycle, and... spatiotemporal mapping relationship ; Wherein, represents the number of requests (dimensionless integer), representing the global order of the request arriving at the system, represents the maximum concurrent micro-batch capacity (unit: number of requests / batch), represents the batch index (dimensionless integer), representing the time window batch to which the request is allocated, represents the slot index (dimensionless integer), representing the specific channel position occupied by the request in the video memory (the value range is to ), represents the beat cycle (unit: seconds), represents the drafting start time (unit: seconds), indicating the absolute time point when the request enters the drafting module, represents the duration of the drafting phase (unit: seconds), represents the check start time (unit: seconds), indicating the absolute time point when the request enters the check module, represents the scheduling result, containing a set object of static parameters and dynamic mapping functions.

[0049] It should be noted that the traditional scheduling method usually adopts First Come First Served (FCFS) queue combined with dynamic allocation of video memory pool. When a request arrives, the scheduler needs to check in real time whether there is free memory, and if not, it will be blocked. This judgment logic involves a large number of conditional branches (if has_memory then run else wait), which will cause unpredictable tail latency under high concurrency.

[0050] Using the (maximum capacity based on paging resonance optimization) and (tick) calculated in the previous steps, a virtual two-dimensional grid coordinate system is constructed. The horizontal axis is time (with as the step size); the vertical axis is space (with as the modulus). Any request does not need to query the current system state, but can directly calculate the corresponding space-time coordinates by modular arithmetic (Modular Arithmetic) based on its number.

[0051] It should be noted that is the remainder of divided by , and is the safe upper limit strictly calculated according to the total page budget , so the total video memory occupancy of the requests mapped to the same tick must be . Thus, it is guaranteed that there is no need for runtime memory checking, and OOM (memory overflow) will never occur.

[0052] It should be noted that ensures that the check module is started immediately after the drafting module. Since the definition of covers the slowest link, this rigid timing ensures that there will be no congestion between the two modules, achieving theoretical maximization of throughput.

[0053] The scheduling result is a packaged object that provides all necessary control parameters, so that the downstream reasoning engine (Executor) only needs to execute according to the table.

[0054] The above describes the embodiments of the present embodiment, but the present embodiment is not limited to the above-described specific embodiments, and the above-described specific embodiments are only illustrative but not restrictive, and those skilled in the art can make many forms under the inspiration of the present embodiment, which all belong to the protection of the present embodiment.

Claims

1. A method for scheduling algorithm modules, characterized in that, include: Get the page size of the key-value cache, the total page budget, and the draft acceptance rate; Based on the draft acceptance rate, determine the target drafting depth so that the expected length of the accepted prefix is ​​aligned with an integer multiple of the page size; Based on the peak page occupancy per single request corresponding to the target drafting depth, the maximum concurrent micro-batch capacity is calculated using the total page budget. The cycle time is determined based on the service rates of the drafting and verification modules. Based on the maximum concurrent micro-batch capacity and cycle time, requests are mapped to specific time coordinates and slots in the order of arrival, and the scheduling results containing the target drafting depth and mapping relationship are output.

2. The algorithm module scheduling method according to claim 1, characterized in that, Page size, total page budget, and draft acceptance rate, including: The page size is the number of key-value entries that a single paginated key-value cache page can hold; The total page budget is the total number of physical pages in system memory that can be allocated and used simultaneously. The draft acceptance rate is the statistical value of the probability that a single draft entry will be retained by the validation module.

3. The algorithm module scheduling method according to claim 2, characterized in that, Based on the draft acceptance rate, determine the target drafting depth so that the expected length of the accepted prefix is ​​an integer multiple of the page size, including: For each candidate drafting depth, subtract the draft acceptance rate raised to the power of the candidate drafting depth from the first value to obtain the first value; multiply the draft acceptance rate by the first value to obtain the second value; subtract the draft acceptance rate from the first value to obtain the third value; divide the second value by the third value to obtain the expected length of the continuous prefix retained by the verification module. Divide the expected length of the consecutive prefixes by the page size, round the quotient to the nearest integer, and multiply the rounded result by the page size to obtain an integer multiple of the alignment length. The absolute value of the difference between the expected length of consecutive prefixes and the integer multiple of the alignment length is calculated, and the candidate drafting depth that minimizes the absolute value of the difference is determined as the target drafting depth.

4. The algorithm module scheduling method according to claim 3, characterized in that, The peak page usage per request corresponding to the target drafting depth includes: Divide the target drafting depth by the page size, and round up the resulting quotient to get the number of pages occupied by the draft. Divide the expected length of the consecutive prefixes retained by the verified module corresponding to the target drafting depth by the page size, and round up the resulting quotient to obtain the number of pages to be retained. Add the number of pages used for drafting to the number of pages used for retention to get the peak page usage per request.

5. The algorithm module scheduling method according to claim 4, characterized in that, Based on the peak page occupancy per single request corresponding to the target drafting depth, the maximum concurrent micro-batch capacity is calculated using the total page budget, including: Divide the total page budget by the peak page usage per request to obtain the quotient. Perform a floor operation on the quotient and use the result of the floor operation as the maximum concurrent micro-batch capacity.

6. The algorithm module scheduling method according to claim 5, characterized in that, The cycle time is determined based on the service rates of the drafting and verification modules, including: Divide the target drafting depth by the drafting module service rate to obtain the time required for the drafting stage; divide the expected length of the continuous prefix retained by the verification module corresponding to the target drafting depth by the verification module service rate to obtain the time required for the verification stage; select the larger value between the time required for the drafting stage and the time required for the verification stage to determine the cycle time.

7. The algorithm module scheduling method according to claim 6, characterized in that, Based on the maximum concurrent micro-batch capacity and cycle time, requests are mapped to defined time coordinates and slots in arrival order, outputting scheduling results that include the target drafting depth and mapping relationships, including: For each request numbered from zero in arrival order, divide the request number by the maximum concurrent micro-batch capacity to obtain the quotient and remainder; round down the quotient to determine the batch index of the request; determine the slot index of the request in the corresponding tick of the batch index; multiply the batch index by the uniform tick period to obtain the drafting start time of the request. Add the draft start time to the required drafting time to obtain the verification start time of the request; Construct and output the scheduling results, which include the target drafting depth, maximum concurrent micro-batch capacity, cycle time, and a spatiotemporal mapping relationship for any request number consisting of the drafting start time, the verification start time, and the slot index.

Citation Information

Patent Citations

  • Processing method and processing device

    CN109933436A

  • Low-delay large model reasoning method and system based on draft model and majority voting

    CN118761469A

  • Large language model low-delay reasoning method based on dynamic reasoning graph optimization

    CN121072787A