Multi-accelerator card multi-task scheduling method and medium based on distributed parallel large model
By utilizing the task request queue of the distributed parallel large model and the preset accelerator card scheduling method in a multi-accelerator card environment, the problem of resource waste in multi-task scheduling is solved, and efficient utilization and saving of resources are achieved.
Patent Information
- Application Number
- CN202411087915.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-08-09
AI Technical Summary
In the existing technology, multi-accelerator card multi-task scheduling has the problem of wasting computing power and memory resources. Especially in the process of large model inference, memory-intensive tasks lead to low resource utilization.
By obtaining the task request queue of the target distributed parallel large model, and using the preset accelerator card task scheduling method, the task request queue is scheduled through multiple accelerator cards to achieve feedback on task analysis results and optimize resource utilization.
It effectively reduces resource waste, saves computing resources, realizes dynamic scheduling of multiple accelerator cards and multi-tasks, and improves resource utilization.
Smart Images

Figure CN118626233B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a multi-accelerator card multi-task scheduling method and medium based on a distributed parallel large model. Background Art
[0002] As the number of distributed parallel large model parameters increases exponentially, the graphics memory capacity of existing artificial intelligence inference accelerator cards is often unable to accommodate all model parameters, so it is necessary to use a distributed method of multiple accelerator cards for inference.
[0003] In the process of implementing the present invention, the inventors found that the prior art has the following defects: large model reasoning generates its output through iteration, and large model reasoning usually involves memory intensiveness rather than computing intensiveness, especially in the generation stage. However, for multi-accelerator card multi-task scheduling algorithms, there is often a waste of computing power and memory resources. Summary of the invention
[0004] The present invention provides a multi-accelerator card multi-task scheduling method and medium based on a distributed parallel large model, so as to improve the dynamic scheduling of multi-accelerator card multi-task, reduce the waste of resources, and save computing power resources.
[0005] According to one aspect of the present invention, a multi-accelerator card multi-task scheduling method based on a distributed parallel large model is provided, which includes:
[0006] Get the task request queue corresponding to the target distributed parallel large model;
[0007] The task request queue includes multiple target task requests; each target task request needs to be processed by each thread in turn, each thread corresponds to an accelerator card, each accelerator card includes at least one cache space, and a cache space includes at least one slot;
[0008] Through the preset acceleration card task scheduling method, the task request queue is processed by each acceleration card to obtain the task analysis results corresponding to each target task request in the task request queue;
[0009] Feedback the analysis results of each task to the user.
[0010] According to another aspect of the present invention, a multi-accelerator card multi-task scheduling device based on a distributed parallel large model is provided, which includes:
[0011] A task request queue acquisition module is used to acquire the task request queue corresponding to the target distributed parallel large model;
[0012] The task request queue includes multiple target task requests; each target task request needs to be processed by each thread in turn, each thread corresponds to an accelerator card, each accelerator card includes at least one cache space, and a cache space includes at least one slot;
[0013] The task token analysis result determination module is used to perform task scheduling processing on the task request queue through each of the accelerator cards through a preset accelerator card task scheduling method, and obtain task analysis results corresponding to each target task request in the task request queue;
[0014] The task analysis result feedback module is used to provide feedback of each task analysis result to the user.
[0015] According to another aspect of the present invention, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the multi-acceleration card multi-task scheduling method based on a distributed parallel large model as described in any embodiment of the present invention is implemented.
[0016] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the multi-acceleration card multi-task scheduling method based on a distributed parallel large model described in any embodiment of the present invention when executed.
[0017] The technical solution of the embodiment of the present invention is to obtain the task request queue corresponding to the target distributed parallel large model; wherein the task request queue includes multiple target task requests; each target task request needs to be processed by each thread in turn, each thread corresponds to an accelerator card, each accelerator card includes at least one cache space, and a cache space includes at least one slot; through the pre-set accelerator card task scheduling method, the task request queue is processed by each accelerator card to obtain the task analysis results corresponding to each target task request in the task request queue; each task analysis result is fed back to the user. The problem of waste of computing power and memory resources in the case of task scheduling of multiple accelerator cards and multiple tasks is solved, dynamic scheduling is realized, resource waste is reduced, and computing power resources are saved.
[0018] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 This is a flowchart of a multi-accelerator card multi-task scheduling method based on a distributed parallel large model provided according to Embodiment 1 of the present invention;
[0021] Figure 2 is a flowchart of performing task scheduling processing on a task request queue through a first accelerator card in a method provided in Embodiment 2 of the present invention;
[0022] Figure 3 is a flowchart of performing task scheduling processing on a task request queue through an intermediate acceleration card in a method provided in Embodiment 3 of the present invention;
[0023] Figure 4 is a flowchart of performing task scheduling processing on a task request queue through the last accelerator card in the method provided in Embodiment 4 of the present invention;
[0024] Figure 5 2 is a schematic diagram of the structure of a multi-accelerator card multi-task scheduling device based on a distributed parallel large model provided according to Embodiment 5 of the present invention;
[0025] Figure 6 It is a structural schematic diagram of an electronic device provided according to Embodiment 6 of the present invention. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0027] It should be noted that the terms "target", "current", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] Embodiment 1
[0029] Figure 1 A flowchart of a multi-accelerator card multi-task scheduling method based on a distributed parallel large model is provided for the first embodiment of the present invention. This embodiment is applicable to the case where multi-accelerator card multi-task is scheduled for a distributed parallel large model. The method can be executed by a multi-accelerator card multi-task scheduling device based on a distributed parallel large model. The multi-accelerator card multi-task scheduling device based on a distributed parallel large model can be implemented in the form of hardware and / or software.
[0030] Correspondingly, such as Figure 1 As shown, the method includes:
[0031] S110. Obtain the task request queue corresponding to the target distributed parallel large model.
[0032] Among them, the task request queue includes multiple target task requests; each target task request needs to be processed by each thread in turn, each thread corresponds to an acceleration card, each acceleration card contains at least one cache space, and a cache space contains at least one slot.
[0033] The task request queue may be a queue for receiving multiple target task requests of the target distributed parallel large model. Specifically, the task request queue may be a queue for storing new task requests sent by the main thread and a queue for receiving task requests processed by the last accelerator card thread.
[0034] The cache space may be a cache space set up to eliminate parallel bubbles in multiple accelerator cards as much as possible and improve resource utilization. Therefore, each accelerator card needs to have a cache space equal to the total number of accelerator cards to store the key value cache of the batch task request.
[0035] Specifically, key-value caching can be an optimization technology that uses the idea of trading space for time to improve reasoning performance without affecting the calculation accuracy. That is, the previous calculation results are cached by caching, and the cached results are directly used during the next reasoning. Each task request corresponds to a key-value cache.
[0036] The slot can be a key value cache used to store a single task request. In batch task processing, at least the number of slots in the batch is required to store the key value cache, that is, there are at least the product of the total number of accelerator cards and the number of batches. The slot's associated information can be used to find the key value cache stored in this slot and the associated task request.
[0037] Specifically, a batch task can be an accelerator card that supports processing multiple tasks at a time, that is, performing a calculation once to obtain the results of multiple tasks. In addition, all single tasks in the batch task must be in the same cache space.
[0038] S120, performing task scheduling processing on the task request queue through each of the accelerator cards using a preset accelerator card task scheduling method, and obtaining task parsing results corresponding to each target task request in the task request queue.
[0039] Among them, the accelerator card task scheduling method can be a pre-set task scheduling method for different accelerator cards, which can include the first accelerator card scheduling method, the middle accelerator card scheduling method and the last accelerator card scheduling method, and can also include pre-filling stage processing and generation stage processing methods for target task requests.
[0040] The task analysis result is the analysis result obtained by scheduling the target task request.
[0041] Optionally, the acceleration card includes a first acceleration card, 0 to N intermediate acceleration cards and a last acceleration card, wherein N is an integer greater than 0; the task request queue is processed through each of the acceleration cards through a pre-set acceleration card task scheduling method to obtain task parsing results corresponding to each target task request in the task request queue, including: through the acceleration card task scheduling method, the task request queue is processed through the first accelerator card, each intermediate accelerator card and the last accelerator card in turn to obtain task parsing results corresponding to each target task request in the task request queue.
[0042] The intermediate acceleration card may be an acceleration card other than the first acceleration card and the last acceleration card. If there are only two acceleration cards, the acceleration cards do not include the intermediate acceleration card.
[0043] In this embodiment, the accelerator card may include a first accelerator card, 0 to N intermediate accelerator cards, and a last accelerator card. It can be known that at least two accelerator cards are included, that is, the accelerator card includes at least the first accelerator card and the last accelerator card. In addition, the accelerator card may also include one or more intermediate accelerator cards.
[0044] Furthermore, each target task request in the task request queue can be processed by the first accelerator card, each intermediate accelerator card and the last accelerator card in turn to perform task scheduling, and obtain task analysis results corresponding to each target task request in the task request queue.
[0045] S130: Feedback the analysis results of each task to the user.
[0046] In this embodiment, after the scheduling process of each target task request is completed, the corresponding task analysis result can be obtained, and the obtained task analysis result can be fed back to the user for processing.
[0047] The technical solution of the embodiment of the present invention is to obtain the task request queue corresponding to the target distributed parallel large model; wherein the task request queue includes multiple target task requests; each target task request needs to be processed by each thread in turn, each thread corresponds to an accelerator card, each accelerator card includes at least one cache space, and a cache space includes at least one slot; through the pre-set accelerator card task scheduling method, the task request queue is processed by each accelerator card to obtain the task analysis results corresponding to each target task request in the task request queue; each task analysis result is fed back to the user. The problem of waste of computing power and memory resources in the case of task scheduling of multiple accelerator cards and multiple tasks is solved, dynamic scheduling is realized, resource waste is reduced, and computing power resources are saved.
[0048] Embodiment 2
[0049] Figure 2 A flowchart of performing task scheduling processing on a task request queue through a first accelerator card in a multi-task scheduling method for multiple accelerator cards based on a distributed parallel large model is provided for Embodiment 2 of the present invention. This embodiment is refined based on the above embodiments. In this embodiment, the task scheduling method through the accelerator card is refined to perform task scheduling processing on the task request queue through the first accelerator card.
[0050] Correspondingly, such as Figure 2 As shown, the method includes:
[0051] S210. Obtain the task request queue corresponding to the target distributed parallel large model.
[0052] S220, instructing the first accelerator card to determine whether there is at least one target task request in the task request queue, and if so, determine whether there is a completed target task request in the task request queue.
[0053] The completed target task request may be a task request information storing a stop mark encountered and a maximum sequence length reached. For the completed target task request, it is necessary to delete it from the task request queue.
[0054] S230: If there is a completed target task request, the completed target task request is deleted from the task request queue, and the slot of the first accelerator card corresponding to the completed target task request is marked as idle.
[0055] In this embodiment, if there is a completed target task request in the task request queue, the completed target task request needs to be deleted from the task request queue, and the slot occupied by the completed target task request in the first acceleration card needs to be released, and the state corresponding to the slot needs to be changed to an idle state.
[0056] S240: If there is no completed target task request, determine whether there is at least one new task request in each target task request and whether there is an empty slot in the first accelerator card.
[0057] The new task request may be a task request that has not been processed in the pre-filling phase.
[0058] In this embodiment, if there is no completed target task request in the task request queue, it is necessary to determine whether there is at least one new task request in each target task request and whether there is an empty slot in the first accelerator card.
[0059] S250: If satisfied, then obtain a current new task request in each new task request in sequence.
[0060] Exemplarily, it is assumed that there are m target task requests in total, wherein the m target task requests include 2 new task requests (it can be known that: m>2), and there are 5 empty slots in the first accelerator card.
[0061] Furthermore, it can be known that, in each target task request, there is at least one new task request and there is an empty slot in the first accelerator card. Then, for two new task requests (new task request 1 and new task request 2), it is necessary to obtain a current new task request in sequence, assuming that the current new task request obtained is new task request 1.
[0062] S260. Through the acceleration card task scheduling method, the current new task request is processed in the pre-filling stage to obtain the tensor result of the pre-filling processing of the current new task request, and the cache data of the task is stored in the cache space of the associated slot, and the slot usage information in the cache space corresponding to the current new task request is updated.
[0063] The tensor result of the pre-filling processing of the current new task request may be a tensor result obtained by pre-filling the current new task request.
[0064] Continuing with the previous example, it is necessary to perform pre-filling stage processing on the new task request 1 to obtain the current new task request pre-filling processing tensor result corresponding to the new task request 1.
[0065] Furthermore, the cache data of the new task request 1 is stored in the cache space of the associated slot, and the slot usage information in the cache space corresponding to the new task request 1 is updated and recorded.
[0066] S270: Add the current new task request to the batch task request queue of the next accelerator card, and pass the pre-filled processing tensor result of the current new task request to the next accelerator card through the inter-accelerator card communication mechanism.
[0067] Continuing with the previous example, it is assumed that the accelerator card includes three accelerator cards, specifically including a first accelerator card, a middle accelerator card and a last accelerator card.
[0068] Specifically, it is necessary to add the new task request 1 to the batch task request queue of the intermediate accelerator card, and transmit the pre-filled processing tensor result of the current new task request to the intermediate accelerator card through the inter-accelerator card communication mechanism.
[0069] S280, returning to execute the step of sequentially acquiring a current new task request until all the current new task requests are traversed and completed.
[0070] Continuing with the previous example, since the scheduling and processing operation of the new task request 1 has been completed, the new task request 2 needs to be scheduled and processed next. The scheduling and processing method is the same as that of the new task request 1, and will not be repeated here.
[0071] S290, returning to execute the instructing the first acceleration card to determine whether there is at least one target task request in the task request queue, until the target task request determination time reaches a preset target task request determination time threshold.
[0072] The target task request judgment time may be a statistically calculated time for judging the target task request. The target task request judgment time threshold may be a preset target task request judgment time threshold.
[0073] In this embodiment, after completing the scheduling processing of the new task request 2, it is necessary to return to execute the instruction to the first acceleration card to determine whether there is at least one target task request in the task request queue until the target task request judgment time meets the target task request judgment time threshold, that is, the above-mentioned judgment of whether there is at least one target task request in the task request queue is no longer performed.
[0074] S2100, the accelerator card task scheduling method is used to sequentially schedule the task request queue through the intermediate accelerator card and the last accelerator card to obtain task parsing results corresponding to each target task request in the task request queue.
[0075] S2110: Feedback the analysis results of each task to the user.
[0076] Optionally, after the determination of whether at least one new task request exists in each target task request and whether there is an empty slot in the first accelerator card, the method further includes: if the determination of whether at least one new task request exists or the determination of whether there is an empty slot in the first accelerator card does not exist, determining whether there is cache space for batch task processing in each cache space of the first accelerator card; wherein at least one slot is in use and is associated with a corresponding task request in a task request queue; if there is cache space for batch task processing, combining the associated non-new task requests in the cache space to obtain a non-new task combined batch task request; and using The cache data in the cache space that can perform batch task processing is used to perform generation phase processing on the non-new task combination batch task request to obtain the tensor result of the non-new task request generation processing; each non-new task request is deleted from the task request queue, and the non-new task combination batch task request is added to the batch task request queue of the next accelerator card, and the tensor result of the non-new task request generation processing is transmitted to the next accelerator card through the accelerator card inter-communication mechanism; and the execution is returned to instruct the first accelerator card to determine whether there is at least one target task request in the task request queue until the target task request judgment time reaches a preset target task request judgment time threshold.
[0077] Exemplarily, it is assumed that there are m target task requests in total. Specifically, three situations are assumed: Situation 1: It is assumed that no new task request is included in the m target task requests and there are 5 empty slots in the first accelerator card. Situation 2: It is assumed that 2 new task requests are included in the m target task requests and there are no empty slots in the first accelerator card. Situation 3: It is assumed that no new task request is included in the m target task requests and there are no empty slots in the first accelerator card.
[0078] Furthermore, it can be known that in each target task request, the above three situations do not satisfy the existence of at least one new task request or the existence of an empty slot in the first accelerator card. It is necessary to determine whether there is a cache space available for batch task processing in each cache space of the first accelerator card.
[0079] For case 1, the m target task requests do not include new task requests, that is, the number of non-new task requests is m. If there is a cache space that can be used for batch task processing, the associated non-new task requests in the cache space are combined, that is, the m non-new task requests are combined to obtain a non-new task combined batch task request.
[0080] Among them, the non-new task request may be a task that has completed the pre-filling process and needs to be processed in the generation stage next.
[0081] Furthermore, the cache data in the cache space capable of batch task processing may be used to perform generation phase processing on the non-new task combination batch task request to obtain a tensor result of the non-new task request generation processing.
[0082] Since the processing is currently being performed in the first accelerator card, it can be known from the above that the accelerator card includes three accelerator cards, specifically including the first accelerator card, an intermediate accelerator card and the last accelerator card. Therefore, each non-new task request can be deleted from the task request queue, and the non-new task combination batch task request can be added to the batch task request queue of the intermediate accelerator card, and the tensor results generated by each non-new task request can be passed to the intermediate accelerator card through the inter-accelerator card communication mechanism; return to execute the instruction to the first accelerator card to determine whether there is at least one target task request in the task request queue, until the target task request judgment time reaches the preset target task request judgment time threshold.
[0083] In addition, if the accelerator card includes two accelerator cards, specifically the first accelerator card and the last accelerator card, then it is necessary to add the non-new task combination batch task request to the batch task request queue of the last accelerator card, and pass the processing tensor results generated by each non-new task request to the last accelerator card through the inter-accelerator card communication mechanism.
[0084] Optionally, after determining whether there is cache space for batch task processing in each cache space of the first accelerator card, the method further includes: if there is no cache space for batch task processing, returning to execute the method of instructing the first accelerator card to determine whether there is at least one target task request in the task request queue, until the target task request judgment time reaches a preset target task request judgment time threshold.
[0085] In this embodiment, after determining whether there is cache space available for batch task processing in each cache space of the first accelerator card, if there is no cache space available for batch task processing, the current batch task cannot be processed, and the process directly returns to execute the instruction to instruct the first accelerator card to determine whether there is at least one target task request in the task request queue until the target task request judgment time reaches a preset target task request judgment time threshold.
[0086] The technical solution of the embodiment of the present invention is to obtain the task request queue corresponding to the target distributed parallel large model; through the pre-set acceleration card task scheduling method, the task request queue is processed through the first acceleration card, the middle acceleration card and the last acceleration card to obtain the task analysis results corresponding to each target task request in the task request queue; and each task analysis result is fed back to the user. By describing the task scheduling process of the first acceleration card in detail, the dynamic scheduling method of the target task request on the first acceleration card can be better clarified, thereby reducing the waste of resources and saving computing resources.
[0087] Embodiment 3
[0088] Figure 3 A flowchart of a multi-accelerator card multi-task scheduling method based on a distributed parallel large model is provided for the third embodiment of the present invention, in which a task request queue is scheduled through an intermediate accelerator card. This embodiment is refined based on the above embodiments. In this embodiment, the task scheduling method through the accelerator card is refined to schedule the task request queue through an intermediate accelerator card.
[0089] Correspondingly, such as Figure 3 As shown, the method includes:
[0090] S310. Obtain the task request queue corresponding to the target distributed parallel large model.
[0091] S320: Obtain a current batch task request in the batch task request queue in sequence, and instruct the first intermediate accelerator card to determine whether the current batch task request is a single new task request.
[0092] The batch task request queue can be a pipeline for transferring tasks between the nth accelerator card and the n+1th accelerator card. Since batch processing tasks are supported, each request in the batch task request queue stores a task list (including one or more task requests). The current batch task request corresponds to a task list, which includes one or more task requests.
[0093] S330: If yes, perform pre-filling phase processing on the current new task request to obtain the tensor result of pre-filling processing of the current new task request, and store the cache data of the task into the cache space associated with the target intermediate accelerator card.
[0094] In this embodiment, if the current batch task request is a single new task request, it is necessary to receive the tensor result of the previous accelerator card corresponding to the intermediate accelerator card, and perform pre-filling stage processing on the current new task request based on the tensor result (the cache space and slot corresponding to the previous accelerator card can be found through the associated information of the new task request), obtain the tensor result of the pre-filling processing of the current new task request, and store the cache data of the task in the cache space associated with the target intermediate accelerator card.
[0095] S340: Add the current new task request to the batch task request queue of the next intermediate accelerator card, and pass the pre-filled processing tensor result of the current batch task request to the next intermediate accelerator card or the last accelerator card through the inter-accelerator card communication mechanism.
[0096] S350, returning to execute the step of sequentially acquiring a current batch task request until all batch task requests in the batch task request queue are traversed and completed.
[0097] Optionally, after instructing the first intermediate accelerator card to determine whether the current batch task request is a single new task request, it also includes: if not, using the cache data in the cache space of the target intermediate accelerator card associated with the current batch task request to perform generation phase processing on the current batch task request to obtain the tensor result of the current batch task request generation processing; adding the current batch task request to the batch task request queue of the next intermediate accelerator card, and transmitting the tensor result of the current batch task request generation processing to the next intermediate accelerator card or the last accelerator card through the inter-accelerator card communication mechanism; returning to execute the acquisition of a current batch task request in sequence until all batch task requests in the batch task request queue are traversed and completed.
[0098] In this embodiment, if the current batch task request is not a single new task request, it is also necessary to receive the tensor result of the previous accelerator card corresponding to the intermediate accelerator card, and based on the tensor result, use the cache data in the cache space of the target intermediate accelerator card associated with the current batch task request to perform generation phase processing on the current batch task request to obtain the tensor result of the current batch task request generation processing.
[0099] Furthermore, the current batch task request is added to the batch task request queue of the next intermediate accelerator card, and the tensor result generated by the current batch task request is transmitted to the next intermediate accelerator card or the last accelerator card through the accelerator card communication mechanism. Accordingly, it is necessary to return to execute the step of obtaining a current batch task request in sequence until all batch task requests in the batch task request queue are traversed and completed.
[0100] S360, performing task scheduling processing on the task request queue through the last accelerator card through the accelerator card task scheduling method, and obtaining task parsing results corresponding to each target task request in the task request queue.
[0101] S370: Feedback the analysis results of each task to the user.
[0102] The technical solution of the embodiment of the present invention is to obtain the task request queue corresponding to the target distributed parallel large model; through the preset acceleration card task scheduling method, the task request queue is processed through the first acceleration card, the middle acceleration card and the last acceleration card to obtain the task analysis results corresponding to each target task request in the task request queue; and each task analysis result is fed back to the user. By describing the task scheduling processing of the middle acceleration card in detail, the dynamic scheduling method of the target task request in the middle acceleration card can be better clarified, thereby reducing the waste of resources and saving computing resources.
[0103] Embodiment 4
[0104] Figure 4 A flowchart of performing task scheduling processing on a task request queue through the last accelerator card in a multi-accelerator card multi-task scheduling method based on a distributed parallel large model is provided for the fourth embodiment of the present invention. This embodiment is refined based on the above embodiments. In this embodiment, the task scheduling method through the accelerator card is refined to perform task scheduling processing on the task request queue through the last accelerator card.
[0105] Correspondingly, such as Figure 4 As shown, the method includes:
[0106] S410. Obtain the task request queue corresponding to the target distributed parallel large model.
[0107] S420: Obtain the last batch of task request queue corresponding to the last accelerator card, and sequentially obtain a current last batch of task request in the last batch of task request queue.
[0108] S430, instructing the last accelerator card to determine whether the current last batch of task requests is a single new task request, and if so, performing a pre-filling phase processing on the current last batch of task requests to obtain a tensor result of the pre-filling processing of the current last batch of task requests, and storing the cache data of the task in the cache space associated with the last accelerator card, adding the current new task request to the task request queue of the first accelerator card, and setting this new task request as a non-new task request.
[0109] In this embodiment, the last accelerator card also needs to determine whether the current last batch of task requests is a single new task request. If so, it is necessary to obtain the tensor result of the second-to-last accelerator card, and perform pre-filling stage processing on the current last batch of task requests based on the tensor result (the cache space and slot corresponding to the second-to-last accelerator card can be found through the associated information of the new task request) to obtain the tensor result of the pre-filling processing of the current last batch of task requests.
[0110] Furthermore, the cache data of the task needs to be stored in the cache space associated with the last accelerator card, and the current new task request needs to be added to the task request queue of the first accelerator card, and the new task request needs to be set as a non-new task request.
[0111] S440. If not, generate and process tensor results based on the cache data in the cache space of the current batch task request and the associated last accelerator card, perform generation phase processing on the current last batch task request, obtain the tensor results generated by the current last batch task request, and split the current last batch task request into the task request queue of the first accelerator card.
[0112] In this embodiment, the last accelerator card also needs to determine whether the current last batch task request is a single new task request. If it is not a single new task request, it is necessary to obtain the tensor result of the second-to-last accelerator card, and based on the tensor results in the cache space of the current batch task request and the associated last accelerator card, perform generation phase processing on the current last batch task request to obtain the tensor result of the generation processing of the current last batch task request.
[0113] In addition, the method also includes splitting the current last batch of task requests and adding them to the task request queue of the first accelerator card.
[0114] S450 , pre-fill processing tensor results according to the current last batch of task requests and generate processing tensor results according to the current last batch of task requests to obtain parsing results of each current task.
[0115] S460, return to execute the operation of obtaining a current last batch of task requests in the last batch of task request queue in sequence, until the traversal of each current last batch of task requests in the last batch of task request queue is completed, and according to each current task parsing result, the task parsing results corresponding to each target task request in the task request queue are obtained.
[0116] S470: Obtain task analysis results corresponding to each target task request in the task request queue.
[0117] S480: Feedback the analysis results of each task to the user.
[0118] The technical solution of the embodiment of the present invention is to obtain the task request queue corresponding to the target distributed parallel large model; through the pre-set acceleration card task scheduling method, the task request queue is processed through the first acceleration card, the middle acceleration card and the last acceleration card to obtain the task analysis results corresponding to each target task request in the task request queue; and each task analysis result is fed back to the user. By describing the task scheduling process of the last acceleration card in detail, the dynamic scheduling method of the target task request on the last acceleration card can be better clarified, thereby reducing the waste of resources and saving computing resources.
[0119] Embodiment 5
[0120] Figure 5 The schematic diagram of the structure of a multi-accelerator card multi-task scheduling device based on a distributed parallel large model provided in the fifth embodiment of the present invention. The multi-accelerator card multi-task scheduling device based on a distributed parallel large model provided in this embodiment can be implemented by software and / or hardware, and can be configured in a terminal device or a server to implement a multi-accelerator card multi-task scheduling method based on a distributed parallel large model in the embodiment of the present invention. Figure 5 As shown, the device includes: a task request queue acquisition module 510, a task token resolution result determination module 520 and a task resolution result feedback module 530.
[0121] The task request queue acquisition module 510 is used to acquire the task request queue corresponding to the target distributed parallel large model;
[0122] The task request queue includes multiple target task requests; each target task request needs to be processed by each thread in turn, each thread corresponds to an accelerator card, each accelerator card includes at least one cache space, and a cache space includes at least one slot;
[0123] The task token parsing result determination module 520 is used to perform task scheduling processing on the task request queue through each accelerator card through a preset accelerator card task scheduling method, and obtain task parsing results corresponding to each target task request in the task request queue;
[0124] The task analysis result feedback module 530 is used to provide feedback of each task analysis result to the user.
[0125] The technical solution of the embodiment of the present invention is to obtain the task request queue corresponding to the target distributed parallel large model; wherein the task request queue includes multiple target task requests; each target task request needs to be processed by each thread in turn, each thread corresponds to an accelerator card, each accelerator card includes at least one cache space, and a cache space includes at least one slot; through the pre-set accelerator card task scheduling method, the task request queue is processed by each accelerator card to obtain the task analysis results corresponding to each target task request in the task request queue; each task analysis result is fed back to the user. The problem of waste of computing power and memory resources in the case of task scheduling of multiple accelerator cards and multiple tasks is solved, dynamic scheduling is realized, resource waste is reduced, and computing power resources are saved.
[0126] Based on the above embodiments, the acceleration card includes a first acceleration card, 0 to N intermediate acceleration cards and a last acceleration card, wherein N is an integer greater than 0.
[0127] Based on the above embodiments, the task token resolution result determination module 520 can be specifically used for: through the accelerator card task scheduling method, the task request queue is sequentially processed through the first accelerator card, each intermediate accelerator card and the last accelerator card to obtain the task resolution results corresponding to each target task request in the task request queue.
[0128] On the basis of the above embodiments, the task token parsing result determination module 520 can also be specifically used for: the task request queue is processed by the first accelerator card through the accelerator card task scheduling method: the first accelerator card is instructed to determine whether there is at least one target task request in the task request queue, and if so, whether there is a completed target task request in the task request queue; if there is a completed target task request, the completed target task request is deleted in the task request queue, and the slot of the first accelerator card corresponding to the completed target task request is marked as idle; if there is no completed target task request, it is determined whether at least one new task request is satisfied in each target task request and there is an empty slot in the first accelerator card; if satisfied, in each new task request, Obtain a current new task request; perform pre-filling phase processing on the current new task request through the acceleration card task scheduling method to obtain the tensor result of the pre-filling processing of the current new task request, and store the cache data of the task in the cache space of the associated slot, and update the slot usage information in the cache space corresponding to the current new task request; add the current new task request to the batch task request queue of the next acceleration card, and pass the tensor result of the pre-filling processing of the current new task request to the next acceleration card through the acceleration card inter-communication mechanism; return to execute the step of obtaining a current new task request in sequence until the traversal of each current new task request is completed; return to execute the step of instructing the first acceleration card to determine whether there is at least one target task request in the task request queue until the target task request judgment time reaches a preset target task request judgment time threshold.
[0129] On the basis of the above embodiments, the task token parsing result determination module 520 can also be specifically used for: after judging whether there is at least one new task request in each target task request and whether there is an empty slot in the first accelerator card, if there is not at least one new task request or there is not an empty slot in the first accelerator card, then judging whether there is cache space for batch task processing in each cache space of the first accelerator card; wherein at least one slot is in use and is associated with the corresponding task request in the task request queue; if there is cache space for batch task processing, then combining the associated non-new task requests in the cache space to obtain to a non-new task combination batch task request; using the cache data in the cache space that can perform batch task processing, the non-new task combination batch task request is processed in the generation phase to obtain the tensor result of the non-new task request generation processing; deleting each non-new task request from the task request queue, and adding the non-new task combination batch task request to the batch task request queue of the next accelerator card, and transmitting the tensor result of each non-new task request generation processing to the next accelerator card through the accelerator card inter-communication mechanism; returning to execute the instruction to the first accelerator card to determine whether there is at least one target task request in the task request queue, until the target task request judgment time reaches the preset target task request judgment time threshold.
[0130] Based on the above embodiments, the task token parsing result determination module 520 can also be specifically used for: after determining whether there is cache space for batch task processing in each cache space of the first accelerator card, if there is no cache space for batch task processing, returning to execute the instruction to the first accelerator card to determine whether there is at least one target task request in the task request queue, until the target task request judgment time reaches a preset target task request judgment time threshold.
[0131] On the basis of the above embodiments, the task token parsing result determination module 520 can also be specifically used for: through the acceleration card task scheduling method, the task request queue is processed by each intermediate acceleration card for task scheduling: in the batch task request queue, a current batch task request is obtained in turn, and the first intermediate acceleration card is instructed to determine whether the current batch task request is a single new task request; if so, the current new task request is processed in the pre-filling stage to obtain the tensor result of the pre-filling processing of the current new task request, and the cache data of the task is stored in the cache space associated with the target intermediate acceleration card; the current new task request is added to the batch task request queue of the next intermediate acceleration card, and the tensor result of the pre-filling processing of the current batch task request is passed to the next intermediate acceleration card or the last acceleration card through the communication mechanism between acceleration cards; return to execute the step of obtaining a current batch task request in turn until all batch task requests in the batch task request queue are traversed and completed.
[0132] On the basis of the above embodiments, the task token parsing result determination module 520 can also be specifically used for: after the instructing the first intermediate accelerator card to determine whether the current batch task request is a single new task request, if it is not a single new task request, the current batch task request is processed in the generation phase using the cache data in the cache space of the target intermediate accelerator card associated with the current batch task request to obtain the tensor result of the current batch task request generation processing; the current batch task request is added to the batch task request queue of the next intermediate accelerator card, and the tensor result of the current batch task request generation processing is transmitted to the next intermediate accelerator card or the last accelerator card through the inter-accelerator card communication mechanism; and the execution is returned to obtain a current batch task request in sequence until each batch task request is traversed in the batch task request queue.
[0133] On the basis of the above embodiments, the task token resolution result determination module 520 can also be specifically used for: the task request queue is processed through the last acceleration card through the acceleration card task scheduling method to obtain the task resolution results corresponding to each target task request in the task request queue: the last batch of task request queue corresponding to the last acceleration card is obtained, and a current last batch of task request is obtained in the last batch of task request queue in sequence; the last acceleration card is instructed to determine whether the current last batch of task request is a single new task request, and if so, the current last batch of task request is processed in the pre-filling stage to obtain the tensor result of the pre-filling processing of the current last batch of task request, and the cached data of the task is stored in the cache space associated with the last acceleration card, and the current new task request is added to the task request queue of the first acceleration card. , and set this new task request as a non-new task request; if not, generate and process tensor results according to the cache data in the cache space of the current batch task request and the associated last accelerator card, perform generation phase processing on the current last batch task request, obtain the tensor results generated by the current last batch task request, and split the current last batch task request into the task request queue of the first accelerator card; pre-fill the tensor results and generate the tensor results according to the current last batch task request to obtain the parsing results of each current task; return to execute the operation of obtaining one current last batch task request in the last batch task request queue in turn, until the traversal of each current last batch task request in the last batch task request queue is completed, and according to each current task parsing result, obtain the task parsing results corresponding to each target task request in the task request queue.
[0134] The multi-accelerator card multi-task scheduling device based on a distributed parallel large model provided in an embodiment of the present invention can execute the multi-accelerator card multi-task scheduling method based on a distributed parallel large model provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0135] Embodiment 6
[0136] Figure 6 A schematic diagram of the structure of an electronic device 10 that can be used to implement the sixth embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0137] like Figure 6 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.
[0138] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0139] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a multi-accelerator card multi-task scheduling method based on a distributed parallel large model.
[0140] In some embodiments, the multi-accelerator card multi-task scheduling method based on the distributed parallel large model can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the multi-accelerator card multi-task scheduling method based on the distributed parallel large model described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the multi-accelerator card multi-task scheduling method based on the distributed parallel large model in any other appropriate manner (for example, by means of firmware).
[0141] The method includes: obtaining a task request queue corresponding to a target distributed parallel large model; wherein the task request queue includes a plurality of target task requests; each target task request needs to be processed in turn through each thread, each thread corresponds to an accelerator card, each accelerator card includes at least one cache space, and a cache space includes at least one slot; through a pre-set accelerator card task scheduling method, the task request queue is processed by each accelerator card to obtain task parsing results corresponding to each target task request in the task request queue; and each task parsing result is fed back to a user.
[0142] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0143] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0144] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0145] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0146] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0147] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0148] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0149] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
[0150] Embodiment 7
[0151] Embodiment 7 of the present invention also provides a computer-readable storage medium, wherein the computer-readable instructions are used to execute a multi-acceleration card multi-task scheduling method based on a distributed parallel large model when executed by a computer processor, the method comprising: obtaining a task request queue corresponding to the target distributed parallel large model; wherein the task request queue comprises multiple target task requests; each target task request needs to be processed by each thread in turn, each thread corresponds to an accelerator card, each accelerator card comprises at least one cache space, and a cache space comprises at least one slot; through a pre-set accelerator card task scheduling method, the task request queue is processed by each accelerator card to obtain task parsing results corresponding to each target task request in the task request queue; and each task parsing result is fed back to the user.
[0152] Of course, the computer-readable storage medium provided in an embodiment of the present invention has computer executable instructions that are not limited to the method operations described above, and can also execute related operations in multi-accelerator card multi-task scheduling based on a distributed parallel large model provided in any embodiment of the present invention.
[0153] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0154] It is worth noting that in the above-mentioned embodiment of multi-accelerator card multi-task scheduling based on the distributed parallel large model, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0155] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A multi-accelerator card multi-task scheduling method based on a distributed parallel large model, characterized in that: include: Get the task request queue corresponding to the target distributed parallel large model; The task request queue includes multiple target task requests; each target task request needs to be processed by each thread in turn, each thread corresponds to an accelerator card, each accelerator card includes at least one cache space, and a cache space includes at least one slot; The task request queue is processed by each accelerator card through a preset accelerator card task scheduling method to obtain task parsing results corresponding to each target task request in the task request queue; Feedback the analysis results of each task to the user; The acceleration card includes a first acceleration card, 0 to N intermediate acceleration cards and a last acceleration card, wherein N is an integer greater than 0; The task request queue is processed by each accelerator card through the preset accelerator card task scheduling method to obtain task parsing results corresponding to each target task request in the task request queue, including: Through the accelerator card task scheduling method, the task request queue is sequentially processed through the first accelerator card, each intermediate accelerator card and the last accelerator card to obtain task parsing results corresponding to each target task request in the task request queue; The method of scheduling tasks on the task request queue through the first accelerator card includes: instructing the first accelerator card to determine whether there is at least one target task request in the task request queue, and if so, determining whether there is a completed target task request in the task request queue; If there is a completed target task request, the completed target task request is deleted from the task request queue, and the slot of the first accelerator card corresponding to the completed target task request is marked as idle; If there is no completed target task request, determining whether there is at least one new task request in each target task request and whether there is an empty slot in the first accelerator card; If satisfied, then in each new task request, a current new task request is obtained in turn; Through the accelerator card task scheduling method, the current new task request is processed in the pre-filling stage to obtain the tensor result of the pre-filling processing of the current new task request, and the cache data of the task is stored in the cache space of the associated slot, and the slot usage information in the cache space corresponding to the current new task request is updated and recorded; Add the current new task request to the batch task request queue of the next accelerator card, and pass the pre-filled processing tensor result of the current new task request to the next accelerator card through the inter-accelerator card communication mechanism; Return to execute the step of obtaining a current new task request in sequence until all the current new task requests are traversed and completed; Return to execute the instructing the first accelerator card to determine whether there is at least one target task request in the task request queue, until the target task request determination time reaches a preset target task request determination time threshold.
2. The method according to claim 1, characterized in that: After determining whether at least one new task request exists in each target task request and whether there is an empty slot in the first accelerator card, the method further includes: If the condition that there is at least one new task request or there is an empty slot in the first accelerator card is not satisfied, determining whether there is a cache space available for batch task processing in each cache space of the first accelerator card; Wherein, at least one slot is in use and is associated with a corresponding task request in the task request queue; If there is a cache space that can process batch tasks, then the associated non-new task requests in the cache space are combined to obtain a non-new task combined batch task request; Using cache data in a cache space capable of batch task processing, the non-new task combination batch task request is processed in a generation phase to obtain a tensor result of the non-new task request generation processing; Delete each non-new task request from the task request queue, add the non-new task combination batch task request to the batch task request queue of the next accelerator card, and pass the tensor results generated by each non-new task request to the next accelerator card through the inter-accelerator card communication mechanism; Return to execute the instructing the first accelerator card to determine whether there is at least one target task request in the task request queue, until the target task request determination time reaches a preset target task request determination time threshold.
3. The method according to claim 2, characterized in that After determining whether there is a cache space available for batch task processing in each cache space of the first accelerator card, the method further includes: If there is no cache space for batch task processing, the execution is returned to instruct the first accelerator card to determine whether there is at least one target task request in the task request queue until the target task request determination time reaches a preset target task request determination time threshold.
4. The method according to claim 3, characterized in that By using the accelerator card task scheduling method, the task request queue is processed by each intermediate accelerator card for task scheduling, including: In the batch task request queue, a current batch task request is obtained in sequence, and the first intermediate accelerator card is instructed to determine whether the current batch task request is a single new task request; If so, the current new task request is processed in the pre-filling stage to obtain the tensor result of the pre-filling processing of the current new task request, and the cache data of the task is stored in the cache space associated with the target intermediate accelerator card; Add the current new task request to the batch task request queue of the next intermediate accelerator card, and pass the pre-filled processing tensor result of the current batch task request to the next intermediate accelerator card or the last accelerator card through the inter-accelerator card communication mechanism; Return to execute the step of sequentially acquiring a current batch task request until all batch task requests in the batch task request queue are traversed and completed.
5. The method according to claim 4, characterized in that After instructing the first intermediate acceleration card to determine whether the current batch task request is a single new task request, the method further includes: If not, the current batch task request is processed at the generation stage using the cache data in the cache space of the target intermediate accelerator card associated with the current batch task request to obtain the tensor result of the current batch task request generation processing; Add the current batch task request to the batch task request queue of the next intermediate accelerator card, and pass the tensor result generated by the current batch task request to the next intermediate accelerator card or the last accelerator card through the inter-accelerator card communication mechanism; Return to execute the step of sequentially acquiring a current batch task request until all batch task requests in the batch task request queue are traversed and completed.
6. The method according to claim 5, characterized in that The method for scheduling tasks by the accelerator card performs task scheduling processing on the task request queue through the last accelerator card to obtain task parsing results corresponding to each target task request in the task request queue, including: Obtain the last batch of task request queue corresponding to the last accelerator card, and obtain a current last batch of task request in the last batch of task request queue in sequence; Instruct the last accelerator card to determine whether the current last batch of task requests is a single new task request. If so, perform pre-filling phase processing on the current last batch of task requests to obtain the tensor result of pre-filling processing of the current last batch of task requests, store the cache data of the task in the cache space associated with the last accelerator card, add the current new task request to the task request queue of the first accelerator card, and set the new task request as a non-new task request; If not, generate and process the tensor result according to the cache data in the cache space of the current batch task request and the associated last accelerator card, perform generation phase processing on the current last batch task request, obtain the tensor result generated and processed by the current last batch task request, and split the current last batch task request into the task request queue of the first accelerator card; According to the current last batch of task requests, pre-fill processing tensor results and generate processing tensor results for the current last batch of task requests to obtain the parsing results of each current task; Return to execute the operation of obtaining a current last batch of task requests in the last batch of task request queue in sequence, until the traversal of each current last batch of task requests in the last batch of task request queue is completed, and according to each current task parsing result, the task parsing results corresponding to each target task request in the task request queue are obtained.
7. A multi-accelerator card multi-task scheduling device based on a distributed parallel large model, characterized in that: include: A task request queue acquisition module is used to acquire the task request queue corresponding to the target distributed parallel large model; The task request queue includes multiple target task requests; each target task request needs to be processed by each thread in turn, each thread corresponds to an accelerator card, each accelerator card includes at least one cache space, and a cache space includes at least one slot; The task token analysis result determination module is used to perform task scheduling processing on the task request queue through each of the accelerator cards through a preset accelerator card task scheduling method, and obtain task analysis results corresponding to each target task request in the task request queue; A task analysis result feedback module is used to provide feedback of each task analysis result to the user; The acceleration card includes a first acceleration card, 0 to N intermediate acceleration cards and a last acceleration card, wherein N is an integer greater than 0; The task token parsing result determination module is used to: through the accelerator card task scheduling method, sequentially schedule the task request queue through the first accelerator card, each intermediate accelerator card and the last accelerator card to obtain the task parsing results corresponding to each target task request in the task request queue; Among them, the task token parsing result determination module is also used for: the task scheduling method of the acceleration card is used to process the task request queue through the first acceleration card: instruct the first acceleration card to determine whether there is at least one target task request in the task request queue, and if so, determine whether there is a completed target task request in the task request queue; if there is a completed target task request, delete the completed target task request in the task request queue, and mark the slot of the first acceleration card corresponding to the completed target task request as idle; if there is no completed target task request, determine whether at least one new task request is satisfied in each target task request and whether there is an empty slot in the first acceleration card; if satisfied, obtain a current new task request in each new task request in turn. service request; through the acceleration card task scheduling method, the current new task request is pre-filled in the stage, the tensor result of the pre-filling processing of the current new task request is obtained, and the cache data of the task is stored in the cache space of the associated slot, and the slot usage information in the cache space corresponding to the current new task request is updated and recorded; the current new task request is added to the batch task request queue of the next acceleration card, and the tensor result of the pre-filling processing of the current new task request is transmitted to the next acceleration card through the acceleration card communication mechanism; return to execute the method of obtaining a current new task request in turn until the traversal of each current new task request is completed; return to execute the method of instructing the first acceleration card to determine whether there is at least one target task request in the task request queue until the target task request judgment time reaches the preset target task request judgment time threshold.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it implements a multi-accelerator card multi-task scheduling method based on a distributed parallel large model as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a multi-accelerator card multi-task scheduling method based on a distributed parallel large model as described in any one of claims 1-6.
Citation Information
Patent Citations
Image processing device
CN111833232A
Data processing method and device and medium
CN114138481A
